aswang  1.0
Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Attributes | Static Protected Attributes
aswang::window Class Reference

#include <window.h>

+ Inheritance diagram for aswang::window:

List of all members.

Public Types

enum  Alignment { ALIGN_LEFT, ALIGN_RIGHT, ALIGN_CENTER }
typedef LRESULT(window::* msgCallback )(window *, UINT, WPARAM, LPARAM)

Public Member Functions

 window ()
 window (HWND h)
 window (HWND h, window *p)
 window (unsigned long newStyle)
 window (window *p, unsigned long newStyle=0UL)
virtual ~window ()
void Add ()
void Erase ()
HWND GetHwnd ()
void SetHwnd (HWND h)
windowGetParent ()
void SetParent (window *newp)
AswangStr GetText () const
void SetText (AswangStr s) const
long GetWindowX () const
long GetWindowY () const
long GetWindowWidth () const
long GetWindowHeight () const
long GetClientWidth () const
long GetClientHeight () const
void Center () const
virtual void SetBrush (const Brush &b)
virtual const BrushGetBrush () const
virtual void SetAlignment (Alignment a)
virtual void Invalidate ()
virtual void Update ()
virtual void Move (int x, int y)
virtual void Resize (int width, int height)
virtual void SetStyle (unsigned long s)
virtual unsigned long GetStyle ()
virtual void Create (int x, int y, int width, int height)
virtual void Show (int showCommand=SW_SHOWNORMAL)
virtual void Transparent (bool t) const
virtual const _TCHAR * GetClassName () const =0
virtual void AddCallback (unsigned long msg, msgCallback cbk, HWND caller=NULL)
virtual void RemoveCallback (unsigned long msg)
virtual LRESULT OnButtonColor (HDC dc, HWND btn)
virtual LRESULT OnChar (TCHAR c, long flags)
virtual LRESULT OnClose ()
virtual LRESULT OnCommand (HWND win, unsigned short Notify, unsigned short wID)
virtual LRESULT OnDestroy (HWND win)
virtual LRESULT OnDialogColor (HDC dc, HWND dlg)
virtual LRESULT OnDrawItem (unsigned long ID, DRAWITEMSTRUCT *dis)
virtual LRESULT OnEraseBG (HDC dc)
virtual LRESULT OnFail (UINT msg, WPARAM wParam, LPARAM lParam)
virtual LRESULT OnGetDlgCode (long VirtKey, MSG *m)
virtual LRESULT OnInitDialog (HWND win, unsigned long param)
virtual LRESULT OnKeyDown (long VirtKey, long flags)
virtual LRESULT OnKeyUp (long VirtKey, long flags)
virtual LRESULT OnLDClick (unsigned int flags, POINTS p)
virtual LRESULT OnLDown (unsigned int flags, POINTS p)
virtual LRESULT OnLUp (unsigned int flags, POINTS p)
virtual LRESULT OnMeasureItem (long ctlID, MEASUREITEMSTRUCT *mis)
virtual LRESULT OnMouseOut (HWND NewWindow)
virtual LRESULT OnMouseOver (unsigned int flags, POINTS p)
virtual LRESULT OnMove (unsigned long NewX, unsigned long NewY)
virtual LRESULT OnNCPaint (HRGN region)
virtual LRESULT OnNCHitTest (POINTS pos)
virtual LRESULT OnNotify (unsigned long ID, NMHDR *nmh)
virtual LRESULT OnPaint ()
virtual LRESULT OnParentNotifyCreate (unsigned short event, unsigned short wID, HWND win)
virtual LRESULT OnParentNotifyClick (unsigned short event, short x, short y)
virtual LRESULT OnPosChanged (WINDOWPOS *wpos)
virtual LRESULT OnRDClick (unsigned int flags, POINTS p)
virtual LRESULT OnRDown (unsigned int flags, POINTS p)
virtual LRESULT OnRUp (unsigned int flags, POINTS p)
virtual LRESULT OnShow (bool show, long Status)
virtual LRESULT OnSize (unsigned long flag, unsigned short NewWidth, unsigned short NewHeight)
virtual LRESULT OnSizing (unsigned long side, RECT *r)
virtual LRESULT OnStaticColor (HDC dc, HWND sttc)
virtual LRESULT OnTimer (unsigned long id, TIMERPROC tproc)
virtual operator HWND ()

Static Public Member Functions

static windowGetWindow (HWND h)
static LRESULT CALLBACK WProc (HWND h, UINT msg, WPARAM wParam, LPARAM lParam)
static int Loop ()
static void SetInstance (HINSTANCE h)
static HINSTANCE GetInstance ()

Protected Types

typedef std::map< HWND, window * > wmap_type
typedef std::map< unsigned int,
std::pair< HWND, msgCallback > > 
callbackMap_type

Protected Attributes

HWND hWnd
windowmParent
Brush bg
unsigned long style
callbackMap_type callbackMap

Static Protected Attributes

static wmap_type wmap
static HINSTANCE hInstance

Detailed Description

Definition at line 28 of file window.h.


Member Typedef Documentation

typedef std::map<unsigned int,std::pair<HWND,msgCallback> > aswang::window::callbackMap_type [protected]

Definition at line 34 of file window.h.

typedef LRESULT(window::* aswang::window::msgCallback)(window *, UINT, WPARAM, LPARAM)

Definition at line 31 of file window.h.

typedef std::map<HWND,window *> aswang::window::wmap_type [protected]

Definition at line 33 of file window.h.


Member Enumeration Documentation

Enumerator:
ALIGN_LEFT 
ALIGN_RIGHT 
ALIGN_CENTER 

Definition at line 30 of file window.h.


Constructor & Destructor Documentation

aswang::window::window ( ) [inline]

Definition at line 43 of file window.h.

aswang::window::window ( HWND  h) [inline, explicit]

Definition at line 44 of file window.h.

aswang::window::window ( HWND  h,
window p 
) [inline]

Definition at line 45 of file window.h.

aswang::window::window ( unsigned long  newStyle) [inline]

Definition at line 46 of file window.h.

aswang::window::window ( window p,
unsigned long  newStyle = 0UL 
) [inline]

Definition at line 47 of file window.h.

virtual aswang::window::~window ( ) [inline, virtual]

Definition at line 48 of file window.h.


Member Function Documentation

void window::Add ( )

Definition at line 27 of file window.cpp.

virtual void aswang::window::AddCallback ( unsigned long  msg,
msgCallback  cbk,
HWND  caller = NULL 
) [inline, virtual]

Definition at line 88 of file window.h.

void window::Center ( ) const

Definition at line 135 of file window.cpp.

void window::Create ( int  x,
int  y,
int  width,
int  height 
) [virtual]

Reimplemented in aswang::Dialog.

Definition at line 37 of file window.cpp.

void window::Erase ( )

Definition at line 31 of file window.cpp.

virtual const Brush& aswang::window::GetBrush ( ) const [inline, virtual]

Definition at line 68 of file window.h.

virtual const _TCHAR* aswang::window::GetClassName ( ) const [pure virtual]
long window::GetClientHeight ( ) const

Definition at line 126 of file window.cpp.

long window::GetClientWidth ( ) const

Definition at line 117 of file window.cpp.

HWND aswang::window::GetHwnd ( ) [inline]

Definition at line 54 of file window.h.

static HINSTANCE aswang::window::GetInstance ( ) [inline, static]

Definition at line 86 of file window.h.

window* aswang::window::GetParent ( ) [inline]

Definition at line 56 of file window.h.

unsigned long window::GetStyle ( ) [virtual]

Definition at line 201 of file window.cpp.

AswangStr window::GetText ( ) const

Definition at line 63 of file window.cpp.

window * window::GetWindow ( HWND  h) [static]

Definition at line 56 of file window.cpp.

long window::GetWindowHeight ( ) const

