HOME, PRODUCTS, ARTICLESCONTACT

BUY UPC™UPC™ FEEDBACKUPC™ SUPPORT

D.05. TADVANCE_MasterToolbarInterface

TComponent

TADVANCE_MasterToolbarInterface

TADVANCE_MasterToolbarInterfaceWToolEvents

MasterToolbar™ (full size), immediately below LogoPanel™.

TADVANCE_MasterToolbarInterface exposes a pre-populated MasterToolbar™ which can negotiate all the tables of DBMS (relational database) applications.

DEPLOYING THE MASTERTOOLBAR™ FOR *ANY* RDBMS API

The MasterToolbar™ is designed to readily process any DBMS/RDBMS API (Paradox TTable, MySQL, MS SQL, Oracle, etc.), and to allow you to move or extend your code base to other DBMS APIs by simply modifying the few lines of code which declare and process the API objects:

  1. To connect data-aware controls to a principal table interfaced by each main page of a TADVANCE_PM04_DataMasterUPA module, simply declare formal or informal table API objects for every page. To move or extend your code base to further APIs, modify these declarations.
  2. To process the principal table interfaced by each main page, you write the few simple processes that your application needs to respond to MasterToolbar™ click events. These will usually be one-liners calling API methods (TTable.Next, etc.). To move or extend your code base to further APIs, change these one-liners as required by API design.

As a result,

  • If you made your API objects formal members of your pages, your MasterToolbar™ processes are automatically focused by the UPC™ navigation system.
  • If instead you made your API objects informal members of your pages, then to focus your MasterToolbar™ processes on the principal table of the focused page, you
    1. Declare a global table API object pointer and process this pointer with your MasterToolbar™ handlers.
    2. Assign the informal API object of the page to the global API object pointer with the OnFocus event of the page.

    This approach too automatically applies MasterToolbar™ processes to the focused page.

The following examples illustrate how both approaches auto-focus MasterToolbar™ processes on the focused page, and are readily moved or extended to further APIs with minimal coding. Resultant designs are flexible, and leverage the small footprint of the MasterToolbar™ across unlimited tables.

EXAMPLES — PROCESSING FORMAL API OBJECT MEMBERS

DELPHI FORMAL MEMBER EXAMPLE

Copy code to clipboard (JavaScript/IE).

C++ FORMAL MEMBER EXAMPLE

Copy code to clipboard (JavaScript/IE).

EXAMPLES — PROCESSING INFORMAL API OBJECT MEMBERS

DELPHI EXAMPLE — PAGE.ONFOCUS EVENT HANDLER

Copy code to clipboard (JavaScript/IE).

DELPHI EXAMPLE — MASTERTOOLBAR™ TOOL CLICK HANDLER CALLING 'NEXT' METHOD OF TTABLE

Copy code to clipboard (JavaScript/IE).

C++ EXAMPLE — PAGE->ONFOCUS EVENT HANDLER

Copy code to clipboard (JavaScript/IE).

C++ EXAMPLE — MASTERTOOLBAR™ TOOL CLICK HANDLER CALLING 'NEXT' METHOD OF TTABLE

Copy code to clipboard (JavaScript/IE).

GUIDELINE FOR CONTROLLING VISIBLE AND ENABLED BUTTONS

HANDLING THE INTEGRITY OF AN APPLICATION'S CONNECTION TO ITS SERVER

Assigning False to MasterToolbar.ConnectedToServer displays the MT_RECONNECT button (right) and automatically disables tools not included in ButtonsEnabledAfterDisconnect. Assigning True to ConnectedToServer hides the MT_RECONNECT button and re-enables intended tools.

The MasterToolbar™ allows you to easily support attempts to re-establish failed network connectivity, and to protect processes from execution while failed connectivity persists. The following code examples show how easy it is to do this.

  • A UsualOpenAPIObjectsMethod opens/activates your DBMS API objects. The extended design of this method however also supports attempts to re-establish connections with server-based data or API objects.
  • Any process which discovers it cannot communicate with server-based data or API objects calls DysfunctionalConnectionHandler, which sets MasterToolbar.ConnectedToServer to False.
    • The MasterToolbar™ responds by disabling all buttons not belonging to ButtonsEnabledAfterDisconnect, and by presenting its MT_RECONNECT button.
      • Your MT_RECONNECTClick handler then can call UsualOpenAPIObjectsMethod.
    • As in the code examples above, the False ConnectedToServer condition prevents execution of impermissible MasterToolbar™ handlers.

DELPHI EXAMPLE — HANDLING A DYSFUNCTIONAL CONNECTION, AND REC0NNECTING TO THE SERVER

Copy code to clipboard (JavaScript/IE).

C++ EXAMPLE — HANDLING A DYSFUNCTIONAL CONNECTION, AND REC0NNECTING TO THE SERVER

Copy code to clipboard (JavaScript/IE).

EVENTS

Former MasterToolbar™ events have been moved to the root module.

PROPERTIES

MasterToolbar™ properties in the Object Inspector™.

MasterToolbar™ properties in the Object Inspector™ (C++Builder™).

ButtonsEnabledAfterDisconnect : TADVANCE_MasterToolbar_Set read FButtonsEnabledAfterDisconnect write SetButtonsEnabledAfterDisconnect default [MT_RESTOREToOriginal, MT_UNDO, MT_REDO, MT_TentativeACCEPT, MT_ConfirmCANCEL, MT_HELP];

__property TADVANCE_MasterToolbar_Set ButtonsEnabledAfterDisconnect = {read=FButtonsEnabledAfterDisconnect, write=SetButtonsEnabledAfterDisconnect, default=97280};

TADVANCE_MasterToolbar_EnumeratedType = (MT_ConfirmREFRESH, MT_FINDSQL, MT_FIND, MT_FIRST, MT_PRIOR, MT_NEXT, MT_LAST, MT_ConfirmDELETE, MT_ADD, MT_CLONE, MT_RESTOREToOriginal, MT_UNDO, MT_REDO, MT_TentativeACCEPT, MT_ConfirmCANCEL, MT_OKPOST, MT_HELP, MT_RECONNECT);

enum TADVANCE_MasterToolbar_EnumeratedType { MT_ConfirmREFRESH, MT_FINDSQL, MT_FIND, MT_FIRST, MT_PRIOR, MT_NEXT, MT_LAST, MT_ConfirmDELETE, MT_ADD, MT_CLONE, MT_RESTOREToOriginal, MT_UNDO, MT_REDO, MT_TentativeACCEPT, MT_ConfirmCANCEL, MT_OKPOST, MT_HELP, MT_RECONNECT };

TADVANCE_MasterToolbar_Set = set of TADVANCE_MasterToolbar_EnumeratedType;
typedef Set<TADVANCE_MasterToolbar_EnumeratedType, MT_ConfirmREFRESH, MT_RECONNECT> TADVANCE_MasterToolbar_Set;

Prescribes MT toolbuttons which will remain enabled when ConnectedToServer is False.

property ButtonsVisible : TADVANCE_MasterToolbar_Set read FButtonsVisible write SetButtonsVisible default [MT_ConfirmREFRESH..MT_HELP];
__property TADVANCE_MasterToolbar_Set ButtonsVisible = {read=FButtonsVisible, write=SetButtonsVisible, default=131071};

Prescribes visible MT buttons. MT_RECONNECT is ignored unless ConnectedToServer is False.

property ConnectedToServer : Boolean read FConnectedToServer write SetConnectedToServer default True;
__property bool ConnectedToServer = {read=FConnectedToServer, write=SetConnectedToServer, default=1};

See Handling the Integrity of an Application's Connection to its Server, above.

property Enabled : Boolean read FEnabled write SetEnabled default True;
__property bool Enabled = {read=FEnabled, write=SetEnabled, default=1};

Disables the MasterToolbar™ region. Does not call the alternate drawing methods invoked when buttons are disabled.

property ToolButton_ProportionalSpacerWidthPercent: TADVANCE_ToolButton_ProportionalSpacerWidthPercent read FToolButton_ProportionalSpacerWidthPercent write SetToolButton_ProportionalSpacerWidthPercent default pswp100;

__property TADVANCE_ToolButton_ProportionalSpacerWidthPercent ToolButton_ProportionalSpacerWidthPercent = {read=FToolButton_ProportionalSpacerWidthPercent, write=SetToolButton_ProportionalSpacerWidthPercent, default=0};

TADVANCE_ToolButton_ProportionalSpacerWidthPercent = (pswp100, pswp050, pswp025);
enum TADVANCE_ToolButton_ProportionalSpacerWidthPercent { pswp100, pswp050, pswp025 };

Button spacer width as a percentage of button width.

property Tools_HeightAndWidth : Integer read FTools_HeightAndWidth write SetTools_HeightAndWidth; // [Minimum = 24, Maximum = 50]
__property int Tools_HeightAndWidth = {read=FTools_HeightAndWidth, write=SetTools_HeightAndWidth, nodefault};

MT toolbutton height and width.

property Visible : Boolean read FVisible write SetVisible default True;
__property bool Visible = {read=FVisible, write=SetVisible, default=1};

MasterToolbar.Visible.

property Wrap : Boolean read FWrap write SetWrap default True;
__property bool Wrap = {read=FWrap, write=SetWrap, default=1};

MasterToolbar™ events have been moved to the root module.

property Wrap_OffAtWidthLessThan : Integer read FWrap_OffAtWidthLessThan write SetWrap_OffAtWidthLessThan default 10; // [Minimum = 25, Maximum = 25000]
__property int Wrap_OffAtWidthLessThan = {read=FWrap_OffAtWidthLessThan, write=SetWrap_OffAtWidthLessThan, default=10};

Disables wrapping when client width < than Wrap_OffAtWidthLessThan.

© Copyright 1995-2007, by ADVANCE Information Systems, Inc. ALL RIGHTS RESERVED.Copyright 1995-2007, by ADVANCE Information Systems, Inc. ALL RIGHTS RESERVED.

Firefox™.Best viewed in Mozilla Firefox™.