#include <CtrlLib/CtrlLib.h> using namespace Upp; class App : public TopWindow { typedef App CLASSNAME; ArrayCtrl array; Button btn; //this will remove all ArrayCtrl rows if last row selected: void RemoveArrSel() { array.RemoveSelection(); } public: App() { array.AddColumn("some data"); for(int i = 1; i < 51; i++) array.Add(FormatIntRoman(i, true)); SetRect(0, 0, 300, 300); Add(array.HSizePos().TopPos(0, 170)); btn.SetLabel("remove selected"); Add(btn.HCenterPos(100).BottomPos(4)); btn.WhenAction = THISBACK(RemoveArrSel); } }; GUI_APP_MAIN { App().Run(); }
Report message to a moderator
void RemoveArrSel() { static bool inFunction; if (inFunction) return; inFunction = true; array.RemoveSelection(); inFunction = false; }