Swinc
SourceForge.net Logo

 

 

swinc::SwincWindowBase Class Reference

Abstract Base Class that all other Swinc windows are based. More...

#include <swincbase.h>

Inheritance diagram for swinc::SwincWindowBase:

swinc::SwincControlWindow swinc::SwincDialog swinc::SwincWindow swinc::SwincButton swinc::SwincComboBox swinc::SwincEdit swinc::SwincLabel swinc::SwincListBox swinc::SwincListView swinc::SwincTab List of all members.

Public Types

enum  ALIGNMENT { LEFT, CENTER, RIGHT }

Public Member Functions

 SwincWindowBase ()
 Constructor.
virtual ~SwincWindowBase ()
 Destructor.
HINSTANCE Instance () const
bool IsDialog () const
virtual bool TreatAsDialog ()
void SetPos (const long x, const long y, long width, long height)
void WindowText (const tstring &text)
virtual tstring WindowText ()
void WindowStyle (DWORD style, bool replace=true)
DWORD ExWindowStyle (const DWORD style, const bool replace=true)
swinc::pMsgHandler addMsgHandler (int msg, GlobalMessageHandler pmh)
 Adds a global message handler to the class You can add a global or static function to you class to handle Window messages. The global form of the function should be: LRESULT function_name(SwincWindowBase*, WPARAM, LPARAM).
template<typename _Ty>
swinc::pMsgHandler addMsgHandler (int msg, LRESULT(_Ty::*pfMessageHandler)(WPARAM, LPARAM))
 Templated function which adds a member function message handler.

Static Public Member Functions

static LRESULT CALLBACK WndProc (HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
static LRESULT CALLBACK WndProc2 (HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
static SwincWindowBaseGetSwincWindow (const HWND hwnd)

Public Attributes

swinc::SwincHwnd Hwnd
swinc::SwincHwnd Parent

Static Public Attributes

static HWND g_current_dialog_hwnd = 0

Protected Member Functions

void setDialog ()
void Create ()
void Register ()
void MenuOrControlId (int id)
void ClassName (tstring name)
tstring ClassName ()

Protected Attributes

DWORD mWinStyle
DWORD mExWinStyle
WNDCLASSEX * m_pWindowclass
swinc::MessageMap WinMsgMap

Friends

class swinc::PtrMap

Detailed Description

Abstract Base Class that all other Swinc windows are based.

SwincWindowBase is the base for all other Swinc Based windows and controls.
It is preferred that user not derive their classes from SwincWindowBase as it would be difficult to implement many of the pure virtual functions.


Member Enumeration Documentation

enum swinc::SwincWindowBase::ALIGNMENT

Used in various text related functions to provide a consistent grammer throughout in interface. The Windows API for example uses differnt IDs for alignment for a combobox and a listbox and a listview, 3 similar controls. With Swinc you can use the ALIGNMENT enum for all.

Enumerator:
LEFT 
CENTER 
RIGHT 


Constructor & Destructor Documentation

swinc::SwincWindowBase::SwincWindowBase (  ) 

Constructor.

swinc::SwincWindowBase::~SwincWindowBase (  )  [virtual]

Destructor.


Member Function Documentation

HINSTANCE swinc::SwincWindowBase::Instance (  )  const [inline]

bool swinc::SwincWindowBase::IsDialog (  )  const [inline]

virtual bool swinc::SwincWindowBase::TreatAsDialog (  )  [inline, virtual]

void swinc::SwincWindowBase::SetPos ( const long  x,
const long  y,
long  width,
long  height 
)

void swinc::SwincWindowBase::WindowText ( const tstring text  ) 

swinc::tstring swinc::SwincWindowBase::WindowText (  )  [virtual]

void swinc::SwincWindowBase::WindowStyle ( DWORD  style,
bool  replace = true 
)

DWORD swinc::SwincWindowBase::ExWindowStyle ( const DWORD  style,
const bool  replace = true 
)

Description: Changes the Extended Window Style of a Window

Returns:
Previous Extended Window style;
Parameters:
style,The Extended Window Style to set
replace,Set to true(default) to replace existing Extended style; false to preserve existing styles.

LRESULT CALLBACK swinc::SwincWindowBase::WndProc ( HWND  hwnd,
UINT  msg,
WPARAM  wp,
LPARAM  lp 
) [static]

LRESULT CALLBACK swinc::SwincWindowBase::WndProc2 ( HWND  hwnd,
UINT  msg,
WPARAM  wp,
LPARAM  lp 
) [static]

swinc::SwincWindowBase * swinc::SwincWindowBase::GetSwincWindow ( const HWND  hwnd  )  [static]

Description: Retrieves a pointer to the Swinc Class for a Swinc based window;

Returns:
Pointer to a SwincWindowBase or 0 if not a Swinc Window
Parameters:
hwnd,HWND of the window you wish to retrieve the associated Swinc class.

swinc::pMsgHandler swinc::SwincWindowBase::addMsgHandler ( int  msg,
GlobalMessageHandler  pmh 
)

Adds a global message handler to the class You can add a global or static function to you class to handle Window messages. The global form of the function should be: LRESULT function_name(SwincWindowBase*, WPARAM, LPARAM).

Parameters:
msg - The window message to be handled. ex WM_COMMAND.
pmh - A pointer to the function that will handle the msg.

template<typename _Ty>
swinc::pMsgHandler swinc::SwincWindowBase::addMsgHandler ( int  msg,
LRESULT(_Ty::*)(WPARAM, LPARAM)  pfMessageHandler 
) [inline]

Templated function which adds a member function message handler.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
usage ex. addMsgHandler(WM_COMMAND, &YourClass::OnCommand);

Parameters:
msg - The window message to be handled. ex WM_COMMAND.
pfMessageHandler - a pointer to member function

void swinc::SwincWindowBase::setDialog (  )  [inline, protected]

void swinc::SwincWindowBase::Create (  )  [protected]

void swinc::SwincWindowBase::Register (  )  [protected]

void swinc::SwincWindowBase::MenuOrControlId ( int  id  )  [protected]

void swinc::SwincWindowBase::ClassName ( tstring  name  )  [protected]

swinc::tstring swinc::SwincWindowBase::ClassName (  )  [protected]


Friends And Related Function Documentation

friend class swinc::PtrMap [friend]


Member Data Documentation

HWND swinc::SwincWindowBase::g_current_dialog_hwnd = 0 [static]

swinc::SwincHwnd swinc::SwincWindowBase::Hwnd

swinc::SwincHwnd swinc::SwincWindowBase::Parent

DWORD swinc::SwincWindowBase::mWinStyle [protected]

DWORD swinc::SwincWindowBase::mExWinStyle [protected]

WNDCLASSEX* swinc::SwincWindowBase::m_pWindowclass [protected]

swinc::MessageMap swinc::SwincWindowBase::WinMsgMap [protected]


The documentation for this class was generated from the following files:
Generated on Sat Jul 7 11:45:10 2007 for SWinC by  doxygen 1.5.2