Quickstart

Return to Introduction  Previous page  Next page

Follow the steps below to quicly implement a Taskpanel in your application:

 

 

Add the global template

 

Do-it Open your application (or create a new one)

 

Do-it Press the "Global"-options button (GlobalOptionsBtn)

 

Do-it Click the "Extensions"-button

 

Do-it Click the "Insert"-button

 

Do-it Choose the "XPTaskpanelGlobal - Icetips XP Taskpanel Global"-template

 

ChooseGlobalTemplate

 

Do-it Press "Ok" two times to get back to the application

 

Do-it In the Application frame properties check the "Immediate" option.

 

 

Populate the control

 

Do-it Create a Window

 

Do-it Populate "XPTaskPanel" control template by clicking the

  PopulateControl

 

Do-it Choose the "XPTaskPanel - Icetips XP Taskpanel Control"-template

ChooseTemplate

       Legacy-NOTE: Select XPTaskPanelCW instead..

 

Do-it 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

   

Do-it Right-click on the XPTaskpanel control and choose "Actions".

   

Prcarrow Now, press the "Insert"-button to bring up the "Header Editor".

    HeaderEd

    (Header Settings)

 

Bullet In the "Title"-field, enter "Header 1" (without the quotes)

 

Bullet 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.

 

Do-it Click the "Tasks"-tab

 

Do-it Now, click "Insert" to add a task.

 

   TaskEd

   (Task Settings)

 

Bullet Enter "Task 1" in the "Title"-field

 

Do-it Click "Ok" to add the Task

 

Do-it Click "Insert" to add another task

 

   TaskEd2

 

Bullet Enter "Quit" in the title-field

 

 

Do-it Choose the "Action"-tab

 

   TaskEd3

 

Bullet Action: Post Event

Bullet Event: EVENT:CloseWindow

Bullet Click "Ok" to add the Task

 

Do-it Click "Ok" three times to get back to the window formatter.

Bullet Save the window

 

Do-it Now, go to the embed-point "Local Objects -Onestep XPTaskpanel1 -Onestep Header1 -Onestep Header1:Task1 -Onestep Task Clicked -Onestep Before Generated Code", and

  enter the following code:

 

       Message('You clicked ' & Self.GetTaskTitle(HeaderID, TaskID))

 

 

Do-it Save, compile and run your application.

 

  The result should look something like this:

 

  RunningApp

 

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"

 



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