v14 defaultcontrol for xbmcgui.WindowDialog
#1
Hi everyone, and please for helpSmile

I can't set default focus for windowDialog. After open my addon everything is right, but when i slide away mouse arrow from buttons then i can't focus any buttons by pressing arrow keys, only option is sliding mouse arrow back on button.

Code:
class PopupWindow(xbmcgui.WindowDialog):
  def __init__(self):
        #setting basic controls
    self.searchButton = xbmcgui.ControlButton(1100, 15, 160, 50, 'Search', font='Font40', alignment=0x00000006, noFocusTexture=xbmcaddon.Addon().getAddonInfo('path')+'/bottom_line.png',  focusTexture=xbmcaddon.Addon().getAddonInfo('path')+'/focus_bottom_line.png', focusedColor='0xFFAAAAAA')
    self.addControl(self.searchButton)
        #and rest of code
In my code is few more buttons which have set navigations between them.
Reply
#2
Can Someone help me in that case?

And by the way, sorry for my english.
Reply
#3
OK, I solved problem by myself

Code:
import xbmcgui

ACTION_PREVIOUS_MENU = 10

class PopupWindow(xbmcgui.WindowDialog):
  def __init__(self):
    ...
    ...
    ...
  def onAction(self, action):
    try:                                                        #this
      self.getFocus()                                   #is
    except:                                                 #what i
      self.setFocus(self.Button[0])             #needed
    if action.getButtonCode() == 61448 or action == ACTION_PREVIOUS_MENU:
      xbmc.executebuiltin('ReplaceWindow(Home)')
      self.close()

if __name__ == '__main__':
    window = PopupWindow()
    if xbmc.getCondVisibility('Window.IsActive(1100)'):
      window.doModal()
    window.close()
    del window
Reply

Logout Mark Read Team Forum Stats Members Help
defaultcontrol for xbmcgui.WindowDialog0