Navigation Component
Fnd_Nav_AddButtonMethod
Fnd_Nav_AddButtonMethod (method; label{; foreground color; background color}})
Parameters
| Parameter | Type | Description |
|---|---|---|
| method | Text | Method name to execute |
| label | Text | Button label |
| foreground color | Longint | Text color (optional) |
| background color | Longint | Background color (optional) |
Description
This routine adds a new button to the palette and assigns the method as its action. When the button is clicked, the first parameter, method, will be executed.
Fnd_Nav_AddButtonMethod ("MyCoolMethod"; "Run Cool Method")
You can include parameters or any other executable code as the first parameter. For example, the following example will pass a text and a numeric parameter to MyCoolMethod:
Fnd_Nav_AddButtonMethod ("MyCoolMethod("\one\";2)"; "Run Cool Method")
If a button with an identical label already exists, it is updated with the new method name. Buttons are always added to the palette after existing palette buttons. To add a button in any other position, just use the Fnd_Nav_Delete to delete all of the existing palette buttons, then recreate the palette using Fnd_Nav_AddButtonMethod and Fnd_Nav_AddButtonTable. Fnd_Nav_Delete ` Remove all of the buttons.
Fnd_Nav_AddButtonMethod ("MyCoolMethod";"Run Cool Method")
Fnd_Nav_AddButtonTable (->[Invoices])
Fnd_Nav_AddButtonTable (->[People];"Customers")
You can optionally specify the text color and background color to use for the new button. See 4D’s SET RGB COLORS command documentation for more information about specifying colors. Pass the 4D constant Default foreground color and Default background color to restore the palette’s default colors.
` Add a button with a light green background color.
Fnd_Nav_AddButtonMethod ("MyMethod";"Run My Method";Default foreground
color ;0xE2FFDF)
Extracted source text
Fnd_Nav_AddButtonMethod (method; label{; foreground color; background color}})
Parameter Type Description
method Text Method name to execute
label Text Button label
foreground color Longint Text color (optional)
background color Longint Background color (optional)
This routine adds a new button to the palette and assigns the method as its action. When the button is
clicked, the first parameter, method, will be executed.
Fnd_Nav_AddButtonMethod ("MyCoolMethod"; "Run Cool Method")
You can include parameters or any other executable code as the first parameter. For example, the
following example will pass a text and a numeric parameter to MyCoolMethod:
Fnd_Nav_AddButtonMethod ("MyCoolMethod("\one\";2)"; "Run Cool Method")
If a button with an identical label already exists, it is updated with the new method name.
Buttons are always added to the palette after existing palette buttons. To add a button in any other
position, just use the Fnd_Nav_Delete to delete all of the existing palette buttons, then recreate the
palette using Fnd_Nav_AddButtonMethod and Fnd_Nav_AddButtonTable.
Fnd_Nav_Delete ` Remove all of the buttons.
Fnd_Nav_AddButtonMethod ("MyCoolMethod";"Run Cool Method")
Fnd_Nav_AddButtonTable (->[Invoices])
Fnd_Nav_AddButtonTable (->[People];"Customers")
You can optionally specify the text color and background color to use for the new button. See 4D’s
SET RGB COLORS command documentation for more information about specifying colors. Pass the
4D constant Default foreground color and Default background color to restore the palette’s default
colors.
` Add a button with a light green background color.
Fnd_Nav_AddButtonMethod ("MyMethod";"Run My Method";Default foreground
color ;0xE2FFDF)