Advanced Browse

Return to Introduction  Previous page  Next page

This tutorial shows how to create a browse and control it from the AppFrame toolbar. For a tutorial on how to control a browse with a toolbar in the same window as the browse, click here.

 

You can find the finished application can be found at: Clarion6\3rdParty\Examples\PowerToolbar\AdvancedBrowseTutorial.app

 

advbrwtut_8

 

In this example you should use the dictionary named ptbexamples.dct

 

 

Part 1 - Populate templates

Onestep Create a new application (ABC)

 

Bullet Choose the ptbexample.dct from Clarion6\3rdParty\Examples\PowerToolbar as "Dictionary File".

 

advbrwtut_9

 

 

Onestep Add the global PowerToolbar template

Bullet See Adding the templates

 

Onestep Select the "Advanced"-tab of the global template

Bullet Make sure "Support AppFrame-Toolbar from other threads" is checked.

 

threadtut_2

 

Bullet Click "Ok" twice to get back to the Application Tree.

 

Onestep Add AppFrame

Bullet Double-click the Main(Todo) procedure to bring up the "Select Procedure Type" dialog.

Bullet Select "Frame - Multiple Document Main Menu"

 

threadtut_3

 

 

Onestep Create the window

Bullet Click the Window button

Bullet Select "Application Main MDI Frame" and click OK. This will bring up the window formatter.

 

threadtut_4

 

Onestep Delete the menubar (We do not want a menu for this tutorial)

Bullet Select the menu-item "Menu -> Delete Menu"

 

Onestep Create the toolbar

Bullet Select the menu-item "Toolbar -> New Toolbar"

 

Onestep Populate PowerToolbar control

Bullet Click the "Control Template" toolbutton

    tplbutton

 

Bullet Choose the template "POToolbar - Toolbar Control"

   addtpl_c1_75pst

 

Bullet Click somewhere inside the Clarion toolbar or Window to place the PowerToolbar-control.

 

 

Part 2 - Toolbar settings

Onestep Right-click the PowerToolbar control, and select "Actions"

 

Onestep Select the "Advanced" tab

Bullet Notice "ID-Filename". All ID's for this toolbar will be exported to this file. You will need to select this file in the MDI Client template later in this tutorial.

Bullet "Object name" must be the same as global template setting.

 

brwtut_14

 

Onestep Add a band

Bullet Select the "Bands"-tab

Bullet Click the "Insert"-button

Bullet As "Name", type "Tutorial"

 

threadtut_5

 

Onestep Add a button to start a browse

Bullet Click the "Insert"-button

Bullet Type "New Browse" in the Name field.

 

advbrwtut_2

 

Onestep Set button action

Bullet Select the "Actions"-tab

Bullet As "Action" select "Call a Procedure"

Bullet Enter "TestWindow" as procedure name

Bullet Check the "Initiate thread" checkbox

 

threadtut_7

 

Bullet Click "Ok" two times, to get back to "Bands"

 

Onestep Add new band

Bullet Click the "Insert"-button

Bullet As "Name", type "Browse Control"

 

advbrwtut_3

 

Onestep Add browse "Insert" button

Bullet Click the "Insert"-button

Bullet Type "Insert" in the Name field.

Bullet Notice the ID generated (ID1_Insert)

Bullet Check "Disable" to make the button disabled by default

 

advbrwtut_4

 

Bullet Click "Ok" to save the new button

 

Onestep Add browse "Change" button

Bullet Click the "Insert"-button (below the list)

Bullet Type "Change" in the Name field.

Bullet Notice the ID generated (ID1_Change)

Bullet Check "Disable" to make the button disabled by default

Bullet Click "Ok" to save the new button

 

Onestep Add browse "Delete" button

Bullet Click the "Insert"-button (below the list)

Bullet Type "Delete" in the Name field.

Bullet Notice the ID generated (ID1_Delete)

Bullet Check "Disable" to make the button disabled by default

Bullet Click "Ok" to save the new button

Bullet Click "Ok" 2 times to get back to the window formatter

Bullet Save and exit the window

 

Onestep Compile the application

Bullet We need to compile (or at least generate) the application to generate the ID-file (AdvancedBrowseTutorial1.id)

Bullet Compile the application (just quit it right away, we got more work to do :-)

 

 

Part 3 - Create the browse

Onestep Double click the "TestWindow (Todo)"-procedure and choose "Browse - Browse Fields in a List Box" as template type

 

brwtut_2

 

 

Onestep Click the "Window" button and select "MDI Child Window" as window type.

 

advbrwtut_5

 

Onestep You should now be in the window formatter.

Bullet Click the "Control template" button (tplbutton)

Bullet Choose the "Browse Box - File-Browsing List Box"-template

   brwtut_4

 

Bullet Place it somewhere in your window

Bullet Choose the "Sample Table" as table, and "SAM:SampleText" as display field.

   brwtut_5

 

Bullet Click "Ok" in the list box formatter

 

Onestep Now you should add browse update buttons

Bullet Click the "Control template" button (tplbutton)

Bullet Choose the "BrowseUpdateButtons - Update records from a Browse Box"-template

   brwtut_6

 

Bullet Position the buttons over the browse box

Bullet Set buttons to "Hide"

   brwtut_7

 

Bullet On one of the button's action-tab, check the "Use Edit in-Place" option

   brwtut_8

 

 

 

Part 4 - MDI Client template

 

Onestep Add the MDI-template

Bullet Click the "Extensions"-button

Bullet Click "Insert"

Bullet Select "PowerToolbarMDIClient - PowerToolbar MDI Client"

threadtut_8_1

 

Onestep Set up the template

Bullet Click the "..." button next to the ID-file prompt.

Bullet Select the "AdvancedBrowseTutorial1.id"-file. This is the file generated by the toolbar-control i the AppFrame.

 

brwtut_13

 

Onestep Add button mimic for browse "Insert" button

Bullet Click "Insert" to add mimic control

Bullet Choose "ID1_Insert" as "Toolbar Button ID"

Bullet Choose "?Insert" as Control.

Bullet We have now established a link between the toolbar button, and the insert browse update button.

 

advbrwtut_6

 

Bullet Click "Ok"

 

Onestep Add button mimic for browse "Change" button

Bullet Click "Insert" (below the list box) to add mimic control

Bullet Choose "ID1_Change" as "Toolbar Button ID"

Bullet Choose "?Change" as Control.

Bullet Click "Ok"

 

Onestep Add button mimic for browse "Delete" button

Bullet Click "Insert" (below the list box) to add mimic control

Bullet Choose "ID1_Delete" as "Toolbar Button ID"

Bullet Choose "?Delete" as Control.

Bullet Click "Ok"

 

advbrwtut_7

 

 

Part 5 - Try application

Onestep Compile and run

Bullet Click "Ok" to get back to the application tree

Bullet Compile and run the application

 

Bullet Try opening and closing a browse

Bullet Try several browses open and controling them from the toolbar

 

advbrwtut_8

 



Direct link to this page on our website: http://www.icetips.com/manuals/powertoolbar/advancedbrowsecontrol.htm