Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
customization:songtree [2007/09/21 20:03] – squentin | customization:songtree [2022/05/23 01:30] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | This page describe how to customize the SongTree, a new widget introduced in the ([[http:// | + | This page describe how to customize the SongTree, a new widget introduced in version |
- | An example of a SongTree can be seen in this [[http://squentin.free.fr/ | + | An example of a SongTree can be seen in this [[http://gmusicbrowser.org/ |
Very rough and incomplete draft, better than nothing | Very rough and incomplete draft, better than nothing | ||
Line 25: | Line 25: | ||
object1_name : type(opt1=val1, | object1_name : type(opt1=val1, | ||
object2_name : type(opt1=val1, | object2_name : type(opt1=val1, | ||
+ | option1_name : type(opt1=val1, | ||
or | or | ||
Line 34: | Line 35: | ||
Examples can be seen in the ' | Examples can be seen in the ' | ||
+ | |||
====== Groups ====== | ====== Groups ====== | ||
Line 44: | Line 46: | ||
* vcollapse defines the height that will be given to the group in collapsed mode | * vcollapse defines the height that will be given to the group in collapsed mode | ||
all 6 values default to 0, they are expression evaluated at group initialization | all 6 values default to 0, they are expression evaluated at group initialization | ||
+ | |||
+ | * title : name used in the grouping edition dialog, default to NameOfTheSkin | ||
====== Columns ====== | ====== Columns ====== | ||
Line 56: | Line 60: | ||
* hreq : expression evaluated at column initialization, | * hreq : expression evaluated at column initialization, | ||
all options are optional except title | all options are optional except title | ||
+ | |||
====== Objects ====== | ====== Objects ====== | ||
Line 66: | Line 71: | ||
Most options have a reasonable default value, they also compute some other values that can be used, for example text/ | Most options have a reasonable default value, they also compute some other values that can be used, for example text/ | ||
- | |||
- | ===== drawn objects and their options ===== | ||
- | * text : x y w h markup text rotate hide xpad ypad pad xalign yalign | ||
- | * aapic : picsize aa aakey picnb hide xpad ypad pad xalign yalign | ||
- | * picture : x y w h file resize crop hide xpad ypad pad xalign yalign | ||
- | * icon : x y w h size icon hide xpad ypad pad xalign yalign | ||
- | * rect : x y w h color filled hide | ||
- | * line : x1 y1 x2 y2 color hide | ||
Line 93: | Line 90: | ||
example : '' | example : '' | ||
- | ===== generic | + | ===== drawn objects |
- | x and y : x and y position, default to 0. if negative, the value is added to $_w or $_h | + | |
- | w and h : width and height | + | * text : x y w h markup text rotate hide xpad ypad pad xalign yalign |
- | xpad, ypad and pad : padding around the object, xpad and ypad default to the value of pad | + | * aapic : picsize aa aakey picnb hide xpad ypad pad xalign yalign |
- | xalign and yalign : value between 0 (left/top) and 1 (right/ | + | * picture : x y w h file resize crop hide xpad ypad pad xalign yalign |
- | hide : if true the object is hidden (=> width and height equal to 0) | + | * icon : x y w h size icon hide xpad ypad pad xalign yalign |
+ | * rect : x y w h color filled width hide | ||
+ | * line : x1 y1 x2 y2 color width | ||
+ | |||
+ | common options : | ||
+ | * x and y : x and y position, default to 0. if negative, the value is added to $_w or $_h | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
==== text ==== | ==== text ==== | ||
Line 124: | Line 130: | ||
* icon : icon name, can be an array ref containing multiple icon names (example : '' | * icon : icon name, can be an array ref containing multiple icon names (example : '' | ||
==== rect ==== | ==== rect ==== | ||
- | draws a rectangle at x,y of width w and height h, filled if " | + | draws a rectangle at x,y of width w and height h, filled if " |
==== line ==== | ==== line ==== | ||
draws a line from x1,y1 to x2,y2 with color " | draws a line from x1,y1 to x2,y2 with color " | ||
+ | ===== user-editable group settings ===== | ||
+ | Groups can define some settings that can easily be changed by user, for example for choosing a color, font, text ... | ||
+ | There are different types of settings, the type only affect the interface that the user will use to edit it. | ||
+ | the syntax is : | ||
+ | option1_name : type(default=' | ||
+ | |||
+ | * type is one of OptionText, OptionColor, | ||
+ | * name is the name that will be displayed in the GUI, use option1_name by default. | ||
+ | * OptionNumber needs a few parameters : min, | ||
+ | * OptionCombo possible values are defined by the parameter list, ' | ||
+ | |||
+ | example : | ||
+ | mytext : OptionText(default=' | ||
+ | text1: text(text=mytext) | ||
+ | will allow the user to change the text that the object ' | ||
+ | more complex example : | ||
+ | mytext | ||
+ | mycolor : OptionColor(default=' | ||
+ | myfont | ||
+ | myhide | ||
+ | title: text( markup='< | ||
Line 146: | Line 173: | ||
* not : return the negation of its argument, same as ! | * not : return the negation of its argument, same as ! | ||
* average : return the average of its arguments (not rounded, may change) | * average : return the average of its arguments (not rounded, may change) | ||
+ | * formattime : to format time, the first parameter is the standard time format string, the second parameter is the number of seconds since epoch and the third optional parameter is the value when the number of seconds is 0, which is the value of $lastplay_ when the song has never been played, example : formattime(' | ||
currently allowed perl functions (more to come) : ucfirst uc lc abs int sprintf substr length index join warn \\ | currently allowed perl functions (more to come) : ucfirst uc lc abs int sprintf substr length index join warn \\ | ||
examples: | examples: | ||
- | 'year is '.if(%year> | + | 'year is '.if($year> |
Line 155: | Line 183: | ||
* $name : song/group variables | * $name : song/group variables | ||
- | * for columns : title | + | * for columns : title |
- | * for groups : title year length (more will be added) | + | * for groups : title year length |
Line 167: | Line 195: | ||
* $_odd : true if the row is odd-numbered | * $_odd : true if the row is odd-numbered | ||
- | * name:option : the value of the object option/ | + | * name:option : the value of the object option/ |
- | example : | + | |
* name : options of the column/ | * name : options of the column/ |