omgui::win32::Notebook Class Reference

#include <omgui/win32/notebook.h>

Inherits omgui::win32::Panel, and omgui::common::Notebook.

List of all members.

Public Types

typedef
omgui::initializer::NotebookData 
data_type
 Initialization data used for Notebook.
typedef
omgui::initializer::PanelData 
data_type
 Initialization data used for Panel.
typedef
omgui::initializer::WidgetData 
data_type
 Initialization data used for Widgets.
typedef omgui::Notebook wrapper_type
typedef omgui::Panel wrapper_type
typedef omgui::Widget wrapper_type

Public Member Functions

void add_child (const Pointer< omgui::Widget > &child)
void add_ex_style (int style)
 Adds an extended style flag or flags to this HWND.
void append_page (NotebookPage page, const string &name)
void begin_defer_window_pos ()
void create (const omgui::initializer::PanelData &params)
void create (const omgui::initializer::NotebookData &params)
void defer_window_pos (HWND hwnd, int x, int y, int w, int h, int flags)
virtual void destroy ()
virtual void enable (bool e)
void end_defer_window_pos ()
const ChildListget_child_list () const
void get_display_rect (RECT *rect) const
virtual void * get_handle () const
HDWP get_hdwp ()
HFONT get_hfont () const
virtual omgui::Size get_max_size () const
Size get_min_size () const
virtual omgui::Size get_natural_size () const
NotebookPage get_page (int index) const
int get_page_count () const
int get_page_index (NotebookPage page) const
string get_page_name (NotebookPage page) 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
void get_screen_display_rect (RECT *rect) const
NotebookPage get_selected_page () 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 insert_page (int where, NotebookPage page, const string &name)
omgui::win32::Notebookinside_notebook () const
void invalidate_cached_child_values ()
void invalidate_parent ()
virtual bool is_enabled () const
virtual bool is_hidden () const
bool is_orphaned () const
virtual bool is_shown () const
 Notebook (omgui::Notebook *wrapper=0)
bool process_menu_command (menu_id id)
int process_message (HWND hwnd, UINT msg, WPARAM w_param, LPARAM l_param)
bool process_notification (int notification, HWND hwnd)
void remove_child (const Pointer< omgui::Widget > &child)
void remove_ex_style (int style)
 Removes an extended style flag or flags from this HWND.
NotebookPage remove_page (NotebookPage page)
bool select_next_page ()
bool select_previous_page ()
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)
void set_page_name (NotebookPage page, const string &name)
virtual void set_position (const omgui::Point &p)
virtual void set_rect (const omgui::Rect &r)
bool set_selected_page (NotebookPage page)
virtual void set_size (const omgui::Size &s)
void set_window_text (const string &str)
void show (bool show, bool focus)
void update_layout ()

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)
void set_old_proc (WNDPROC proc)
void set_window_pos (int x, int y, int w, int h, int flags=0)

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 Types

typedef std::map< Panel *, int > PageIndexes

Private Member Functions

Panelget_win32_page (int index) const
void select_page (Panel *page)
void send_changed ()
bool send_changing ()
void update_page_indexes ()

Private Attributes

Panelm_current_page
PageIndexes m_indexes
HWND m_tabs

Friends

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


Member Typedef Documentation

Initialization data used for Notebook.

Reimplemented from omgui::api::Panel.

Initialization data used for Panel.

Reimplemented from omgui::api::Widget.

Reimplemented in omgui::api::Notebook, and omgui::api::TableLayout.

typedef std::map<Panel*, int> omgui::win32::Notebook::PageIndexes [private]

Reimplemented from omgui::api::Panel.

Reimplemented from omgui::api::Widget.

Reimplemented in omgui::api::Notebook, and omgui::api::TableLayout.


Constructor & Destructor Documentation

omgui::win32::Notebook::Notebook ( omgui::Notebook wrapper = 0  ) 


