omgui::win32::Widget Class Reference

#include <omgui/win32/widget.h>

Inherits omgui::common::Widget.

Inherited by omgui::win32::Button [virtual], omgui::win32::ComboBox [virtual], omgui::win32::Panel [virtual], omgui::win32::TextWidget [virtual], and omgui::win32::Window [virtual].

List of all members.

Public Types

typedef
omgui::initializer::WidgetData 
data_type
 Initialization data used for Widgets.
typedef omgui::Widget wrapper_type

Public Member Functions

void add_ex_style (int style)
 Adds an extended style flag or flags to this HWND.
virtual void destroy ()
virtual void enable (bool e)
virtual void * get_handle () const
HFONT get_hfont () const
virtual omgui::Size get_max_size () const
virtual omgui::Size get_min_size () const
virtual omgui::Size get_natural_size () const
virtual Pointer< omgui::Panelget_parent () const
virtual Pointer< omgui::Windowget_parent_window () const
virtual omgui::Point get_position () const
virtual omgui::Rect get_rect () const
virtual omgui::Size get_size () const
int get_window_styles () const
string get_window_text () const
template<typename T>
T * get_wrapper ()
template<typename T>
const T * get_wrapper () const
omgui::Widgetget_wrapper ()
const omgui::Widgetget_wrapper () const
omgui::object_id get_wrapper_id () const
void invalidate_parent ()
virtual bool is_enabled () const
virtual bool is_hidden () const
virtual bool is_shown () const
bool process_menu_command (menu_id id)
bool process_notification (int notification, HWND hwnd)
void remove_ex_style (int style)
 Removes an extended style flag or flags from this HWND.
void set_default_font ()
virtual void set_max_size (const omgui::Size &s)
virtual void set_min_size (const omgui::Size &s)
virtual void set_natural_size (const omgui::Size &s)
virtual void set_position (const omgui::Point &p)
virtual void set_rect (const omgui::Rect &r)
virtual void set_size (const omgui::Size &s)
void set_window_text (const string &str)
virtual void show (bool show, bool focus)
virtual ~Widget ()

Static Public Member Functions

static void set_default_font (HWND h)

Protected Member Functions

void create (const omgui::initializer::WidgetData &params, bool parent_required, LPCTSTR class_name, LPCTSTR window_name, int styles, int styles_ex=0, int x=0, int y=0, int w=0, int h=0, HMENU menu=0)
virtual void post_create (const omgui::initializer::WidgetData &params)
virtual int process_message (HWND hwnd, UINT msg, WPARAM w_param, LPARAM l_param)
void set_old_proc (WNDPROC proc)
void set_window_pos (int x, int y, int w, int h, int flags=0)
 Widget ()

Protected Attributes

bool m_hidden
HWND m_hwnd
omgui::Size m_max_size
omgui::Size m_min_size
omgui::Size m_natural_size
WNDPROC m_old_proc

Private Attributes

bool m_delete

Friends

class CreationHook
LRESULT CALLBACK widget_wndproc (HWND hwnd, UINT msg, WPARAM w_param, LPARAM l_param)


Member Typedef Documentation


Constructor & Destructor Documentation

omgui::win32::Widget::Widget (  )  [protected]

Reimplemented from omgui::common::Widget.

omgui::win32::Widget::~Widget (  )  [virtual]


Member Function Documentation

void omgui::win32::Widget::add_ex_style ( int  style  ) 

Adds an extended style flag or flags to this HWND.

Performs existing_ex_style |= style

void omgui::win32::Widget::create ( const omgui::initializer::WidgetData params,
bool  parent_required,
LPCTSTR  class_name,
LPCTSTR  window_name,
int  styles,
int  styles_ex = 0,
int  x = 0,
int  y = 0,
int  w = 0,
int  h = 0,
HMENU  menu = 0 
) [protected]

Creates the native widget using CreateWindowEx.

Parameters:
params Initializer arguments for position, size, visibility and enabled states.
parent_required If true and params.m_parent is NULL, an exception is thrown
class_name Class name passed to CreateWindowEx
window_name Window name passed to CreateWindowEx
styles Window styles
styles_ex Extended window styles
x X position
y Y position
w Width
h Height
menu The menu handle for the widget

void omgui::win32::Widget::destroy (  )  [virtual]

Implements omgui::api::Widget.

void omgui::win32::Widget::enable ( bool  e  )  [virtual]

Implements omgui::api::Widget.

virtual void* omgui::win32::Widget::get_handle (  )  const [inline, virtual]

Implements omgui::api::Widget.

HFONT omgui::win32::Widget::get_hfont (  )  const

Gets the HFONT associated with this HWND

omgui::Size omgui::win32::Widget::get_max_size (  )  const [virtual]

Implements omgui::api::Widget.

omgui::Size omgui::win32::Widget::get_min_size (  )  const [virtual]

omgui::Size omgui::win32::Widget::get_natural_size (  )  const [virtual]

Todo:
If m_natural_size has default values (0), calculate an acceptible value

Implements omgui::api::Widget.

Pointer< omgui::Panel > omgui::win32::Widget::get_parent (  )  const [virtual]

Implements omgui::api::Widget.

Pointer< omgui::Window > omgui::win32::Widget::get_parent_window (  )  const [virtual]

Implements omgui::api::Widget.

omgui::Point omgui::win32::Widget::get_position (  )  const [virtual]

Implements omgui::api::Widget.

omgui::Rect omgui::win32::Widget::get_rect (  )  const [virtual]

Implements omgui::api::Widget.

omgui::Size omgui::win32::Widget::get_size (  )  const [virtual]

Implements omgui::api::Widget.

int omgui::win32::Widget::get_window_styles (  )  const

Gets the window styles for this HWND

string omgui::win32::Widget::get_window_text (  )  const

Todo:
Clean this function when we figure out what we are doing with strings

template<typename T>
T* omgui::common::Widget::get_wrapper (  )  [inline, inherited]

Returns:
The wrapper object for this Widget casted to T*

template<typename T>
const T* omgui::common::Widget::get_wrapper (  )  const [inline, inherited]

Returns:
The wrapper object for this Widget casted to const T *

omgui::Widget* omgui::common::Widget::get_wrapper (  )  [inline, inherited]

Returns:
The wrapper object for this Widget

const omgui::Widget* omgui::common::Widget::get_wrapper (  )  const [inline, inherited]

Returns:
The wrapper object for this Widget

omgui::object_id omgui::common::Widget::get_wrapper_id (  )  const [inherited]

Returns:
The id of this Widget's wrapper object

void omgui::win32::Widget::invalidate_parent (  ) 

Calls invalidate_cached_child_values on the parent if there is one

bool omgui::win32::Widget::is_enabled (  )  const [virtual]

Implements omgui::api::Widget.

bool omgui::win32::Widget::is_hidden (  )  const [virtual]

Implements omgui::api::Widget.

bool omgui::win32::Widget::is_shown (  )  const [virtual]

Implements omgui::api::Widget.

void omgui::win32::Widget::post_create ( const omgui::initializer::WidgetData params  )  [protected, virtual]

Performs post widget creation initialization

bool omgui::win32::Widget::process_menu_command ( menu_id  id  ) 

Processes a WM_COMMAND sent from a menu.

Returns:
True if the command was processed

int omgui::win32::Widget::process_message ( HWND  hwnd,
UINT  msg,
WPARAM  w_param,
LPARAM  l_param 
) [protected, virtual]

Instead of subclassing window procedures to simulate inheritance, there is only one window procedure, which is widget_wndproc. This function calls process_message which does all message processing. process_message is responsible for knowing whether or not to call DefWindowProc, or some other window procedure.

Reimplemented in omgui::win32::Button, omgui::win32::EntryBox, omgui::win32::Notebook, omgui::win32::Panel, omgui::win32::SecureEntryBox, omgui::win32::TableLayout, omgui::win32::TextWidget, and omgui::win32::Window.

bool omgui::win32::Widget::process_notification ( int  notification,
HWND  hwnd 
)

Processes a WM_COMMAND sent from a control

Returns:
True if the command was processed

void omgui::win32::Widget::remove_ex_style ( int  style  ) 

Removes an extended style flag or flags from this HWND.

Performs existing_ex_style &= ~style

void omgui::win32::Widget::set_default_font (  ) 

Sets the font for this HWND to be the acceptible default GUI font

void omgui::win32::Widget::set_default_font ( HWND  h  )  [static]

Sets the font for the given HWND to be the acceptible default GUI font

void omgui::win32::Widget::set_max_size ( const omgui::Size s  )  [virtual]

Implements omgui::api::Widget.

void omgui::win32::Widget::set_min_size ( const omgui::Size s  )  [virtual]

Implements omgui::api::Widget.

void omgui::win32::Widget::set_natural_size ( const omgui::Size s  )  [virtual]

Implements omgui::api::Widget.

void omgui::win32::Widget::set_old_proc ( WNDPROC  proc  )  [inline, protected]

void omgui::win32::Widget::set_position ( const omgui::Point p  )  [virtual]

Implements omgui::api::Widget.

void omgui::win32::Widget::set_rect ( const omgui::Rect r  )  [virtual]

Implements omgui::api::Widget.

void omgui::win32::Widget::set_size ( const omgui::Size s  )  [virtual]

Implements omgui::api::Widget.

void omgui::win32::Widget::set_window_pos ( int  x,
int  y,
int  w,
int  h,
int  flags = 0 
) [protected]

Wraps SetWindowPos and supports DeferWindowPos functionality

void omgui::win32::Widget::set_window_text ( const string str  ) 

Sets the text of this widget using SetWindowText

Todo:
This won't work for unicode...

void omgui::win32::Widget::show ( bool  show,
bool  focus 
) [virtual]

Implements omgui::api::Widget.

Reimplemented in omgui::win32::Panel.


Friends And Related Function Documentation

friend class CreationHook [friend]

LRESULT CALLBACK widget_wndproc ( HWND  hwnd,
UINT  msg,
WPARAM  w_param,
LPARAM  l_param 
) [friend]

This is the window procedure which is implemented outside of the win32::widget classes. It is called by the window procedures for all widgets and contains only common functionality.


Member Data Documentation

HWND omgui::win32::Widget::m_hwnd [protected]

WNDPROC omgui::win32::Widget::m_old_proc [protected]


doxygen SourceForge.net Logo