Exported methods:
PBX_GetDescription method
Description
Passes a description of all the classes and methods in the
PowerBuilder extension module to PowerBuilder.
Syntax
|
1 |
PBX_GetDescription ( ) |
Return Values
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 |
PBXEXPORT LPCTSTR PBXCALL PBX_GetDescription()<br>{<br>   static const TCHAR desc[] = {<br>      "class class_a from nonvisualobject " <br>      "function long meth1(string classpath) " <br>      "function string meth2() " <br>      "end class " <br> <br>      "class class_b from nonvisualobject "<br>      "subroutine sbrt1() "<br>      "subroutine sbrt2() "<br>      "function long func1() "<br>      "end class "<br> <br>      "class class_c from nonvisualobject "<br>      "end class "<br>   };<br> <br>  return desc;<br>} |
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 |
PBXEXPORT LPCTSTR PBXCALL PBX_GetDescription()<br>{<br>   static const TCHAR desc[] = {<br>      "class visualext from userobject "<br>      "event int onclick() "<br>      "event int ondoubleclick() "<br>      "subroutine setcolor(int r, int g, int b) "<br>      "subroutine settext(string txt) "<br>      "event testmouse pbm_mousemove "<br>      "end class "<br> <br>      "globalfunctions "<br>      "function int funca(int a, int b) "<br>      "function int funcb(int a, int b) "<br>      "end globalfunctions "<br>   };<br> <br> return desc;<br>} |
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 |
<span>Desc</span> ::= <br>             <span>class_desc</span> | <span>globalfunc_desc</span> | <span>forward_desc</span> | [<span>Desc</span>]* |
|
1 |
<span>class_desc</span> ::= <br>           class <span>className</span> from <span>parentClass</span> newline<br>             [<span>methods_desc</span>]* end class newline |
|
1 |
<span>globalfunc_desc</span> := <br>             globalfunctions newLine [<span>func_desc</span>]* end globalfunctions |
|
1 |
<span>forward_desc</span> := <br>             forward newLine [<span>forwardtype_desc</span>]* end forward |
|
1 |
<span>forwardtype_desc</span> := <br>             class <span>className</span> from <span>parentClass</span> newline |
|
1 |
<span>className</span> ::= <br>             a PowerBuilder token (cannot duplicate an existing group name) |
|
1 |
<span>parentClass</span> ::= <br>            any class inherited from NonVisualObject or UserObject |
|
1 |
newline ::= <br>            a newline character |
|
1 |
<span>methods_desc</span> ::= <br>            <span>method_desc</span> [<span>methods_desc</span>]* |
|
1 |
<span>method_desc</span> ::= <br>            <span>func_desc</span> | <span>sub_desc</span> | <span>event_desc</span> |
|
1 |
<span>func_desc</span> ::= <br>            function <span>returnType</span> <span>funcName</span>(<span>args_desc</span>) newline |
|
1 |
<span>returnType</span> :: =<br>            <span>pbType</span> |
|
1 |
<span>pbType</span> ::= <br>            any PowerBuilder type | previous declared PBNI class |
|
1 |
<span>funcName</span> ::= <br>            a PowerBuilder token |
|
1 |
<span>args_desc</span> ::= <br>            None | <span>arg_desc</span>, [<span>args_desc</span>]* |
|
1 |
<span>arg_desc</span> ::= <br>            [ ref | readonly ] <span>pbType</span> <span>argName</span> [<span>array_desc</span>] |
|
1 |
<span>argName</span> ::= <br>            a PowerBuilder token |
|
1 |
<span>array_desc</span> ::= <br>             array declaration of PowerBuilder |
|
1 |
<span>sub_desc</span> ::= <br>            subroutine <span>subName</span>(<span>args_desc</span>) newline |
|
1 |
<span>event_desc</span> ::= <br>             event <span>returnType</span> <span>eventName</span>(<span>args_desc</span>) newline <br>               | event <span>eventName</span> <span>pbevent_token</span> newline |
|
1 |
<span>pbevent_token</span> :: =<br>          <span>string</span> |
This syntax for event_desc allows you to map a Windows
message directly to a PowerBuilder event:
|
1 |
event <span>eventName</span> <span>pbevent_token</span> newline |
For more information, see “Event processing
in visual extensions”.