License stamp location window class: displays the stamp and allows the user to move it. More...
#include <CCLicenseLocationWnd.h>
Public Member Functions | |
CCLicenseLocationWnd (SIZE szPage, RECT rectLocation) | |
Constructor. | |
~CCLicenseLocationWnd () | |
Destructor. | |
BOOL | CreateWnd (LPCTSTR lpName, DWORD dwStyle, const RECT &rect, HWND hParent) |
This function creates a license stamp location window. | |
POINT | GetLicenseLocation () const |
Retrieves the current license stamp location (in page co-ordinates). | |
void | SetXLocation (UINT uX) |
Sets the X co-ordinates of the license stamp. | |
void | SetYLocation (UINT uY) |
Sets the Y co-ordinates of the license stamp. | |
Protected Member Functions | |
void | CalcLicenseViewLocation () |
Calculates the stamp location in client co-ordinates. | |
void | MoveLicense (POINT pt) |
Moves the license stamp. | |
void | SendLicenseLocationMsg () |
Sends a license stamp location change message to the parent. | |
void | UpdateLocation () |
Updates the view and the parent about changed location of the stamp. | |
virtual LRESULT | ProcessMessage (UINT uMsg, WPARAM wParam, LPARAM lParam) |
Called to handle windows messages. | |
virtual void | PostDestroy () |
Called when the window is destroyed. | |
Static Protected Member Functions | |
static bool | RegisterWindowClass () |
Registers the license stamp location window class. | |
static void | UnregisterWindowClass () |
Unregisters the license stamp location window class (holds until all such windows are destroyed). | |
static void | UnregisterWindowClassNow () |
Actually unregisters the license stamp location window class. | |
static LRESULT CALLBACK | WndProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) |
Window message handling callback. | |
Protected Attributes | |
HWND | m_hWnd |
Handle to the window. | |
SIZE | m_szPage |
Actual size of the page (relative to the stamp). | |
RECT | m_rectLocation |
Current location of the license stamp. | |
RECT | m_rectPageView |
The page display location (in client co-ordinates). | |
RECT | m_rectLicenseView |
The license stamp display location (in client co-ordinates). | |
HBITMAP | m_hBmp |
Handle to license stamp image. | |
SIZE | m_szBitmap |
Size of the stamp image (in client units). | |
bool | m_bDragging |
true will the user is dragging the stamp, false otherwise | |
SIZE | m_szOffset |
Offset of the mouse cursor from the top-left corner of the stamp (while dragging). | |
Static Protected Attributes | |
static ATOM | m_aClass = 0 |
Windows ATOM holding the Windows class registration (valid while there is at least one active window). | |
static int | m_nCount = 0 |
Count of active windows. |
License stamp location window class: displays the stamp and allows the user to move it.
Definition at line 36 of file CCLicenseLocationWnd.h.
CCLicenseLocationWnd::CCLicenseLocationWnd | ( | SIZE | szPage, | |
RECT | rectLocation | |||
) | [inline] |
Constructor.
szPage | Size of the page | |
rectLocation | Initial location (and size) of the license stamp |
Definition at line 45 of file CCLicenseLocationWnd.h.
BOOL CCLicenseLocationWnd::CreateWnd | ( | LPCTSTR | lpName, | |
DWORD | dwStyle, | |||
const RECT & | rect, | |||
HWND | hParent | |||
) |
This function creates a license stamp location window.
lpName | Name of new window | |
dwStyle | Style of new window | |
rect | Location of new window (in parent co-ordinates) | |
hParent | Handle to parent window |
Definition at line 61 of file CCLicenseLocationWnd.cpp.
References ghInstance, m_aClass, m_hWnd, RegisterWindowClass(), and UnregisterWindowClass().
Referenced by CCLicenseLocationDlg::PageProc().
POINT CCLicenseLocationWnd::GetLicenseLocation | ( | ) | const [inline] |
Retrieves the current license stamp location (in page co-ordinates).
Definition at line 88 of file CCLicenseLocationWnd.h.
References m_rectLocation.
Referenced by CCLicenseLocationDlg::PageProc().
void CCLicenseLocationWnd::MoveLicense | ( | POINT | pt | ) | [protected] |
Moves the license stamp.
pt | The location to put the stamp at (client co-ordinates) |
Definition at line 370 of file CCLicenseLocationWnd.cpp.
References m_hWnd, m_rectLicenseView, m_rectLocation, m_rectPageView, m_szOffset, m_szPage, and SendLicenseLocationMsg().
Referenced by ProcessMessage().
LRESULT CCLicenseLocationWnd::ProcessMessage | ( | UINT | uMsg, | |
WPARAM | wParam, | |||
LPARAM | lParam | |||
) | [protected, virtual] |
Called to handle windows messages.
uMsg | ID of the message | |
wParam | First parameter of the message | |
lParam | Second parameter of the message |
Definition at line 198 of file CCLicenseLocationWnd.cpp.
References CalcLicenseViewLocation(), PngImage::GetHeight(), PngImage::GetWidth(), ghInstance, PngImage::LoadFromResource(), m_bDragging, m_hBmp, m_hWnd, m_rectLicenseView, m_rectPageView, m_szBitmap, m_szOffset, m_szPage, MoveLicense(), PngImage::ToBitmap(), and UnregisterWindowClass().
Referenced by WndProc().
bool CCLicenseLocationWnd::RegisterWindowClass | ( | ) | [static, protected] |
Registers the license stamp location window class.
Definition at line 84 of file CCLicenseLocationWnd.cpp.
References ghInstance, m_aClass, m_nCount, and WndProc().
Referenced by CreateWnd().
void CCLicenseLocationWnd::SetXLocation | ( | UINT | uX | ) |
Sets the X co-ordinates of the license stamp.
uX | The new X location of the stamp (in page co-ordinates) |
Definition at line 418 of file CCLicenseLocationWnd.cpp.
References m_rectLocation, m_szPage, and UpdateLocation().
Referenced by CCLicenseLocationDlg::PageProc().
void CCLicenseLocationWnd::SetYLocation | ( | UINT | uY | ) |
Sets the Y co-ordinates of the license stamp.
uY | The new Y location of the stamp (in page co-ordinates) |
Definition at line 433 of file CCLicenseLocationWnd.cpp.
References m_rectLocation, m_szPage, and UpdateLocation().
Referenced by CCLicenseLocationDlg::PageProc().
LRESULT CALLBACK CCLicenseLocationWnd::WndProc | ( | HWND | hWnd, | |
UINT | uMsg, | |||
WPARAM | wParam, | |||
LPARAM | lParam | |||
) | [static, protected] |
Window message handling callback.
hWnd | Handle to the window | |
uMsg | ID of the message | |
wParam | First parameter of the message | |
lParam | Second parameter of the message |
Definition at line 155 of file CCLicenseLocationWnd.cpp.
References m_hWnd, PostDestroy(), and ProcessMessage().
Referenced by RegisterWindowClass().