[Cxxgui-devel] Introduction, Menus, and General Design Question
Brought to you by:
davidturner
From: David H. <dl...@st...> - 2004-09-12 03:02:27
|
Hi, I just recently discovered this --mostly inactive--project and I thought I'd like to help breathe a little life into it. Anyway, my skill set isn't amazing, I know c++ ok, but the only GUI toolkit I really know is wxWidgets, which offends my sense of rightness with all the heavy macro use and such. I'm generally a quick learner, and have access to Windows, Mingw, and soon Linux with gtk and gcc. Anyway, so I thought my first project would be menus, under win32 for now, and this is the usage I've conjured up (I've written the interface for it and the beginnings of the win32 impl as well): using namespace gui; window win("Test"); menu mn; win.contain(mn); mn.append( menu("File").append(menu("New").append(menu_item("Picture",boost::bind(on_new_picture,win))) .append(menu_item("Document",boost::bind(on_new_document,win))) ) .append(menu_item("Open...",boost::bind(on_open,win))) .append(menu_item("Save",boost::bind(on_save,win))) .append(separator()) .append(menu_item("Close",boost::bind(on_close,win))) .append(menu_item("Exit",boost::bind(on_exit,win))) ) .append( menu("Edit").append(menu_item("Cut",boost::bind(on_cut,win))) .append(menu_item("Copy",boost::bind(on_copy,win))) .append(menu_item("Paste",boost::bind(on_paste,win))) ); I personally like the append chaining, but if it's generally not liked, I'll drop it. But I have an implementation question (assuming that this method is acceptable): Should I go ahead and add some kind of set (or maybe even map?) of Callback ids to signals in the window implementation? or maybe just a deque? Finally, there seems to be rather schizophrenic support for std::string and std::wstring: it's in the win32 implementation code, but not in the interface code (e.g. labels on buttons). Is there a reason for this? David Hall |