Member Function Documentation

void omgui::common::Panel::add_child ( const Pointer< omgui::Widget > &  child  )  [virtual, inherited]

Implements omgui::api::Panel.

void omgui::win32::Widget::add_ex_style ( int  style  )  [inherited]

Adds an extended style flag or flags to this HWND.

Performs existing_ex_style |= style

void omgui::win32::Notebook::append_page ( NotebookPage  page,
const string name 
) [virtual]

Implements omgui::api::Notebook.

void omgui::win32::Panel::begin_defer_window_pos (  )  [inherited]

BeginDeferWindowPos

Todo:
Handle failre of BeginDeferWindowPos

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, inherited]

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::Panel::create ( const omgui::initializer::PanelData params  )  [inherited]

void omgui::win32::Notebook::create ( const omgui::initializer::NotebookData params  )  [virtual]

Implements omgui::api::Notebook.

void omgui::win32::Panel::defer_window_pos ( HWND  hwnd,
int  x,
int  y,
int  w,
int  h,
int  flags 
) [inherited]

DeferWindowPos

Todo:
Handle failure of DeferWindowPos

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

Implements omgui::api::Widget.

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

Implements omgui::api::Widget.

void omgui::win32::Panel::end_defer_window_pos (  )  [inherited]

EndDeferWindowPos

Todo:
Handle failure of EndDeferWindowPos

const ChildList & omgui::common::Panel::get_child_list (  )  const [virtual, inherited]

Implements omgui::api::Panel.

void omgui::win32::Notebook::get_display_rect ( RECT *  rect  )  const

Parameters:
rect Pointer to the current client rect of the tab control. Also used to return the display rect.
Returns:
The display rect of the tab control in client coordinates

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

Implements omgui::api::Widget.

HDWP omgui::win32::Panel::get_hdwp (  )  [inherited]

Returns:
Handle to the DeferWindowPos structure if a DWP is taking place. 0 otherwise.

HFONT omgui::win32::Widget::get_hfont (  )  const [inherited]

Gets the HFONT associated with this HWND

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

Implements omgui::api::Widget.

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

Reimplemented from omgui::win32::Widget.

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

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

Implements omgui::api::Widget.

NotebookPage omgui::win32::Notebook::get_page ( int  index  )  const [virtual]

Implements omgui::api::Notebook.

int omgui::win32::Notebook::get_page_count (  )  const [virtual]

Implements omgui::api::Notebook.

int omgui::win32::Notebook::get_page_index ( NotebookPage  page  )  const [virtual]

Todo:
Throw something?

Implements omgui::api::Notebook.

string omgui::win32::Notebook::get_page_name ( NotebookPage  page  )  const [virtual]

Implements omgui::api::Notebook.

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

Implements omgui::api::Widget.

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

Implements omgui::api::Widget.

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

Implements omgui::api::Widget.

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

Implements omgui::api::Widget.

void omgui::win32::Notebook::get_screen_display_rect ( RECT *  rect  )  const

Parameters:
rect Used to return the display rect in window coordinates. Its initial value is ignored.
Returns:
The display rect of the tab control in screen coordinates.

NotebookPage omgui::win32::Notebook::get_selected_page (  )  const [virtual]

Implements omgui::api::Notebook.

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

Implements omgui::api::Widget.

omgui::win32::Panel * omgui::win32::Notebook::get_win32_page ( int  index  )  const [private]

Todo:
Determine what we want to do with our exceptions. Do we want a hierarchy of WidgetException, DerivedWidgetException? Or would we rather just use asserts for this?

int omgui::win32::Widget::get_window_styles (  )  const [inherited]

Gets the window styles for this HWND

string omgui::win32::Widget::get_window_text (  )  const [inherited]

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::Notebook::insert_page ( int  where,
NotebookPage  page,
const string name 
) [virtual]

Todo:
Check for failure...

Implements omgui::api::Notebook.

