
Hi, Considering the fact that some of the Boosters work on the GUI library, I would like to throw something to the mix: http://cpptk.sourceforge.net/ This library uses some template techniques, especially in those places where GUI integrates with C++ (callbacks, variable binding, etc.). As a result, the library is highly generic, uses some of the Boost, should be compatible the rest of Boost and may benefit from further "boostification". Anyway - please note that the concepts used in this library (well, and in Tcl/Tk which is used as an underlying engine) are very different from what normally comes to mind when we think "GUI programming". In particular, this library is not object-based and does not use RAII at all (apart from a couple of places which are not related to GUI), but somehow still manages to "keep the shape". It may help to put some things in perspective. Your comments are welcome, -- Maciej Sobczak : http://www.msobczak.com/ Programming : http://www.msobczak.com/prog/

Hello all,
Considering the fact that some of the Boosters work on the GUI library, I would like to throw something to the mix:
I wasn't aware that some people here were into GUI work! In that case I'd like to gauge interest in my work: http://developers.slashdot.org/article.pl?sid=04/10/18/1118242 and the homepage at http://www.litwindow.com/library This is a two part library. The base part is UI independent while the second part aims at reducing the work for UI coding. I was about to prepare an announcement for the base part because it might be of interest even to non-gui programming, but am jumping the gun here. An official announcement will follow soon. The base part contains "data adapters" and a (very) simple constraints solver. "Data adapters" is a small, portable "reflections" or extended runtime type information like mechanism for C++. It is a bit simpler to use than other such mechanisms I've seen. If you've got this struct struct SomeSettings { int m_aMember; SomeOtherStruct m_struct; vector<string> m_strings; }; the neccessary data adapter definition which you must include in a source file looks like this IMPLEMENT_CONTAINER_ADAPTER(vector<string>) BEGIN_DATA_ADAPTER(SomeSettings) PROP(m_aMember) PROP(m_struct) PROP(m_strings) END_DATA_ADAPTER() Note these things: It supports containers, you do not have to repeat any type information and you do not have to modify the original struct definition, which allows using foreign data definitions. To use it: SomeSettings aVariable; aggregate a=make_aggregate(aVariable); cout << a["m_struct"].to_string(); container c=a["m_strings"].get_container(); // do stuff with the container Initial documentation is http://www.litwindow.com/lwl/doc/html/group__data__adapters__howto.html Some code is at http://cvs.sourceforge.net/viewcvs.py/litwindow/litwindow/lwbase/include/litwindow/dataadapter.h?rev=1.2&view=markup and http://cvs.sourceforge.net/viewcvs.py/litwindow/litwindow/lwbase/src/dataadapterimp.cpp?rev=1.2&view=markup (look for accessor_as_debug) still under development but already somewhat mature (> 1year) The second part of the library aims at reducing GUI coding by a factor of 10 (if anyone has a better catch phrase, please let me know). It introduces a generic "mediator" object, enhances widgets of an existing UI framework and lets a programmer use rules (predicates) to code UI dependencies. http://www.litwindow.com/library contains several links to an overview, FAQ and further reading. I welcome any comments and thoughts you might have. Best regards and thank you for your interest Hajo Kirchhoff -------------------------------------------- Lit Window Library - Speed up GUI coding 10x http://www.litwindow.com/library?src=ml wxVisualSetup - integrate wxWidgets into Visual Studio .NET http://www.litwindow.com/Products/products.html?src=ml BugLister - Defect Tracker http://www.litwindow.com/buglister?src=ml Tips & Tricks for wxWidgets & MS Visual Studio http://www.litwindow.com/Knowhow/knowhow.html?src=ml

struct SomeSettings { int m_aMember; SomeOtherStruct m_struct; vector<string> m_strings; };
the neccessary data adapter definition which you must include in a source file looks like this
IMPLEMENT_CONTAINER_ADAPTER(vector<string>)
BEGIN_DATA_ADAPTER(SomeSettings) PROP(m_aMember) PROP(m_struct) PROP(m_strings) END_DATA_ADAPTER()
Sure thing, but how about *true* bindings? http://www.torjo.com/win32gui/save_dlg.html (if you download the code, you'll find quite a few examples: examples/smart_dialogs) Note that you can add correspondences directly to your data + validation code (no macros whatsoever). Best, John -- John Torjo, Contributing editor, C/C++ Users Journal -- "Win32 GUI Generics" -- generics & GUI do mix, after all -- http://www.torjo.com/win32gui/ -- v1.5 - tooltips at your fingertips (work for menus too!) + bitmap buttons (work for MessageBox too!) + tab dialogs, hyper links, lite html

