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

VCF::AbstractGTKControl Class Reference

This class serves as a common implementation for various methods of the ControlPeer interface. More...

#include <AbstractGTKControl.h>

Inheritance diagram for VCF::AbstractGTKControl:

VCF::Object VCF::ControlPeer VCF::Interface VCF::GTKCommandButton VCF::GTKControl VCF::GTKTextControl VCF::GTKToolbar VCF::GTKWindow VCF::GTKDialog List of all members.

Public Member Functions

 AbstractGTKControl ()
virtual ~AbstractGTKControl ()
virtual OSHandleID getHandleID ()
 returns a ID that identifies this control.
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 String getText ()
 returns a text associated with the component.
virtual void setText (const String &text)
 sets the text for the widget
virtual void setBounds (Rect *rect)
 sets the bounds for the component.
virtual bool beginSetBounds (const uint32 &numberOfChildren)
 advanced function for changing the size of multiple child windows
virtual void endSetBounds ()
virtual 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 ControlgetControl ()
 returns the component that this Peer is attached to.
virtual void setControl (Control *component)
 attahces the Peer to a particular component.
virtual void setCursor (Cursor *cursor)
virtual void setParent (Control *parent)
virtual 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=NULL)
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 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 gboolean handleEvent (GdkEvent *gtkEvent)
Rect internal_getBounds ()
void internal_setBounds (const Rect &bounds)

Static Public Member Functions

static AbstractGTKControlgetGTKControlFromWidget (GtkWidget *wndHandle)
static GtkType getGTKType ()

Protected Types

typedef std::map< GtkWidget *,
AbstractGTKControl * > 
GTKControlMap

Protected Member Functions

virtual void initGdkEventHandlers ()

Static Protected Member Functions

static void registerGTKControl (AbstractGTKControl *gtkControl)
static void unRegisterGTKControl (AbstractGTKControl *gtkControl)
static gboolean onGdkEvent (GtkWidget *widget, GdkEvent *event, gpointer user_data)

Protected Attributes

AbstractGTKControlparent_
bool enabled_
GtkWidget * wndHandle_
Controlcontrol_
Rect bounds_
bool repainted_

Static Protected Attributes

static GTKControlMap gtkControlMap

Classes

struct  Container
struct  ContainerChild
struct  ContainerClass

Detailed Description

This class serves as a common implementation for various methods of the ControlPeer interface.

Usually a class like GTKControl, GTKWindow, etc will share most of the same functionality, and only differ by a few overridden methods


Member Typedef Documentation

typedef std::map<GtkWidget*,AbstractGTKControl*> VCF::AbstractGTKControl::GTKControlMap [protected]
 


Constructor & Destructor Documentation

VCF::AbstractGTKControl::AbstractGTKControl  ) 
 

virtual VCF::AbstractGTKControl::~AbstractGTKControl  )  [virtual]
 


Member Function Documentation

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

advanced function for changing the size of multiple child windows

Implements VCF::ControlPeer.

virtual void VCF::AbstractGTKControl::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::GTKCommandButton, VCF::GTKControl, VCF::GTKDialog, VCF::GTKTextControl, VCF::GTKToolbar, and VCF::GTKWindow.

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

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

Implements VCF::ControlPeer.

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

Implements VCF::ControlPeer.

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

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

Implements VCF::ControlPeer.

Reimplemented in VCF::GTKWindow.

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

returns the component that this Peer is attached to.

Implements VCF::ControlPeer.

static AbstractGTKControl* VCF::AbstractGTKControl::getGTKControlFromWidget GtkWidget *  wndHandle  )  [static]
 

static GtkType VCF::AbstractGTKControl::getGTKType  )  [static]
 

virtual OSHandleID VCF::AbstractGTKControl::getHandleID  )  [inline, virtual]
 

returns a ID that identifies this control.

On Win32 this corresponds to an HWND.

Implements VCF::ControlPeer.

Reimplemented in VCF::GTKWindow.

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

Implements VCF::ControlPeer.

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

returns a text associated with the component.

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

Implements VCF::ControlPeer.

Reimplemented in VCF::GTKCommandButton, VCF::GTKTextControl, and VCF::GTKWindow.

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

returns wether or not the component is currently visible.

Implements VCF::ControlPeer.

virtual gboolean VCF::AbstractGTKControl::handleEvent GdkEvent *  gtkEvent  )  [virtual]
 

Reimplemented in VCF::GTKCommandButton, VCF::GTKTextControl, VCF::GTKToolbar, and VCF::GTKWindow.

virtual void VCF::AbstractGTKControl::initGdkEventHandlers  )  [protected, virtual]
 

Reimplemented in VCF::GTKWindow.

Rect VCF::AbstractGTKControl::internal_getBounds  )  [inline]
 

void VCF::AbstractGTKControl::internal_setBounds const Rect bounds  )  [inline]
 

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

Implements VCF::ControlPeer.

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

Implements VCF::ControlPeer.

virtual void VCF::AbstractGTKControl::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.

static gboolean VCF::AbstractGTKControl::onGdkEvent GtkWidget *  widget,
GdkEvent *  event,
gpointer  user_data
[static, protected]
 

static void VCF::AbstractGTKControl::registerGTKControl AbstractGTKControl gtkControl  )  [static, protected]
 

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

releases mouse events - goes back to normal event handling

Implements VCF::ControlPeer.

virtual void VCF::AbstractGTKControl::repaint Rect repaintRect = NULL  )  [virtual]
 

virtual void VCF::AbstractGTKControl::setBounds 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::GTKWindow.

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

attahces the Peer to a particular component.

This should only be done once.

Implements VCF::ControlPeer.

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

Implements VCF::ControlPeer.

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

Implements VCF::ControlPeer.

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

Implements VCF::ControlPeer.

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

Implements VCF::ControlPeer.

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

Implements VCF::ControlPeer.

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

sets the text for the widget

Implements VCF::ControlPeer.

Reimplemented in VCF::GTKCommandButton, VCF::GTKTextControl, and VCF::GTKWindow.

virtual void VCF::AbstractGTKControl::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.

virtual void VCF::AbstractGTKControl::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::AbstractGTKControl::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.

static void VCF::AbstractGTKControl::unRegisterGTKControl AbstractGTKControl gtkControl  )  [static, protected]
 


Member Data Documentation

Rect VCF::AbstractGTKControl::bounds_ [protected]
 

Control* VCF::AbstractGTKControl::control_ [protected]
 

bool VCF::AbstractGTKControl::enabled_ [protected]
 

GTKControlMap VCF::AbstractGTKControl::gtkControlMap [static, protected]
 

AbstractGTKControl* VCF::AbstractGTKControl::parent_ [protected]
 

bool VCF::AbstractGTKControl::repainted_ [protected]
 

GtkWidget* VCF::AbstractGTKControl::wndHandle_ [protected]
 


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