#include using namespace Upp; #define LAYOUTFILE #include class DropListBug : public WithDropListBugLayout { private: char chr; public: typedef DropListBug CLASSNAME; DropListBug() { chr = 'a'; CtrlLayout(*this, "Window title"); addButton <<= THISBACK(AddButtonClicked); removeButton <<= THISBACK(RemoveButtonClicked); } void AddButtonClicked() { dropList.Add(String().Cat() << chr++); dropList.SetIndex(dropList.GetCount() - 1); } void RemoveButtonClicked() { if (dropList.GetCount() == 0) return; dropList.Remove(dropList.GetIndex()); } }; GUI_APP_MAIN { DropListBug().Run(); }