APPLICATION OVERVIEW

shareclip_overview.png
This application is composed of 3 components:
• The application object shareclip used only to open the main screen.
There is no database connexion used.
• The window w_shareclip that stands for the main GUI of the application.
• The non-visual user object ncstshareclip that stands for the business object of the application (autoinstanciate)

COMPONENTS DETAILS

APPLICATION OBJECT – SHARECLIP

DETAILS

EVENTS

OPEN
The window w_shareclip is open from here.

WINDOW OBJECT – W_SHARECLIP

TECHNICAL OVERVIEW

w_shareclip_overview_a.png
w_shareclip_overview_B.png

VISUAL OVERVIEW

dialog_overview_dev.png

DETAILS

INSTANCE VARIABLES

Scope Type Name Description Default Value
Public Constant integer CST_MODE_EXPORT Mode export symbolic constant 1
Public Constant integer CST_MODE_IMPORT Mode import symbolic constant 2
Protected n_cst_shareclip inv_sc ShareClip business object n/a
Protected Integer Ii__mode Actual mode of usage CST_MODE_EXPORT
Protected Integer Ii__product Actual product inv_sc. CST_IDE_POWERBUILDER
Protected Boolean ib_Keyboardshortcuts Either to handle or not keyboard shortcuts False

EVENTS

OPEN

The dropdown list box that contains the product versions available (ddlb_1) is populated by default for product PowerBuilder by calling the window’s method of_populate_product_version().

FUNCTIONS

OF_POPULATE_PRODUCT_VERSION

This function is used to retrieve all the version(s) installed on the current pc of the selected product (PowerBuilder – rb_pb or PocketBuilder – rb_pk) and populate the corresponding dropdown list box (ddlb_1). To obtains the content of this list, it call the n_cst_shareclip::of_getavailableideversion() passing to it the actual mode (export or import) and selected product (PowerBuilder or PocketBuilder) values.

CONTROLS

CHECKBOX - CBX_KEYBOARDSHORTCUTS

EVENTS

CLICK
Enable or disable the handling of the Keyboard Shortcuts by setting the value of the instance variable ib_keyboardshortcuts to TRUE or FALSE.

RADIO BUTTON - RB_EXPORT

EVENTS

CLICK
Set the tool in export mode setting adequate value to iimode instance variable. It also adapt the label of the cb_apply_ button to “Export…”

RADIO BUTTON - RB_IMPORT

EVENTS

CLICK
Set the tool in import mode setting adequate value to ii_mode instance variable. It also adapt the label of the cb_apply button to “Import…”

RADIO BUTTON - RB_PB

EVENTS

CLICK
Set PowerBuilder as the current product by setting the ii_product instance variable with the corresponding symbolic constant and populate the installed product version dropdown list (ddlb_1) by calling the window’s of_populate_product_version() method.

RADIO BUTTON - RB_PK

EVENTS

CLICK
Set PocketBuilder as the current product by setting the ii_product instance variable with the corresponding symbolic constant and populate the installed product version dropdown list (ddlb_1) by calling the window’s of_populate_product_version() method.

COMMAND BUTTON - CB_APPLY

EVENTS

CLICK
Apply the selected action (Export or Import) by executing the following actions:
• displaying the adequate file selection dialog by calling the n_cst_shareclip::of_setfilename() method,
• getting the actual file name by calling n_cst_shareclip::of_getfilename() method
• Call the n_cst_shareclip::of_exportClip () method in case of Export or n_cst_shareclip::of_importClip () in case of Import.
• If the ib_keyboardshortcuts instance variable is set to TRUE, it will call the n_cst_shareclip::of_importkeyboardshortcuts() or -n_cst_shareclip::of_exportkeyboardshortcuts_according to actual IMPORT or EXPORT mode.

COMMAND BUTTON - CB_CLOSE

EVENTS

CLICK
Close the w_shareclip main window and exit the application.

NON-VISUAL OBJECT – N_CST_SHARECLIP (AUTOINSTANCIATE)

TECHNICAL OVERVIEW

n_cst_shareclip_overview.png

DETAILS

INSTANCE VARIABLES

Scope Type Name Description Default Value
Public Constant Integer CST_IDE_POWERBUILDER PowerBuilder product symbolic constant 1
Public Constant Integer CST_IDE_POCKETBUILDER PocketBuilder product symbolic constant 2
Protected String is_VersionsPb[] List of installed PowerBuilder versions n/a
Protected String is_VersionsPk[] List of installed PocketBuilder versions n/a
Protected String is_RegEntryClip[2] Registry keys to find clips according to products See definition
Protected String is_RegEntryIDE[2] Registry keys to find IDE according to products See definition
Protected String is_filename Complete filename to export into or to import from n/a

FUNCTIONS

OF_CREATE_FILE
This method is used to create a blank .INI file that will be used to store exported clips. It is called by the ["of_exportclip () "} method when needed.
OF_EXPORTCLIP
This method is called when the user click on the export button (w_shareclip.cb_apply in EXPORT mode) and exports the clips defined in the specified IDE of the specified product into the specified .INI file. If it does not exists, the of_createfile () method is called to create it.
OF_EXPORTKEYBOARDSHORTCUT
This method is called when the user click on the export button button (w_shareclip.cb_apply in EXPORT mode) and that the checkbox “include keyboard shortcuts” is checked (w_shareclip::cbx_keyboardshortcuts).
It exports the adequate registry entries using REG.EXE into a .REG file with the same name than the .INI file and link it to the .INI file by adding the key Keyboard shortcuts in the Settings section of the .INI file using the relative path to the corresponding .REG file as value.
When deploying the .INI file, the corresponding .REG file must come along in the same folder.
OF_GETAVAILABLEIDEVERSION
This method list all the IDE versions of the specified product installed on the pc into the specified string array (by ref). It is called when the user clicks on the PowerBuilder radio button (w_shareclip.rb_pb) or on the PocketBuilder radio button (w_shareclip.rb_pk) to populate the product version dropdown list box (w_shareclip.ddlb_1).
OF_GETFILENAME
Returns the filename actually defined that points to the .INI file used for export or import of clips. It uses the value of the instance variable is_filename.
OF_IMPORTCLIP
This method is called by the import button (w_shareclip.cb_apply in IMPORT mode) to import the clips contained in the specified .INI file, into the specified product version. You can import any .INI file exported from any product compatible version into any destination compatible product version. You can even export from PowerBuilder and import into PocketBuilder and vice-versa. If the destination product version is not installed no error will be raised. In order to check if the PowerBuilder destination version is compatible, it call the of_iscompatibleversion () method. Any version of PocketBuilder is compatible.
OF_IMPORTKEYBOARDSHORTCUT
This method is called when the user click on the import button button (w_shareclip.cb_apply in IMPORT mode) and that the checkbox “include keyboard shortcuts” is checked (w_shareclip::cbx_keyboardshortcuts).
It import the content of the linked .REG file declared in the KeyboardShortcuts value of the Settings section of the .INI file using REG.EXE.

OF_ISCOMPATIBLEVERSION
This method check if the specified PowerBuilder version is compatible. PowerBuilder compatibility begin from version 8.x until version 12.x.
OF_SETFILENAME
This method show a file selection dialog to let the user choose the .INI file being used to export or import clip and store its complete filename into the instance variable is_filename. It is called by the w_shareclip.cb_apply command button in any EXPORT or IMPORT mode.

Last edited Oct 26, 2014 at 11:14 AM by domangep, version 4