Emulation of the Forms "free" widget. More...
|Fl_Free (uchar t, int X, int Y, int W, int H, const char *L, FL_HANDLEPTR hdl)|
|Create a new Fl_Free widget with type, position, size, label and handler. |
|int||handle (int e)|
|Handles the specified event. |
|The destructor will call the handle function with the event FL_FREE_MEM. |
|Draws the widget. |
Emulation of the Forms "free" widget.
This emulation allows the free demo to run, and appears to be useful for porting programs written in Forms which use the free widget or make subclasses of the Forms widgets.
There are five types of free, which determine when the handle function is called:
FL_NORMAL_FREEnormal event handling.
FL_SLEEPING_FREEdeactivates event handling (widget is inactive).
FL_INPUT_FREEaccepts FL_FOCUS events.
FL_CONTINUOUS_FREEsets a timeout callback 100 times a second and provides an FL_STEP event. This has obvious detrimental effects on machine performance.
FL_ALL_FREEsame as FL_INPUT_FREE and FL_CONTINUOUS_FREE.
|const char *||L,|
Create a new Fl_Free widget with type, position, size, label and handler.
|[in]||X,Y,W,H||position and size|
The constructor takes both the type and the handle function. The handle function should be declared as follows:
int handle_function(Fl_Widget *w, int event, float event_x, float event_y, char key)
The event argument contains the event type:
// old event names for compatibility: #define FL_MOUSE FL_DRAG #define FL_DRAW 0 #define FL_STEP 9 #define FL_FREEMEM 12 #define FL_FREEZE FL_UNMAP #define FL_THAW FL_MAP
Draws the widget.
Never call this function directly. FLTK will schedule redrawing whenever needed. If your widget must be redrawn as soon as possible, call redraw() instead.
Override this function to draw your own widgets.
Handles the specified event.
You normally don't call this method directly, but instead let FLTK do it when the user interacts with the widget.
When implemented in a widget, this function must return 0 if the widget does not use the event or 1 otherwise.
Most of the time, you want to call the inherited handle() method in your overridden method so that you don't short-circuit events that you don't handle. In this last case you should return the callee retval.
|[in]||event||the kind of event received|
|0||if the event was not used or understood|
|1||if the event was used and can be deleted|
Reimplemented from Fl_Widget.