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

Base class for components which need to center dialogs. More...

Inheritance diagram for t3_widget::center_component_t:
t3_widget::window_component_t t3_widget::edit_window_t t3_widget::text_field_t t3_widget::text_window_t

Public Member Functions

 center_component_t (void)
 Create a new center_component_t. More...
 
virtual void set_center_window (window_component_t *_center_window)
 Set the window_component_t to center over. More...
 

Protected Attributes

window_component_tcenter_window
 The window_component_t to center over. 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...
 

Additional Inherited Members

- Protected Types inherited from t3_widget::window_component_t
enum  focus_t {
  FOCUS_OUT, FOCUS_SET, FOCUS_IN_FWD, FOCUS_IN_BCK,
  FOCUS_REVERT
}
 
- Protected Member Functions inherited from t3_widget::window_component_t
virtual void force_redraw (void)=0
 Request that this window_component_t be completely redrawn. More...
 
virtual t3_window_t * get_base_window (void)
 Retrieve the t3_window_t for this window_component_t. More...
 
virtual void hide (void)=0
 Hide the window_component_t. More...
 
virtual bool process_key (key_t key)=0
 Handle a key press by the user. More...
 
virtual void set_focus (focus_t focus)=0
 Set whether this window_component_t has the input focus. More...
 
virtual void set_position (optint top, optint left)=0
 Move the window_component_t to a specified position. More...
 
virtual bool set_size (optint height, optint width)=0
 Set the size of this window_component_t. More...
 
virtual void show (void)=0
 Display the window_component_t. More...
 
virtual void update_contents (void)=0
 Update the contents of the window. More...
 
 window_component_t (void)
 Base constructor. More...
 
virtual ~window_component_t (void)
 Base destructor. More...
 

Detailed Description

Base class for components which need to center dialogs.

This base class is specifically made for widgets like edit_window_t which need to show dialogs. In some cases it is better to center those dialogs over the widget itself, but in other cases it is more intuitive to center those dialogs over the containing window_component_t of the widget. The latter may be the case when the widget is itself part of a dialog. To allow both cases, this interface defines a function to set the window_component_t used for centering.

Constructor & Destructor Documentation

t3_widget::center_component_t::center_component_t ( void  )

Create a new center_component_t.

The center_window member will be set to this.

Member Function Documentation

void t3_widget::center_component_t::set_center_window ( window_component_t _center_window)
virtual

Set the window_component_t to center over.

Member Data Documentation

window_component_t* t3_widget::center_component_t::center_window
protected

The window_component_t to center over.