Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » Is it possible to ebmed Ctrl into row (not cell) inside ArrayCtrl?
|
|
Re: Is it possible to ebmed Ctrl into row (not cell) inside ArrayCtrl? [message #26345 is a reply to message #26343] |
Mon, 26 April 2010 13:45 |
Mindtraveller
Messages: 917 Registered: August 2007 Location: Russia, Moscow rgn.
|
Experienced Contributor |
|
|
mrjt, thank you very much for quick answer. But I'm afraid your example is not exactly what I wanted.
I try to embed Ctrl on regular basis (not as editing Ctrl, but as Ctrl that is seen even if row is not selected/edited). So I changed your example a bit to use ArrayCtrl::SetCtrl() instead of ArrayCtrl::Column::Edit().
#include <CtrlLib/CtrlLib.h>
using namespace Upp;
template <class T>
struct WithForcedHorz : public T
{
virtual void Layout() {
Rect r = GetRect();
Size sz = 300;
SetRect(0,2,300,r.Height());
T::Layout();
}
};
GUI_APP_MAIN
{
TopWindow wnd;
ArrayCtrl ctrl;
WithForcedHorz<DropList> list[9];
ctrl.AddColumn("Item");
ctrl.AddColumn("Data");
for (int i = 0; i < 9; i++) {
String s = Format("Item %d", i+1);
ctrl.Add(s, i);
ctrl.SetCtrl(i, 0, list[i]);
ctrl.SetLineCy(i, list[i].GetRect().Height()+2);
}
wnd << ctrl.SizePos();
wnd.SetRect(Size(300, 400));
wnd.CenterScreen().Sizeable();
wnd.Run();
}
And it looks like embedded control is cropped by cell ractangle (that is in fact good behaviour). It looks like there is no way to embed Ctrl this way, so I'll try to set custom Display for my row and emulate needed control.
|
|
|
|
|
|
Goto Forum:
Current Time: Sat Sep 21 06:30:48 CEST 2024
Total time taken to generate the page: 0.02908 seconds
|