Hi lijian,

this is because the ComboBox is a control combined by many other
controls: edit, listbox, ...

There is an extra inner edit that has the focus and gets the normal
events. That's why your derived edit doesn't get the events, because it
is not derived from the inner edit.

You can use long Window::PreNotify( NotifyEvent& ) to get the event
before it's passed to the "normal" event handler, and you can even catch it.

With long Window::Notify( NotifyEvent& ) you get it after it was handled
in the normal event handler.

(Pre)Notify bubbles up the window hierarchy, until some implementation
returns something != 0, which means the event was catched/handled and
shouldn't bubble anymore.

If you don't handle it, make sure to call the base class.

See svtools/source/edit/svmedit.cxx as an example.

HTH,
Malte.



lijian wrote, On 11/12/09 06:57:
> Hi all,
> 
> I am working on writer now, and I came accross a problem.
> Truly hope to get help from here.
> 
> I newed a dialog which contains a ComboBox in writer.
> I want to do some special keyinput operations for the ComboBox.
> So I derived a control from ComboBox named SwEncloseComboBox,
> and override the virtual method ::KeyInput of ComboBox which is 
> derived from class Edit.
> 
> This question is : When I do KeyInput, the method SwEncloseComboBox::KeyInput
> will not be called. But the method Edit::KeyInput will be directly called.
> I don't know why. 
> 
> And I found that the method keyinput of all ComboBox derivations in writer 
> didn't 
> work at all. But KeyInput of the derivations of class Edit works all right.
> 
> Hope somebody can help me. I am really need to implement this keyinput for 
> SwEncloseComboBox. 
> 
> Thank you very much in advance and looking forward to your help.
> 
> regards,
> 2009-11-12 
> 
> 
> 
> lijian 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to