#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(); }
Report message to a moderator