User manual

old releases - latest release - trunk

Frame Class Reference

Inheritance diagram for Frame:
Collaboration diagram for Frame:

List of all members.


Detailed Description

Class representing a frame in the GUI.

Provides some basic functionality common to all frames, such as the frame content selection menu displayed in the top left corner (created by calling create_menu() ), and the drawing of the extra-thick frame border of selected frames.

Public Types

enum  FrameType { PROPERTY_FRAME, VIEW_FRAME, BROWSER_FRAME, CONSOLE_FRAME }
 Enumeration describing the type of frame.

Public Member Functions

virtual int handle (int msg)
 FLTK handle() method for selecting frames.
void selected (bool selected)
 Set the \ m_selected property.
bool is_selected () const
 Get the selection status of this frame.
virtual FrameType frame_type () const =0
 Get the type of the frame.
virtual void deregister ()=0
 Deregisters the Frame with its Workspace.
virtual bool resizable_width (int width)=0
 Returns true if the frame can be resized to width width.
virtual bool resizable_height (int height)=0
 Returns true if the frame can be resized to height height.
virtual Frameclone (int x, int y, int w, int h)=0
 Creates a clone of the frame with the specified screen dimensions.

Static Public Member Functions

static void menu_callback (Fl_Widget *w, void *data)
 Frame content selection menu callback. Changes the frame type according to the users choice in the menu.

Protected Member Functions

 Frame (int x, int y, int w, int h, char *l=0)
 Creates the frame content selection menu.
virtual void draw ()
 Draws an extra thick frame border if the frame is selected.

Private Attributes

bool m_selected
 Indicates whether this is the selected frame or not. true if selected false if not.


Constructor & Destructor Documentation

Frame ( int  x,
int  y,
int  w,
int  h,
char *  l = 0 
) [protected]

Creates the frame content selection menu.

This constructor creates the FLTK Fl_Menu_Button object that implements the frame content selection menu, and registers menu_callback() as the callback function for the menu.

This constructor should be called in the constructor of the derived classes.

Parameters:
x The x-coordinate of the top left corner of this frame.
y The y-coordinate of the top left corner of this frame.
w The width of this frame.
h The height of this frame.
l The widget label (for FLTK compatibility)


Member Function Documentation

void menu_callback ( Fl_Widget *  w,
void *  data 
) [static]

Frame content selection menu callback. Changes the frame type according to the users choice in the menu.

This method will hide the current frame and create a new Frame object over it. It will mark the current frame for deletion by calling the Fl::delete_widget() function.

This function is triggered by the user selecting an option in the frame content selection menu.

Parameters:
w A pointer to the Fl_Menu_Button representing the frame content selection menu.
data A pointer to void, as required by FLTK (not used)

int handle ( int  msg  )  [virtual]

FLTK handle() method for selecting frames.

This method is called by FLTK when an event occurs. If the event is a FL_PUSHED event, it means the user has clicked inside this frame. In that case, we set this frame as selected (by calling Workspace::select_frame()).

We also pass all events on to Fl_Scroll::handle() to make sure any child widgets get the event as usual.

Parameters:
msg The FLTK event passed to this method.
Returns:
If msg was FL_PUSHED, we return 1, else we return whatever Fl_Scroll::handle() returns.

void selected ( bool  selected  ) 

Set the \ m_selected property.

This method sets the m_selected property, which indicates whether the frame border should be drawn thick or not.

Parameters:
selected true if the frame is selected, false if not.

bool is_selected (  )  const

Get the selection status of this frame.

Returns true if the frame is selected, false if it is not.

virtual FrameType frame_type (  )  const [pure virtual]

Get the type of the frame.

This method is abstract and must be implemented by derived classes.

Returns:
The FrameType of this frame.

Implemented in BrowserFrame, ConsoleFrame, PropertyFrame, and ViewFrame.

void draw (  )  [protected, virtual]

Draws an extra thick frame border if the frame is selected.

This method uses FLTK drawing mode functions to draw an extra thick frame border during drawing mode.

This method should only be called by FLTK, during a redraw, or from the draw() methods of derived classes.

Reimplemented in ConsoleFrame.


The documentation for this class was generated from the following files: