Difference between revisions of "PropertyListBox"

From Jeremie Leroy - XOJO Controls Wiki
Jump to: navigation, search
m (1 revision)
(No difference)

Revision as of 12:13, 24 November 2012

This control is a subclass of the Listbox that was designed to act like REALbasic’s Property Listbox visible in the IDE when editing window contents, or the project tab.

The control is XML-driven, which means that the best way to display something in it, is to load an XML definition file specially made for it.

The creation of the XML file can be done with the "PropertyListbox Creator". This helps to show all available options for each type of cell, and also helps users who aren’t used to writing XML files.

To use this control, just drag it in a window, and in the open event, load an XML file, using the method: "me. LoadFromXML(XMLString As String)".

Events
ButtonPressed ContentsChanged
CellAction DoubleClick
CellClick LoadingValueList
CellColorClick ShouldTriggerAutocomplete
CellCustomEdit
CellValueChanged


Properties
AutoCompleteMode CustomGridLinesVertical RBColorDisplay
BBCode DefaultType RowHeight
ButtonColor defaultvalueStyle Star
ButtonEdit headerStyle SyntaxComment
ButtonPopupArrow LastEditCell TransparentString
ButtonPopupArrowUp LastError ValueString
ColonString LastValue valueStyle
ColorGutter LineCount
CustomButtons MacOSStyle
CustomGridLinesColor nameStyle
CustomGridLinesHorizontal PropertyString


Methods
CellValue NewRow
CellValue Reload
GetLine toXML
GetLine ValuesForHeader
LoadFromXML
NewRow


Shared Methods
Register


Notes

XML definition

You can use this example as XML definition to load in the PropertyListBox.

<?xml version="1.0" encoding="UTF-8"?>
<PropertyListBox version="1.1">
<name>PropertyListbox Example</name>
<button id="0" text="Help"/>
<contents>
<header visible="True" expanded="True">
<name>Cell Types</name>
<param type="1" visible="True">
<name>Normal</name>
<value>Normal Text</value>
</param>
<param type="2" visible="True">
<name>CheckBox</name>
<value>False</value>
</param>
<param type="3" visible="True">
<name>Editable</name>
<value>Click to edit</value>
</param>
<param type="4" visible="True">
<name>Multiline Text</name>
<value>Click to edit
</value>
</param>
<param type="5" visible="True" required="True">
<name>List</name>
<valuelist>Red|Green|Blue</valuelist>
</param>
<param type="6" visible="True">
<name>Editable List</name>
<valuelist>Red|Green|Blue</valuelist>
</param>
<param type="6" visible="True" autocomplete="True">
<name>Autocomplete List</name>
<valuelist>font_list</valuelist>
</param>
<param type="7" visible="True">
<name>Color</name>
<value>&amp;cDBDFFF</value>
</param>
<param type="8" visible="True">
<name>FolderItem (File)</name>
</param>
<param type="8" visible="True" folder="True">
<name>FolderItem (Folder)</name>
</param>
<param type="9" visible="True">
<name>RadioButton 1</name>
<value>True</value>
<helptag>Only one RadioButton per header can be checked at at time.
RadioButton appear as checkboxes.
However, RadioButtons and Checkboxes are independant</helptag>
</param>
<param type="9" visible="True">
<name>RadioButton 2</name>
<value>False</value>
<helptag>Only one RadioButton per header can be checked at at time.
RadioButton appear as checkboxes.
However, RadioButtons and Checkboxes are independant</helptag>
</param>
<param type="9" visible="True">
<name>RadioButton 3</name>
<value>False</value>
<helptag>Only one RadioButton per header can be checked at at time.
RadioButton appear as checkboxes.
However, RadioButtons and Checkboxes are independant</helptag>
</param>
<param type="10" visible="True">
<name>Rating</name>
<value>3</value>
</param>
</header>
<header visible="True" expanded="True" button="0">
<name>Header with Button</name>
<param type="2" visible="True">
<name>Show Invisible Lines</name>
<value>False</value>
</param>
<param type="1" visible="False">
<name>Invisible Line 1</name>
</param>
<param type="1" visible="False">
<name>Invisible Line 2</name>
</param>
<param type="2" visible="False">
<name>Show Invisible Header</name>
<value>False</value>
</param>
</header>
<header visible="False" expanded="True">
<name>Invisible Header</name>
<param type="1" visible="True">
<name>No value</name>
</param>
</header>
</contents>
<style>
<header UpdateStyle="False">
<backColor>#DBDFFF</backColor>
<bold>True</bold>
<highlightcolor>#3399FF</highlightcolor>
<italic>False</italic>
<textalign>0</textalign>
<textcolor>#000000</textcolor>
<textfont>System</textfont>
<texthighlightcolor>#FFFFFF</texthighlightcolor>
<textsize>0</textsize>
<underline>False</underline>
</header>
<name UpdateStyle="False">
<backColor>#FFFFFF</backColor>
<bold>False</bold>
<highlightcolor>#3399FF</highlightcolor>
<italic>False</italic>
<textalign>2</textalign>
<textcolor>#000000</textcolor>
<textfont>System</textfont>
<texthighlightcolor>#FFFFFF</texthighlightcolor>
<textsize>0</textsize>
<underline>False</underline>
</name>
<value UpdateStyle="False">
<backColor>#FFFFFF</backColor>
<bold>False</bold>
<highlightcolor>#3399FF</highlightcolor>
<italic>False</italic>
<textalign>0</textalign>
<textcolor>#000000</textcolor>
<textfont>System</textfont>
<texthighlightcolor>#FFFFFF</texthighlightcolor>
<textsize>0</textsize>
<underline>False</underline>
</value>
<ColonString>:</ColonString>
<PropertyString>Property</PropertyString>
<ValueString>Value</ValueString>
<TransparentString>transparent</TransparentString>
<Border>True</Border>
<ColumnWidths>50% 50%, 1*</ColumnWidths>
<GridLinesHorizontal>0</GridLinesHorizontal>
<GridLinesVertical>0</GridLinesVertical>
<HasHeading>True</HasHeading>
<ScrollBarHorizontal>False</ScrollBarHorizontal>
<ScrollBarVertical>True</ScrollBarVertical>
<DefaultRowHeight>-1</DefaultRowHeight>
<AutoHideScrollbars>True</AutoHideScrollbars>
<Hierarchical>True</Hierarchical>
</style>
</PropertyListBox>


