PBX_GetDescription
Description
Passes a description of all the classes and methods in the
PowerBuilder extension module to PowerBuilder.
Syntax
|
1 |
PBX_GetDescription ( ) |
Return value
LPCTSTR containing the description of the module.
Examples
The following extension module contains three classes:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
PBXEXPORT LPCTSTR PBXCALL PBX_GetDescription() { static const TCHAR desc[] = { "class class_a from nonvisualobject " "function long meth1(string classpath) " "function string meth2() " "end class " "class class_b from nonvisualobject " "subroutine sbrt1() " "subroutine sbrt2() " "function long func1() " "end class " "class class_c from nonvisualobject " "end class " }; return desc; } |
The following module contains a visual class that has two
subroutines (functions that do not return values), two events that
require that Windows messages be captured in the extension (onclick and
ondoubleclick), and one event that maps a Windows message directly to a
PowerBuilder event (testmouse). The module also contains two global
functions, funca and funcb.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
PBXEXPORT LPCTSTR PBXCALL PBX_GetDescription() { static const TCHAR desc[] = { "class visualext from userobject " "event int onclick() " "event int ondoubleclick() " "subroutine setcolor(int r, int g, int b) " "subroutine settext(string txt) " "event testmouse pbm_mousemove " "end class " "globalfunctions " "function int funca(int a, int b) " "function int funcb(int a, int b) " "end globalfunctions " }; return desc; } |
Usage
You must implement this method in every PowerBuilder extension
module. The method is exported from the PowerBuilder extension module
and is used by PowerBuilder to display the prototype of each class,
function, and event in the module.
The syntax of the description follows:
Multiple instances
A syntax element with an asterisk indicates that multiple
instances of that element can appear in a description. For example,
[Desc]* indicates that one description can contain multiple classes,
global functions, and forward declarations.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
Desc::= class_desc| globalfunc_desc| forward_desc | [Desc]* class_desc::= class className from parentClass newline [methods_desc]* end class newline globalfunc_desc:= globalfunctions newLine [func_desc]* end globalfunctions forward_desc:= forward newLine [forwardtype_desc]* end forward forwardtype_desc:= class className from parentClass newline className::= a PowerBuilder token (cannot duplicate an existing group name) parentClass::= any class inherited from NonVisualObject or UserObject newline ::= a newline character methods_desc::= method_desc [methods_desc]* method_desc::= func_desc| sub_desc| event_desc func_desc::= function returnType funcName(args_desc) newline returnType :: = pbType pbType::= any PowerBuilder type | previous declared PBNI class funcName::= a PowerBuilder token args_desc::= None | arg_desc, [args_desc]* arg_desc::= [ ref | readonly ] pbType argName [array_desc] argName::= a PowerBuilder token array_desc::= array declaration of PowerBuilder sub_desc::= subroutine subName(args_desc) newline event_desc::= event returnType eventName(args_desc) newline | event eventName pbevent_token newline pbevent_token :: = string |
This syntax for event_desc allows you to map a Windows message
directly to a PowerBuilder event:
|
1 |
event eventName pbevent_tokennewline |
For more information, see Event processing in visual
extensions.
See also