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 #26343 is a reply to message #26340] Mon, 26 April 2010 11:51 Go to previous messageGo to previous message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
#include <CtrlLib/CtrlLib.h>
using namespace Upp;

template <class T>
struct WithForcedHorz : public T
{
	virtual void Layout() {
		Rect r = GetRect();
		Size sz = GetParent()->GetSize();
		r.right = sz.cx - r.left;
		SetRect(r);
		T::Layout();
	}
};

GUI_APP_MAIN
{
	TopWindow wnd;
	ArrayCtrl ctrl;
	WithForcedHorz<DropList> list;
	
	ctrl.AddColumn("Item").Edit(list);
	ctrl.AddColumn("Data");
	for (int i = 0; i < 9; i++) {
		String s = Format("Item %d", i+1);
		ctrl.Add(s, i);
		list.Add(s, s);
	}
	wnd << ctrl.SizePos();
	wnd.SetRect(Size(300, 400));
	wnd.CenterScreen().Sizeable();
	wnd.Run();	
}

Easy Smile
 
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: Sun Jun 16 08:00:13 CEST 2024

Total time taken to generate the page: 0.02274 seconds