InsertLargeButton
PowerScript function
Description
Inserts a large button in the panel of the RibbonBar control.
Applies to
Syntax
|
1 |
controlname.InsertLargeButton ( Long PanelHandle, Long ItemHandleAfter, String Text, String PictureName, String Clicked ) |
|
1 |
controlname.InsertLargeButton ( Long PanelHandle, Long ItemHandleAfter, RibbonLargeButtonItem Item ) |
|
Argument |
Description |
|---|---|
|
controlname |
The name of the RibbonBar control. |
|
PanelHandle |
The handle of the panel into which you want to insert a |
|
ItemHandleAfter |
The handle of the item (check box, combo box, large |
|
Text |
The text that displays in the large button. |
|
PictureName |
The name of the file that contains the picture. It will be |
|
Clicked |
The name of the Clicked user event to be bound with the |
|
Item |
A large button 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 large button must be defined
correctly according to the requirements of RibbonLargeButtonItem. For
details, see Clicked in PowerScript Reference and Selected in PowerScript Reference.
Example 1
This example inserts a “Delete” large button after the “Add” large
button in the “MyPanel” panel. Both buttons are bound with the
“Ue_LargeButtonClicked” user event.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
Long ll_Handle_Category, ll_Handle_Panel, ll_Handle_LargeButton, ll_Handle_LargeButton2 ll_Handle_Category = rbb_1.InsertCategoryFirst ("MyCategory") ll_Handle_Panel = rbb_1.InsertPanelFirst (ll_Handle_Category, "MyPanel", "AddSmall!") ll_Handle_LargeButton = rbb_1.InsertLargeButtonFirst (ll_Handle_Panel, "Add", "AddBig!", "Ue_LargeButtonClicked") ll_Handle_LargeButton2 = rbb_1.InsertLargeButton (ll_Handle_Panel, ll_Handle_LargeButton, "Delete", "DeleteBig!", "Ue_LargeButtonClicked") //Ue_LargeButtonClicked user event must have a long parameter for receiving the handle //of LargeButton where the mouse is clicking. //event type long ue_largebuttonclicked(long itemhandle); //RibbonLargeButtonItem lr_LargeButton //rbb_1.GetLargeButton(ItemHandle,lr_LargeButton) ////... //Return 1 //end event |
Example 2
This example inserts a “Delete” large button after the “Add” large
button in the “MyPanel” panel. It first defines a large button item with
various properties (including Text, PictureName, Clicked, SSelected etc.)
and then inserts it after the “Add’ large button. The “Add” button is
bound with the “Ue_LargeButtonClicked” user event, and the “Delete” button
is bound with the “Ue_LargeButtonClicked” and “Ue_LargeButtonSelected”
user events.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
Long ll_Handle_Category, ll_Handle_Panel, ll_Handle_LargeButton, ll_Handle_LargeButton2 RibbonLargeButtonItem lr_LargeButton ll_Handle_Category = rbb_1.InsertCategoryFirst ("MyCategory") ll_Handle_Panel = rbb_1.InsertPanelFirst (ll_Handle_Category, "MyPanel", "AddSmall!") ll_Handle_LargeButton = rbb_1.InsertLargeButtonFirst (ll_Handle_Panel, "Add", "AddBig!", "Ue_LargeButtonClicked") lr_LargeButton.Text = "Delete" lr_LargeButton.PictureName = "DeleteBig!" lr_LargeButton.Clicked = "Ue_LargeButtonClicked" lr_LargeButton.Selected = "Ue_LargeButtonSelected" ll_Handle_LargeButton2 = rbb_1.InsertLargeButton (ll_Handle_Panel, ll_Handle_LargeButton, lr_LargeButton) //Ue_LargeButtonSelected user event must have a long parameter for receiving the handle //of LargeButton where the mouse is hovering over. //event type long ue_largebuttonselected(long itemhandle); //RibbonLargeButtonItem lr_LargeButton //rbb_1.GetLargeButton(ItemHandle,lr_LargeButton) ////... // //Return 1 //end event |
See also