guides:programming:programmers_reference_manual:add_method_propertygrid

ADD method (PropertyGrid)

Adds a new property item to the Property Grid.

AddedOK = Exec_Method( CtrlEntID,    

                          "ADD",        

                          Category,     

                          Name,         

                          Type,         

                          Value,        

                          Options,      

                          Description,  

                          Disabled,     

                          Itemstyle,    

                          Iconv,        

                          ErrorText,    

                          DefaultValue, 

                          OptionValues )

(These parameters are more fully described in "Property Items" section above)

NameRequiredDescription
Category Yes Category that the item belongs to. Items are grouped by this.
Name Yes Name of the property item. This name must be unique across all items in the control.
Type Yes Type of property item: PGIT_STATIC$, PGIT_EDIT$ etc.
Value No Value of the property item.
Options No Options for the item.
Description No Description of the item.
Disabled No If TRUE$ then the property cannot be disabled.
ItemStyle No Style bits to control inline editing and color processing mode etc.
Iconv No Validation string for the property.
ErrorText No Error text to display when validation is displayed.
DefaultValueNo Value to use if the control contains no data.
OptionValuesNo Internal values for use with a dropdown-list property item.
DisplayName No Text to use when displaying the property item name.

TRUE$ if the property was added successfully, FALSE$ otherwise.

None.

 
$Insert PS_Property_Grid_Equates

   $Insert Logical

   

   CtrlEntID = @Window : ".PRG_MAIN"

   

   // Set the full list of items...

   //

   // Data

   //    Title    - Yadda

   //    SubTitle - Whatever

   // UI

   //    Visible - TRUE$

   //    Color   - 0xFF (red)

   

   Pgl     = "Data" : @Vm : "Title"    : @Vm : PS_PGI_EDIT$     : @Vm : "Yadda"

   Pgl<-1> = "Data" : @Vm : "SubTitle" : @Vm : PS_PGI_EDIT$     : @Vm : "Whatever"

   Pgl<-1> = "UI"   : @Vm : "Visible"  : @Vm : PS_PGI_CHECK$    : @Vm : TRUE$

   Pgl<-1> = "UI"   : @Vm : "Color"    : @Vm : PS_PGI_COLORDLG$ : @Vm : 0xFF

   

   Call Set_Property_Only( CtrlEntID, "LISTX", Pgl )

   

   // Add a new read-only text property to the Data Category

   Call Exec_Method( CtrlEntID, "ADD", "Data", "Notes", PGIT_STATIC$, "SomeText" )

   

   // The full list of items now looks like:

   //

   // Data

   //    Title    - Yadda

   //    SubTitle - Whatever

   //    Notes    - SomeText

   // UI

   //    Visible - TRUE$

   //    Color   - 0xFF (red)
 
 
 

N/A

  • guides/programming/programmers_reference_manual/add_method_propertygrid.txt
  • Last modified: 2023/10/25 10:49
  • by 127.0.0.1