PDA

View Full Version : bigger dialog().ok(), with room for more text.


jt0451
2009-08-06, 03:28
hello,
I need to create a dialog similar to ok, only bigger, with room for a full paragraph of text. Is there already a dialogue that I've overlooked? Is it possible to change to the ok dialogue or should I be creating a custom window?


I've been working on a plugin for myself, a learning experience. Hopefully it will turn into something usable by the community in a few weeks.

jmarshall
2009-08-06, 05:05
We don't really have one I'm afraid, so you'll have to create your own.

It's a problem with just how flexible the skinning engine is - skinners can create dialogs that wouldn't be resizable in any meaningful manner (eg mc360's dialogs).

Cheers,
Jonathan

rwparris2
2009-08-06, 06:46
To make it easy on yourself, just copy the current ok dialog skin file from pm3 or pm3.hd, grab the media files from svn, then just resize it as you see fit.
IMO skinning is the hardest & least fun part (but thankfully others seem to like it!)
Note that I don't know if this will actually work as I've never done it, but that is how I would start.

BigBellyBilly
2009-08-07, 13:20
I've had many instances where I couldve used a bigger OK Dialog.

just an idea;
What about one that's based around a scrollable TextBox, would that translate well to all skins ?

possibly as: ok = Dialog.bigok(header, text)

jt0451
2009-08-07, 13:49
Thanks for all the replies gents. I'm a bit scared of skinning, it's the sort of thing you have to jump into the deep end with, t least it seams that way too me. Guess I don't have the right type of brain for it.

I've currently set it up as a full window with a bit of text in the center, not very aesthetically pleasing, but it does the job.

BigBellyBilly
2009-08-07, 14:07
if your happy with that view then you'd be better using the standard skin 'debug' window that all skins have. that way you don't have to custom create anything.
You just need a small 'loader' class.

debug xml: DialogScriptInfo.xml

sample loader class:

class TextBox( xbmcgui.WindowXML ):
""" Create a skinned textbox window """
def __init__( self, *args, **kwargs):
pass

def onInit( self ):
try:
self.getControl( 5 ).setText( self.text )
self.getControl( 3 ).setLabel( self.title ) # may not have an ID assigned
except: pass

def onClick( self, controlId ):
pass

def onFocus( self, controlId ):
pass

def onAction( self, action ):
if action and (action.getButtonCode() in CANCEL_DIALOG or action.getId() in CANCEL_DIALOG):
self.close()

def ask(self, title, text ):
self.title = title
self.text = text
self.doModal() # causes window to be drawn


called with:

tbd = TextBox("DialogScriptInfo.xml", os.getcwd(), "Default")
tbd.ask("my title", mytext)
del tbd


something like that.

jt0451
2009-08-07, 14:24
Thanks a lot BigBellyBilly.