InsertCheckBox
PowerScript function
Description
Inserts a check box in the panel or group of the RibbonBar
control.
Applies to
Syntax
|
1 |
controlname.InsertCheckBox ( Long ParentHandle, Long ItemHandleAfter, String Text, String Clicked ) |
|
1 |
controlname.InsertCheckBox ( Long ParentHandle, Long ItemHandleAfter, RibbonCheckBoxItem Item ) |
|
Argument |
Description |
|---|---|
|
controlname |
The name of the RibbonBar control. |
|
ParentHandle |
The handle of the panel or group in which you want to |
|
ItemHandleAfter |
The handle of the item (check box, combo box, large |
|
Text |
The text that displays in the check box. |
|
Clicked |
The name of the Clicked user event to be bound with the |
|
Item |
A check box item to be inserted. |
Return value
Long.
Returns the handle of the inserted item if it succeeds and -1 if an
error occurs. If any argument’s value is null, returns null.
Usage
The user events to be bound with the check box must be defined
correctly according to the requirements of RibbonCheckBoxItem. For
details, see Clicked in PowerScript Reference and Selected in PowerScript Reference.
Example 1
This example inserts the “Print Using PDFlib” check box after the
“Distill Custom PostScript” check box and binds both check boxes with the
“Ue_CheckBoxClicked” user event.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
Long ll_Handle_Category, ll_Handle_Panel, ll_Handle_CheckBox, ll_Handle_CheckBox2 ll_Handle_Category = rbb_1.InsertCategoryFirst ("MyCategory") ll_Handle_Panel = rbb_1.InsertPanelFirst (ll_Handle_Category, "MyPanel", "AddSmall!") ll_Handle_CheckBox = rbb_1.InsertCheckBoxFirst (ll_Handle_Panel, "Distill Custom PostScript", "Ue_CheckBoxClicked") ll_Handle_CheckBox2 = rbb_1.InsertCheckBox (ll_Handle_Panel, ll_Handle_CheckBox, "Print Using PDFlib", "Ue_CheckBoxClicked") //Ue_CheckBoxClicked user event must have a long parameter for receiving the handle //of CheckBox where the mouse is clicking. //event type long ue_checkboxclicked(long itemhandle); //RibbonCheckBoxItem lr_CheckBox //rbb_1.GetCheckBox(ItemHandle,lr_CheckBox) ////... // //Return 1 //end event |
Example 2
This example inserts the “Print Using PDFlib” check box after the
“Distill Custom PostScript” check box and binds it with the
“Ue_CheckBoxClicked” and “Ue_CheckBoxSelected” user events. It first
defines a check box item with various properties (including Text, Clicked,
Selected etc.) and then inserts it after the “Distill Custom PostScript”
check box.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
Long ll_Handle_Category,ll_Handle_Panel,ll_Handle_CheckBox,ll_Handle_CheckBox2 RibbonCheckBoxItem lr_CheckBox ll_Handle_Category = rbb_1.InsertCategoryFirst ("MyCategory") ll_Handle_Panel = rbb_1.InsertPanelFirst (ll_Handle_Category, "MyPanel", "AddSmall!") ll_Handle_CheckBox = rbb_1.InsertCheckBoxFirst (ll_Handle_Panel, "Distill Custom PostScript", "Ue_CheckBoxClicked") lr_CheckBox.Text = "Print Using PDFlib" lr_CheckBox.Clicked = "Ue_CheckBoxClicked" lr_CheckBox.Selected = "Ue_CheckBoxSelected" ll_Handle_CheckBox2 = rbb_1.InsertCheckBox (ll_Handle_Panel, ll_Handle_CheckBox, lr_CheckBox) //Ue_CheckBoxSelected user event must have a long parameter for receiving the handle //of CheckBox where the mouse is hovering over. //event type long ue_checkboxselected(long itemhandle); //RibbonCheckBoxItem lr_CheckBox //rbb_1.GetCheckBox(ItemHandle,lr_CheckBox) ////... // //Return 1 //end event |
See also