|
|
Label can't be edited by clicking |
|
Author |
Message |
fredtrai

|
Posted: Wed Nov 09 09:06:23 CST 2005 |
Top |
MFC >> Label can't be edited by clicking
This is a multi-part message in MIME format.
------=_NextPart_000_00AA_01C5E551.3C9449B0
Content-Type: text/plain;
charset="gb2312"
Content-Transfer-Encoding: quoted-printable
Hi:
I wonder In what conditions tree items can not be edited through =
clicking the label of that item?
I didn't intercept any mouse click message, and the ctrl also has the =
TVS_EDITLABELS style, but when I click the item label the break point in =
OnBeginlabeledit(...) doesn't reached.=20
------=_NextPart_000_00AA_01C5E551.3C9449B0
Content-Type: text/html;
charset="gb2312"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dgb2312">
<META content=3D"MSHTML 6.00.2600.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#c0c0c0>
<DIV><FONT size=3D2>Hi:</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV>I wonder In what conditions tree items can not be edited through =
clicking=20
the label of that item?<BR><BR>I didn't intercept any mouse click =
message, and=20
the ctrl also has the TVS_EDITLABELS style, but when I click the item =
label the=20
break point in <B>OnBeginlabeledit(...)</B> doesn't reached.=20
<BR></DIV></BODY></HTML>
------=_NextPart_000_00AA_01C5E551.3C9449B0--
Visual Studio196
|
|
|
|
 |
Tom

|
Posted: Wed Nov 09 09:06:23 CST 2005 |
Top |
|
|
 |
LiYS

|
Posted: Thu Nov 10 02:19:17 CST 2005 |
Top |
MFC >> Label can't be edited by clicking
> Sometimes it's a little tricky (as you may have noticed with Explorer) to
do
> this with clicking. You have to click on the item, hesitate, then click
> again. That's why most people put a right click menu with something like
> "Rename" or "Edit" and pump the message directly. It sounds like you're
> doing it right from your description:
>
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html
/_core_tree_control_label_editing.asp
>
>
http://www.codeguru.com/Cpp/controls/treeview/editinglabels/article.php/c639
/
>
> http://www.codeproject.com/treectrl/TreeEditorPackage.asp
>
>
> Tom
>
> Tom
> Hi:
>
> I wonder In what conditions tree items can not be edited through clicking
> the label of that item?
>
> I didn't intercept any mouse click message, and the ctrl also has the
> TVS_EDITLABELS style, but when I click the item label the break point in
> OnBeginlabeledit(...) doesn't reached.
>
>
Who will thought Tree::OnTimer() is the criminal, I finally solved the
problem by adding OnTimer() call to Tree's parent class(CTreeCtrl). Doing so
will let the tree ctrl get the chance to handle OnTimer(), because the
process of label edit involves little "idle time", that's after you first
click the tree item's label, So in the wrong case I took this "idle time"
and stop tree ctrl from handling subsequent process inside
CTreeCtrl::OnTimer(), at lease I believe so.
|
|
|
|
 |
Tom

|
Posted: Thu Nov 10 09:05:45 CST 2005 |
Top |
MFC >> Label can't be edited by clicking
Hi LiYS,
I was just going to suggest that this morning and you're right. Otherwise
it would get confused with a double click.
Congrats on getting it to work.
Tom
>
> Who will thought Tree::OnTimer() is the criminal, I finally solved the
> problem by adding OnTimer() call to Tree's parent class(CTreeCtrl). Doing
> so
> will let the tree ctrl get the chance to handle OnTimer(), because the
> process of label edit involves little "idle time", that's after you first
> click the tree item's label, So in the wrong case I took this "idle time"
> and stop tree ctrl from handling subsequent process inside
> CTreeCtrl::OnTimer(), at lease I believe so.
>
>
|
|
|
|
 |
LiYS

|
Posted: Thu Nov 10 19:33:17 CST 2005 |
Top |
MFC >> Label can't be edited by clicking
> Hi LiYS,
>
> I was just going to suggest that this morning and you're right. Otherwise
> it would get confused with a double click.
>
> Congrats on getting it to work.
>
Thanks Tom, actually I solve the problem in a extreme but efficient way, in
which I comment out all the message map entries in my Tree class, and get it
up and running, I was shocked to see problem get fixed. I thought I was
going to solve the problem by initiate EditLabel() manually.
Later, I uncommented those message map entry one by one to see which one is
making the trouble, luckily ON_WM_TIMER() was at the very bottom and when I
just begin from bottom. So...
|
|
|
|
 |
Tom

|
Posted: Fri Nov 11 09:40:24 CST 2005 |
Top |
MFC >> Label can't be edited by clicking
Is debugging and "art" or what? Sometimes the old comment and uncomment
method works as well as anything. This is especially true of some of the
MFC things that actually generate a lot of code at compile time that you
never really get to see.
:o)
Tom
> Later, I uncommented those message map entry one by one to see which one
> is
> making the trouble, luckily ON_WM_TIMER() was at the very bottom and when
> I
> just begin from bottom. So...
|
|
|
|
 |
|
|