Boost logo

Boost :

From: E. Gladyshev (egladysh_at_[hidden])
Date: 2003-08-01 17:57:16


> Here is a very simplified version of how this can
> happen.
>
> template <typename Traits> struct edit_imp {...};
>
> struct edit {
>
> template <typename Traits> edit_imp<Traits>
> make_gui() {...}
> };
>
> template <typename Traits> struct
> gui_wrapper_base {
>
> //some pure virtual functions
> };
>
> template <typename Traits, typename Control>
> struct gui_wrapper :
> gui_wrapper_base<Traits> {
>
> gui_wrapper(const Control& imp);
>
> //implements virtual functions by forwarding
> to Control
>
> private:
>
> Control imp;
> };
>
> template <typename Traits> struct gui_application
> {
>
> template <typename Control>
> gui_application(const Control&
> control)
> : pimpl(new
> gui_wrapper<Traits,Control>(control) {
> }
>
> //also assignment operator, etc...
>
> //forward operations to pimpl
>
> private:
>
> boost::shared_ptr<gui_wrapper_base<Traits> >
> pimpl;
> };

Something is confusing here. How does make_gui() get
used?
Anyway I think I got the basic idea. The idea is that
the GUI elements are classes defined on top of a
pImpl. Someone else creates the pImpl object and
passes it to the GUI elements classes. The GUI
elements then call pImpl methods do the real job.
Did I get it right?

> I just learned aboutit today after my attachment was
> rejected for being
> too large and I gave up on the sandbox :) It's at:
>
> http://groups.yahoo.com/group/boost/files/

Thanks.

>
> you could connect two controls
> with my code like:
>
> set_manager( row( edit(&employee::name),
> edit(&employee::name)));

I don't think that it is exactly the same. If some
control changes the data, how do other connected
controls get updated in your code?

> I kind of like another poster's (Mr. Bouchard I
> think) idea of default
> control types. You might be able to simplify the
> above to:
>
> set_manager( row( &employee::name,
> &employee::name));

Agree, it sounds interesting.

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk