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 » 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 Go to previous messageGo to previous message
Mindtraveller is currently offline  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.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: App crashes when remove rows in WhenChangeRow-callback
Next Topic: Problem - GridCtrl::Get(int,int) with DropTree
Goto Forum:
  


Current Time: Mon May 06 08:44:26 CEST 2024

Total time taken to generate the page: 0.03620 seconds