libt3widget
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Modules
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Friends
t3_widget::dialog_t Class Reference

Base class for dialogs. More...

Inheritance diagram for t3_widget::dialog_t:
t3_widget::dialog_base_t t3_widget::window_component_t t3_widget::container_t t3_widget::window_component_t t3_widget::attribute_picker_dialog_t t3_widget::file_dialog_t t3_widget::find_dialog_t t3_widget::goto_dialog_t t3_widget::input_selection_dialog_t t3_widget::insert_char_dialog_t t3_widget::main_window_base_t t3_widget::menu_panel_t t3_widget::message_dialog_t t3_widget::replace_buttons_dialog_t

Public Member Functions

virtual void hide (void)
 Hide the window_component_t. More...
 
virtual bool process_key (key_t key)
 Handle a key press by the user. More...
 
virtual void show (void)
 Display the window_component_t. More...
 
 T3_WIDGET_SIGNAL (closed, void)
 Signal emitted when the dialog is closed by calling close. More...
 
virtual void update_contents (void)
 Update the contents of the window. More...
 
- Public Member Functions inherited from t3_widget::dialog_base_t
virtual void center_over (window_component_t *center)
 Set the position and anchoring for this dialog such that it is centered over a window_component_t. More...
 
virtual void force_redraw (void)
 Request that this window_component_t be completely redrawn. More...
 
virtual void set_focus (focus_t focus)
 Set whether this window_component_t has the input focus. More...
 
virtual void set_position (optint top, optint left)
 Move the window_component_t to a specified position. More...
 
virtual bool set_size (optint height, optint width)
 Set the size of this window_component_t. More...
 
virtual ~dialog_base_t ()
 Destroy this dialog. More...
 
- Public Member Functions inherited from t3_widget::window_component_t
virtual t3_window_t * get_base_window (void)
 Retrieve the t3_window_t for this window_component_t. More...
 
 window_component_t (void)
 Base constructor. More...
 
virtual ~window_component_t (void)
 Base destructor. More...
 

Protected Member Functions

virtual void close (void)
 Close the dialog. More...
 
 dialog_t (int height, int width, const char *_title)
 Create a new dialog with height and width, and with title _title. More...
 
virtual bool is_child (window_component_t *widget)
 Determine whether a window_compnent_t is a child of the container_t. More...
 
virtual void set_child_focus (window_component_t *target)
 Set the focus to a specific window component. More...
 
- Protected Member Functions inherited from t3_widget::dialog_base_t
 dialog_base_t (int height, int width, bool has_shadow)
 Create a new dialog with height and width, and with title _title. More...
 
void focus_next (void)
 Focus the previous widget, wrapping around if necessary. More...
 
void focus_previous (void)
 Focus the next widget, wrapping around if necessary. More...
 
void push_back (widget_t *widget)
 Add a widget to this dialog. More...
 
- Protected Member Functions inherited from t3_widget::container_t
virtual bool set_widget_parent (window_component_t *widget)
 Make widget a child window of this container_t, by setting its parent window. More...
 
virtual void unset_widget_parent (window_component_t *widget)
 Unset the parent window for a widget. More...
 

Protected Attributes

const char * title
 The title of this dialog. More...
 
- Protected Attributes inherited from t3_widget::dialog_base_t
widgets_t::iterator current_widget
 Iterator indicating the widget that has the input focus. More...
 
bool redraw
 Boolean indicating whether redrawing is necessary. More...
 
cleanup_t3_window_ptr shadow_window
 t3_window_t used to draw the shadow under a dialog. More...
 
widgets_t widgets
 List of widgets on this dialog. More...
 
- Protected Attributes inherited from t3_widget::window_component_t
cleanup_t3_window_ptr window
 The t3_window_t used for presenting this item on screen (see libt3window). More...
 

Friends

void iterate (void)
 Perform a single iteration of the main loop. More...
 
class main_window_base_t
 
bool mouse_target_t::handle_mouse_event (mouse_event_t event)
 
class popup_t
 

Additional Inherited Members

- Public Types inherited from t3_widget::window_component_t
enum  focus_t {
  FOCUS_OUT, FOCUS_SET, FOCUS_IN_FWD, FOCUS_IN_BCK,
  FOCUS_REVERT
}
 
- Static Public Member Functions inherited from t3_widget::dialog_base_t
static void force_redraw_all (void)
 Call force_redraw on all dialogs. More...
 

Detailed Description

Base class for dialogs.

Constructor & Destructor Documentation

t3_widget::dialog_t::dialog_t ( int  height,
int  width,
const char *  _title 
)
protected

Create a new dialog with height and width, and with title _title.

Member Function Documentation

void t3_widget::dialog_t::close ( void  )
protectedvirtual

Close the dialog.

This function should be called when the dialog is closed by some event originating from this dialog.

Reimplemented in t3_widget::main_window_base_t.

void t3_widget::dialog_t::hide ( void  )
virtual

Hide the window_component_t.

Reimplemented from t3_widget::dialog_base_t.

bool t3_widget::dialog_t::is_child ( window_component_t component)
protectedvirtual

Determine whether a window_compnent_t is a child of the container_t.

Reimplemented from t3_widget::dialog_base_t.

Reimplemented in t3_widget::menu_panel_t.

bool t3_widget::dialog_t::process_key ( key_t  key)
virtual

Handle a key press by the user.

Returns
A boolean indicating whether this window_component_t handled the key press.

Implements t3_widget::window_component_t.

Reimplemented in t3_widget::menu_panel_t, and t3_widget::input_selection_dialog_t.

void t3_widget::dialog_t::set_child_focus ( window_component_t target)
protectedvirtual

Set the focus to a specific window component.

Reimplemented from t3_widget::dialog_base_t.

void t3_widget::dialog_t::show ( void  )
virtual
t3_widget::dialog_t::T3_WIDGET_SIGNAL ( closed  ,
void   
)

Signal emitted when the dialog is closed by calling close.

void t3_widget::dialog_t::update_contents ( void  )
virtual

Update the contents of the window.

Reimplemented from t3_widget::dialog_base_t.

Reimplemented in t3_widget::main_window_base_t.

Friends And Related Function Documentation

void iterate ( void  )
friend

Perform a single iteration of the main loop.

This function updates the contents of the terminal, waits for a key press and sends it to the currently focussed dialog. Called repeatedly from main_loop.

Member Data Documentation

const char* t3_widget::dialog_t::title
protected

The title of this dialog.