Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » Add Ctrls to ArrayCtrl
Add Ctrls to ArrayCtrl [message #20069] Mon, 16 February 2009 09:59 Go to next message
MatthiasG is currently offline  MatthiasG
Messages: 27
Registered: January 2008
Location: Germany
Promising Member
Hello,

i have a class derived from ParentCtrl, consisting of a button and a few EditStrings. I want this to show up in a column of an ArrayCtrl. In my ArrayCtrl i did the following:

	array.AddColumn ("Column1", 1).Ctrls<MyLayout>();
	array.Add();
	array.Add();


At first, it seemed to work, my Ctrl is showing in the ArrayCtrl, but it seems that it is eating all mouse-events. No Mousewheel is possible, and no rmb menu is showing up.
What can i do, to make this work?

greetings,
Matthias
Re: Add Ctrls to ArrayCtrl [message #20071 is a reply to message #20069] Mon, 16 February 2009 10:51 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
MatthiasG wrote on Mon, 16 February 2009 03:59

Hello,

i have a class derived from ParentCtrl, consisting of a button and a few EditStrings. I want this to show up in a column of an ArrayCtrl. In my ArrayCtrl i did the following:

	array.AddColumn ("Column1", 1).Ctrls<MyLayout>();
	array.Add();
	array.Add();


At first, it seemed to work, my Ctrl is showing in the ArrayCtrl, but it seems that it is eating all mouse-events. No Mousewheel is possible, and no rmb menu is showing up.
What can i do, to make this work?

greetings,
Matthias



Err, and what have you expected? U++ delivers mouse events to widget with mouse pointer.

However, MyLayout suggests that it is in fact some sort of minidialog. There is magic "IgnoreMouse" modifier that will deliver the mouse events to parent widget. Maybe if you activate this for your layout ParentCtrl, you will get what you desire. You can use IgnoreMouse for any Ctrl, but of course, ignoring mouse inputs is not always what you want to achieve.

Mirek
Re: Add Ctrls to ArrayCtrl [message #20072 is a reply to message #20071] Mon, 16 February 2009 10:52 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
P.S.: Alternative, still possible method is to filter mouse events and reroute to parent - but in that case, you need not to forget to actually convert Point to target. The best way how to use it is via converting to screen coordinates and back to view coordinates.
Re: Add Ctrls to ArrayCtrl [message #20146 is a reply to message #20069] Sat, 21 February 2009 21:50 Go to previous message
MatthiasG is currently offline  MatthiasG
Messages: 27
Registered: January 2008
Location: Germany
Promising Member
Hello, an thank you for your answer.

I came up with the following in my main class:

	
void ChildMouseEvent (Ctrl *child, int event, Point p, int zdelta, dword keyflags) {
    if (event == MOUSEWHEEL && array.HasChildDeep(child) == true) {
        array.MouseWheel(p, zdelta, keyflags);			
    }
}


seems to work so far...

greetings,
Matthias
Previous Topic: AcceptRow broken when SetCtrl is used
Next Topic: Assertion in GridCtrl on Linux
Goto Forum:
  


Current Time: Sun Apr 28 23:57:01 CEST 2024

Total time taken to generate the page: 0.05971 seconds