Quickstart |
Follow the steps below to quicly implement a Taskpanel in your application:
Add the global template
Open your application (or create a new one)
Press the "Global"-options button ()
Click the "Extensions"-button
Click the "Insert"-button
Choose the "XPTaskpanelGlobal - Icetips XP Taskpanel Global"-template
Press "Ok" two times to get back to the application
In the Application frame properties check the "Immediate" option.
Populate the control
Create a Window
Populate "XPTaskPanel" control template by clicking the
Choose the "XPTaskPanel - Icetips XP Taskpanel Control"-template
Legacy-NOTE: Select XPTaskPanelCW instead..
Place the control somewhere on you window and adjust the size.
Add 2 global variables (you can do that in the dictionary if you want to) Here we are using:
MainThreadID LONG
ToolboxMenuID LONG
In the Appframe procedure, add this code in OpenWindow event handling embed, after generated code:
MainThreadID = THREAD()
START(TaskPanelProcedure, 25000)
In the Sized window event handling embed, after generated code, add:
pix# = 0{PROP:Pixels}
0{PROP:Pixels} = TRUE
h# = 0{PROP:ClientHeight} - 4
NOTIFY(h#, ToolboxMenuID)
0{PROP:Pixels} = pix#
On the Taskpanel procedure add a local variable:
nHeight UNSIGNED
Then, in ThisWindow.Init method, right at the beginning:
ToolboxMenuID = THREAD()
In ThisWindow.TakeWindowEvent method, priority 2501:
OF EVENT:Notify
IF NOTIFICATION (nHeight,,)
pix# = 0{PROP:Pixels}
0{PROP:Pixels} = TRUE
0{PROP:Height} = nHeight
?XPTaskpanel{PROP:Height} = nHeight
0{PROP:Pixels} = pix#
DISPLAY
END
And finally in the CloseWindow event handling embed, before generated code put:
ToolboxMenuID = 0
That should be all the code you need to get the Taskpanel up and running.
Template settings
Right-click on the XPTaskpanel control and choose "Actions".
Now, press the "Insert"-button to bring up the "Header Editor".
In the "Title"-field, enter "Header 1" (without the quotes)
If you'd like an icon in the header, you can select the "Style"-tab and press the elipsis-button (...) to right of the icon-field, and choose an .ico-file.
Click the "Tasks"-tab
Now, click "Insert" to add a task.
Enter "Task 1" in the "Title"-field
Click "Ok" to add the Task
Click "Insert" to add another task
Enter "Quit" in the title-field
Choose the "Action"-tab
Action: Post Event
Event: EVENT:CloseWindow
Click "Ok" to add the Task
Click "Ok" three times to get back to the window formatter.
Save the window
Now, go to the embed-point "Local Objects - XPTaskpanel1 - Header1 - Header1:Task1 - Task Clicked - Before Generated Code", and
enter the following code:
Message('You clicked ' & Self.GetTaskTitle(HeaderID, TaskID))
Save, compile and run your application.
The result should look something like this:
When you click on "Task 1" a message saying "You clicked Task 1" should appear.
You'll find this application under "Clarion6\3rdParty\Examples\XPTaskpanel\quickstart_c6.app"