Label and button width
#16
hi,

i downloaded and build the csv on the 10th of april but i still get this error:

Quote:11-04-2005 19:18:22 info self.grid.append(xbmcgui.controlbutton(38, 80 + (row * 40), 140, 38, epgdata[gline]['number'] + '   ' + epgdata[gline]['name'], 'font14', 'ffffffff', 'ffffffff', 'chfocus.png', 'chnofocus.png'))
11-04-2005 19:18:22 info typeerror
11-04-2005 19:18:22 info :
11-04-2005 19:18:22 info function takes at most 7 arguments (10 given)
11-04-2005 19:18:22 info

thor918's xbmcgui documents clearly state that as of the 6th of april this should work, or so i understood.

what am i missing? aren't the python modules updated in the cvs? and if so where could i find the updated modules?

tai,
cactus
Reply
#17
well the 6.april build did work. non errors reported to me.
perhaps you got previous objects in the release directory.
try to delete the release dir and make a fresh build.
Reply
#18
hey thanks!

that did do the trick. well part of it Wink why?

the documentation (http://home.no.net/thor918/xbmc/xbmcgui....trolbutton) clearly states
Quote:controlbutton(
   x, y, width, height, label, font, textcolor, disabledcolor,
   focustexture, nofocustexture, textxoffset, textyoffset, alignment)
but digging into controlbutton.cpp i found
Quote: pyobject* controlbutton_new(
       pytypeobject *type,
       pyobject *args,
       pyobject *kwds )
{
static char *keywords[] = {
"x", "y", "width", "height", "label",
           "focustexture", "nofocustexture",
"textxoffset", "textyoffset", "alignment",
           "font", "textcolor", "disabledcolor", null };

but i got there and it now does what i want. i know documentation is usualy the last thing that needs to be done, but only if there aren't any more 'fun' things to do, right? Smile

thanks for these new parameters, i love them!

cactus
Reply
#19
are you saying that the doc is wrong because the order is different or something? are you sure that the order in that array is the order of the args? im a little confused.
Reply
#20
hmm,

i'm kinda new at this, so i'm not sure.

if is use this:
Quote:xbmcgui.controlbutton(10, 80,  150, 38, label, 'button-focus.png', 'nownofocus.png')
it works like a charme.

but if i use this:
Quote:xbmcgui.controlbutton(10, 80,  150, 38, label, 'font13', 'ffffffff', 'ffffffff', 'button-focus.png', 'nownofocus.png')
it doesn't work.

and if i use this:
Quote:xbmcgui.controlbutton(10, 80,  150, 38, label, 'font13', 'ffffffff')
it doesn't give me an error, but no button textures show.

so i may be way of, but i assumed it is because of the sequence of the paramaters. makes sence to me, but again, i may just as well be completely wrong :p

cactus

b.t.w., anyone knows how to use the textxoffset, textyoffset and the alignment parameter?
Reply
#21
Quote: if (!pyarg_parsetupleandkeywords(
args,
kwds,
"llll|osslllsss",
keywords,
&self->dwposx,
&self->dwposy,
&self->dwwidth,
&self->dwheight,
&pobjecttext,
&ctexturefocus,
&ctexturenofocus,
&self->dwtextxoffset,
&self->dwtextyoffset,
&self->dwalign,
&cfont,
&ctextcolor,
&cdisabledcolor ))
i agree there is a bug in the python doc... will open a new topic for this.
Reply
#22
jmarshallnz has updated the doc.
the online doc i have on my website is updated to that.
xbmc.html
xbmcgui.html
Reply
#23
(cactus @ april 13 2005,09:56 Wrote:b.t.w., anyone knows how to use the textxoffset, textyoffset and the alignment parameter?
yep, i added the text offset parameters because of the project mayhem iii skin. the text offset parameters are used to specify a text label x and y rendering offset from the left edge of the button. the pm3 skin has that little red arrow on the buttons and i found the text would overlap the arrow... with the offset parameters, you can fix that.

the alignment parameter is supposed to allow you to specify if the label should be left justified, right justified, center x, center y. also, there is a value to specify that you want the label truncated if it doesn't fit in the button area but the c++ button control doesn't seem to support it correctly yet. have a look in xbmc/guilib/common/xbfont.h for the cxbfont::drawtext flag values that you can pass.

fyi, the label control supports more alignment features than the button control.
Reply
#24
Quote:also, there is a value to specify that you want the label truncated...

:bowdown:

your my hero, my own solution didn't really work, so this is another very welcome addition.

thanks!

cactus
Reply
#25
(jmarshall @ april 05 2005,15:36 Wrote:it appears that the default right action from the spin control is not mapped, so it basically just returns to the list control in this case.

i'll see what i can fix up on the list control side (because it should go to the <onright> control of the listcontrol).

cheers,
jonathan
did this navigating right off spincontrol go in ?

i expected the new controlright on a controllist to now move onto whatever control you setup, but it still goes right off the spin back to the list. (i'm using a build from yesterday).

also, slightly off topic:  is it possible to create the compact 1 line lists that are used throuout the xbmc (the ones were the label and option and spin are all compacted close together) ?

if not, could the current controllist have the spincontrols not visible as an option. this would reduce their overall height when space is ata premium ?

thanks.
Reply
#26
does anyone know if a fix to use truncating on controlbutton is in the works ?
Reply

Logout Mark Read Team Forum Stats Members Help
Label and button width0