WinapiExtension
 All Classes Files Functions Variables Typedefs Pages
Classes | Public Member Functions | Static Public Attributes | List of all members
WindowModal Class Reference

This window can enter a modal message loop. More...

#include <WindowModal.h>

Inheritance diagram for WindowModal:
Window WindowMessageHandler IWindow

Public Member Functions

 WindowModal ()
 
int DoModal (bool blockEntireThread=true)
 
void EndModal (int result)
 
bool IsModal ()
 
- Public Member Functions inherited from Window
 Window ()
 
virtual ~Window ()
 
HWND _InternalGetHandle ()
 
void AttachFontRecursive (HFONT font)
 
bool Create (const WindowParams &params)
 
HWND GetHandle () const
 
HINSTANCE GetInstance () const
 
WindowGetParent () const
 
 operator HWND () const
 
void SetClientSize (int w, int h)
 
- Public Member Functions inherited from WindowMessageHandler
template<typename MESSAGE >
void Bind (UINT message, void(*function)(MESSAGE &))
 
template<typename MESSAGE , typename FUNCTOR >
void Bind (UINT message, FUNCTOR function)
 
template<typename CLASS , typename MESSAGE , typename HANDLER >
void Bind (UINT message, void(CLASS::*function)(MESSAGE &), HANDLER *handler)
 
template<typename FUNCTOR >
void BindCommand (WORD id, FUNCTOR function, WORD notifyCode=0)
 
template<typename FUNCTOR >
void BindCommand (HWND hwnd, FUNCTOR function, WORD notifyCode=0)
 
template<typename CLASS , typename HANDLER >
void BindCommand (WORD id, void(CLASS::*function)(msgCommand &), HANDLER *handler, WORD notifyCode=0)
 
template<typename CLASS , typename HANDLER >
void BindCommand (HWND hwnd, void(CLASS::*function)(msgCommand &), HANDLER *handler, WORD notifyCode=0)
 
template<typename FUNCTOR >
void BindNotify (UINT_PTR id, UINT notifyCode, FUNCTOR function)
 
template<typename FUNCTOR >
void BindNotify (HWND hwnd, UINT notifyCode, FUNCTOR function)
 
template<typename CLASS , typename HANDLER >
void BindNotify (UINT_PTR id, UINT notifyCode, void(CLASS::*function)(msgNotify &), HANDLER *handler)
 
template<typename CLASS , typename HANDLER >
void BindNotify (HWND hwnd, UINT notifyCode, void(CLASS::*function)(msgNotify &), HANDLER *handler)
 
bool PassMessageToHandlerFunction (HWND hwnd, UINT message, WPARAM wp, LPARAM lp, LRESULT &result)
 
void UnBind (UINT message)
 
void UnBindCommand (WORD id, WORD notifyCode=0)
 
void UnBindCommand (HWND hwnd, WORD notifyCode=0)
 
void UnBindNotify (UINT_PTR id, UINT notifyCode=0)
 
void UnBindNotify (HWND hwnd, UINT notifyCode=0)
 
- Public Member Functions inherited from IWindow
Rect ClientRect ()
 
void Destroy ()
 
void DragAcceptFiles (BOOL accept=TRUE)
 
void Enable (BOOL enable)
 
DWORD GetExStyle ()
 
HFONT GetFont ()
 
HICON GetIcon (BOOL bigIcon)
 
DWORD GetID ()
 
DWORD GetStyle ()
 
tstring GetText ()
 
BOOL Invalidate (const RECT *rect=NULL, BOOL eraseBkgnd=TRUE)
 
BOOL IsEnabled ()
 
BOOL IsVisible ()
 
void KillTimer (UINT_PTR timerID)
 
void ModifyStyle (DWORD add, DWORD remove)
 
void Move (int x, int y, BOOL redraw=TRUE)
 
void Move (const POINT &p, BOOL redraw=TRUE)
 
void Move (int x, int y, int width, int height, BOOL redraw=TRUE)
 
void Move (const POINT &p, const SIZE &s, BOOL redraw=TRUE)
 
void Move (const RECT &r, BOOL redraw=TRUE)
 
HWND ParentHandle ()
 
Rect RectOnParent ()
 
BOOL Redraw (const RECT *rect=NULL, HRGN region=NULL, UINT flags=RDW_INVALIDATE|RDW_UPDATENOW|RDW_ERASE)
 
HWND SetFocus ()
 
void SetFont (HFONT font, BOOL redraw=TRUE)
 
HICON SetIcon (HICON icon, BOOL bigIcon)
 
void SetRedraw (BOOL allowRedraw)
 
void SetText (const tstring &text)
 
UINT_PTR SetTimer (UINT_PTR timerID, UINT interval, TIMERPROC proc=NULL)
 
BOOL Show (int cmdShow)
 
Rect WindowRect ()
 

Static Public Attributes

static const int MODAL_ERROR = -1
 

Additional Inherited Members

- Static Public Member Functions inherited from Window
static HBRUSH GetDefaultBackground ()
 
static HCURSOR GetDefaultCursor ()
 
static HFONT GetDefaultFont ()
 
static HICON GetDefaultIcon ()
 
static WindowGetObjectFromWindow (HWND hwnd)
 
static void SetDefaultBackground (HBRUSH bg)
 
static void SetDefaultCursor (HCURSOR cursor)
 
static void SetDefaultFont (HFONT font)
 
static void SetDefaultIcon (HICON icon)
 
static LRESULT CALLBACK StaticWndProc (HWND hwnd, UINT message, WPARAM wp, LPARAM lp)
 
- Protected Member Functions inherited from Window
virtual LRESULT OnMessage (HWND hwnd, UINT message, WPARAM wp, LPARAM lp)
 

Detailed Description

This window can enter a modal message loop.

First create the window without WS_VISIBLE, then call DoModal() to start the loop. All other windows in the thread will be disabled while the modal loop runs.

Constructor & Destructor Documentation

WindowModal::WindowModal ( )
inline

Empty ctor.

Member Function Documentation

int WindowModal::DoModal ( bool  blockEntireThread = true)
inline

Shows the modal window and waits until EndModal() is called or WM_QUIT is received.

Parameters
blockEntireThreadIf true, all windows in the thread are disable, otherwise only the immediate parent of this window is disabled.
Returns
Either the parameter from EndModal() or MODAL_ERROR if an error occured.
void WindowModal::EndModal ( int  result)
inline

Break the modal message loop.

Parameters
resultThe result that DoModal() should return.
bool WindowModal::IsModal ( )
inline

Check if the modal message loop is active.

Member Data Documentation

const int WindowModal::MODAL_ERROR = -1
static

This is returned by DoModal() if an error occured.


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