when using this code the error generated tell me that i IDC_IPEDIT is undeclared variable
and when declare it as unsigned integer a warning tell me that i used IDC_IPEDIT without initiate it
how can override that?
If you wish the parent and the CMyListCtrl to process the LVN_ENDLABELEDIT
Posted by digwizf18
on 02/03/2005 04:00pm
ON_NOTIFY_REFLECT_EX returns a BOOl value. If
you return FALSE in CMyListCtrl::OnEndLabelEdit,
the parent dialog's OnEndLabelEdit will also be
invoked. This is useful if you have a resusable list control and you need to notify the parent dialogue to do something when the data changes.
Perhaps the parent dialogue is using the CMyListCtrl and needs to update some global
variable states when the user enters new data. The list control shouldn't need to worry about how it is used. It is simply providing the basic
capabilities. It could be the parents job to
insert, remove, delete items from the control or extract information to save in some other global data structure or something. So in the parent you also setup handling of the LVN_ENDLABELEDIT
just as was done for the CMyListCtrl except that you use ON_NOTIFY instead of
ON_NOTIFY_REFLECT_EX. Write the code for that handler to do whatever is necessary. In the CMyListCtrl, simply add a return value of FALSE to allow the parent's handler to be called after the CMyListCtrl finishes.
If you are haveing a problem with an inactive ComboBox here is one solution. Detemine if the mouse is
clicked whithin the rect of the combobox. If it is I set the focus to another control in the dialog and
then set the focus back to the combobox.
// Under Win95 the combobox does not drop down if the user has clicked in the
// list control. Setting focus to the OK button first corrects the problem
... i am trying to use this implementation with full row select code i got from a microsoft example several
things seem to be working ok, except as soon as i click on a "subitem" i am given the edit
control. i.e. i don't have to click twice, like on the main item.
i am pretty sure the problem lies in the OnLButtonDown() routine. i tried moving the line:
to the end of the routine, rather than at the top, but the effect that has is to let me edit the main
item immediately when i click on the row.
If an Edit box in the list control has the focus and then the focus is sent to a drop down combobox (via the
mouse), the combobox won't drop down or receive any mouse input. I've spent a fair amount of time trying to
resolve the problem but haven't been very successful. Strangely enough this problem doesn't seem to exist
I'm taking this a step further and adding column definitions
that allow an LButton down do one of 3 things. Edit the field
using an edit box, edit the field using a drop list or
not allowing an edit on the box.
Suprisingly, the last case (not allowing an edit) is not working.
At the point where you would normally call EditSubLabel(), I do
nothing. Unfortunately, MFC gets in the way, and does the standard
field edit action (ie bring up an edit for the first column). I'm
stumped on how to stop this behavior. For this implementation, you
need the LVS_EDITLABELS flag defined, so I can't just remove the
attribute. I can't see what the CInPlaceEdit and CInPlaceList classes
are doing to stop it from happening when an edit is done using one of