Notebook * omgui::win32::Panel::inside_notebook (  )  const [inherited]

The purpose of this function is to be able to painted themed notebook page backgrounds for nested panels properly. If the panel is contained within a notebook, this function returns true. The rect returned through the function parameter specifies the display area of the tab control in screen coordinates. This value can be used to call DrawThemeBackground with the proper offsets to make the tab controls background gradient appear in the proper location

void omgui::common::Panel::invalidate_cached_child_values (  )  [virtual, inherited]

Implements omgui::api::Panel.

Reimplemented in omgui::common::TableLayout.

void omgui::win32::Widget::invalidate_parent (  )  [inherited]

Calls invalidate_cached_child_values on the parent if there is one

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

Implements omgui::api::Widget.

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

Implements omgui::api::Widget.

bool omgui::common::Panel::is_orphaned (  )  const [virtual, inherited]

Implements omgui::api::Panel.

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

Implements omgui::api::Widget.

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

Performs post widget creation initialization

bool omgui::win32::Widget::process_menu_command ( menu_id  id  )  [inherited]

Processes a WM_COMMAND sent from a menu.

Returns:
True if the command was processed

int omgui::win32::Notebook::process_message ( HWND  hwnd,
UINT  msg,
WPARAM  w_param,
LPARAM  l_param 
) [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 from omgui::win32::Panel.

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

Processes a WM_COMMAND sent from a control

Returns:
True if the command was processed

void omgui::common::Panel::remove_child ( const Pointer< omgui::Widget > &  child  )  [virtual, inherited]

Implements omgui::api::Panel.

Reimplemented in omgui::common::TableLayout.

void omgui::win32::Widget::remove_ex_style ( int  style  )  [inherited]

Removes an extended style flag or flags from this HWND.

Performs existing_ex_style &= ~style

NotebookPage omgui::win32::Notebook::remove_page ( NotebookPage  page  )  [virtual]

Todo:
Throw if page isnt found?

Implements omgui::api::Notebook.

bool omgui::win32::Notebook::select_next_page (  )  [virtual]

Implements omgui::api::Notebook.

void omgui::win32::Notebook::select_page ( Panel page  )  [private]

bool omgui::win32::Notebook::select_previous_page (  )  [virtual]

Implements omgui::api::Notebook.

void omgui::win32::Notebook::send_changed (  )  [private]

Sends the NOTEBOOK_PAGE_CHANGED event

bool omgui::win32::Notebook::send_changing (  )  [private]

Sends the NOTEBOOK_PAGE_CHANGING event

Returns:
True if the event was not vetoed

void omgui::win32::Widget::set_default_font (  )  [inherited]

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

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

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, inherited]

Implements omgui::api::Widget.

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

Implements omgui::api::Widget.

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

Implements omgui::api::Widget.

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

void omgui::win32::Notebook::set_page_name ( NotebookPage  page,
const string name 
) [virtual]

Implements omgui::api::Notebook.

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

Implements omgui::api::Widget.

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

Implements omgui::api::Widget.

bool omgui::win32::Notebook::set_selected_page ( NotebookPage  page  )  [virtual]

Implements omgui::api::Notebook.

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

Implements omgui::api::Widget.

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

Wraps SetWindowPos and supports DeferWindowPos functionality

void omgui::win32::Widget::set_window_text ( const string str  )  [inherited]

Sets the text of this widget using SetWindowText

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

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

Reimplemented from omgui::win32::Widget.

void omgui::common::Panel::update_layout (  )  [virtual, inherited]

Implements omgui::api::Panel.

Reimplemented in omgui::common::TableLayout.

void omgui::win32::Notebook::update_page_indexes (  )  [private]


Friends And Related Function Documentation

friend class CreationHook [friend, inherited]

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

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

bool omgui::win32::Widget::m_hidden [protected, inherited]

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

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


doxygen SourceForge.net Logo