wxShapeFramework  1.13.0 beta
wxSFControlShape Class Reference

Class encapsulates a special shape able to manage assigned GUI controls (widgets). The GUI control's position and size can by modified via parent control shape. User can also specify how events incoming from the managed GUI control are processed. More...

#include <ControlShape.h>

Inheritance diagram for wxSFControlShape:
Collaboration diagram for wxSFControlShape:

List of all members.

Public Types

enum  EVTPROCESSING {
  evtNONE = 0, evtKEY2GUI = 1, evtKEY2CANVAS = 2, evtMOUSE2GUI = 4,
  evtMOUSE2CANVAS = 8
}
 Way of processing of GUI control's events. More...

Public Member Functions

 wxSFControlShape ()
 Default constructor.
 wxSFControlShape (wxWindow *ctrl, const wxRealPoint &pos, const wxRealPoint &size, wxSFDiagramManager *manager)
 User constructor.
 wxSFControlShape (const wxSFControlShape &obj)
 Copy constructor.
virtual ~wxSFControlShape ()
 Default destructor.
void SetControl (wxWindow *ctrl, bool fit=sfFIT_SHAPE_TO_CONTROL)
 Set managed GUI control.
wxWindow * GetControl ()
 Get pointer to managed GUI control.
void SetEventProcessing (int mask)
 Set a way how GUI control's events are processed.
int GetEventProcessing ()
 Get a way how GUI control's events are processed.
void SetModFill (const wxBrush &brush)
 Set control shape's background style used during its modification.
wxBrush GetModFill ()
 Get control shape's background style used during its modification.
void SetModBorder (const wxPen &pen)
 Set control shape's border styl used during its modification.
wxPen GetModBorder ()
 Get control shape's border styl used during its modification.
void SetControlOffset (int offset)
 Set control shape's offset (a gap between the shape's border and managed GUI control).
int GetControlOffset ()
 Get control shape's offset (a gap between the shape's border and managed GUI control).
void UpdateControl ()
 Update size and position of the managed control according to the parent shape.
void UpdateShape ()
 Update size of the shape position according to the managed control.
virtual void Scale (double x, double y, bool children=sfWITHCHILDREN)
 Scale the shape size by in both directions. The function can be overrided if necessary (new implementation should call default one ore scale shape's children manualy if neccesary).
virtual void MoveTo (double x, double y)
 Move the shape to the given absolute position. The function can be overrided if necessary.
virtual void MoveBy (double x, double y)
 Move the shape by the given offset. The function can be overrided if neccessary.
virtual void Update ()
 Upate shape (align all child shapes an resize it to fit them)
virtual void FitToChildren ()
 Resize the shape to bound all child shapes. The function can be overrided if neccessary.
virtual void OnBeginDrag (const wxPoint &pos)
 Event handler called at the begining of the shape dragging process. The function can be overrided if necessary.
virtual void OnEndDrag (const wxPoint &pos)
 Event handler called at the end of the shape dragging process. The function can be overrided if necessary.
virtual void OnBeginHandle (wxSFShapeHandle &handle)
 Event handler called when the user started to drag the shape handle. The function can be overrided if necessary.
virtual void OnHandle (wxSFShapeHandle &handle)
 Event handler called during dragging of the shape handle. The function can be overrided if necessary.
virtual void OnEndHandle (wxSFShapeHandle &handle)
 Event handler called when the user finished dragging of the shape handle. The function can be overrided if necessary.

Protected Attributes

wxWindow * m_pControl
 Pointer to manager data control.
int m_nProcessEvents
 Events processing mask.
wxBrush m_ModFill
 Brush used during the shape's modification.
wxPen m_ModBorder
 Pen used during the shape's modification.
int m_nControlOffset
 Offset between the shape and managed GUI control.

Private Member Functions

void MarkSerializableDataMembers ()
 Initialize serializable properties.

Private Attributes

wxWindow * m_pPrevParent
 Pointer to parent window.
EventSinkm_pEventSink
 Pointer to event sink.
long m_nPrevStyle
 Previous canvas style.
wxBrush m_PrevFill
 Previously used shape's brush.
wxPen m_PrevBorder
 Previously used shape's pen.

Friends

class EventSink

Detailed Description

Class encapsulates a special shape able to manage assigned GUI controls (widgets). The GUI control's position and size can by modified via parent control shape. User can also specify how events incoming from the managed GUI control are processed.

Note that the managed controls use a shape canvas as their parent window so these shapes cannot be used without existing and properly initialized shape canvas. Moreover, managed GUI controls are not serialized in any way internaly so it is completely up to the user to provide this functionality if needed.


Member Enumeration Documentation

Way of processing of GUI control's events.

Enumerator:
evtNONE 

Event isn't processed.

evtKEY2GUI 

Keyboard events are processed by the GUI control.

evtKEY2CANVAS 

Keyboard events are send to a shape canvas.

evtMOUSE2GUI 

Mouse events are processed by the GUI control.

evtMOUSE2CANVAS 

Mouse events are send to a shape canvas.


Constructor & Destructor Documentation

Default constructor.

wxSFControlShape::wxSFControlShape ( wxWindow *  ctrl,
const wxRealPoint &  pos,
const wxRealPoint &  size,
wxSFDiagramManager manager 
)

User constructor.

Parameters:
ctrlPointer to managed GUI control
posInitial position
sizeInitial size
managerPointer to parent diagram manager

Copy constructor.

Parameters:
objObject to copy from
virtual wxSFControlShape::~wxSFControlShape ( ) [virtual]

Default destructor.


Member Function Documentation

virtual void wxSFControlShape::FitToChildren ( ) [virtual]

Resize the shape to bound all child shapes. The function can be overrided if neccessary.

Reimplemented from wxSFRectShape.

wxWindow* wxSFControlShape::GetControl ( ) [inline]

Get pointer to managed GUI control.

Returns:
Pointer to the GUI control

Get control shape's offset (a gap between the shape's border and managed GUI control).

Returns:
Offset size

Get a way how GUI control's events are processed.

Returns:
Combination of EVTPROCESSING flags
See also:
EVTPROCESSING
wxPen wxSFControlShape::GetModBorder ( ) [inline]

Get control shape's border styl used during its modification.

Returns:
Used pen
wxBrush wxSFControlShape::GetModFill ( ) [inline]

Get control shape's background style used during its modification.

Returns:
Used brush

Initialize serializable properties.

Reimplemented from wxSFRectShape.

virtual void wxSFControlShape::MoveBy ( double  x,
double  y 
) [virtual]

Move the shape by the given offset. The function can be overrided if neccessary.

Parameters:
xX offset
yY offset

Reimplemented from wxSFShapeBase.

virtual void wxSFControlShape::MoveTo ( double  x,
double  y 
) [virtual]

Move the shape to the given absolute position. The function can be overrided if necessary.

Parameters:
xX coordinate
yY coordinate

Reimplemented from wxSFShapeBase.

virtual void wxSFControlShape::OnBeginDrag ( const wxPoint &  pos) [virtual]

Event handler called at the begining of the shape dragging process. The function can be overrided if necessary.

The function is called by the framework (by the shape canvas). Default implementation does nothing.

See also:
wxSFShapeCanvas

Reimplemented from wxSFShapeBase.

virtual void wxSFControlShape::OnBeginHandle ( wxSFShapeHandle handle) [virtual]

Event handler called when the user started to drag the shape handle. The function can be overrided if necessary.

The function is called by the framework (by the shape canvas). Default implementation does nothing.

Parameters:
handleReference to dragged handle

Reimplemented from wxSFRectShape.

virtual void wxSFControlShape::OnEndDrag ( const wxPoint &  pos) [virtual]

Event handler called at the end of the shape dragging process. The function can be overrided if necessary.

The function is called by the framework (by the shape canvas). Default implementation does nothing.

Parameters:
posCurrent mouse position
See also:
wxSFShapeCanvas

Reimplemented from wxSFShapeBase.

virtual void wxSFControlShape::OnEndHandle ( wxSFShapeHandle handle) [virtual]

Event handler called when the user finished dragging of the shape handle. The function can be overrided if necessary.

The function is called by the framework (by the shape canvas). Default implementation does nothing.

Parameters:
handleReference to dragged handle

Reimplemented from wxSFShapeBase.

virtual void wxSFControlShape::OnHandle ( wxSFShapeHandle handle) [virtual]

Event handler called during dragging of the shape handle. The function can be overrided if necessary.

The function is called by the framework (by the shape canvas). Default implementation does nothing.

Parameters:
handleReference to dragged handle

Reimplemented from wxSFRectShape.

virtual void wxSFControlShape::Scale ( double  x,
double  y,
bool  children = sfWITHCHILDREN 
) [virtual]

Scale the shape size by in both directions. The function can be overrided if necessary (new implementation should call default one ore scale shape's children manualy if neccesary).

Parameters:
xHorizontal scale factor
yVertical scale factor
childrenTRUE if the shape's children shoould be scaled as well, otherwise the shape will be updated after scaling via Update() function.

Reimplemented from wxSFRectShape.

void wxSFControlShape::SetControl ( wxWindow *  ctrl,
bool  fit = sfFIT_SHAPE_TO_CONTROL 
)

Set managed GUI control.

Parameters:
ctrlPointer to existing manager GUI control
fitTRUE if the control shape should be resized in accordance to the given GUI control
void wxSFControlShape::SetControlOffset ( int  offset) [inline]

Set control shape's offset (a gap between the shape's border and managed GUI control).

Parameters:
offsetOffset size
void wxSFControlShape::SetEventProcessing ( int  mask) [inline]

Set a way how GUI control's events are processed.

Parameters:
maskEvent processing
See also:
EVTPROCESSING
void wxSFControlShape::SetModBorder ( const wxPen &  pen) [inline]

Set control shape's border styl used during its modification.

Parameters:
penReference to used pen
void wxSFControlShape::SetModFill ( const wxBrush &  brush) [inline]

Set control shape's background style used during its modification.

Parameters:
brushReference to used brush
virtual void wxSFControlShape::Update ( ) [virtual]

Upate shape (align all child shapes an resize it to fit them)

Reimplemented from wxSFShapeBase.

Update size and position of the managed control according to the parent shape.

Update size of the shape position according to the managed control.


Friends And Related Function Documentation

friend class EventSink [friend]

Member Data Documentation

wxPen wxSFControlShape::m_ModBorder [protected]

Pen used during the shape's modification.

wxBrush wxSFControlShape::m_ModFill [protected]

Brush used during the shape's modification.

Offset between the shape and managed GUI control.

Previous canvas style.

Events processing mask.

wxWindow* wxSFControlShape::m_pControl [protected]

Pointer to manager data control.

Pointer to event sink.

wxWindow* wxSFControlShape::m_pPrevParent [private]

Pointer to parent window.

Previously used shape's pen.

wxBrush wxSFControlShape::m_PrevFill [private]

Previously used shape's brush.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines