Creating a Custom Tab Button

<< Click to Display Table of Contents >>

 

Creating a Custom Tab Button

To create a custom tab button, follow these steps:

1.Create an XControl on a user library.

2.Based on the hpLinkIcon object from the hpMenus library, copy and paste only the primitives to this new XControl. Exclude properties and scripts from the original object.

3.The Object group can be ungrouped, resulting in only two objects on this XControl's root, MouseArea and Background.

4.Insert an icon on the XControl's root, which can be any icon from the hpIcons library or similar.

5.Simplify the Link in the Foreground property of the Background object with the next expression.

-1*CInt(Parent.MouseArea.MouseOver)

 

NOTE

The Links registered on the multiple connections window of this Link must remain unchanged. Only the Source field of the original Link must be changed.

 

6.In the MouseArea object, keep only the Link in the FillStyle property.

7.Configure this XControl's script, such as on the Click event of the MouseArea object, with the next code.

Sub MouseArea_Click()
  MsgBox "Hello!"
End Sub

 

8.Select the MouseArea object and click Bring to Front.

9.Save the XControl.

 

Whenever this custom button is declared in the PopupCode property of the hpXFaceplateTemplate object, it must follow the format Library.XControl, where Library is the name of the library file that contains the XControl and XControl is the name of the object.

Was this page useful?