Hi John, John Torjo wrote:
BEGIN_DATA_ADAPTER(SomeSettings) PROP(m_aMember) PROP(m_struct) PROP(m_strings) END_DATA_ADAPTER()
Sure thing, but how about *true* bindings? http://www.torjo.com/win32gui/save_dlg.html
you are missing my point. I want a higher level of abstraction. win32gui is nice if you have a simple 1:1 binding for a struct - dialog scenario. But it will kill you if you have a frame window with a notebook as a client, several notebook pages with splitter windows, list boxes forms etc... I don't think I would like to do that using your 'save_dlg' setting. You need a way to break it up into small, manageable parcels. The Lit Window Library (http://www.litwindow.com/library) also lets you specify complex bindings that evaluate C++ expressions: Frame.Title = "Headline: " + myStruct.m_title The framework reevaluates Frame.Title everytime myStruct.m_title changes. The data abstraction layer requires some macros, which btw are using templates and are type save, but allows you to do more than simple 1:1 binding. I've written a new article explaining the interface. A behind the scenes look will follow shortly: http://www.litwindow.com/Library/Articles/rapidui_article_3.htm
Note that you can add correspondences directly to your data + validation code (no macros whatsoever).
While I don't like macros, I don't want to add them directly for bigger dialogues. It messes up my code. But your win32gui is interesting. Regards Hajo

Hajo Kirchhoff wrote:
Hi John, http://www.litwindow.com/Library/Articles/rapidui_article_3.htm
Note that you can add correspondences directly to your data + validation code (no macros whatsoever).
While I don't like macros, I don't want to add them directly for bigger dialogues. It messes up my code.
Err, I meant to say, While I don't like having to use macros for my data abstraction layer, I don't want to add Johns "correspondences" directly to my data for bigger dialogues. It messes up my code. Regards Hajo

