Home » U++ TheIDE » U++ TheIDE: Other Features Wishlist and/or Bugs » Ctrl * GetCallbackCtrl()
Re: Ctrl * GetCallbackCtrl() [message #6193 is a reply to message #6121] |
Thu, 02 November 2006 09:36   |
|
Ok, it's not so perfect... Because if I change cursor in ChildGotFocus for edits the cursor change its place immediately on left click. For rest of controls cursor change place in WhenAction routine and it happens mostly on left mouse up.
Anyway I patched a little bit CtrlCore and I hope you'll accept this. What I've done is:
CtrlCore.h : Ctrl class
virtual void ChildMouseAction(Ctrl * ctrl, int event, Point p) {}
CtrlMouse.cpp
Image Ctrl::DispatchMouseEvent(int e, Point p, int zd) {
if(!IsEnabled())
return Image::Arrow();
if(captureCtrl && captureCtrl != this && captureCtrl->IsMouseActive())
return captureCtrl->MEvent0(e, p + GetScreenRect().TopLeft() -
captureCtrl->GetScreenRect().TopLeft(), zd);
Ctrl *top = this;
if(e == MOUSEWHEEL && !GetParent()) {
Ctrl *w = GetFocusCtrl();
if(w) {
top = w->GetTopCtrl();
p = GetMousePos() - top->GetScreenRect().TopLeft();
}
}
Ctrl *q = top->ChildFromPoint(p);
if(parent)
parent->ChildMouseAction(q, e, p);
return q ? q->DispatchMouseEvent(e, p, zd) : top->MEvent0(e, p, zd);
}
This line was added:
if(parent) parent->ChildMouseAction(q, e, p);
With such a simple modification I can override ChildMouseActtion in my grid ctrl and has control over mouse events before they go to any child contol.
What do you think about it?
|
|
|
 |
|
Ctrl * GetCallbackCtrl()
By: unodgs on Tue, 31 October 2006 08:56
|
 |
|
Re: Ctrl * GetCallbackCtrl()
By: mirek on Tue, 31 October 2006 11:34
|
 |
|
Re: Ctrl * GetCallbackCtrl()
By: unodgs on Tue, 31 October 2006 13:08
|
 |
|
Re: Ctrl * GetCallbackCtrl()
By: mirek on Tue, 31 October 2006 13:20
|
 |
|
Re: Ctrl * GetCallbackCtrl()
By: unodgs on Tue, 31 October 2006 13:46
|
 |
|
Re: Ctrl * GetCallbackCtrl()
By: unodgs on Tue, 31 October 2006 14:01
|
 |
|
Re: Ctrl * GetCallbackCtrl()
By: unodgs on Thu, 02 November 2006 09:36
|
 |
|
Re: Ctrl * GetCallbackCtrl()
By: unodgs on Thu, 02 November 2006 09:41
|
 |
|
Re: Ctrl * GetCallbackCtrl()
By: mirek on Thu, 02 November 2006 14:39
|
 |
|
Re: Ctrl * GetCallbackCtrl()
By: unodgs on Thu, 02 November 2006 14:51
|
 |
|
Re: Ctrl * GetCallbackCtrl()
By: mirek on Thu, 02 November 2006 14:55
|
 |
|
Re: Ctrl * GetCallbackCtrl()
By: unodgs on Thu, 02 November 2006 15:11
|
 |
|
Re: Ctrl * GetCallbackCtrl()
By: mirek on Thu, 02 November 2006 15:15
|
 |
|
Re: Ctrl * GetCallbackCtrl()
By: unodgs on Thu, 02 November 2006 15:52
|
 |
|
Re: Ctrl * GetCallbackCtrl()
By: unodgs on Thu, 02 November 2006 22:48
|
 |
|
Re: Ctrl * GetCallbackCtrl()
By: mirek on Thu, 02 November 2006 22:54
|
 |
|
Re: Ctrl * GetCallbackCtrl()
By: unodgs on Thu, 02 November 2006 23:08
|
Goto Forum:
Current Time: Sat Aug 16 22:43:27 CEST 2025
Total time taken to generate the page: 0.04883 seconds
|