Print Page | Close Window

Bolding Task Panel Iems

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=492
Printed Date: 23 December 2024 at 12:46pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Bolding Task Panel Iems
Posted By: DougW
Subject: Bolding Task Panel Iems
Date Posted: 03 March 2004 at 1:49pm

I created an application that uses the CXTPTaskPanel.  I studied the example from  ...\ToolkitPro\samples\ToolkitPro\TaskPanel

My goal is to have Task Panel items turn bold when the user clicks them, so I handle the

XTPWM_TASKPANEL_NOTIFY message and I unbold any previous selection and them bold the new selection.  This technique seems to work fine....well, almost!

It appears that the size of the text is insufficient.  Most of my Task Panel items have labels that are 2 or 3 words long.  When an item is bolded the last word is chopped off.  I noticed that if I define the item text (in the resources) as having a few spaced padded to the end the bolding works.  This suggests that the GroupItem class is not properly resizing the text area for bolded items.

Any ideas how to handle this?  Oh, I don't want to add the padded spaces since that causes the hot link text the show underlined spaces.

BTW: I'm using Windows 2000; Xtreme Toolkit Pro 8.61

 




Replies:
Posted By: Oleg
Date Posted: 04 March 2004 at 12:44pm
Try to call m_wnTaskPanel.Reposition() after SetBold();

-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: DougW
Date Posted: 04 March 2004 at 3:56pm

  No go.  I added the call to Reposition() but it still behaves the same. 

BTW: I streched out the width of my Task Panel window so that the width is not an issue.

I am changing views based on what Task Panel item is clicked.  When I do I am unbolding the previous selection and bolding the new selection.  The new selection shows up in bold but the last wordis cut off (not partially...the whole word is gone).

If I hover over the bolded item the underline (hot) text shows me the full label.



Posted By: DougW
Date Posted: 04 March 2004 at 4:12pm

By the way, as a test I modified the TaskPanel sample and I get the same problem.  The sample project is located at samples\ToolkitPro\TaskPanel.

Here's my modifications:

In the MainFrm.h file add a member variable to the CMainFrame class as follows:

CXTPTaskPanelGroupItem* m_pPreviousTaskPanelItem;

Now in the MainFrm.cpp file you need to initialize the member variable in the class constructor.

CMainFrame::CMainFrame()

{

m_pPreviousTaskPanelItem = NULL;

...

 

Finally, in the Task Panel's notification handler, change the click case to look like the following:

LRESULT CMainFrame::OnTaskPanelNotify(WPARAM wParam, LPARAM lParam)

{

   switch(wParam)

   {

      case XTP_TPN_CLICK:

      {

         if (m_pPreviousTaskPanelItem)

         {

             m_pPreviousTaskPanelItem->SetBold(FALSE);

         }

         m_pPreviousTaskPanelItem = (CXTPTaskPanelGroupItem*)lParam;

         m_pPreviousTaskPanelItem->SetBold(TRUE);

         m_wndTaskPanel.Reposition();

      }

...

 

Notice that all I do is unbold the previous and bold the current selection.  When you run it make the task panel plenty wide so that width is not an issue.  Click an item; now click another one.  I am seeing the last word dropped.

 



Posted By: Oleg
Date Posted: 05 March 2004 at 1:59am
Ok, agree. I sended fix to email.

-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: DougW
Date Posted: 05 March 2004 at 9:58am

  Yeah!!!  It works!  Thanks Oleg!

 



Posted By: studioars
Date Posted: 17 March 2004 at 3:34am

Please, can you send me that fix besause I have the same problem

Thanks



Posted By: Oleg
Date Posted: 17 March 2004 at 9:09am
We must release next version within 3 weeks. Please  wait a little.

-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net