you are missing my point. I want a higher level of abstraction.
win32gui is nice if you have a simple 1:1 binding for a struct - dialog scenario. But it will kill you if you have a frame window with a notebook as a client, several notebook pages with splitter windows, list boxes forms etc...
Really? Why?
I don't think I would like to do that using your 'save_dlg' setting. You need a way to break it up into small, manageable parcels.
And how is that not broken up into small parcels? (side-note: a dialog can contain sub-dialogs, each subdialog showing small pieces of information)
The Lit Window Library (http://www.litwindow.com/library) also lets you specify complex bindings that evaluate C++ expressions:
Frame.Title = "Headline: " + myStruct.m_title
Really? That's very unflexible if you ask me. You see everything as scripting. In fact, I see very little as scripting. You should note that you lose a lot of C++'s power if you switch to scrpting. And just for fun, you can accomplish the above using save_dlg, very easy: std::string headline(const your_struct & val) { return "Headline: " + val.m_title; } When creating the corresp. class, simply say: add_corresp( &headline, ID_whatever_field);
The data abstraction layer requires some macros, which btw are using templates and are type save, but allows you to do more than simple 1:1 binding.
Show me real examples where this makes sense. And let me repeat: - the 1:1 is a current limitation - you can work around it. And more to the point, where do you do validation? I don't see it anywhere in code. Best, John -- John Torjo, Contributing editor, C/C++ Users Journal -- "Win32 GUI Generics" -- generics & GUI do mix, after all -- http://www.torjo.com/win32gui/ -- v1.5 - tooltips at your fingertips (work for menus too!) + bitmap buttons (work for MessageBox too!) + tab dialogs, hyper links, lite html

The data abstraction layer requires some macros, which btw are using templates and are type save, but allows you to do more than simple 1:1 binding.
I've written a new article explaining the interface. A behind the scenes look will follow shortly:
http://www.litwindow.com/Library/Articles/rapidui_article_3.htm
This sounds very nice in theory... ... But, please implement this: A dialog with - two edit boxes (width and height) - a check box (maintain_ratio) If maintain_ratio is checked, whatever is typed on width is synchronized with height, and vice versa (they preserve the original ratio). If maintain_ration is not checked, witdh and height can be modified independent of each-other. Best, John -- John Torjo, Contributing editor, C/C++ Users Journal -- "Win32 GUI Generics" -- generics & GUI do mix, after all -- http://www.torjo.com/win32gui/ -- v1.5 - tooltips at your fingertips (work for menus too!) + bitmap buttons (work for MessageBox too!) + tab dialogs, hyper links, lite html

John Torjo wrote:
Hajo Kirchhoff wrote:
I've written a new article explaining the interface. A behind the scenes look will follow shortly:
http://www.litwindow.com/Library/Articles/rapidui_article_3.htm
This sounds very nice in theory...
This is not a theory. Download the project, build it and try it yourself.
... But, please implement this: A dialog with - two edit boxes (width and height) - a check box (maintain_ratio)
If maintain_ratio is checked, whatever is typed on width is synchronized with height, and vice versa (they preserve the original ratio).
If maintain_ration is not checked, witdh and height can be modified independent of each-other.
This exists today in version 0.3.1: // please unwrap these lines BEGIN_RULES(dialog) RULE("eb_height.value", if_else(make_expr<bool>("cb_maintain_ratio.value"), make_expr<wxString>("eb_width.value"), make_expr<wxString>("eb_height.value")) RULE("eb_width.value", if_else(make_expr<bool>("cb_maintain_ratio.value"), make_expr<wxString>("eb_height.value"), make_expr<wxString>("eb_width.value")) END_RULES() It looks complicated because I am using C++ templates to specify rules that are lazily linked and evaluated only when a widget or data element changes its value. As the parser and named rules will be implemented next, the following will work next year... rule_editboxes { eb_height.value <=> eb_width.value // two way rule } rule_editboxes.enabled = cb_maintain_ratio.value The first rule links the edit boxes. The second rule enables the first rule when the checkbox is checked and disables when it is not checked. I don't have the time to write the example you suggest now, although it is a nice example. But perhaps the other two samples I've written already will suffice. Contained in the project (http://www.litwindow.com/library) you will find... The generic sample has a radiobox and an editcontrol. Whenever you change the radiobox, the value in the editcontrol gets updated and vice versa. The RssReader sample links a couple of listboxes and an html window together. When the user changes the selection of the rss channels list box, the headlines list box is updated automatically. When the user selects a different headline, the news item html window is updated automatically. Rules are headlines_listbox.items = channels_listbox.current.m_headlines newsitem_htmlwin.page = headlines_listbox.current.m_page Regards and thanks for sharing your thoughts. Hajo Kirchhoff http://www.litwindow.com/library

Hajo Kirchhoff wrote:
Hello all,
Considering the fact that some of the Boosters work on the GUI library, I would like to throw something to the mix:
I wasn't aware that some people here were into GUI work!
There are :). John Torjo has a Win32 specific library (www.torjo.com) and I am currently working on a generic GUI framework. The problem is that we have 4 or more people interested in developing a GUI framework and the same number of GUI frameworks up for consideration. The question is which platform do we use and who develops it? With this in mind, it might be best if a sub-group with a specialist list be created, aimed at creating a GUI framework for integration into Boost with possible adoption by the next C++ standard. My library is available at http://uk.geocities.com/msclrhd/gui/gui.zip It is not quite ready to be committed into the boost sandbox and lacks documentation and a lot of functionality. It is buildable with gcc 3.3 and msvc 8.0, e.g.: bjam release link=static gcc-3.3 The aims of my library are: * provide a platform-independant programming model * integrate with the platform for native functionality and interoperability with existing code The platform specific code is contained in a namespace associated with the API for that platform (cocoa for MacOS, win for Win32/64, x11, gtk, motif for *nix). In order to aid platform independant programming, the API you are targeting is aliased as platf. This allows code like: boost::io::platf::position pos; without knowing whether you are targeting MacOS, Windows or *nix. There is a platform independant interface with source files for the specific APIs (currently only Win32/64 is supported). This includes a platform independant entry point: int gui_main( const boost::gui::platf::entry_data & ed ); where entry_data is specific to the target API. This allows you to access WinMain specific data on Win32/64 and PilotMain specific data on PalmPilot PalmOS. I am also making use of properties (based on the Louis Goldthwaite document on library properties at http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1615.pdf). This allows: gui::area a( gui::position( 5, 5 ), gui::size( 100, 50 )); gui::size sz = a.size; assert( sz.dx == 100 ); assert( a.width == 100 ); assert( a.center == gui::position( 55, 30 )); Currently, I have area, size and position support in Cocoa, Win32/64 and PalmOS. Regards, Reece
participants (4)
-
Hajo Kirchhoff
-
John Torjo
-
Maciej Sobczak
-
Reece Dunn