History

Version 1.5.0 - Released November 24, 2012

  • New:
    • TypeNumericUpDown constant
    Display a numeric value with up/down arrows
  • Fix:
    • PopupArrow missing the tip pixel in newer versions of RealStudio
    • NilObjectException if the focus is lost when opening the window containing the PropertyListBox
    • Caption in buttons for Windows HiDPI screens

Version 1.4.0 - Released December 27, 2011

  • New Properties :
    • ColorGutter for coloring the gutter (left part of the listbox) with the Headerbackground color
    • CustomGridLinesVertical
    • CustomGridLinesHorizontal
    • CustomGridLinesColor

Custom Grid Lines in order to change the color of the grid lines. Only ThinSolid style is supported for the moment


Version 1.3 - Released December 27, 2011

  • Fix:
    • UnsupportedFormatException in RealStudio 2011r3 and 2011r4


Version 1.2.1

  • Fix:
    • OutOfBoundsException in PropertyListbox.CellValue


Version 1.2 - Released

  • New property for Lines:
    • Comment
    Store any information you want in the Comment
  • New Line type:
    • TypePicture
    Selects a FolderItem and opens it as a picture.
  • New Event:
    • CellColorClick
    Fires when the select color button in TypeColor cells is clicked. Return True if you handle the color selection (by displaying your own colorwheel for example)


Version 1.1 - Released February 03, 2009

  • New property for Editable lines: Numeric As Boolean and ColorNegative As Boolean
    If Numeric is True, when the Editable cell looses the focus, the Value is evaluated as a maths function
    If ColorNegative is True and the value is smaller than 0, the text will be red
  • New property for all lines (including Header): Caption As String
    Enables to have a global name for a line and a different caption than the name. This is very useful for multi-language apps
    When loading an XML definition, if the caption isn't defined, the name value is copied in the caption value.
  • New button for TypeColor cells
  • List can now be hierarchical
  • New Event: CellClick
    Fires when a cell is clicked before doing anything else (editing cell, pressing button, opening window, ...)
  • New property for FolderItem lines: Folder As Boolean
    If Folder is true, then the cell will fire SelectFolder instead of GetOpenFolderItem
  • New Function in PropertyListLine: ParentName() As String
    Returns the Name of the Line's Parent if it has a Parent (Header)


  • Fix:
    • Cellvalue now returns a color if the cell of TypeColor (It used to return the string value of the color)
    • LimitText in RB 2009r5 doesn't bring up an error anymore
    • FolderItem type opens the Dialog window in the current FolderItem path
    • Autocomplete window now displays on the correct screen if using multiple screens.

Version 1.0 - First Public Release

Note

If you get an Unhandled exception or no data when loading an XML definition, add this line of code: Return Array("")

In the Event LoadingValueList

See Also

BBCodeStorage, PropertyListButton, PropertyListLine, PropertyListStyle classes. PropertyListModule module. Listbox control.