aswang
1.0
|
#include <window.h>
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) |
window * | GetParent () |
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 Brush & | GetBrush () 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 window * | GetWindow (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 |
window * | mParent |
Brush | bg |
unsigned long | style |
callbackMap_type | callbackMap |
Static Protected Attributes | |
static wmap_type | wmap |
static HINSTANCE | hInstance |
typedef std::map<unsigned int,std::pair<HWND,msgCallback> > aswang::window::callbackMap_type [protected] |
typedef LRESULT(window::* aswang::window::msgCallback)(window *, UINT, WPARAM, LPARAM) |
typedef std::map<HWND,window *> aswang::window::wmap_type [protected] |
aswang::window::window | ( | window * | p, |
unsigned long | newStyle = 0UL |
||
) | [inline] |
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] |
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] |
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.
static HINSTANCE aswang::window::GetInstance | ( | ) | [inline, static] |
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.
dc | HDC handle sent by the windows API |
sttc | The HWND of the control |
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] |
virtual void aswang::window::RemoveCallback | ( | unsigned long | msg | ) | [inline, virtual] |
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] |
static void aswang::window::SetInstance | ( | HINSTANCE | h | ) | [inline, static] |
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.
Brush aswang::window::bg [protected] |
callbackMap_type aswang::window::callbackMap [protected] |
HINSTANCE window::hInstance [static, protected] |
HWND aswang::window::hWnd [protected] |
window* aswang::window::mParent [protected] |
unsigned long aswang::window::style [protected] |
window::wmap_type window::wmap [static, protected] |