All Classes Files Functions Variables Typedefs Pages
Public Member Functions | Public Attributes | List of all members
Control Class Reference

Base class for all control wrappers. More...

#include <control.h>

Inheritance diagram for Control:
IWindow Button ComboBox Edit ListBox ListView ProgressBar ScrollBar StaticCtrl StatusBar TabCtrl TreeView

Public Member Functions

 Control (HWND hwnd=NULL)
HWND _InternalGetHandle ()
 operator HWND ()
Controloperator= (HWND hwnd)
- Public Member Functions inherited from IWindow
Rect ClientRect ()
void Destroy ()
void DragAcceptFiles (BOOL accept=TRUE)
void Enable (BOOL enable)
DWORD GetExStyle ()
HFONT GetFont ()
HICON GetIcon (BOOL bigIcon)
DWORD GetStyle ()
tstring GetText ()
BOOL Invalidate (const RECT *rect=NULL, BOOL eraseBkgnd=TRUE)
BOOL IsEnabled ()
BOOL IsVisible ()
void KillTimer (UINT_PTR timerID)
void ModifyStyle (DWORD add, DWORD remove)
void Move (int x, int y, BOOL redraw=TRUE)
void Move (const POINT &p, BOOL redraw=TRUE)
void Move (int x, int y, int width, int height, BOOL redraw=TRUE)
void Move (const POINT &p, const SIZE &s, BOOL redraw=TRUE)
void Move (const RECT &r, BOOL redraw=TRUE)
HWND ParentHandle ()
Rect RectOnParent ()
HWND SetFocus ()
void SetFont (HFONT font, BOOL redraw=TRUE)
HICON SetIcon (HICON icon, BOOL bigIcon)
void SetRedraw (BOOL allowRedraw)
void SetText (const tstring &text)
UINT_PTR SetTimer (UINT_PTR timerID, UINT interval, TIMERPROC proc=NULL)
BOOL Show (int cmdShow)
Rect WindowRect ()

Public Attributes

HWND handle

Detailed Description

Base class for all control wrappers.

Control wrappers don't manage the handle, they are only there to call messages on the handle. So they can be freely copied or destroyed without affecting the control on screen. Since controls are automatically deleted when their parent window closes, I saw no need to manage handles here.

So the guideline for Control derived classes is:

Constructor & Destructor Documentation

Control::Control ( HWND  hwnd = NULL)

Member Function Documentation

HWND Control::_InternalGetHandle ( )

Subclasses must override this function to make this interface work.

Handle of the window that implements this interface.

Implements IWindow.

Control::operator HWND ( )
Control& Control::operator= ( HWND  hwnd)

Member Data Documentation

HWND Control::handle

Window handle of the control. It's public to be modified in any way.

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