USER COMPONENTS INTERFACE
Standard Interface To Allow HMG Users Create Its Own Components
- InstallEventHandler ( <cEventHandlerFunctionName> )
Every time that an event is triggered by the system the specified
function will be called.
This function will receive the following parameters:
hWnd, nMsg, wParam, lParam
If your function process the message, it must return a not NIL
value. If not, it must return NIL.
- InstallMethodHandler(<cMethodName>,<cMethodHandlerProcName>)
Every time that specified method is called, your procedure will
be executed.
If your procedure process the method, you must set the 'user
process flag' ( _HMG_SYSDATA [63] ) to .T. If not, you must
set it to .F.
- InstallPropertyHandler(<cPropName>,<cSetFucName>,<cGetFuncName>)
When the specified property is set, <cSetFucName> is called
with all the original parameters
When the specified property is value retrieved <cGetFucName> is
called with all the original parameters.
In both cases if your functions process the property, you must
set the 'user process flag' ( _HMG_SYSDATA [63] ) to .T.
If not, you must set it to .F.
Other Considerations:
If you've created components that requires #command directives
(ie. a control) you must add these definitions to i_UsrInit.ch
file located at HMG's INCLUDE folder.
The definitions must include start and end markers that will be
used to allow the creation of automated installation and
maintenance procedures for components.
The format for start marker is:
#define BASEDEF_<YourComponentTypeName>
The format for end marker is:
#undef BASEDEF_<YourComponentTypeName>
If you've created methods or properties with new names (not
currently specified in i_windows.ch, DECLARE WINDOW command
definition) you must add translation directives for them in
'i_UsrSOOP.ch' file, located at HMG's INCLUDE folder.
The definitions must include start and end markers too and the
translation directives must follow special rules.
The format for start marker is:
#define SOOP_<YourComponentTypeName> ;;
The format for translation directives for methods is:
#xtranslate <Window> . \<Control\> . MethodName => Domethod ( <"Window">, \<"Control"\> , "MethodName" ) ;;
The format for translation directives for properties is:
#xtranslate <Window> . \<Control\> . PropName => GetProperty ( <"Window">, \<"Control"\> , "PropName" ) ;;
#xtranslate <Window> . \<Control\> . PropName := \<v\> => SetProperty ( <"Window">, \<"Control"\> , "PropName" , \<v\> ) ;;
The format for end marker is:
#undef SOOP_<YourComponentTypeName> ;;
- Sample:
c:\hmg\samples\user_components