Sourceforge.net - The VCF's Project Host
   The VCF Website Home   |   Online Discussion Forums   |   Sourceforge.net Project Page   

VCF::AbstractWin32Component Class Reference

This is the core Win32 control class peer, does most of the handling of WM_XXX messages. More...

#include <AbstractWin32Component.h>

Inheritance diagram for VCF::AbstractWin32Component:

VCF::Win32Object VCF::ControlPeer VCF::ObjectWithCallbacks VCF::Interface VCF::Object VCF::Win32Button VCF::Win32Component VCF::Win32DropDownPeer VCF::Win32Edit VCF::Win32HTMLBrowser VCF::Win32ListBox VCF::Win32Listview VCF::Win32Toolbar VCF::Win32Tree VCF::Win32Window List of all members.

Public Types

enum  { cpBorderOnly = 0, cpControlOnly, cpBorderAndControl }
 identifiers to specify what to paint More...

Public Member Functions

 AbstractWin32Component ()
 AbstractWin32Component (Control *component)
virtual ~AbstractWin32Component ()
virtual void create (Control *owningControl)
 This is called to actually create any neccessary windowing system resources specific to a new control (or widget/window/etc) instance for the platform.
virtual void destroyControl ()
 Destroy the control peer's resoruces (if neccessary).
virtual OSHandleID getHandleID ()
 returns a ID that identifies this control.
virtual VCF::String getText ()
 returns a text associated with the component.
virtual void setText (const VCF::String &text)
 sets the text for the control
virtual void setBounds (VCF::Rect *rect)
 sets the bounds for the component.
virtual VCF::Rect getBounds ()
 returns the bounds of the component in the coordinate system of the parent.
virtual void setVisible (const bool &visible)
 shows or hides the component.
virtual bool getVisible ()
 returns wether or not the component is currently visible.
virtual VCF::ControlgetControl ()
 returns the component that this Peer is attached to.
virtual void setControl (VCF::Control *component)
 attahces the Peer to a particular component.
virtual void setParent (VCF::Control *parent)
virtual VCF::ControlgetParent ()
virtual bool isFocused ()
virtual void setFocused ()
virtual bool isEnabled ()
virtual void setEnabled (const bool &enabled)
virtual void setFont (Font *font)
virtual void repaint (Rect *repaintRect, const bool &immediately)
virtual void keepMouseEvents ()
 this keeps the mouse events being sent to this control, even is the mouse leaves the physical bounds of the control
virtual void releaseMouseEvents ()
 releases mouse events - goes back to normal event handling
virtual bool handleEventMessages (UINT message, WPARAM wParam, LPARAM lParam, LRESULT &wndProcResult, WNDPROC defaultWndProc=NULL)
 returns true if no further handling is required, otherwise returns false, which means the rest of the handling needs to be done by the default wnd proc.
virtual String toString ()
virtual void setCursor (Cursor *cursor)
virtual bool beginSetBounds (const uint32 &numberOfChildren)
 advanced function for changing the size of multiple child windows.
virtual void endSetBounds ()
virtual void translateToScreenCoords (Point *pt)
 Takes the coordinates in pt, which are in the coordinate system of this control, and translates them into the coordinate system of the Screen.
virtual void translateFromScreenCoords (Point *pt)
 Takes the coordinates in pt, which are in the coordinate system of the Screen, and translates them into the coordinate system of this control.
virtual void setBorder (Border *border)
 Called by the control when it's border object changes.
virtual void preChildPaint (GraphicsContext *graphicsContext, Control *child, Rect *childClipRect)
 Called by the container instance of the child's parent control during it's paintChildren() function.
virtual void postChildPaint (GraphicsContext *graphicsContext, Control *child, Rect *oldClipRect)
 Called by the container instance of the child's parent control during it's paintChildren() function.
HDC doControlPaint (HDC paintDC, RECT paintRect, RECT *exclusionRect, int whatToPaint)
 manages a paint message for a control.
void updatePaintDC (HDC paintDC, RECT paintRect, RECT *exclusionRect)

Protected Member Functions

LRESULT handleNCPaint (WPARAM wParam, LPARAM lParam)
LRESULT handleNCCalcSize (WPARAM wParam, LPARAM lParam)
void init ()
 This is where the window is actually created.
void registerForFontChanges ()
void onControlFontChanged (Event *event)

Protected Attributes

HDC memDC_
HBITMAP originalMemBMP_
HBITMAP memBMP_
bool mouseEnteredControl_
int memDCState_
bool destroyed_
bool canProcessMessages_
std::vector< MSG > * cachedMessages_

Detailed Description

This is the core Win32 control class peer, does most of the handling of WM_XXX messages.


Member Enumeration Documentation

anonymous enum
 

identifiers to specify what to paint

See also:
AbstractWin32Component::doControlPaint()
Enumerator:
cpBorderOnly 
cpControlOnly 
cpBorderAndControl 


Constructor & Destructor Documentation

VCF::AbstractWin32Component::AbstractWin32Component  ) 
 

VCF::AbstractWin32Component::AbstractWin32Component Control component  ) 
 

virtual VCF::AbstractWin32Component::~AbstractWin32Component  )  [virtual]
 


Member Function Documentation

virtual bool VCF::AbstractWin32Component::beginSetBounds const uint32 numberOfChildren  )  [virtual]
 

advanced function for changing the size of multiple child windows.

This may have no implementation on some windowing systems

Implements VCF::ControlPeer.

virtual void VCF::AbstractWin32Component::create Control owningControl  )  [virtual]
 

This is called to actually create any neccessary windowing system resources specific to a new control (or widget/window/etc) instance for the platform.

create() must be called by the containing VCF::Control subclass, typically in the classes constructor, after retreiving the new peer instance from the appropriate UIToolkit::createXXX() call.

Implements VCF::ControlPeer.

Reimplemented in VCF::Win32Button, VCF::Win32Component, VCF::Win32Dialog, VCF::Win32DropDownPeer, VCF::Win32Edit, VCF::Win32Listview, VCF::Win32PopupWindowPeer, VCF::Win32Toolbar, VCF::Win32TransparentWindowPeer, VCF::Win32Tree, VCF::Win32Window, and VCF::Win32HTMLBrowser.

virtual void VCF::AbstractWin32Component::destroyControl  )  [virtual]
 

Destroy the control peer's resoruces (if neccessary).

Implements VCF::ControlPeer.

HDC VCF::AbstractWin32Component::doControlPaint HDC  paintDC,
RECT  paintRect,
RECT *  exclusionRect,
int  whatToPaint
 

manages a paint message for a control.

it prepares the Graphics context for the control so the correct device context handle is used. It garantees that the state of the Graphics context doesn't change during tha paint operation.

Parameters:
HDC paintDC, the HDC given by the system with the paint message.
See also:
GraphicsContext::saveState()

virtual void VCF::AbstractWin32Component::endSetBounds  )  [virtual]
 

Implements VCF::ControlPeer.

virtual VCF::Rect VCF::AbstractWin32Component::getBounds  )  [virtual]
 

returns the bounds of the component in the coordinate system of the parent.

Implements VCF::ControlPeer.

Reimplemented in VCF::Win32DropDownPeer, and VCF::Win32ListBox.

virtual VCF::Control* VCF::AbstractWin32Component::getControl  )  [virtual]
 

returns the component that this Peer is attached to.

Implements VCF::ControlPeer.

Reimplemented in VCF::Win32ListBox.

virtual OSHandleID VCF::AbstractWin32Component::getHandleID  )  [virtual]
 

returns a ID that identifies this control.

On Win32 this corresponds to an HWND.

Implements VCF::ControlPeer.

Reimplemented in VCF::Win32ListBox.

virtual VCF::Control* VCF::AbstractWin32Component::getParent  )  [virtual]
 

Implements VCF::ControlPeer.

Reimplemented in VCF::Win32ListBox.

virtual VCF::String VCF::AbstractWin32Component::getText  )  [virtual]
 

returns a text associated with the component.

This usually gets used in the Control::getCaption() method.

Implements VCF::ControlPeer.

Reimplemented in VCF::Win32Edit, and VCF::Win32ListBox.

virtual bool VCF::AbstractWin32Component::getVisible  )  [virtual]
 

returns wether or not the component is currently visible.

Implements VCF::ControlPeer.

Reimplemented in VCF::Win32ListBox.

virtual bool VCF::AbstractWin32Component::handleEventMessages UINT  message,
WPARAM  wParam,
LPARAM  lParam,
LRESULT &  wndProcResult,
WNDPROC  defaultWndProc = NULL
[virtual]
 

returns true if no further handling is required, otherwise returns false, which means the rest of the handling needs to be done by the default wnd proc.

Reimplemented from VCF::Win32Object.

Reimplemented in VCF::Win32Button, VCF::Win32Dialog, VCF::Win32DropDownPeer, VCF::Win32Edit, VCF::Win32Listview, VCF::Win32PopupWindowPeer, VCF::Win32Toolbar, VCF::Win32TransparentWindowPeer, VCF::Win32Tree, VCF::Win32Window, and VCF::Win32HTMLBrowser.

LRESULT VCF::AbstractWin32Component::handleNCCalcSize WPARAM  wParam,
LPARAM  lParam
[protected]
 

LRESULT VCF::AbstractWin32Component::handleNCPaint WPARAM  wParam,
LPARAM  lParam
[protected]
 

void VCF::AbstractWin32Component::init  )  [protected]
 

This is where the window is actually created.

Called from constructors

Reimplemented from VCF::Win32Object.

virtual bool VCF::AbstractWin32Component::isEnabled  )  [virtual]
 

Implements VCF::ControlPeer.

Reimplemented in VCF::Win32ListBox.

virtual bool VCF::AbstractWin32Component::isFocused  )  [virtual]
 

Implements VCF::ControlPeer.

Reimplemented in VCF::Win32ListBox.

virtual void VCF::AbstractWin32Component::keepMouseEvents  )  [virtual]
 

this keeps the mouse events being sent to this control, even is the mouse leaves the physical bounds of the control

Implements VCF::ControlPeer.

Reimplemented in VCF::Win32ListBox.

void VCF::AbstractWin32Component::onControlFontChanged Event event  )  [protected]
 

virtual void VCF::AbstractWin32Component::postChildPaint GraphicsContext graphicsContext,
Control child,
Rect oldClipRect
[virtual]
 

Called by the container instance of the child's parent control during it's paintChildren() function.

Called after the child control's paint() and paintBorder() functions.

Implements VCF::ControlPeer.

virtual void VCF::AbstractWin32Component::preChildPaint GraphicsContext graphicsContext,
Control child,
Rect childClipRect
[virtual]
 

Called by the container instance of the child's parent control during it's paintChildren() function.

The implementation should do whatever is neccessary to seup up the child control's cliprect. A pre-calculated cliprect is passed in that was generated by the paintChildren() function.

This function is called prior the child control's paint() or paintBorder() functions.

Implements VCF::ControlPeer.

void VCF::AbstractWin32Component::registerForFontChanges  )  [protected]
 

virtual void VCF::AbstractWin32Component::releaseMouseEvents  )  [virtual]
 

releases mouse events - goes back to normal event handling

Implements VCF::ControlPeer.

Reimplemented in VCF::Win32ListBox.

virtual void VCF::AbstractWin32Component::repaint Rect repaintRect,
const bool &  immediately
[virtual]
 

Implements VCF::ControlPeer.

Reimplemented in VCF::Win32Tree.

virtual void VCF::AbstractWin32Component::setBorder Border border  )  [virtual]
 

Called by the control when it's border object changes.

May or may not need to be implemented depending on the windowing system.

Implements VCF::ControlPeer.

Reimplemented in VCF::Win32PopupWindowPeer.

