Advanced GUI Code Example
This code example demonstrates how to create an advanced graphical user interface (GUI) in
PowerBuilder, using native PowerBuilder objects as well as third-party controls implemented
using the PowerBuilder Native Interface (PBNI).
This application consists of a workspace containing a standard PowerBuilder (Win32) target. The
target contains three PBLs: advguisample.pbl, advguicontrols.pbl, and advguiobjects.pbl.
This application contains examples of the following types of objects:
§ Button List Bar
§ Shortcut Bar
§ Static Text Control
§ Tab Strip
§ Toolbar Strip
§ XP List Bar
Information on how to use each control is provided below.
Button List Bar
Usage
Add the following library to your application library list:
advguicontrols.pbl
Place u_cst_buttonlistbar from advguicontrols.pbl on your window.
Distribution
You need to distribute the canvas.pbx PowerBuilder extension file with your application
Functions
of_additem (string as_text, string as_image)
- Add an item to the list
of_setsize (integer ai_size)
- Set button size
- for 16x16 pass SMALL
- for 24x24 pass MEDIUM
- for 32x32 pass LARGE
- for 48x48 pass XLARGE
of_selectbutton (long al_selected)
of_selectbutton (string as_text)
- Select a button by index or text
of_setenabled (long al_index, boolean ab_enabled)
of_setenabled (string as_text, boolean ab_enabled)
- Set buttons enabled property by index or text
of_gettext (long al_index)
- Get Button text by index
评论0