2014-09-21, 18:23
Hi guys,
I have got a problem with my code. I'm adding the button controls in the pixel area, the area where the tv guide programs will display. When I added the button controls in the pixel area, it will add the buttons but most of the buttons will not calculating in the pixel area to get it separate with other button controls.
Here is the screenshot:
Here is the code
Here's the addon: https://www.mediafire.com/?7dtkjz6j4ia6guz
Do you know how i can add the button controls in the pixel area?
I have got a problem with my code. I'm adding the button controls in the pixel area, the area where the tv guide programs will display. When I added the button controls in the pixel area, it will add the buttons but most of the buttons will not calculating in the pixel area to get it separate with other button controls.
Here is the screenshot:
Here is the code
Code:
for row in programs:
program = row[1].encode('ascii'), str(row[2]), str(row[3])
title = row[1].encode('ascii')
program_start_date = str(row[2])
program_end_date = str(row[3])
#convert the date formats into minutes
minutes_start = self.parseDateTimeToMinutesSinceEpoch(program_start_date)
minutes_end = self.parseDateTimeToMinutesSinceEpoch(program_end_date)
minutes_length = minutes_end - minutes_start
program_index = channel_index
program_start = channel_index * 60
program_length = minutes_length
program_notification = program
program_minutes = minutes_length
program_start_to_end = 100
programs_top = 325
program_height = 34.5
pixels_per_minute = 1080 / minutes_length
program_gap = 10
position_start = program_start_to_end + (program_start * pixels_per_minute) + ((program_index - 1) * program_gap)
position_top = programs_top + (channel_index * program_height) + ((channel_index - 1) * program_gap)
program_width = program_length * pixels_per_minute
if program_width > 1:
if program_notification:
button_nofocus = 'channels_bar1.png'
button_focus = 'channels_yellow.png'
else:
button_nofocus = 'channels_bar1.png'
button_focus = 'channels_yellow.png'
if program_width < 1:
program_title = ''
else:
program_title = title
program_controls = xbmcgui.ControlButton(
position_start,
position_top,
program_width,
program_height,
program_title,
focusTexture = button_focus,
noFocusTexture = button_nofocus
)
self.addControl(program_controls)
cur.close()
Here's the addon: https://www.mediafire.com/?7dtkjz6j4ia6guz
Do you know how i can add the button controls in the pixel area?