CCLicenseLocationWnd Class Reference

License stamp location window class: displays the stamp and allows the user to move it. More...

#include <CCLicenseLocationWnd.h>

List of all members.

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.

Detailed Description

License stamp location window class: displays the stamp and allows the user to move it.

Definition at line 36 of file CCLicenseLocationWnd.h.


Constructor & Destructor Documentation

CCLicenseLocationWnd::CCLicenseLocationWnd ( SIZE  szPage,
RECT  rectLocation 
) [inline]

Constructor.

Parameters:
szPage Size of the page
rectLocation Initial location (and size) of the license stamp

Definition at line 45 of file CCLicenseLocationWnd.h.


Member Function Documentation

BOOL CCLicenseLocationWnd::CreateWnd ( LPCTSTR  lpName,
DWORD  dwStyle,
const RECT &  rect,
HWND  hParent 
)

This function creates a license stamp location window.

Parameters:
lpName Name of new window
dwStyle Style of new window
rect Location of new window (in parent co-ordinates)
hParent Handle to parent window
Returns:
TRUE if created successfully, false if failed

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).

Returns:
The location of the license stamp

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.

Parameters:
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.

Parameters:
uMsg ID of the message
wParam First parameter of the message
lParam Second parameter of the message
Returns:
TRUE if handled, FALSE to continue handling 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.

Returns:
true if the window class was registered successfully, false if failed

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.

Parameters:
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.

Parameters:
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.

Parameters:
hWnd Handle to the window
uMsg ID of the message
wParam First parameter of the message
lParam Second parameter of the message
Returns:
TRUE if handled, FALSE to continue handling the message

Definition at line 155 of file CCLicenseLocationWnd.cpp.

References m_hWnd, PostDestroy(), and ProcessMessage().

Referenced by RegisterWindowClass().


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

Generated on Mon Jun 18 12:40:41 2012 for CC PDF Converter by doxygen 1.6.1