BUG: CXTTreeView on label edits |
Post Reply |
Author | |
Unormal
Newbie Joined: 12 November 2003 Location: United States Status: Offline Points: 8 |
Post Options
Thanks(0)
Posted: 24 February 2004 at 3:03pm |
If you do something like the code below, inserting an item with a label, but then immediately firing on an editlabel, you can actually see the old label behind the box in which you are typing the new label, when the new label is short enough that the old text can poke out to the right. Minor, but definitly a buglet.
insert.hParent = ItemID;
|
|
Unormal
Newbie Joined: 12 November 2003 Location: United States Status: Offline Points: 8 |
Post Options
Thanks(0)
|
This bug still appears in 8.70!
|
|
MacW
Senior Member Joined: 26 June 2007 Status: Offline Points: 253 |
Post Options
Thanks(0)
|
Still the same problem in the 12.0.0
Will there ever be a fix for this, Oleg? |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
I can't reproduce it. :(
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
MacW
Senior Member Joined: 26 June 2007 Status: Offline Points: 253 |
Post Options
Thanks(0)
|
I can reproduce it here any time:
It happens when the text displayed in the editor window is shorter than the text displayed by the label. I use GetDispInfo to display the labels with some additional dynamic information (the (3/19)), and when the user edits the label, I set the "real" text. |
|
MacW
Senior Member Joined: 26 June 2007 Status: Offline Points: 253 |
Post Options
Thanks(0)
|
Hi, Oleg
any news on this? I can reproduce it at will here. |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Please attach sample.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
MacW
Senior Member Joined: 26 June 2007 Status: Offline Points: 253 |
Post Options
Thanks(0)
|
Hi, Oleg
no sample needed. Just call EditLabel() on a tree item in an CXTTreeCtrl-derived class which also uses GetDispInfo to dynamically supply the label text. Catch the TVN_BEGINLABELEDIT and set a shorter text than the current text in the label (what the user can edit must not be the same what is displayed later in the tree). E.g. The label currently shows "Some longer label" and in BeginEdit you set the text "Test" for the label. This produces the effect I mentioned. |
|
MacW
Senior Member Joined: 26 June 2007 Status: Offline Points: 253 |
Post Options
Thanks(0)
|
Hi, Oleg
any news on this? This bugs me every day. |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi, Still waiting your sample.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
MacW
Senior Member Joined: 26 June 2007 Status: Offline Points: 253 |
Post Options
Thanks(0)
|
Oleg,
as I wrote, there is no need for a sample. I outlined the steps to reproduce several replies ago. |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
And I wrote few replies ago that can't reproduce it.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
MacW
Senior Member Joined: 26 June 2007 Status: Offline Points: 253 |
Post Options
Thanks(0)
|
Oleg, this is clearly a bug in your code.
I just don't have the time in this project to create sample applications for you. If you carry out the steps I mentioned the problem will show. I have lost a half day today again because of the documentation of XTP is misleading, plain wrong or just not existing. I'm working against tight timelines here. If you attach the test app you have used trying to repro this bug I can look it over. Just catch TVN_BEGINLABELEDIT in your code and set a shorter text than currently in the edit control. |
|
MacW
Senior Member Joined: 26 June 2007 Status: Offline Points: 253 |
Post Options
Thanks(0)
|
If the text in the tree label was longer than "a" before, you will see the effect. |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
MacW
Senior Member Joined: 26 June 2007 Status: Offline Points: 253 |
Post Options
Thanks(0)
|
Hi, Oleg
Yes, I can repro this bug in your sample. I just added an "OnBeginEdit" and set a label text shorter than what's in the tree. See screen shot. I've also attached the two modified files. uploads/20081212_114151_TreeCtrl_upd.zip |
|
MacW
Senior Member Joined: 26 June 2007 Status: Offline Points: 253 |
Post Options
Thanks(0)
|
SOLVED
If you override OnBeginLabelEdit in a class derived from XTPTreeBase you need to set the member variable m_htiEdit to the HTREEITEM of the item that is currently edited. Codejock uses this member to determine if they paint the tree item in the normal colors or just plain white. If the tree background color is not white the text drawn by the codejock tree control shows outside of the edit control created by the Windows tree control. If the text set in OnBeginLabelEdit is shorter than the text in the tree control. If m_htiEdit is set to a HTREEITEM the OnPaint method in XTPTreeCtrl will not use the background color of the tree but white, which makes the extra text invisible next to the edit control. Codejock should change the test in OnPaint to use m_pTreeCtrl->GetEditControl() to determine how to paint the tree text and not rely on the member variable m_htiEdit which is internal to Codejock and cannot be relied on. |
|
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 |