ubit::UCall Class Reference

UCall and its template subclasses define a family of classes for adding callback functions and methods. More...

#include <ucall.hpp>

Inheritance diagram for ubit::UCall:

ubit::UBrick ubit::UObject ubit::UCtlAction ubit::UPanAction ubit::UScrollAction ubit::UZoomAction List of all members.

Public Member Functions

virtual void operator() (UEvent &)=0
 the method that fires callbacks; must be redefined by subclasses.
virtual UCallcallCast ()
virtual void addingTo (UChild *self, UGroup *parent)
 impl.

Detailed Description

UCall and its template subclasses define a family of classes for adding callback functions and methods.

UClass is never instanciated directly. A variety of ucall( ) templates are used instead, Exemple:

    void helpCB(const char* s) {...}  // non member function
    struct Demo {
        void saveFile() {...}   // member function (instance method)
        ....
    };
    Demo* d = new Demo;
    UBox& b = ubutton(UPix::diskette + " Save..."
                      + UOn::enter  / ucall("Saves the file", helpCB)
                      + UOn::action / ucall(d, &Demo::saveFile));
 

Notes on callback prototypes and arguments

Misc. remarks

Example:

     UStr a, b = "toto";
     UDialog& dial = udialog(...whatever... 
                             + ubutton("Close" + uassign(a,b)) + ucloseWin()));
    
when the "Close" button is activated, a = b is performed then the dialog is closed.


The documentation for this class was generated from the following files:
Generated on Mon Jan 29 00:20:46 2007 for Ubit by  doxygen 1.4.7