Form VL_SAM070: Demonstration of Dynamic Tool Bars

LANSA

Form VL_SAM070: Demonstration of Dynamic Tool Bars
Name: VL_SAM070

Description: The following RDMLX form is used to demonstrate how reusable component VL_SAM068 and form VL_SAM069 can be used to dynamically create tool bars.
* ===================================================================
*
* Component : VL_SAM070
* Type : Form
* Ancestor : PRIM_FORM
*
* Description : Demonstration of Dynamic Tool Bars
* The following RDMLX form is used to demonstrate how reusable component
* VL_SAM068 and form VL_SAM069 can be used to dynamically create tool bars.
*
* Disclaimer : The following material is supplied as sample material
* only. No warranty concerning this material or its use
* in any way whatsoever is expressed or implied.
*
* ===================================================================
Function Options(*DIRECT)
Begin_Com Role(*EXTENDS #PRIM_FORM) Formposition(ScreenCenter) Height(429) Left(387) Top(192) Width(576)
Define_Com Class(#VL_SAM068) Name(#TOOLBAR1) Displayposition(2) Left(5) Parent(#GROUPBOX) Tabposition(2) Tabstop(False) Top(6)
Define_Com Class(#VL_SAM068) Name(#TOOLBAR2) Displayposition(3) Left(160) Parent(#GROUPBOX) Tabposition(3) Tabstop(False) Top(6)
Define_Com Class(#VL_SAM068) Name(#TOOLBAR3) Left(256) Parent(#GROUPBOX) Tabstop(False) Top(6) Width(273)
Define_Com Class(#STD_OBJ.Visual) Name(#TOOLNAME) Caption('Last Tool Bar Item Clicked was Named') Displayposition(1) Height(19) Labeltype(Caption) Left(16) Marginleft(190) Parent(#GROUPTST) Tabposition(2) Top(24) Width(273)
Define_Com Class(#PRIM_PHBN) Name(#ORIENT_B1) Caption('Flip Orientation - Tool Bar 1') Displayposition(2) Left(16) Parent(#GROUPTST) Tabposition(1) Top(56) Width(150)
Define_Com Class(#PRIM_PHBN) Name(#ORIENT_B2) Caption('Flip Orientation - Tool Bar 2') Displayposition(3) Left(16) Parent(#GROUPTST) Tabposition(3) Top(80) Width(150)
Define_Com Class(#PRIM_PHBN) Name(#ORIENT_B3) Caption('Flip Orientation - Tool Bar 3') Displayposition(4) Left(16) Parent(#GROUPTST) Tabposition(4) Top(104) Width(150)

Define_Com Class(#PRIM_PHBN) Name(#ENABALL_B1) Caption('Enable All - Tool Bar 1') Displayposition(6) Left(176) Parent(#GROUPTST) Tabposition(6) Top(56) Width(137)
Define_Com Class(#PRIM_PHBN) Name(#ENABALL_B2) Caption('Enable All - Tool Bar 2') Displayposition(8) Left(176) Parent(#GROUPTST) Tabposition(8) Top(80) Width(137)
Define_Com Class(#PRIM_PHBN) Name(#ENABALL_B3) Caption('Enable All - Tool Bar 3') Displayposition(10) Left(176) Parent(#GROUPTST) Tabposition(10) Top(104) Width(137)
Define_Com Class(#PRIM_PHBN) Name(#ENABCLS_B3) Caption('Enable Close - Tool Bar 3') Displayposition(12) Left(176) Parent(#GROUPTST) Tabposition(12) Top(128) Width(137)

Define_Com Class(#PRIM_PHBN) Name(#DNABALL_B1) Caption('Disable All - Tool Bar 1') Displayposition(11) Left(320) Parent(#GROUPTST) Tabposition(11) Top(56) Width(137)
Define_Com Class(#PRIM_PHBN) Name(#DNABALL_B2) Caption('Disable All - Tool Bar 2') Displayposition(9) Left(320) Parent(#GROUPTST) Tabposition(9) Top(80) Width(137)
Define_Com Class(#PRIM_PHBN) Name(#DNABALL_B3) Caption('Disable All - Tool Bar 3') Displayposition(7) Left(320) Parent(#GROUPTST) Tabposition(7) Top(104) Width(137)
Define_Com Class(#PRIM_PHBN) Name(#DNABCLS_B3) Caption('Disable Close - Tool Bar 3') Displayposition(5) Left(320) Parent(#GROUPTST) Tabposition(5) Top(128) Width(137)

Define_Com Class(#PRIM_GPBX) Name(#GROUPTST) Caption('Test Options') Displayposition(1) Height(161) Left(0) Parent(#COM_OWNER) Tabposition(1) Tabstop(False) Top(240) Width(569)
Define_Com Class(#PRIM_GPBX) Name(#GROUPBOX) Displayposition(2) Left(0) Parent(#COM_OWNER) Tabposition(2) Tabstop(False) Top(0) Width(569)


Evtroutine Handling(#com_owner.Initialize)
Set Com(#com_owner) Caption(*component_desc)
*
* Dynamically Add Items to Tool Bar 1
*
Invoke Method(#ToolBar1.AddToolBarItem) Usename(Bck) Usehint('Backwards') Usebitmap(VB_ARROWB)
Invoke Method(#ToolBar1.AddToolBarItem) Usename(Crv) Usehint('Curved') Usebitmap(VB_ARROWC)
Invoke Method(#ToolBar1.AddToolBarItem) Usename(Fwd) Usehint('Forwads') Usebitmap(VB_ARROWF)
Invoke Method(#ToolBar1.AddToolBarItem) Usename(Lft) Usehint('Left') Usebitmap(VB_ARROWL)
Invoke Method(#ToolBar1.AddToolBarItem) Usename(Rgt) Usehint('Right') Usebitmap(VB_ARROWR)
*
* Dynamically Add Items to Tool Bar 2
*
Invoke Method(#ToolBar2.AddToolBarItem) Usename(TB2-1) Usehint('Send to Rubbish Bin') Usebitmap(VB_BIN)
Invoke Method(#ToolBar2.AddToolBarItem) Usename(TB2-2) Usehint('Open File') Usebitmap(VB_OPEN)
Invoke Method(#ToolBar2.AddToolBarItem) Usename(TB2-3) Usehint('Close File') Usebitmap(VB_CLOSE)
*
* Dynamically Add Items to Tool Bar 3 (and set to initial vertical orientation)
*
Invoke Method(#ToolBar3.AddToolBarItem) Usename(CD) Usehint('CD') Usebitmap(VB_CD)
Invoke Method(#ToolBar3.AddToolBarItem) Usename(CLOSE) Usehint('Close File') Usebitmap(VB_CLOSE)
Invoke Method(#ToolBar3.AddToolBarItem) Usename(OPEN) Usehint('Open File') Usebitmap(VB_OPEN)
Invoke Method(#ToolBar3.AddToolBarItem) Usename(COMPUTER) Usehint('Target Computer') Usebitmap(VB_COMPUT)
Invoke Method(#ToolBar3.AddToolBarItem) Usename(FLOPPY) Usehint('Save to Floppy Disk') Usebitmap(VB_FLOPPY)
Invoke Method(#ToolBar3.AddToolBarItem) Usename(HARD) Usehint('Save to Hard Disk') Usebitmap(VB_HRDISK)
Invoke Method(#ToolBar3.AddToolBarItem) Usename(CUT) Usehint('Cut to the Clipboard') Usebitmap(VB_CUT)
Invoke Method(#ToolBar3.AddToolBarItem) Usename(COPY) Usehint('Copy to the Clipboard') Usebitmap(VB_COPY)
Invoke Method(#ToolBar3.AddToolBarItem) Usename(PASTE) Usehint('Paste from the Clipboard') Usebitmap(VB_PASTE)

Endroutine

Evtroutine Handling(#TooLBar1.TooBarButtonClicked #TooLBar2.TooBarButtonClicked #TooLBar3.TooBarButtonClicked) Withname(#ID1)
Set Com(#ToolName) Value(#ID1.Value)
Endroutine
*
* Alter orientation of any of the tool bars programmatically (this can also be done by right mouse button)
*
Evtroutine Handling(#ORIENT_B1.Click)
If Cond('#ToolBar1.Orientation = H')
Set Com(#ToolBar1) Orientation(V)
Else
Set Com(#ToolBar1) Orientation(H)
Endif
Endroutine
Evtroutine Handling(#ORIENT_B2.Click)
If Cond('#ToolBar2.Orientation = H')
Set Com(#ToolBar2) Orientation(V)
Else
Set Com(#ToolBar2) Orientation(H)
Endif
Endroutine
Evtroutine Handling(#ORIENT_B3.Click)
If Cond('#ToolBar3.Orientation = H')
Set Com(#ToolBar3) Orientation(V)
Else
Set Com(#ToolBar3) Orientation(H)
Endif
Endroutine
*
* Alter enablement of all tool bar items (this can also be done for individual items)
*
Evtroutine Handling(#ENABALL_B1.Click)
Invoke Method(#ToolBar1.AlterToolBarItem) Named(ALL) Setenabled(True)
Endroutine
Evtroutine Handling(#ENABALL_B2.Click)
Invoke Method(#ToolBar2.AlterToolBarItem) Named(ALL) Setenabled(True)
Endroutine
Evtroutine Handling(#ENABALL_B3.Click)
Invoke Method(#ToolBar3.AlterToolBarItem) Named(ALL) Setenabled(True)
Endroutine
Evtroutine Handling(#ENABCLS_B3.Click)
Invoke Method(#ToolBar3.AlterToolBarItem) Named(close) Setenabled(True)
Endroutine
Evtroutine Handling(#DNABALL_B1.Click)
Invoke Method(#ToolBar1.AlterToolBarItem) Named(ALL) Setenabled(False)
Endroutine
Evtroutine Handling(#DNABALL_B2.Click)
Invoke Method(#ToolBar2.AlterToolBarItem) Named(ALL) Setenabled(False)
Endroutine
Evtroutine Handling(#DNABALL_B3.Click)
Invoke Method(#ToolBar3.AlterToolBarItem) Named(ALL) Setenabled(False)
Endroutine
Evtroutine Handling(#DNABCLS_B3.Click)
Invoke Method(#ToolBar3.AlterToolBarItem) Named(Close) Setenabled(False)
Endroutine

End_Com