OWLNext 7.0
Borland's Object Windows Library for the modern age
|
You can identify a gadget by using the GetId function to access its identifier.
GetId takes no parameters and returns an int, the gadget identifier. The identifier comes from the value passed in as the first parameter of the TGadget constructor.
There are a number of uses for the gadget identifier:
These last two techniques are often combined. Suppose you have a command identifier CM_FILEOPEN for the File|Open menu command and a string with the resource identifier CM_FILEOPEN. If you also give the gadget the identifier CM_FILEOPEN, when you press the gadget, the gadget window posts the CM_FILEOPEN event, and the string with the resource identifier CM_FILEOPEN is displayed in the message or status bar.
You can see an illustration of this technique in Step 10 of the Learning ObjectWindows Tutorial manual.