Added angle to Python's Control Label

January 8th, 2009
  • this update adds the capability to rotate the label
    control in python "angle".

    controllabel(x, y, width, height, label, font,
    textcolor, disabledcolor, alignment, haspath, angle)

    i'm not sure i did this correctly, but it works.

    i had to add an extra argument to guicontrollabel and then just checked if it was non zero. which i guess should only be if called from python.

    i downloaded the code this morning before editing it.

    also for the pydoc i put "angle : angle of text +/- 360 (opt)"). is that worded right?

    i'm not sure if this is one that can be chaged after the label is created, so i did not create a new method. i know setcolor doesn't work after.

    patch 1496490 (http://sourceforge.net/tracker/index.php?func=detail&aid=1496490&group_id=87054&atid=581840)


  • to be honest, i'd prefer to allow python to load in or pass in an xml description of the control.

    unless python needs access to all the members of the control structures (imo it probably doesn't).

    this'll have to wait for after 2.0 though.


  • if you are talking about creating a whole window.xml and just let the script fill certain controls. that would be great.

    i can do something similar with two and a custom*.xml right now as long as it's not a type .

    xbmc.activatewindow(222)
    xbmc.runscript(q:\scripts\script.py)

    or an activatewindow() at the beginning of the script.

    i just need to get the timing down for animations and any controls that are script specific will have to be created with python, but it does work.

    did you update xbmcmodule.cpp with the newest code for getinfolabel() and getinfoimage(). it really needs to be, otherwise you can't use 'skin.string(stringname)'. it's in the python5.zip or i can upload it as a new patch.

    thanks


  • yeah, i'll add the string versions when i get the chance.

    as for the xml based loading of controls/windows it means that you have access to everything at creation time - it'll allow you to distribute skin files next to the .py files to load, and you'll still have the same ability to add new controls, or modify the ones that are loaded (assuming they are of the "usual" types)

    obviously it'll take a while to do all this - so post 2.0.

    cheers,
    jonathan







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about Added angle to Python's Control Label , Please add it free.