Definition at line 108 of file window.cpp.

long window::GetWindowWidth ( ) const

Definition at line 99 of file window.cpp.

long window::GetWindowX ( ) const

Definition at line 81 of file window.cpp.

long window::GetWindowY ( ) const

Definition at line 90 of file window.cpp.

void window::Invalidate ( ) [virtual]

Definition at line 169 of file window.cpp.

int window::Loop ( ) [static]

Reimplemented in aswang::Dialog.

Definition at line 327 of file window.cpp.

void window::Move ( int  x,
int  y 
) [virtual]

Definition at line 183 of file window.cpp.

LRESULT window::OnButtonColor ( HDC  dc,
HWND  btn 
) [virtual]

Definition at line 385 of file window.cpp.

LRESULT window::OnChar ( TCHAR  c,
long  flags 
) [virtual]

Definition at line 436 of file window.cpp.

LRESULT window::OnClose ( ) [virtual]

Reimplemented in aswang::Dialog.

Definition at line 336 of file window.cpp.

LRESULT window::OnCommand ( HWND  win,
unsigned short  Notify,
unsigned short  wID 
) [virtual]

Definition at line 380 of file window.cpp.

LRESULT window::OnDestroy ( HWND  win) [virtual]

Definition at line 490 of file window.cpp.

LRESULT window::OnDialogColor ( HDC  dc,
HWND  dlg 
) [virtual]

Definition at line 411 of file window.cpp.

LRESULT window::OnDrawItem ( unsigned long  ID,
DRAWITEMSTRUCT *  dis 
) [virtual]

Definition at line 456 of file window.cpp.

LRESULT window::OnEraseBG ( HDC  dc) [virtual]

Definition at line 472 of file window.cpp.

LRESULT window::OnFail ( UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
) [virtual]

Reimplemented in aswang::Dialog.

Definition at line 506 of file window.cpp.

LRESULT window::OnGetDlgCode ( long  VirtKey,
MSG *  m 
) [virtual]

Definition at line 424 of file window.cpp.

LRESULT window::OnInitDialog ( HWND  win,
unsigned long  param 
) [virtual]

Reimplemented in aswang::Dialog.

Definition at line 452 of file window.cpp.

LRESULT window::OnKeyDown ( long  VirtKey,
long  flags 
) [virtual]

Definition at line 432 of file window.cpp.

LRESULT window::OnKeyUp ( long  VirtKey,
long  flags 
) [virtual]

Definition at line 428 of file window.cpp.

LRESULT window::OnLDClick ( unsigned int  flags,
POINTS  p 
) [virtual]

Definition at line 356 of file window.cpp.

LRESULT window::OnLDown ( unsigned int  flags,
POINTS  p 
) [virtual]

Definition at line 348 of file window.cpp.

LRESULT window::OnLUp ( unsigned int  flags,
POINTS  p 
) [virtual]

Definition at line 352 of file window.cpp.

LRESULT window::OnMeasureItem ( long  ctlID,
MEASUREITEMSTRUCT *  mis 
) [virtual]

Definition at line 502 of file window.cpp.

LRESULT window::OnMouseOut ( HWND  NewWindow) [virtual]

Definition at line 372 of file window.cpp.

LRESULT window::OnMouseOver ( unsigned int  flags,
POINTS  p 
) [virtual]

Definition at line 376 of file window.cpp.

LRESULT window::OnMove ( unsigned long  NewX,
unsigned long  NewY 
) [virtual]

Definition at line 460 of file window.cpp.

LRESULT window::OnNCHitTest ( POINTS  pos) [virtual]

Definition at line 482 of file window.cpp.

LRESULT window::OnNCPaint ( HRGN  region) [virtual]

Definition at line 464 of file window.cpp.

LRESULT window::OnNotify ( unsigned long  ID,
NMHDR *  nmh 
) [virtual]

Definition at line 448 of file window.cpp.

LRESULT window::OnPaint ( ) [virtual]

Definition at line 344 of file window.cpp.

LRESULT window::OnParentNotifyClick ( unsigned short  event,
short  x,
short  y 
) [virtual]

Definition at line 498 of file window.cpp.

LRESULT window::OnParentNotifyCreate ( unsigned short  event,
unsigned short  wID,
HWND  win 
) [virtual]

Definition at line 494 of file window.cpp.

LRESULT window::OnPosChanged ( WINDOWPOS *  wpos) [virtual]

Definition at line 468 of file window.cpp.

LRESULT window::OnRDClick ( unsigned int  flags,
POINTS  p 
) [virtual]

Definition at line 368 of file window.cpp.

LRESULT window::OnRDown ( unsigned int  flags,
POINTS  p 
) [virtual]

Definition at line 360 of file window.cpp.

LRESULT window::OnRUp ( unsigned int  flags,
POINTS  p 
) [virtual]

Definition at line 364 of file window.cpp.

LRESULT window::OnShow ( bool  show,
long  Status 
) [virtual]

Definition at line 420 of file window.cpp.

LRESULT window::OnSize ( unsigned long  flag,
unsigned short  NewWidth,
unsigned short  NewHeight 
) [virtual]

Definition at line 440 of file window.cpp.

LRESULT window::OnSizing ( unsigned long  side,
RECT *  r 
) [virtual]

Definition at line 444 of file window.cpp.

LRESULT window::OnStaticColor ( HDC  dc,
HWND  sttc 
) [virtual]

Set the background color of the control.

This function allows the parent window to have first priority in determining its background color. If the parent window does not override this function, the base implementation will attempt to send the message to the control object as well.

Parameters:
dcHDC handle sent by the windows API
sttcThe HWND of the control
Returns:
The HBRUSH handle

Reimplemented in aswang::Static.

Definition at line 402 of file window.cpp.

LRESULT window::OnTimer ( unsigned long  id,
TIMERPROC  tproc 
) [virtual]

Definition at line 486 of file window.cpp.

virtual aswang::window::operator HWND ( ) [inline, virtual]

Definition at line 130 of file window.h.

virtual void aswang::window::RemoveCallback ( unsigned long  msg) [inline, virtual]

Definition at line 91 of file window.h.

void window::Resize ( int  width,
int  height 
) [virtual]

Definition at line 189 of file window.cpp.

void window::SetAlignment ( Alignment  a) [virtual]

Definition at line 150 of file window.cpp.

virtual void aswang::window::SetBrush ( const Brush b) [inline, virtual]

Definition at line 67 of file window.h.

void aswang::window::SetHwnd ( HWND  h) [inline]

Definition at line 55 of file window.h.

static void aswang::window::SetInstance ( HINSTANCE  h) [inline, static]

Definition at line 85 of file window.h.

void aswang::window::SetParent ( window newp) [inline]

Definition at line 57 of file window.h.

void window::SetStyle ( unsigned long  s) [virtual]

Definition at line 195 of file window.cpp.

void window::SetText ( AswangStr  s) const

Definition at line 75 of file window.cpp.

void window::Show ( int  showCommand = SW_SHOWNORMAL) [virtual]

Definition at line 41 of file window.cpp.

void window::Transparent ( bool  t) const [virtual]

Definition at line 45 of file window.cpp.

void window::Update ( ) [virtual]

Definition at line 177 of file window.cpp.

LRESULT CALLBACK window::WProc ( HWND  h,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
) [static]

Definition at line 207 of file window.cpp.


Member Data Documentation

Definition at line 39 of file window.h.

Definition at line 41 of file window.h.

HINSTANCE window::hInstance [static, protected]

Definition at line 36 of file window.h.

HWND aswang::window::hWnd [protected]

Definition at line 37 of file window.h.

Definition at line 38 of file window.h.

unsigned long aswang::window::style [protected]

Definition at line 40 of file window.h.

window::wmap_type window::wmap [static, protected]

Definition at line 35 of file window.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines