PPSR > CL Functions 
- General Syntax
- Calls to CL functions (command list functions) take the general form:
cl.ServiceName(expr1, expr2,...)
where:
- ServiceName is one of the functions described in the following sections
- expr1, expr2, etc are expressions representing the function's parameters
- Specifying an Item
- To specify an item in a command list, use either:
- Item index
- Item id
- A text label for an item.
- Used solely by the CL functions.
- Item id cannot be all numbers -- it must contain at least one letter.
- To assign:
- in script files
- Use:
cl.SetId(clname, clindex, newid)
- in PPCD
- Put <id=xxxx> at end of item name (with the angled brackets).
- in text configuration files
- Put "id=xxx" in text configuration files (without the quotes).
- Specifying Colours
- r, g, b
- as 3 comma-separated values
- "r g b"
- as a single blank-separated string
- single integer w/ red in lowest 8 bits using Win.GetPixel or Win.InputColor
- "current"
- leave blank
Working with Entire Command Lists- AddProperties
- Description
- Sets properties for a command list, adding to any properties already set.
- Syntax
- cl.AddProperties(clname, proplines)
- Parameters
- clname
- (string) command list name
- proplines
- (multi-line string) properties to set for command list clname
- Use "\r" as the line separator for proplines.
- Properties follow the same general format as the [Properties] section of the text configuration ini files, described in the main PowerPro Help.
See PowerPro Help (CHM) > Configuring with text files > Layout of text configuration file > Properties for command lists.
- Examples
- cl.AddProperties("myList", "Format = topmost showasbar")
- cl.Create("myList", 1)
cl.SetProperties("myList", "Format1 = Position: floating BarSize Topmost")
- Creates a command list "myList" then sets some initial properties.
- See Also
- Notes
- Each time you call SetProperties all properties are reset.
So, if you are making a series of calls in sequence to set many properties, the first one will normally be SetProperties and the remainder AddProperties. - Newly created bars that have position:floating, must always be defined with all four of Left:, Right:, Bottom:, Top:, even if BarSize is specified.
- When creating new bars that have "position:floating", the command list must always also have the 4 edge coordinates defined, as per:
"Left: lpx Right: rpx Bottom: bpx Top: tpx"
even if "BarSize" is specified. If any of the cooordinate values are omitted, the bar may not behave or format as expected.
- Compact
- Description
- Compacts PowerPro internal memory used to store strings related to command lists.
- Syntax
- Examples
- Notes
- It is never necessary to use this function, but it may help to keep your memory usage down if you add or remove many items, or change the value of many commands, names, icons, tool tips.
- PowerPro automatically does a compact each time you remove all items in a command list or after importing a command list.
- Create
- Description
- Creates a new Command List with specified name.
- Syntax
- cl.Create(clname, samelist)
- Parameters
- clname
- (string) name to give the new command list
- samelist
- (boolean) whether to re-use a list with name=clname, if one exists
- Optional, default is 0.
- Possible Values
- 1
- if list with name=clname already exists, re-use it, but all items are removed by the call to create
- 0
- list with name=clname must not exist
- Return Value
- either:
- 1
- ""
- command list could not be created
- Examples
- cl.Create("myList")
- cl.Create("myList", 1)
- Exists
- Description
- Checks if the specified command list exists.
- Syntax
- Parameters
- clname
- (string) name of the command list
- Return Value
- (boolean)
- 1
- 0
- command list does not exist
- Examples
- if (not cl.Exists("myCL"))
cl.Create("myCL")
- Checks if a command list named "myCL" exists, and if not, creates it.
- GetBackColor
- Description
- Retrieves the list background color as three space-separated values representing red, green & blue.
- If the command list does not have its own color, returns an empty string.
- Syntax
- Parameters
- clname
- (string) name of the command list
- Return Value
- (string) either
- "r g b"
- a string containing 3 space-separated values:
- "" (empty string)
- Examples
- cl.Create("myList", 1)
Win.Debug( cl.GetBackColor("myList") )
- Creates a command list named "myList", then outputs an empty string in response to the cl.GetBackColor() call, as no background color has been set for the command list.
- cl.Create("myList", 1)
cl.AddProperties("myList", "Format = Back: 120 180 200")
Win.Debug( cl.GetBackColor("myList") )
- Creates a command list named "myList", setting its background color to "120 180 200", then outputs the background color to a debug window with the cl.GetBackColor() call.
- Notes
- Use Win.Hex() on the individual color values to translate them into hex.
- GetBackground
- Description
- Returns the background file.
- Syntax
- Parameters
- clname
- (string) command list name
- Return Value
- (string) either:
- path to the background file
- "" (empty string)
- Examples
- cl.Create("myList", 1)
cl.SetBackground("myList", "c:/graphics/pattern.bmp")
Win.Debug( cl.GetBackground("myList") )
- Creates a list named "myList" & sets its background to the file "c:/graphics/pattern.bmp". Outputs that value.
- GetHideAfter
- Description
- Retrieves the value set for interval for hiding a list.
- Syntax
- Parameters
- clname
- (string) command list name
- Return Value
- (integer) time interval for hiding list clname
- Returns 0 if nothing set (so bar does not hide).
- Examples
- cl.GetHideAfter("myList")
- GetLabelIndex
- Description
- Returns the numeric index of the item with the specified label in named command list, or an empty string if not found.
- Syntax
- cl.GetLabelIndex(clname, sLabel)
- Parameters
- clname
- (string) name of the command list
- sLabel
- Return Value
- either:
- (integer) index of item with label=sLabel
- "" (empty string)
- Examples
- Win.Debug( cl.GetLabelIndex("myList", "foo4") )
- Looks for an element in command list "myList" with id "foo4", & outputs its index number, else outputs an empty string.
- Notes
- Be careful not to mistake a result of "0" for "Item not found". Indexes start at 0, so a result of 0 means the first element has the specified label.
- GetLastBar
- Description
- Retrieves the name of the bar that holds the last pressed button, or "" if no bar has been accessed.
- Syntax
- Return Value
- (string) name of the command list that holds the last pressed button
- Examples
- GetPressed
- Description
- Retrieves the index of the button on a specified bar that is currently being pressed.
- Syntax
- Parameters
- Return Value
- (integer) either:
- i
- where i=index of the button in barname that is currently being pressed
- -1
- no button is being pressed
- Examples
- Win.Debug( cl.GetPressed("myList") )
- Notes
- Since cl.GetPressed() returns the button that is currently being pressed, it is only useful when used for a bar command.
- GetLastPressed
- Description
- Retrieves the index of the last pressed button on a specified bar.
- Syntax
- cl.GetLastPressed(barname)
- Parameters
- Return Value
- (integer) index of the button on barname that was pressed last
- If the button no longer exists (if, for example, its click action was to close the bar) cl.GetLastPressed() returns -1.
- Examples
- Win.Debug( cl.GetLastPressed("notesBar") )
- Outputs the index of the last button pressed from the bar named "notesBar".
GetLastMouse- Description
- Returns "L","R", or "M" to indicate which mouse button was used for the last pressed button on bar "barname".
- Syntax
- Parameters
- Return Value
- Examples
- Win.Debug( cl.GetLastMouse("notesBar") )
- Outputs a character as above for the last mouse button used on a button on bar "notesBar".
Notes
cl.GetLastMouse() consistently returns "M" for a newly created bar which has not had a button clicked yet.
- GetIdIndex
- Description
- Returns the numeric index of the item with specified id in named command list, or an empty string if not found.
- Syntax
- cl.GetIdIndex(clname, sid)
- Parameters
- clname
- (string) command list name
- sid
- Return Value
- either:
- (integer)
- index of item with id=sid
- "" (empty string)
- Examples
- Win.Debug( cl.GetIdIndex("myList", "btn4") )
- Outputs the index of the item with id="btn4" in command list "myList", or an empty string if not found.
- Notes
- Be careful not to mistake a result of "0" for "Item not found". Indexes start at 0, so a result of 0 means the first element has the specified label.
- GetMaxText
- Description
- Retrieves the maximum text length setting for a command list.
- Syntax
- Parameters
- clname
- (string) command list name
- Return Value
- (integer) maximum text length setting for command list clname
- Examples
- cl.Create("myList", 1)
cl.SetMaxText("myList", 20)
Win.Debug( cl.GetMaxtext(clname) )
- GetTextColor
- Description
- Retrieves the text color of a command list as three space-separated values representing red, green & blue.
- If the list does not have its own color set, an empty string is returned.
- Syntax
- Parameters
- clname
- (string) name of the command list
- Return Value
- (string) either:
- "r g b"
- "" (empty string)
- no text color explicitly set
- Examples
- Win.Debug( cl.GetTextColor("myList") )
- Outputs the text color of the list "myList", or "" if none is set.
- Insert
- Description
- Inserts a new empty item before the specified index position.
- Syntax
- cl.Insert(clname, clindex)
- Parameters
- clname
- (string) command list name
- clindex
- To add a new item to the end, specify clindex as cl.length(clname).
- Return Value
- (boolean)
- 1
- item inserted successfully
- 0
- item could not be inserted as command list would be too long (>1000 elements) after the insert
- Examples
- cl.insert("list1", 0)
- Inserts a new item at the start of the command list named "list1".
- cl.insert("list2", cl.length("list2"))
- Inserts a new item at the end of the command list named "list2".
- cl.insert("thelist", "theId")
- Inserts a new item before the item with id "theId" in command list "thelist".
- Notes
- If you remove or insert an item for a command list which is showing as a bar, the bar will be closed and then re-opened after the command completes.
Therefore when changing many items, avoid repeated showing & hiding of the bar by closing the bar first with bar.close, adding/removing the items, then showing the bar again with bar.show.
- Length
- Description
- Returns the number of elements in the command list.
- Syntax
- Parameters
- clname
- (string) name of the command list
- Return Value
- (integer) number of elements in clname
- Examples
- cl.Create("myList", 1)
cl.Insert("myList", cl.Length("myList"))
cl.Insert("myList", cl.Length("myList"))
cl.Insert("myList", cl.Length("myList"))
Win.Debug( cl.Length("myList") )
- Creates a command list "myList", adding 3 elements to it, then outputs the length.
- Outputs: 3
- Notes
- The index of the first element is 0.
- The index of the last element would be cl.Length(clname)-1.
- Redisplay
- Description
- If the specified command list is a bar, PowerPro redraws it without closing it first.
- Syntax
- Parameters
- clname
- (string) command list name
- Examples
- cl.Redisplay("myList")
- Redraws the bar named "myList" without closing it.
- Notes
- May be needed after cl.SetProperties() or cl.AddProperties() is used.
- See Also
- Refresh
- Description
- If the specified command list is a bar, PowerPro redraws it by opening and closing the bar.
- Syntax
- Parameters
- clname
- (string) command list name
- Examples
- cl.Refresh("myList")
- Closes then reopens the bar named "myList".
- Notes
- May be needed after cl.SetProperties() or cl.AddProperties() is used.
- See Also
- Remove
- Description
- Removes a particular item from a command list.
- Syntax
- cl.Remove(clname, clindex)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the item to remove from clname
- Return Value
- (boolean)
- 1
- element successfully removed
- 0
- element could not be removed (the element did not exist, or some other problem occurred)
- Examples
- local res = cl.Remove("names", 3)
- Removes the 4th element of the list called "names", putting the result of the removal
- RemoveAll
- Description
- Removes all the items in the command list, setting its length to zero.
- Closes any bar built from the specified command list.
- Syntax
- Parameters
- clname
- (string) name of the command list
- Examples
- cl.RemoveAll("myList")
- Removes all the elements of command list "myList", closing it if it is a bar.
- Notes
- This function does not destroy the command list, & in fact there is no cl.Destroy function.
- SavePcf
- Description
- Writes current pcf, ensuring any changes to command lists from the original pcf are saved.
- Syntax
- Examples
- Notes
- cl.SavePcf() is only needed if you want to ensure that changes made to command lists stored in pcf are saved. If this function is not used, the changes may or may not be saved.
- This function only saves changes to command lists that appear in the original pcf. To save manually created lists or lists from text imports as well, use Configure.WriteAllToPCF(path_to_pcf).
- SetAsAutorun
- Description
- Sets a command list as the source for the special "Autorun" command list.
- Syntax
- Parameters
- clname
- (string) command list name
- Examples
- cl.SetAsAutorun("autos")
- Sets the command list named "autos" to be the source for the autorun list.
- SetAsTray
- Description
- Sets the specified command list as the source for tray icons.
- Syntax
- Parameters
- clname
- (string) command list name
- Examples
- cl.SetAsTray("traylist")
- Sets the command list named "traylist" to be the source for tray icons.
- SetBackground
- Description
- Sets the background of a command list to the specified file.
- Syntax
- cl.SetBackground(clname, path)
- Parameters
- clname
- (string) command list name
- path
- (string) path to the file to use as a background
- Examples
- cl.Create("myList", 1)
cl.SetBackground("myList", "c:/graphics/stripes.bmp")
- Sets the background of the command list "myList" to the file "stripes.bmp".
- Notes
- Only .bmp files work as background files.
- PowerPro doesn't throw an error if the file doesn't exist.
- SetHideAfter
- Description
- Sets the interval to wait before hiding a list after the mouse moves off it.
- Syntax
- cl.SetHideAfter(clname, val)
- Parameters
- clname
- (string) command list name
- val
- (integer) time before list is hidden in milliseconds
- Possible Values
- n
- hide after n milliseconds, where n equals one of:
- 50
- 100
- 250
- 500
- 750
- 1000
- 1500
- 2000
- 2500
- 3000
- 4000
- 5000
- 7500
- 10000
- 0
- -n
- toggles between hide after n milliseconds and no hide
- Examples
- cl.SetHideAfter("myList", 2000)
- Sets the command list "myList" to hide after 2000.
- Notes
- Values other than the values listed for val=n above will not do anything.
- SetMaxText
- Description
- Sets the maximum number of characters to be shown on each button or menu item from specified command list.
- Syntax
- cl.SetMaxtext(clname, newmax)
- Parameters
- clname
- (string) command list name
- newmax
- (integer) new maximum number of characters to show
- Examples
- cl.SetMaxtext("myList", 20)
- Changes the maximum text label length of buttons/menu items created from list "myList" to 20 chars.
- SetProperties
- Description
- Resets properties for a command list, clearing any previous values.
- Syntax
- cl.SetProperties(clname, proplines)
- Parameters
- clname
- (string) command list name
- proplines
- (multi-line string) properties to set for command list clname
- Use "\r" as the line separator for proplines.
- Properties follow the same general format as the [Properties] section of the text configuration ini files, described in the main PowerPro Help.
- Examples
- cl.Create("myList", 1)
cl.SetProperties("myList", "Format1 = Position: above active BarSize Topmost")
- Creates a command list "myList" then sets some initial properties.
- cl.SetProperties("thisone", "Background=c:/a/file/path")
- Sets the background of the command list "thisone" to "c:\a\file\path".
- cl.SetProperties("another", "Format1=showasbar barsize \r active=20")
- Sets some properties of command list "another".
- Notes
- Each time you call SetProperties all properties are reset.
So, if you are making a series of calls in sequence to set many properties, the first one will normally be SetProperties and the remainder AddProperties. - If the target command list is a currently visible bar, it is closed & reshown when cl.SetProperties() is executed.
- When creating bars that have "position:floating", the command list must always also have the 4 coordinates defined, as per:
"Left: lpx Right: rpx Bottom: bpx Top: tpx"
even if "BarSize" is specified. If any of the cooordinate values are omitted, the bar may not behave or format as expected.
- See Also
- Getting Item Attributes
- GetBackColor
- Description
- Retrieves the background color of an item in a command list as three space-separated values: "red green blue".
- Syntax
- cl.GetBackColor(clname, clindex)
- Parameters
- clname
- (string) name of the command list containing item to check
- clindex
- (integer) index of the item in clname
- Return Value
- (string) Either:
- the color as 3 space-separated values, "r g b", where:
- "" (empty string)
- background color not set for specified item
- Examples
- Win.Debug( cl.GetBackColor("myBar", 3) )
- Outputs to a debug window the background color of the 4th item on the PowerPro bar named "myBar".
- Win.Debug( cl.GetBackColor("myBar", "mb3") )
- Outputs to a debug window the background color of the item with item id "mb3" on the PowerPro bar named "myBar".
- GetHeight
- Description
- Retrieves the height of an item in a command list.
- Syntax
- cl.GetHeight(clname, clindex)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the target element in clname
- Return Value
- (integer) item height, in pixels
- Examples
- cl.Create("myList", 1)
cl.Insert("myList", 0)
cl.SetHeight("myList", 0, 30)
Win.Debug( cl.GetHeight("myList", 0) )- Creates a command list "myList" & inserts one item, setting its width to 30px.
- Outputs the width of the first item in "myList": 30
- Notes
- Only retrieves heights set via cl.SetHeight().
Height set using cl.SetProperties() & cl.AddProperties(), or set directly in the PPCD will not be retrieved, and the cl.GetHeight() call will return 0.
- GetIconFile
- Description
- Retrieves the file name of the icon used with an element in a command list.
- Syntax
- cl.GetIconFile(clname, clindex)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the target element in clname
- Return Value
- Examples
- cl.Create("myList", 1)
cl.Insert("myList", 0)
cl.SetProperties("myList", "Format = topmost height: 20 iconsize: 16")
cl.SetIcon("myList", 0, "c:/my icons/star.ico", 1)
Bar.Show("myList")
Win.Debug( cl.GetIconFile("myList", 0) )- Creates a command list "myList" & adds one element with the icon "star.ico", then shows the command list as a bar.
- Outputs: "c:/my icons/star.ico"
- Notes
- Icons must be enabled for them to be visible on a bar.
- GetIconNumber
- Description
- Retrieves the number of the icon in its parent file as used with the specified element in a command list.
- Syntax
- cl.GetIconNumber(clname, clindex)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the target element in clname
- Return Value
- Examples
- cl.Create("myList", 1)
cl.Insert("myList", 0)
cl.SetProperties("myList", "Format = topmost height: 20 iconsize: 16")
cl.SetIcon("myList", 0, "c:/my icons/star.ico", 1)
Bar.Show("myList")
Win.Debug( cl.GetIconNumber("myList", 0) )- Creates a command list "myList" & adds one element with the icon "star.ico", then shows the command list as a bar.
- Outputs: "c:/my icons/star.ico"
- Notes
- Icons must be enabled for them to be visible on a bar.
- GetId
- Description
- Returns the id from an element in a command list.
- Syntax
- cl.GetId(clname, clindex)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the target element in clname
- Return Value
- Examples
- local el_id = cl.GetId("myList", 3)
- Puts the id of the 4th element in command list "myList" into the local variable el_id.
- GetLabel
- Description
- Returns the label from an element in a command list.
- Syntax
- cl.GetLabel(clname, clindex)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the target element in clname
- Return Value
- Examples
- cl.GetLabel("myList", 2)
- Returns the label of the 3rd item in command list "myList".
- Notes
- For *info labels, cl.GetLabel() returns the info format string, not the actual value. Use cl.GetLabelValue() to get the current value of an *info label.
- GetLabelValue
- Description
- Retrieves the label from the specified item.
- For *info labels, the label is parsed & the current actual value is returned.
- Syntax
- cl.GetLabelValue(clname, clindex)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the target element in clname
- Return Value
- (string) item label, or the current value of an *info label
- Examples
- cl.Create("myList", 1)
cl.Insert("myList", 0)
cl.SetLabel("myList", 0, "*Info \"c:\" disk c")
Win.Debug( cl.GetLabel("myList", 0) )
Win.Debug( cl.GetLabelValue("myList", 0) )- Sets up a command list "myList" containing one item with an *info label that shows the amount of free space on C.
The slightly different Win.Debug() calls then output, first, the actual *info format:
"*Info "c:" disk c"
and then the current value, such as:
"c: 3316.0"
- GetLeftCmd
- Description
- Retrieves the specified command parameter from the Left Command of an element in a command list.
- Syntax
- cl.GetLeftCmd(clname, clindex, i)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the target item
- i
- (integer) index of the target command to retrieve
- Possible Values
- 0 or 1
- returns the first command parameter
- 2
- returns the second command parameter
- 3, ...
- returns the 3rd, (4th, etc) command parameter
- Return Value
- (string) ith command string
- where i=index of the command parameter
- Examples
- cl.Create("myList", 1)
cl.Insert("myList", 0)
cl.AddLeft("myList", 0, "Bar.Show", "anotherBar")
Win.Debug( cl.GetLeftCmd("myList", 0, 1) )
Win.Debug( cl.GetLeftCmd("myList", 0, 2) )- Outputs the first command in the Left Command for the 1st item in "myList":
"Bar.Show"
then outputs the second command:
"anotherBar"
Here,
cl.GetLeftCmd("myList", 0, 2) == cl.GetLeftParam("myList", 0, 1)
- GetLeftHow
- Description
- Retrieves the specified how start parameter from the Left Command of an element in a command list.
- Syntax
- cl.GetLeftHow(clname, clindex, i)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the target element in clname
- i
- (integer) index of the parameter to retrieve
- Possible Values
- 0 or 1
- returns the first how start parameter
- 2
- returns the second how start parameter
- 3, ...
- returns the 3rd, (4th, etc) how start parameter
- Return Value
- (string) the ith how start parameter
- Possible Values
- "normal"
- "max"
- "min"
- "hide"
- "traymin"
- Examples
- cl.Create("myList", 1)
cl.Insert("myList", 0)
cl.AddLeft("myList", 0, "notepad", "test.powerpro", pprofolder++?"scripts\", "min")
Win.Debug( cl.GetLeftHow("myList", 0, 1) )- Outputs the first how start parameter of the Left Command for the first element of "myList":
"min"
- GetLeftOnTop
- Description
- Retrieves the On Top setting for the Left Command of an element in a command list.
- Syntax
- cl.GetLeftOnTop(clname, clindex)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the target element in clname
- Return Value
- (boolean)
- 1
- On Top is set
- checkbox is ticked in PPCD
- 0
- On Top is not set
- checkbox is not ticked in PPCD
- Examples
- cl.Create("myList", 1)
cl.Insert("myList", 0)
cl.SetLeftOnTop("myList", 0, 1)
Win.Debug( cl.GetLeftOnTop("myList", 0) )
- GetLeftParam
- Description
- Retrieves the specified parameter argument from the Left Command of an element in a command list.
- Syntax
- cl.GetLeftParam(clname, clindex, i)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the target item
- i
- (integer) index of the parameter to retrieve
- Possible Values
- 0 or 1
- returns the first left parameter
- 2
- returns the second left parameter
- 3, ...
- returns the 3rd, (4th, etc) left parameter
- Return Value
- (string) ith parameter string
- where i=index of the parameter in the Left Command statements
- Examples
- cl.Create("myList", 1)
cl.Insert("myList", 0)
cl.AddLeft("myList", 0, "Bar.Show", "anotherBar")
Win.Debug( cl.GetLeftParam("myList", 0, 1) )- Outputs the first parameter of the Left Command for the first element:
"anotherBar"
- GetLeftSwitchTo
- Description
- Retrieves the Switch To setting for the Left Command of an element in a command list.
- Syntax
- cl.GetLeftSwitchTo(clname, clindex)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the target element in clname
- Return Value
- (boolean)
- 1
- Switch To is set
- checkbox is ticked in PPCD
- 0
- Switch To is not set
- checkbox is not ticked in PPCD
- Examples
- cl.Create("myList", 1)
cl.Insert("myList", 0)
cl.SetLeftSwitchTo("myList", 0, 1)
Win.Debug( cl.GetLeftSwitchTo("myList", 0) )
- GetLeftWork
- Description
- Retrieves the specified work directory parameter from the Left Command of an element in a command list.
- Syntax
- cl.GetLeftWork(clname, clindex, i)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the target element in clname
- i
- (integer) index of the parameter to retrieve
- Possible Values
- 0 or 1
- returns the first work directory parameter
- 2
- returns the second work directory parameter
- 3, ...
- returns the 3rd, (4th, etc) work directory parameter
- Return Value
- (string) the ith work directory
- Examples
- cl.Create("myList", 1)
cl.Insert("myList", 0)
cl.AddLeft("myList", 0, "notepad", "test.powerpro", pprofolder++?"scripts\", "normal")
Win.Debug( cl.GetLeftWork("myList", 0, 1) )- Outputs the first work directory parameter of the Left Command for the first element of "myList":
"C:\Program Files\PowerPro\scripts\"
- GetMiddleCmd
- Description
- Retrieves the specified command parameter from the Middle Command of an element in a command list.
- Syntax
- cl.GetMiddleCmd(clname, clindex, i)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the target item
- i
- (integer) index of the target command to retrieve
- Possible Values
- 0 or 1
- returns the first command
- 2
- returns the second command
- 3, etc
- returns the third command, etc
- Return Value
- (string) ith command name
- where i=index of the command name in the command statements
- Examples
- cl.Create("myList", 1)
cl.Insert("myList", 0)
cl.AddMiddle("myList", 0, "Bar.Show", "anotherBar")
Win.Debug( cl.GetMiddleCmd("myList", 0, 1) )
Win.Debug( cl.GetMiddleCmd("myList", 0, 2) )- Outputs the first command in the Middle Command for the 1st item in "myList":
"Bar.Show"
then outputs the second command:
"anotherBar"
- GetMiddleHow
- Description
- Retrieves the specified how start parameter from the Middle Command of an element in a command list.
- Syntax
- cl.GetMiddleHow(clname, clindex, i)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the target element in clname
- i
- (integer) index of the parameter to retrieve
- Possible Values
- 0 or 1
- returns the first how start parameter
- 2
- returns the second how start parameter
- 3, ...
- returns the 3rd, (4th, etc) how start parameter
- Return Value
- (string) the ith how start parameter
- Possible Values
- "normal"
- "max"
- "min"
- "hide"
- "traymin"
- Examples
- cl.Create("myList", 1)
cl.Insert("myList", 0)
cl.AddMiddle("myList", 0, "notepad", "test.powerpro", pprofolder++?"scripts\", "min")
Win.Debug( cl.GetMiddleHow("myList", 0, 1) )- Outputs the first how start parameter of the Middle Command for the first element of "myList":
"min"
- GetMiddleOnTop
- Description
- Retrieves the On Top setting for the Middle Command of an element in a command list.
- Syntax
- cl.GetMiddleOnTop(clname, clindex)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the target element in clname
- Return Value
- (boolean)
- 1
- On Top is set
- checkbox is ticked in PPCD
- 0
- On Top is not set
- checkbox is not ticked in PPCD
- Examples
- cl.Create("myList", 1)
cl.Insert("myList", 0)
cl.SetMiddleOnTop("myList", 0, 1)
Win.Debug( cl.GetMiddleOnTop("myList", 0) )
- GetMiddleParam
- Description
- Retrieves the specified parameter argument from the Middle Command of an element in a command list.
- Syntax
- cl.GetMiddleParam(clname, clindex, i)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the target item
- i
- (integer) index of the parameter to retrieve
- Possible Values
- 0 or 1
- returns the first middle parameter
- 2
- returns the second middle parameter
- 3, ...
- returns the 3rd, (4th, etc) middle parameter
- Return Value
- (string) ith parameter string
- where i=index of the parameter in the Middle Command statements
- Examples
- cl.Create("myList", 1)
cl.Insert("myList", 0)
cl.AddMiddle("myList", 0, "Bar.Show", "anotherBar")
Win.Debug( cl.GetMiddleParam("myList", 0, 1) )- Outputs the first middle parameter for the first element:
"anotherBar"
- GetMiddleSwitchTo
- Description
- Retrieves the Switch To setting for the Middle Command of an element in a command list.
- Syntax
- cl.GetMiddleSwitchTo(clname, clindex)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the target element in clname
- Return Value
- (boolean)
- 1
- Switch To is set
- checkbox is ticked in PPCD
- 0
- Switch To is not set
- checkbox is not ticked in PPCD
- Examples
- cl.Create("myList", 1)
cl.Insert("myList", 0)
cl.SetMiddleSwitchTo("myList", 0, 1)
Win.Debug( cl.GetMiddleSwitchTo("myList", 0) )
- GetMiddleWork
- Description
- Retrieves the specified work directory parameter from the Middle Command of an element in a command list.
- Syntax
- cl.GetMiddleWork(clname, clindex, i)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the target element in clname
- i
- (integer) index of the parameter to retrieve
- Possible Values
- 0 or 1
- returns the first work directory parameter
- 2
- returns the second work directory parameter
- 3, ...
- returns the 3rd, (4th, etc) work directory parameter
- Return Value
- (string) the ith work directory
- Examples
- cl.Create("myList", 1)
cl.Insert("myList", 0)
cl.AddMiddle("myList", 0, "notepad", "test.powerpro", pprofolder++?"scripts\", "normal")
Win.Debug( cl.GetMiddleWork("myList", 0, 1) )- Outputs the first work directory parameter of the Middle Command for the first element of "myList":
"C:\Program Files\PowerPro\scripts\"
- GetRightCmd
- Description
- Retrieves the specified command parameter from the Right Command of an element in a command list.
- Syntax
- cl.GetRightCmd(clname, clindex, i)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the target item
- i
- (integer) index of the target command to retrieve
- Possible Values
- 0 or 1
- returns the first command
- 2
- returns the second command
- 3, etc
- returns the third command, etc
- Return Value
- (string) ith command name
- where i=index of the command name in the command statements
- Examples
- cl.Create("myList", 1)
cl.Insert("myList", 0)
cl.AddRight("myList", 0, "Bar.Show", "anotherBar")
Win.Debug( cl.GetRightCmd("myList", 0, 1) )
Win.Debug( cl.GetRightCmd("myList", 0, 2) )- Outputs the first command in the Right Command for the 1st item in "myList":
"Bar.Show"
then outputs the second command:
"anotherBar"
- GetRightHow
- Description
- Retrieves the specified how start parameter from the Right Command of an element in a command list.
- Syntax
- cl.GetLeftRight(clname, clindex, i)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the target element in clname
- i
- (integer) index of the parameter to retrieve
- Possible Values
- 0 or 1
- returns the first how start parameter
- 2
- returns the second how start parameter
- 3, ...
- returns the 3rd, (4th, etc) how start parameter
- Return Value
- (string) the ith how start parameter
- Possible Values
- "normal"
- "max"
- "min"
- "hide"
- "traymin"
- Examples
- cl.Create("myList", 1)
cl.Insert("myList", 0)
cl.AddRight("myList", 0, "notepad", "test.powerpro", pprofolder++?"scripts\", "min")
Win.Debug( cl.GetRightHow("myList", 0, 1) )- Outputs the first how start parameter of the Right Command for the first element of "myList":
"min"
- GetRightOnTop
- Description
- Retrieves the On Top setting for the Right Command of an element in a command list.
- Syntax
- cl.GetRightOnTop(clname, clindex)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the target element in clname
- Return Value
- (boolean)
- 1
- On Top is set
- checkbox is ticked in PPCD
- 0
- On Top is not set
- checkbox is not ticked in PPCD
- Examples
- cl.Create("myList", 1)
cl.Insert("myList", 0)
cl.SetRightOnTop("myList", 0, 1)
Win.Debug( cl.GetRightOnTop("myList", 0) )
- GetRightParam
- Description
- Retrieves the specified parameter argument from the Right Command of an element in a command list.
- Syntax
- cl.GetRightParam(clname, clindex, i)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the target item
- i
- (integer) index of the parameter to retrieve
- Possible Values
- 0 or 1
- returns the first right parameter
- 2
- returns the second right parameter
- 3, ...
- returns the 3rd, (4th, etc) right parameter
- Return Value
- (string) ith parameter string
- where i=index of the parameter in the Right Command statements
- Examples
- cl.Create("myList", 1)
cl.Insert("myList", 0)
cl.AddRight("myList", 0, "Bar.Show", "anotherBar")
Win.Debug( cl.GetRightParam("myList", 0, 1) )- Outputs the first right parameter for the first element of "myList":
"anotherBar"
- GetRightSwitchTo
- Description
- Retrieves the Switch To setting for the Right Command of an element in a command list.
- Syntax
- cl.GetRightSwitchTo(clname, clindex)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the target element in clname
- Return Value
- (boolean)
- 1
- Switch To is set
- checkbox is ticked in PPCD
- 0
- Switch To is not set
- checkbox is not ticked in PPCD
- Examples
- cl.Create("myList", 1)
cl.Insert("myList", 0)
cl.SetRightSwitchTo("myList", 0, 1)
Win.Debug( cl.GetRightSwitchTo("myList", 0) )
- GetRightWork
- Description
- Retrieves the specified work directory parameter from the Right Command of an element in a command list.
- Syntax
- cl.GetRightWork(clname, clindex, i)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the target element in clname
- i
- (integer) index of the parameter to retrieve
- Possible Values
- 0 or 1
- returns the first work directory parameter
- 2
- returns the second work directory parameter
- 3, ...
- returns the 3rd, (4th, etc) work directory parameter
- Return Value
- (string) the ith work directory
- Examples
- cl.Create("myList", 1)
cl.Insert("myList", 0)
cl.AddRight("myList", 0, "notepad", "test.powerpro", pprofolder++?"scripts\", "normal")
Win.Debug( cl.GetRightWork("myList", 0, 1) )- Outputs the first work directory parameter of the Right Command for the first element of "myList":
"C:\Program Files\PowerPro\scripts\"
- GetTextColor
- Description
- Retrieves the text color of an item in a command list as three space-separated values: "red green blue".
- Syntax
- cl.GetTextColor(clname, clindex)
- Parameters
- clname
- (string) name of the command list containing item to check
- clindex
- (integer) index of the item in clname
- Return Value
- (string) Either:
- the color as 3 space-separated values, "r g b", where:
- "" (empty string)
- text color not set for specified item
- Examples
- Win.Debug( cl.GetTextColor("myBar", 3) )
- Outputs to a debug window the text color of the 4th item on the PowerPro bar named "myBar".
- Win.Debug( cl.GetTextColor("myBar", "mb3") )
- Outputs to a debug window the text color of the item with id "mb3" on the PowerPro bar named "myBar".
- GetTooltip
- Description
- Returns the tool tip from the item clindex.
- Syntax
- cl.GetTooltip(clname, clindex)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the target element in clname
- Return Value
- (string) tool tip for target element
- Examples
- cl.Create("myList", 1)
cl.Insert("myList", 0)
cl.SetProperties("myList", "Format = topmost tooltips height: 20")
cl.SetLabel("myList", 0, "*Info \"c:\" disk c")
cl.SetTooltip("myList", 0, "free space on C")
Bar.Show("myList")
Win.Debug( cl.GetTooltip("myList", 0) )
- Outputs the tool tip for the first element in command list "myList":
"free space on C"
- Notes
- Tool tips will only show if they are enabled for the command list.
- GetTooltipValue
- Description
- Retrieves the tool tip for the specified item.
- For *info tool tips, the *info string is parsed & the current actual value is returned.
- Syntax
- cl.GetTooltipValue(clname, clindex)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the target element in clname
- Return Value
- (string) tool tip text, or the current value of an *info tool tip
- Examples
- cl.Create("myList", 1)
cl.Insert("myList", 0)
cl.SetProperties("myList", "Format = topmost Tooltips height: 20")
cl.SetLabel("myList", 0, "free space on C")
cl.SetTooltip("myList", 0, "*Info \"c:\" disk c")
Bar.Show("myList")
Win.Debug( cl.GetTooltip("myList", 0) )
Win.Debug( cl.GetTooltipValue("myList", 0) )- Sets up a command list "myList" containing one item with an *info tool tip that shows the amount of free space on C.
The two slightly different Win.Debug() calls then output, first, the actual *info format of the tool tip:
"*Info "c:" disk c"
and then the current tool tip value, such as:
"c: 3316.0"
- Notes
- Tool tips will only show if they are enabled for the command list.
- GetWidth
- Description
- Retrieves the width of an item in a command list.
- Syntax
- cl.GetWidth(clname, clindex)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the target element in clname
- Return Value
- (integer) item width, in pixels
- Examples
- cl.Create("myList", 1)
cl.Insert("myList", 0)
cl.SetWidth("myList", 0, 30)
Win.Debug( cl.GetWidth("myList", 0) )- Creates a command list "myList" & inserts one item, setting its width to 30px.
- Outputs the width of the first item in "myList": 30
- IsEnabled
- Description
- Checks when an item in a command list is enabled or not.
- Syntax
- cl.IsEnabled(clname, clindex)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the target element in clname
- Return Value
- Examples
- Win.Debug( cl.IsEnabled("myList", 0) )
- Outputs 1 if the 1st element in command list "myList" is enabled, or 0 if it is not.
- IsIconVisible
- Description
- Checks whether the icon for an item in a command list is visible or not.
- Syntax
- cl.IsIconVisible(clname, clindex)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the target element in clname
- Return Value
- Examples
- Win.Debug( cl.IsIconVisible("myList", 1) )
- Outputs 1 if the icon for the 2nd element in command list "myList" is visible, or 0 if it is not.
- IsVisible
- Description
- Checks whether an item in a command list is visible or not.
- Syntax
- cl.IsVisible(clname, clindex)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the target element in clname
- Return Value
- Examples
- Win.Debug( cl.IsVisible("myList", 2) )
- Outputs 1 if the 3rd element in command list "myList" is visible, or 0 if it is not.
Setting Item Attributes- AddLeft
- Description
- Adds the specified command to the Left Commands already present for an item in a command list.
- Syntax
- cl.AddLeft(clname, clindex, cmd, params, work, how)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the item in clname
- must be less than the command list length
- cmd
- (string) command to add
- Optional, but must be specified if any of parameters, work or how are specified.
- params
- (string) parameters for the command cmd
- Optional.
- work
- (string) work directory
- Optional.
- how
- (string) what state to start a program in
- Optional, default is "normal".
- Possible Values
- "min"
- "max"
- "normal"
- "traymin"
- "hidden"
- Return Value
- (string) either:
- 1
- Left Command added successfully
- null string
- there is no room for the command so it could not be added
- Examples
- cl.AddLeft("mylist", 1, "Menu", "Show mymenu", "centerscreen")
- adds "Menu Show mymenu" with Work Folder used for the option "centerscreen".
- AddMiddle
- Description
- Adds the specified command to the Middle Commands already present for an item in a command list.
- Syntax
- cl.AddMiddle(clname, clindex, cmd, params, work, how)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the item in clname
- must be less than the command list length
- cmd
- (string) command to add
- Optional, but must be specified if any of parameters, work or how are specified.
- params
- (string) parameters for the command cmd
- Optional.
- work
- (string) work directory
- Optional.
- how
- (string) what state to start a program in
- Optional, default is "normal".
- Possible Values
- "min"
- "max"
- "normal"
- "traymin"
- "hidden"
- Return Value
- (string) either:
- 1
- Middle Command added successfully
- null string
- there is no room for the command so it could not be added
- Examples
- cl.AddMiddle("myList", 1, "Menu", "Show mymenu", "centerscreen")
- Adds "Menu Show mymenu" to the Middle Command for the 2nd element in "myList" with Work used for the option "centerscreen".
- AddRight
- Description
- Adds the specified command to the Right Commands already present for an item in a command list.
- Syntax
- cl.AddRight(clname, clindex, cmd, params, work, how)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the item in clname
- must be less than the command list length
- cmd
- (string) command to add
- Optional, but must be specified if any of parameters, work or how are specified.
- params
- (string) parameters for the command cmd
- Optional.
- work
- (string) work directory
- Optional.
- how
- (string) what state to start a program in
- Optional, default is "normal".
- Possible Values
- "min"
- "max"
- "normal"
- "traymin"
- "hidden"
- Return Value
- (string) either:
- 1
- Right Command added successfully
- null string
- there is no room for the command so it could not be added
- Examples
- cl.AddRight("mylist", 1, "Menu", "Show mymenu", "centerscreen")
- adds "Menu Show mymenu" with Work Folder used for the option "centerscreen".
- ClearLeft
- Description
- Clears Left Command information for an item in a command list.
- Syntax
- cl.ClearLeft(clname, clindex)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the item in clname
- Examples
- cl.ClearLeft("myList", 1)
- Clears the Left Command information for the 2nd element in command list "myList".
- ClearMiddle
- Description
- Clears the Middle Command information for an item in a command list.
- Syntax
- cl.ClearMiddle(clname, clindex)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the item in clname
- Examples
- cl.ClearMiddle("myList", 1)
- Clears the Middle Command information for the 2nd element in command list "myList".
- ClearRight
- Description
- Clears Right Command information for an item in a command list.
- Syntax
- cl.ClearRight(clname, clindex)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the item in clname
- Examples
- cl.ClearRight("myList", 1)
- Clears the Right Command information for the 2nd element in command list "myList".
- SetBackColor
- Description
- Sets the background color of a button on a command list being shown as a bar.
- Syntax
- cl.SetBackColor(clname, clindex, colorParams)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the item in clname
- colorParams
- The value for the background color, which can take various forms.
- Possible Values
- r, g, b
- the red, green & blue components as 3 comma-separated parameters
- each individual value is between 0 and 255
- "r g b"
- the red, green & blue components in 1 space-separated parameter string
- each individual value is between 0 and 255
- i
- a single integer representing the red, green & blue components with red in the lowest 8 bits (as returned by win.getpixel and inputcolor), for example:
16777215 is white
0 is black
- "current"
- use the currently set color (presumably instead of the bar color)
- "" (empty string)
- use the bar's background color
- Examples
- cl.SetBackColor("myList", 3, 255, 255, 255)
- cl.SetBackColor("myList", 3, "255 255 255")
- cl.SetBackColor("myList", 3, 16777215)
- cl.SetBackColor("myList", 3, "current")
- cl.SetBackColor("myList", 3, "")
- Notes
- cl.SetBackColor() doesn't work on menu items, only buttons on bars.
- SetEnabled
- Description
- Toggles the enabled setting for an item in a command list.
- Syntax
- cl.SetEnabled(clname, clindex, enable)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the item to set
- vis
- (boolean) either
- 1
- enables item
- Value can be anything that equates to True:
- any string except ""
- any number except 0
- 0
- disables item
- Value can be anything that equates to False, such as "" (an empty string).
- Optional, default is 0.
- Examples
- cl.SetEnabled("myList", 2, 1)
- Enables the 3rd item in "myList".
- cl.SetEnabled("myList", 2, 0)
- Disables the 3rd item in "myList".
- SetHeight
- Description
- Sets the height of an item in a command list.
- Syntax
- cl.SetHeight(clname, clindex, newheight)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the item to set
- newwidth
- (integer) new width for the item, in pixels
- Optional, default is 0 (use default height).
- Possible Values
- n
- sets item height to n
- n = any positive number
- 0 or "" (an empty string)
- removes any height setting
- item takes default item height for command list
- -n
- sets item height to the default + n
- n = any negative number
- Examples
- cl.SetHeight("myList", 2, 0)
- Sets the height of the 3rd item of "myList" to the default height.
- cl.SetHeight("myList", 2, 30)
- Sets the height of the 3rd item of "myList" to 30px.
- cl.SetHeight("myList", 2, -30)
- Sets the height of the 3rd item of "myList" to the default height plus 30px.
- e.g. if default height is 18px, sets item height to 48px.
SetHover- Description
- If newhover is 0, sets to no hover click, if 2, sets to middle, if 3 sets to right, else sets to left.
- Sets the hover click value for an item in a command list.
- Syntax
- cl.SetHover(clname, clindex, newhover)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the item to set
- hover
- (integer) new hover click setting
- Possible Values
- 0
- 1
- 2
- hover clicks middle button
- 3
- hover clicks right button
- Examples
Notes- If "hover click" is set, hovering the mouse over a button will automatically click the button, as per the hover parameter above.
- Turn on hover click (left) for all buttons using the formatting keyword "HoverClick" with cl.SetProperties() or cl.AddProperties(), as per:
cl.AddProperties("myList", "Format = HoverClick")
can't get this to work..?
- SetIcon
- Description
- Sets the icon for an item in a command list.
- Syntax
- cl.SetIcon(clname, clindex, path, number)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the item to set
- path
- (string) path to the icon file
- number
- (integer) zero-based number indicating index of icon image in icon file specified in path
- Examples
- cl.SetIcon("myList", 1, "c:/pix/icons/dice.ico", 1)
- Sets the icon for the 2nd element of command list "myList" to the second icon in icon file "dice.ico".
- SetIconVisible
- Description
- Toggles the icon visibility setting of an item in a command list.
- Syntax
- cl.SetIconVisible(clname, clindex, ico)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the target item
- ico
- (boolean) either
- 1
- makes icon visible
- Value can be anything that equates to True:
- any string except ""
- any number except 0
- 0
- makes icon invisible
- Value can be anything that equates to False, such as "" (an empty string).
- Optional, default is 0.
- Examples
- cl.SetIconVisible("myList", 2, 1)
- Makes the icon of the 3rd element of "myList" visible.
- cl.SetIconVisible("myList", 2, 0)
- Makes the icon of the 3rd element of "myList" invisible.
- SetId
- Description
- Sets the id for the specified item.
- Syntax
- cl.SetId(clname, clindex, newid)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the item to set
- newid
- (string) new id for the item clindex
- Examples
- cl.SetId("myList", 2, "drawing1")
- Sets the id of the 3rd item in command list "myList" to "drawing1".
- SetLabel
- Description
- Sets the label for the specified item.
- Syntax
- cl.SetLabel(clname, clindex, newlabel)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the target item
- newlabel
- (string) new label for the item at clindex
- Examples
- cl.SetLabel("myList", 0, "apple")
- Sets the label text of the 1st item in "myList" to "apple".
- cl.SetLabel("myList", 0, "*info dun")
- Notes
- Use this command to change *info labels, & change labels to and from being *info labels.
- SetLeftOnTop
- Description
- Configures the OnTop checkbox setting for the Left Command of an item in a command list.
- Syntax
- cl.SetLeftOnTop(clname, clindex, newval)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the item in clname
- newval
- (boolean)
- 1
- on top is set & the checkbox is ticked
- 0
- on top is removed & the checkbox is unticked
- Examples
- cl.SetLeftOnTop("myList", 1, 0)
- Turns off the "On Top" setting of the Left Command for the 2nd item in "myList".
- SetLeftSwitchTo
- Description
- Sets Switch To checkbox for the Left Command of an item in a command list.
- Syntax
- cl.SetLeftSwitchTo(clname, clindex, newval)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the item in clname
- newval
- (boolean)
- 1
- Switch To is set to True & the checkbox is ticked
- 0
- Switch To is set to False & the checkbox is unticked
- Examples
- cl.SetLeftSwitchTo("myList", 0, 1)
- Sets the SwitchTo value for the Left Command of the 1st element in command list "myList" to true (checkbox is ticked).
- SetMiddleOnTop
- Description
- Configures the OnTop checkbox setting for the Middle Command of an item in a command list.
- Syntax
- cl.SetMiddleOnTop(clname, clindex, newval)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the item in clname
- newval
- (boolean)
- 1
- OnTop is set to True & the checkbox is ticked
- 0
- OnTop is set to False & the checkbox is unticked
- Examples
- cl.SetMiddleOnTop("myList", 1, 0)
- Turns off the "On Top" setting of the Middle Command for the 2nd item in "myList".
- SetMiddleSwitchTo
- Description
- Sets the SwitchTo checkbox for the Middle Command of an item in a command list.
- Syntax
- cl.SetMiddleSwitchTo(clname, clindex, newval)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the item in clname
- newval
- (boolean)
- 1
- SwitchTo is set to True & the checkbox is ticked
- 0
- SwitchTo is set to False & the checkbox is unticked
- Examples
- cl.SetMiddleSwitchTo("myList", 0, 1)
- Sets the SwitchTo value for the Middle Command of the 1st element in command list "myList" to true (checkbox is ticked).
- SetRightOnTop
- Description
- Configures the OnTop checkbox setting for the Right Command of an item in a command list.
- Syntax
- cl.SetRightOnTop(clname, clindex, newval)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the item in clname
- newval
- (boolean)
- 1
- on top is set & the checkbox is ticked
- 0
- on top is removed & the checkbox is unticked
- Examples
- cl.SetRightOnTop("myList", 1, 0)
- Turns off the "On Top" setting of the Right Command for the 2nd item in "myList".
- SetRightSwitchTo
- Description
- Sets SwitchTo checkbox for the Right Command of an item in a command list.
- Syntax
- cl.SetRightSwitchTo(clname, clindex, newval)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the item in clname
- newval
- (boolean)
- 1
- SwitchTo is set to True & the checkbox is ticked
- 0
- SwitchTo is set to False & the checkbox is unticked
- Examples
- cl.SetRightSwitchTo("myList", 0, 1)
- Sets the SwitchTo value for the Right Command of the 1st element in command list "myList" to true (checkbox is ticked).
- SetTooltip
- Description
- Sets the tool tip for the specified item.
- Syntax
- cl.SetTooltip(clname, clindex, newtip)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the item to set
- newtip
- (string) new tool tip for the item clindex
- Examples
- cl.SetTooltip("myList", 0, "*info pmem")
- Sets the tooltip for the 1st item in "myList" to a dynamic tooltip showing the amount of free physical memory (Mb).
- Notes
- Use cl.SetTooltip() to set *info tooltips, as well as changing tooltips to and from being *info tips.
- SetTextColor
- Description
- Sets the text color of a button on a bar.
- Syntax
- cl.SetTextColor(clname, clindex, colorParams)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the item in clname
- colorParams
- The value for the text color, which can take various forms.
- Possible Values
- r, g, b
- the red, green & blue components as 3 comma-separated parameters, as per:
cl.SetTextColor(clname, clindex, r, g, b)
- each individual value is between 0 and 255, as per:
cl.SetTextColor(clname, clindex, "r g b")
- "r g b"
- the red, green & blue components in 1 space-separated parameter string
- each individual value is between 0 and 255
- i
- a single integer representing the red, green & blue components with red in the lowest 8 bits
- returned by:
- "current"
- use the currently set color (presumably instead of the bar color)
- "" (empty string)
- Examples
- cl.SetTextColor("myList", 0, 255, 255, 255)
- Sets the text color of the 1st element on bar "myList" to white.
- cl.SetTextColor("myList", 1, "255 255 255")
- Sets the text color of the 2nd element on bar "myList" to white.
- cl.SetTextColor("myList", 2, 16777215)
- Sets the text color of the 3rd element on bar "myList" to white.
- cl.SetTextColor("myList", 3, "current")
- Sets the text color of the 4th element on bar "myList" to the currently set text color (presumably instead of the bar's text color).
- cl.SetTextColor("myList", 4, "")
- Sets the text color of the 5th element on bar "myList" to the bar's text color.
- Notes
- cl.SetBackColor() doesn't work on menu items, only buttons on bars.
- SetVisible
- Description
- Toggles the visibility setting of an item in a command list.
- Syntax
- cl.SetVisible(clname, clindex, vis)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the item to set
- vis
- (boolean) either
- 1
- makes item visible
- Value can be anything that equates to True:
- any string except ""
- any number except 0
- 0
- makes item invisible
- Value can be anything that equates to False, such as "" (an empty string).
- Optional, default is 0.
- Examples
- cl.SetVisible("myList", 1, 1)
- Makes the 2nd element of "myList" visible.
- cl.SetVisible("myList", 1, 0)
- Makes the 2nd element of "myList" invisible.
- SetWidth
- Description
- Sets the width of an item in a command list.
- Syntax
- cl.SetWidth(clname, clindex, newwidth)
- Parameters
- clname
- (string) command list name
- clindex
- (integer) index of the item to set
- newwidth
- (integer) new width for the item, in pixels
- Optional, default is 0 (use default width).
- Possible Values
- n
- sets the width of the item to n
- n = any positive number
- 0 or "" (an empty string)
- removes any width setting
- item takes default item width for command list
- -n
- sets item width to the default + n
- n = any negative number
- Examples
- cl.SetWidth("myList", 2, 0)
- Sets the width of the 3rd item of "myList" to the default width.
- cl.SetWidth("myList", 2, 30)
- Sets the width of the 3rd item of "myList" to 30px.
- cl.SetWidth("myList", 2, -30)
- Sets the width of the 3rd item of "myList" to the default width plus 30px.
- e.g. if default width is 18px, sets item width to 48px.
- Running Item Commands
RunLeft- Description
- Runs the left command of an item in specified command list.
- Syntax
- cl.RunLeft(clname, clindex)
- Parameters
- clname
- (string) command list name
- clindex
- Examples
- cl.RunLeft("myList", 2)
- Runs the left command of the 3rd item of the command list "myList".
- cl.RunLeft("myList", "item2")
- Runs the left command of the item with id "item2" in command list "myList".
RunMiddle- Description
- Runs the middle command of an item in specified command list.
- Syntax
- cl.RunMiddle(clname, clindex)
- Parameters
- clname
- (string) command list name
- clindex
- Examples
- cl.RunMiddle("myList", 2)
- Runs the middle command of the 3rd item of the command list "myList".
- cl.RunMiddle("myList", "item2")
- Runs the middle command of the item with id "item2" in command list "myList".
RunRight- Description
- Runs the right command of an item in specified command list.
- Syntax
- cl.RunRight(clname, clindex)
- Parameters
- clname
- (string) command list name
- clindex
- Examples
- cl.RunRight("myList", 2)
- Runs the right command of the 3rd item of the command list "myList".
- cl.RunRight("myList", "item2")
- Runs the right command of the item with id "item2" in command list "myList".