Bolding Task Panel Iems |
Post Reply |
Author | |
DougW
Newbie Joined: 03 March 2004 Location: United States Status: Offline Points: 8 |
Post Options
Thanks(0)
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
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Try to call m_wnTaskPanel.Reposition() after SetBold();
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
DougW
Newbie Joined: 03 March 2004 Location: United States Status: Offline Points: 8 |
Post Options
Thanks(0)
|
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. |
|
DougW
Newbie Joined: 03 March 2004 Location: United States Status: Offline Points: 8 |
Post Options
Thanks(0)
|
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.
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Ok, agree. I sended fix to email.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
DougW
Newbie Joined: 03 March 2004 Location: United States Status: Offline Points: 8 |
Post Options
Thanks(0)
|
Yeah!!! It works! Thanks Oleg!
|
|
studioars
Newbie Joined: 17 March 2004 Status: Offline Points: 1 |
Post Options
Thanks(0)
|
Please, can you send me that fix besause I have the same problem Thanks |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
We must release next version within 3 weeks. Please wait a little.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |