#include <DynamicWndEx.h>
Inheritance diagram for CDynamicWndEx:
Public Types | |
rflg_none = 0 | |
rflg_state = 0x01 | |
rflg_visibility = 0x02 | |
rflg_all = rflg_state|rflg_visibility | |
flAutoPos = 0x0100 | |
enum | RestoreFlags { rflg_none = 0, rflg_state = 0x01, rflg_visibility = 0x02, rflg_all = rflg_state|rflg_visibility } |
enum | ExFlags { flAutoPos = 0x0100 } |
Public Member Functions | |
CDynamicWndEx (Freedom fd, UINT nFlags) | |
virtual | ~CDynamicWndEx () |
bool | StretchWindow (const CSize &szDelta) |
bool | StretchWindow (int iAddPcnt) |
bool | RestoreWindowPosition (LPCTSTR lpszProfile, UINT restoreFlags=rflg_all) |
bool | StoreWindowPosition (LPCTSTR lpszProfile) |
void | ActivateAutoPos (UINT nID) |
void | ActivateAutoPos (const CString &strID) |
void | NoAutoPos () |
Static Public Attributes | |
static LPCTSTR | M_lpszAutoPosProfileSection = _T("WindowPositions") |
Protected Member Functions | |
virtual void | OnInitialized () |
virtual void | OnDestroying () |
Private Attributes | |
CString | m_strAutoPos |
Definition at line 41 of file DynamicWndEx.h.
Definition at line 44 of file DynamicWndEx.h.
CDynamicWndEx::CDynamicWndEx | ( | Freedom | fd, | |
UINT | nFlags | |||
) | [inline] |
Definition at line 61 of file DynamicWndEx.h.
virtual CDynamicWndEx::~CDynamicWndEx | ( | ) | [inline, virtual] |
Definition at line 62 of file DynamicWndEx.h.
void CDynamicWndEx::ActivateAutoPos | ( | const CString & | strID | ) | [inline] |
void CDynamicWndEx::ActivateAutoPos | ( | UINT | nID | ) | [inline] |
Definition at line 77 of file DynamicWndEx.h.
References m_strAutoPos.
Referenced by CDynamicDialog::CDynamicDialog().
void CDynamicWndEx::NoAutoPos | ( | ) | [inline] |
Definition at line 79 of file DynamicWndEx.h.
References m_strAutoPos.
Referenced by CDynamicChildDlg::CDynamicChildDlg().
void CDynamicWndEx::OnDestroying | ( | ) | [protected, virtual] |
Reimplemented from CDynamicWnd.
Definition at line 93 of file DynamicWndEx.cpp.
References _makeFullProfile(), CDynamicWnd::IsWindow(), M_lpszAutoPosProfileSection, m_strAutoPos, and StoreWindowPosition().
void CDynamicWndEx::OnInitialized | ( | ) | [protected, virtual] |
Reimplemented from CDynamicWnd.
Definition at line 79 of file DynamicWndEx.cpp.
References _makeFullProfile(), ASSERT, CDynamicWnd::IsWindow(), M_lpszAutoPosProfileSection, m_strAutoPos, RestoreWindowPosition(), rflg_all, StretchWindow(), and CDynamicWnd::Window().
bool CDynamicWndEx::RestoreWindowPosition | ( | LPCTSTR | lpszProfile, | |
UINT | restoreFlags = rflg_all | |||
) |
load the registry data stored by StoreWindowPosition() returns true if data have been found in the registry
Definition at line 231 of file DynamicWndEx.cpp.
References ASSERT, CDynamicWnd::IsWindow(), lpszRegVal_Bottom, lpszRegVal_Left, lpszRegVal_Right, lpszRegVal_State, lpszRegVal_Top, lpszRegVal_Valid, lpszRegVal_Visible, REGVAL_HIDDEN, REGVAL_ICONIC, REGVAL_INVALID, REGVAL_MAXIMIZED, REGVAL_NOSTATE, REGVAL_VALID, REGVAL_VISIBLE, rflg_state, rflg_visibility, VERIFY, and CDynamicWnd::Window().
Referenced by OnInitialized().
bool CDynamicWndEx::StoreWindowPosition | ( | LPCTSTR | lpszProfile | ) |
stores a window's position and visiblity to the registry. return false if any error occurred
Definition at line 186 of file DynamicWndEx.cpp.
References ASSERT, BOOL(), CDynamicWnd::IsWindow(), lpszRegVal_Bottom, lpszRegVal_Left, lpszRegVal_Right, lpszRegVal_State, lpszRegVal_Top, lpszRegVal_Valid, lpszRegVal_Visible, REGVAL_HIDDEN, REGVAL_ICONIC, REGVAL_INVALID, REGVAL_MAXIMIZED, REGVAL_NOSTATE, REGVAL_VALID, REGVAL_VISIBLE, VERIFY, and CDynamicWnd::Window().
Referenced by OnDestroying().
bool CDynamicWndEx::StretchWindow | ( | int | iAddPcnt | ) |
stretch window by a percent value the algorithm calculates the new size for both dimensions by:
newWid = oldWid + (oldWid * iAddPcnt) / 100
NOTE: iAddPcnt may even be nagtive, but it MUST be greater than -100. NOTE: this function does NOT care of the min/max dimensions of a window
The function will return false if the new size would be empty.
Definition at line 160 of file DynamicWndEx.cpp.
References ASSERT, CDynamicWnd::GetBorderSize(), CDynamicWnd::GetCurrentClientSize(), CDynamicWnd::IsWindow(), and StretchWindow().
bool CDynamicWndEx::StretchWindow | ( | const CSize & | szDelta | ) |
stretches the window by szDelta (i.e. if szDelta is 100, the window is enlarged by 100 pixels) stretching means that the center point of the window remains
returns false if the window would be smaller than (1,1)
NOTE: this function does NOT care of the min/max dimensions of a window Use MoveWindow() if you need to take care of it.
STATIC
Definition at line 115 of file DynamicWndEx.cpp.
References ASSERT, CDynamicWnd::IsWindow(), VERIFY, and CDynamicWnd::Window().
Referenced by OnInitialized(), and StretchWindow().
LPCTSTR CDynamicWndEx::M_lpszAutoPosProfileSection = _T("WindowPositions") [static] |
CString CDynamicWndEx::m_strAutoPos [private] |
Definition at line 58 of file DynamicWndEx.h.
Referenced by ActivateAutoPos(), NoAutoPos(), OnDestroying(), and OnInitialized().