virtual void VCF::AbstractWin32Component::setBounds VCF::Rect rect  )  [virtual]
 

sets the bounds for the component.

Bounds are specified in the coordinate system of the componenents parent.

Implements VCF::ControlPeer.

Reimplemented in VCF::Win32DropDownPeer, VCF::Win32ListBox, VCF::Win32PopupWindowPeer, and VCF::Win32Window.

virtual void VCF::AbstractWin32Component::setControl VCF::Control component  )  [virtual]
 

attahces the Peer to a particular component.

This should only be done once.

Implements VCF::ControlPeer.

Reimplemented in VCF::Win32ListBox.

virtual void VCF::AbstractWin32Component::setCursor Cursor cursor  )  [virtual]
 

Implements VCF::ControlPeer.

Reimplemented in VCF::Win32ListBox.

virtual void VCF::AbstractWin32Component::setEnabled const bool &  enabled  )  [virtual]
 

Implements VCF::ControlPeer.

Reimplemented in VCF::Win32ListBox.

virtual void VCF::AbstractWin32Component::setFocused  )  [virtual]
 

Implements VCF::ControlPeer.

Reimplemented in VCF::Win32HTMLBrowser.

virtual void VCF::AbstractWin32Component::setFont Font font  )  [virtual]
 

Implements VCF::ControlPeer.

Reimplemented in VCF::Win32DropDownPeer, VCF::Win32ListBox, and VCF::Win32Tree.

virtual void VCF::AbstractWin32Component::setParent VCF::Control parent  )  [virtual]
 

Implements VCF::ControlPeer.

Reimplemented in VCF::Win32ListBox, and VCF::Win32Window.

virtual void VCF::AbstractWin32Component::setText const VCF::String text  )  [virtual]
 

sets the text for the control

Implements VCF::ControlPeer.

Reimplemented in VCF::Win32Edit, VCF::Win32ListBox, VCF::Win32PopupWindowPeer, and VCF::Win32Window.

virtual void VCF::AbstractWin32Component::setVisible const bool &  visible  )  [virtual]
 

shows or hides the component.

This does NOT close the component (if invoked on a frame based component ).

Implements VCF::ControlPeer.

Reimplemented in VCF::Win32ListBox, VCF::Win32PopupWindowPeer, VCF::Win32TransparentWindowPeer, VCF::Win32Window, and VCF::Win32HTMLBrowser.

virtual String VCF::AbstractWin32Component::toString  )  [virtual]
 

virtual void VCF::AbstractWin32Component::translateFromScreenCoords Point pt  )  [virtual]
 

Takes the coordinates in pt, which are in the coordinate system of the Screen, and translates them into the coordinate system of this control.

Parameters:
Point the initial point value, in the coordinate system of the Screen.

Implements VCF::ControlPeer.

virtual void VCF::AbstractWin32Component::translateToScreenCoords Point pt  )  [virtual]
 

Takes the coordinates in pt, which are in the coordinate system of this control, and translates them into the coordinate system of the Screen.

Parameters:
Point the initial point value, in the coordinate system of the control this method is called on.

Implements VCF::ControlPeer.

void VCF::AbstractWin32Component::updatePaintDC HDC  paintDC,
RECT  paintRect,
RECT *  exclusionRect
 


Member Data Documentation

std::vector<MSG>* VCF::AbstractWin32Component::cachedMessages_ [protected]
 

bool VCF::AbstractWin32Component::canProcessMessages_ [protected]
 

bool VCF::AbstractWin32Component::destroyed_ [protected]
 

HBITMAP VCF::AbstractWin32Component::memBMP_ [protected]
 

HDC VCF::AbstractWin32Component::memDC_ [protected]
 

int VCF::AbstractWin32Component::memDCState_ [protected]
 

bool VCF::AbstractWin32Component::mouseEnteredControl_ [protected]
 

HBITMAP VCF::AbstractWin32Component::originalMemBMP_ [protected]
 


The documentation for this class was generated from the following file:
   Comments or Suggestions?    License Information