wxShapeFramework  1.13.0 beta
wxSFShapeCanvas Class Reference

Class encapsulating a Shape canvas. The shape canvas is window control which extends the wxScrolledWindow and is responsible for displaying of shapes diagrams. It also supports clipboard and drag&drop operations, undo/redo operations, and graphics exporting functions. More...

#include <ShapeCanvas.h>

Collaboration diagram for wxSFShapeCanvas:

List of all members.

Public Types

enum  MODE {
  modeREADY = 0, modeHANDLEMOVE, modeMULTIHANDLEMOVE, modeSHAPEMOVE,
  modeMULTISELECTION, modeCREATECONNECTION, modeDND
}
 Working modes. More...
enum  SEARCHMODE { searchSELECTED, searchUNSELECTED, searchBOTH }
 Search mode flags for GetShapeAtPosition function. More...
enum  VALIGN { valignNONE, valignTOP, valignMIDDLE, valignBOTTOM }
 Flags for AlignSelected function. More...
enum  HALIGN { halignNONE, halignLEFT, halignCENTER, halignRIGHT }
 Flags for AlignSelected function. More...
enum  STYLE {
  sfsMULTI_SELECTION = 1, sfsMULTI_SIZE_CHANGE = 2, sfsGRID_SHOW = 4, sfsGRID_USE = 8,
  sfsDND = 16, sfsUNDOREDO = 32, sfsCLIPBOARD = 64, sfsHOVERING = 128,
  sfsHIGHLIGHTING = 256, sfsGRADIENT_BACKGROUND = 512, sfsPRINT_BACKGROUND = 1024, sfsPROCESS_MOUSEWHEEL = 2048,
  sfsDEFAULT_CANVAS_STYLE = sfsMULTI_SELECTION | sfsMULTI_SIZE_CHANGE | sfsDND | sfsUNDOREDO | sfsCLIPBOARD | sfsHOVERING | sfsHIGHLIGHTING
}
 Style flags. More...
enum  SHADOWMODE { shadowTOPMOST, shadowALL }
 Flags for ShowShadow function. More...
enum  PRINTMODE {
  prnFIT_TO_PAPER, prnFIT_TO_PAGE, prnFIT_TO_MARGINS, prnMAP_TO_PAPER,
  prnMAP_TO_PAGE, prnMAP_TO_MARGINS, prnMAP_TO_DEVICE
}
 Printing modes used by SetPrintMode() function. More...

Public Member Functions

 wxSFShapeCanvas ()
 Default constructor.
 wxSFShapeCanvas (wxSFDiagramManager *manager, wxWindow *parent, wxWindowID id=-1, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxHSCROLL|wxVSCROLL)
 Constructor.
 ~wxSFShapeCanvas (void)
 Destructor.
virtual bool Create (wxWindow *parent, wxWindowID id=-1, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxHSCROLL|wxVSCROLL, const wxString &name=wxT("scrolledWindow"))
 Creates the window in two-step construction mode. SetDiagramManager() function must be also called to complete the canvas initialization.
wxSFDiagramManagerGetDiagramManager ()
 Get diagram manager associated with this instance of shape canvas.
void SetDiagramManager (wxSFDiagramManager *manager)
 Set diagram manager for this shape canvas.
void LoadCanvas (const wxString &file)
 Load serialized canvas content (diagrams) from given file.
void SaveCanvas (const wxString &file)
 Save canvas content (diagrams) to given file.
void SaveCanvasToBMP (const wxString &file)
 Export canvas content to BMP file. DEPRECATED: use SaveCanvasToImage() instead.
void SaveCanvasToImage (const wxString &file, wxBitmapType type=wxBITMAP_TYPE_BMP, bool background=true, double scale=-1)
 Export canvas content to image file.
void StartInteractiveConnection (wxClassInfo *shapeInfo, const wxPoint &pos, wxSF::ERRCODE *err=NULL)
 Start interactive connection creation.
void StartInteractiveConnection (wxSFLineShape *shape, const wxPoint &pos, wxSF::ERRCODE *err=NULL)
 Start interactive connection creation from existing line object.
void AbortInteractiveConnection ()
 Abort interactive connection creation process.
void SelectAll ()
 Select all shapes in the canvas.
void DeselectAll ()
 Deselect all shapes.
void HideAllHandles ()
 Hide handles of all shapes.
void RefreshCanvas (bool erase, const wxRect &rct)
 Repaint the shape canvas.
void InvalidateRect (const wxRect &rct)
 Mark given rectangle as an invalidated one, i.e. as a rectangle which should be refreshed (by using wxSFShapeCanvas::RefreshInvalidatedRect()).
void InvalidateVisibleRect ()
 Mark whole visible canvas portion as an invalidated rectangle.
void RefreshInvalidatedRect ()
 Refresh all canvas rectangles marked as invalidated.
void ShowShadows (bool show, SHADOWMODE style)
 Show shapes shadows (only current digram shapes are affected).
wxDragResult DoDragDrop (ShapeList &shapes, const wxPoint &start=wxPoint(-1,-1))
 Start Drag&Drop operation with shapes included in the given list.
void Copy ()
 Copy selected shapes to the clipboard.
void Cut ()
 Copy selected shapes to the clipboard and remove them from the canvas.
void Paste ()
 Paste shapes stored in the clipboard to the canvas.
void Undo ()
 Perform Undo operation (if available)
void Redo ()
 Perform Redo operation (if available)
bool CanCopy ()
 Function returns TRUE if some shapes can be copied to the clipboard (it means they are selected)
bool CanCut ()
 Function returns TRUE if some shapes can be cutted to the clipboard (it means they are selected)
bool CanPaste ()
 Function returns TRUE if some shapes can be copied from the clipboard to the canvas (it means the clipboard contains stored shapes)
bool CanUndo ()
 Function returns TRUE if Undo operation can be done.
bool CanRedo ()
 Function returns TRUE if Redo operation can be done.
bool CanAlignSelected ()
 Function returns TRUE if AlignSelected function can be invoked (if more than one shape is selected)
void SaveCanvasState ()
 Save current canvas state (for Undo/Redo operations)
void ClearCanvasHistory ()
 Clear all stored canvas states (no Undo/Redo operations will be available)
void Print (bool prompt=sfPROMPT)
 Print current canvas content.
void Print (wxSFPrintout *printout, bool prompt=sfPROMPT)
 Print current canvas content using user-defined printout class.
void PrintPreview ()
 Show print preview.
void PrintPreview (wxSFPrintout *preview, wxSFPrintout *printout=NULL)
 Show print preview using user-defined printout classes.
void PageSetup ()
 Show page setup dialog for printing.
wxPoint DP2LP (const wxPoint &pos) const
 Show page margins setup dialog (available only for MAC).
wxRect DP2LP (const wxRect &rct) const
wxPoint LP2DP (const wxPoint &pos) const
 Convert logical position to device position.
wxRect LP2DP (const wxRect &rct) const
wxSFShapeBaseGetShapeUnderCursor (SEARCHMODE mode=searchBOTH)
 Get shape under current mouse cursor position (fast implementation - use everywhere it is possible instead of much slower GetShapeAtPosition()).
wxSFShapeBaseGetShapeAtPosition (const wxPoint &pos, int zorder=1, SEARCHMODE mode=searchBOTH)
 Get shape at given logical position.
wxSFShapeHandleGetTopmostHandleAtPosition (const wxPoint &pos)
 Get topmost handle at given position.
void GetShapesAtPosition (const wxPoint &pos, ShapeList &shapes)
 Get list of all shapes located at given position.
void GetShapesInside (const wxRect &rct, ShapeList &shapes)
 Get list of shapes located inside given rectangle.
void GetSelectedShapes (ShapeList &selection)
 Get list of selected shapes.
wxRect GetTotalBoundingBox () const
 Get box bounding all shapes in the canvas.
wxRect GetSelectionBB ()
 Get bounding box of all selected shapes.
void AlignSelected (HALIGN halign, VALIGN valign)
 Align selected shapes in given directions.
void SetStyle (long style)
 Set canvas style.
long GetStyle () const
 Get current canvas style.
void AddStyle (STYLE style)
 Add new style flag.
void RemoveStyle (STYLE style)
 Remove given style flag.
bool ContainsStyle (STYLE style) const
 Check whether given style flag is used.
void SetCanvasColour (const wxColour &col)
 Set canvas background color.
wxColour GetCanvasColour () const
 Get canvas background color.
void SetGradientFrom (const wxColour &col)
 Set starting gradient color.
wxColour GetGradientFrom () const
 Get starting gradient color.
void SetGradientTo (const wxColour &col)
 Set ending gradient color.
wxColour GetGradientTo () const
 Get ending gradient color.
wxSize GetGrid () const
 Get grid size.
void SetGrid (wxSize grid)
 Set grid size.
void SetGridLineMult (int multiple)
 Set grid line multiple.
int GetGrigLineMult () const
 Get grid line multiple.
void SetGridColour (const wxColour &col)
 Set grid color.
wxColour GetGridColour () const
 Get grid color.
void SetGridStyle (int style)
 Set grid line style.
int GetGridStyle () const
 Get grid line style.
void SetShadowOffset (const wxRealPoint &offset)
 Set shadow offset.
wxRealPoint GetShadowOffset () const
 Get shadow offset.
void SetShadowFill (const wxBrush &brush)
 Set shadow fill (used for shadows of non-text shapes only).
wxBrush GetShadowFill () const
 Get shadow fill.
void SetPrintHAlign (HALIGN val)
 Set horizontal align of printed drawing.
HALIGN GetPrintHAlign () const
 Get horizontal align of printed drawing.
void SetPrintVAlign (VALIGN val)
 Set vertical align of printed drawing.
VALIGN GetPrintVAlign () const
 Get vertical align of printed drawing.
void SetPrintMode (PRINTMODE mode)
 Set printing mode for this canvas.
PRINTMODE GetPrintMode () const
 Get printing mode for this canvas.
void SetScale (double scale)
 Set canvas scale.
void SetMinScale (double scale)
 Set minimal allowed scale (for mouse wheel scale change).
double GetMinScale ()
 Get minimal allowed scale (for mouse wheel scale change).
void SetMaxScale (double scale)
 Set maximal allowed scale (for mouse wheel scale change).
double GetMaxScale ()
 Set maximal allowed scale (for mouse wheel scale change).
double GetScale () const
 Get the canvas scale.
void SetScaleToViewAll ()
 Set the canvas scale so a whole diagram is visible.
void ScrollToShape (wxSFShapeBase *shape)
 Scroll the shape canvas so the given shape will be located in its center.
MODE GetMode () const
 Get canvas workind mode.
void SetHoverColour (const wxColour &col)
 Set default hover color.
wxColour GetHoverColour () const
 Get default hover color.
wxSFCanvasHistoryGetHistoryManager ()
 Get canvas hostory manager.
wxPoint FitPositionToGrid (const wxPoint &pos)
 Update given position so it will fit canvas grid (if enabled).
void UpdateMultieditSize ()
 Update size of multi selection rectangle.
void UpdateVirtualSize ()
 Update scroll window virtual size so it can display all shape canvas.
void MoveShapesFromNegatives ()
 Move all shapes so none of it will be located in negative position.
void CenterShapes ()
 Center diagram in accordance to the shape canvas extent.
void ValidateSelection (ShapeList &selection)
 Validate selection (remove redundantly selected shapes etc...).
virtual void DrawContent (wxDC &dc, bool fromPaint)
 Function responsible for drawing of the canvas's content to given DC. The default implementation draws actual objects managed by assigned diagram manager.
virtual void DrawBackground (wxDC &dc, bool fromPaint)
 Function responsible for drawing of the canvas's background to given DC. The default implementation draws canvas background and grid.
virtual void DrawForeground (wxDC &dc, bool fromPaint)
 Function responsible for drawing of the canvas's foreground to given DC. The default do nothing.
wxSFMultiSelRectGetMultiselectionBox ()
 Get reference to multiselection box.
void DeleteAllTextCtrls ()
 Close and delete all opened text editing controls actualy used by editable text shapes.
virtual void OnLeftDown (wxMouseEvent &event)
 Event handler called when the canvas is clicked by the left mouse button. The function can be overrided if necessary.
virtual void OnLeftDoubleClick (wxMouseEvent &event)
 Event handler called when the canvas is double-clicked by the left mouse button. The function can be overrided if necessary.
virtual void OnLeftUp (wxMouseEvent &event)
 Event handler called when the left mouse button is released. The function can be overrided if necessary.
virtual void OnRightDown (wxMouseEvent &event)
 Event handler called when the canvas is clicked by the right mouse button. The function can be overrided if necessary.
virtual void OnRightDoubleClick (wxMouseEvent &event)
 Event handler called when the canvas is double-clicked by the right mouse button. The function can be overrided if necessary.
virtual void OnRightUp (wxMouseEvent &event)
 Event handler called when the right mouse button is released. The function can be overrided if necessary.
virtual void OnMouseMove (wxMouseEvent &event)
 Event handler called when the mouse pointer is moved. The function can be overrided if necessary.
virtual void OnMouseWheel (wxMouseEvent &event)
 Event handler called when the mouse wheel position is changed. The function can be overrided if necessary.
virtual void OnKeyDown (wxKeyEvent &event)
 Event handler called when any key is pressed. The function can be overrided if necessary.
virtual void OnTextChange (wxSFEditTextShape *shape)
 Event handler called when any editable text shape is changed. The function can be overrided if necessary. The function is called by the framework and its default implementation generates wxEVT_SF_TEXT_CHANGE event.
virtual void OnConnectionFinished (wxSFLineShape *connection)
 Event handler called after successfull conection creation. The function can be overrided if necessary. The default implementation generates wxEVT_SF_LINE_DONE event.
virtual bool OnPreConnectionFinished (wxSFLineShape *connection)
 Event handler called after successfull conection creation in order to alow developper to perform some kind of checks before the connection is really added to the diagram. The function can be overrided if necessary. The default implementation generates wxEVT_SF_LINE_DONE event.
virtual void OnDrop (wxCoord x, wxCoord y, wxDragResult def, const ShapeList &dropped)
 Event handler called by the framework after any dragged shapes are dropped to the canvas. The default implementation generates wxEVT_SF_ON_DROP event.
virtual void OnPaste (const ShapeList &pasted)
 Event handler called by the framework after pasting of shapes from the clipboard to the canvas. The default implementation generates wxEVT_SF_ON_PASTE event.
virtual void OnUpdateVirtualSize (wxRect &virtrct)
 Event handler called if canvas virtual size is going to be updated. The default implementation does nothing but the function can be overrided by a user to modify calculated virtual canvas size.

Static Public Member Functions

static void EnableGC (bool enab)
 Enable usage of wxGraphicsContext for drawing (if supported).
static bool IsGCEnabled ()
 Function returns information whether the wxGraphicsContext is enabled (if supported).

Protected Attributes

MODE m_nWorkingMode
wxSFCanvasSettings m_Settings

Static Protected Attributes

static bool m_fEnableGC

Private Member Functions

void ValidateSelectionForClipboard (ShapeList &selection, bool storeprevpos)
 Validate selection so the shapes in the given list can be processed by the clipboard functions.
void AppendAssignedConnections (wxSFShapeBase *shape, ShapeList &selection, bool childrenonly)
 Append connections assigned to shapes in given list to this list as well.
void InitializePrinting ()
 Initialize printing framework.
void DeinitializePrinting ()
 Deinitialize prnting framework.
void RemoveFromTemporaries (wxSFShapeBase *shape)
 Remove given shape for temporary containers.
void ClearTemporaries ()
 Clear all temporary containers.
void ReparentShape (wxSFShapeBase *shape, const wxPoint &parentpos)
 Assign give shape to parent at given location (if exists)
void PropagateSelection (wxSFShapeBase *shape, bool selection)
 Propagate selection recursively to all parents if sfsPROPAGATE_SELECTION flag is set.
void StorePrevPosition (const wxSFShapeBase *shape)
 Store previous shape's position modified in ValidateSelectionForClipboard() function.
void RestorePrevPositions ()
 Restore previously stored shapes' positions and clear the storage.
void _OnPaint (wxPaintEvent &event)
 Event handler called when the canvas should be repainted.
void _OnEraseBackground (wxEraseEvent &event)
 Event handler called when the canvas should be erased.
void _OnLeaveWindow (wxMouseEvent &event)
 Event handler called when the mouse pointer leaves the canvas window.
void _OnEnterWindow (wxMouseEvent &event)
 Event handler called when the mouse pointer enters the canvas window.
void _OnResize (wxSizeEvent &event)
 Event handler called when the canvas size has changed.
void _OnLeftDown (wxMouseEvent &event)
 Original private event handler called when the canvas is clicked by left mouse button. The handler calls user-overridable event handler function and skips the event for next possible processing.
void _OnLeftDoubleClick (wxMouseEvent &event)
 Original private event handler called when the canvas is double-clicked by left mouse button. The handler calls user-overridable event handler function and skips the event for next possible processing.
void _OnLeftUp (wxMouseEvent &event)
 Original private event handler called when the left mouse button is release above the canvas. The handler calls user-overridable event handler function and skips the event for next possible processing.
void _OnRightDown (wxMouseEvent &event)
 Original private event handler called when the canvas is clicked by right mouse button. The handler calls user-overridable event handler function and skips the event for next possible processing.
void _OnRightDoubleClick (wxMouseEvent &event)
 Original private event handler called when the canvas is double-clicked by right mouse button. The handler calls user-overridable event handler function and skips the event for next possible processing.
void _OnRightUp (wxMouseEvent &event)
 Original private event handler called when the right mouse button is release above the canvas. The handler calls user-overridable event handler function and skips the event for next possible processing.
void _OnMouseMove (wxMouseEvent &event)
 Original private event handler called when the mouse pointer is moving above the canvas. The handler calls user-overridable event handler function and skips the event for next possible processing.
void _OnMouseWheel (wxMouseEvent &event)
 Original private event handler called when the mouse wheel pocition is changed. The handler calls user-overridable event handler function and skips the event for next possible processing.
void _OnKeyDown (wxKeyEvent &event)
 Original private event handler called when any key is pressed. The handler calls user-overridable event handler function and skips the event for next possible processing.
void _OnDrop (wxCoord x, wxCoord y, wxDragResult def, wxDataObject *data)
 Function is called by associated wxSFCanvasDropTarget after any dragged shapes are dropped to the canvas.
 DECLARE_EVENT_TABLE ()

Private Attributes

wxSFMultiSelRect m_shpMultiEdit
bool m_fCanSaveStateOnMouseUp
bool m_fDnDStartedHere
 Flag used for determination whether the D&D operation has started and ended in one canvas instance.
wxPoint m_nDnDStartedAt
 Started position of current D&D operation.
wxDataFormat m_formatShapes
 Custom data format object (used for the clipboard and D&D operations.
wxPoint m_nPrevMousePos
PositionMap m_mapPrevPositions
wxRect m_nInvalidateRect
wxSFCanvasHistory m_CanvasHistory
 Canvas history manager.
wxSFDiagramManagerm_pManager
 Pointer to parent data (shapes) manager.
wxSFShapeHandlem_pSelectedHandle
 Pointer to currently selected shape handle.
wxSFLineShapem_pNewLineShape
 Pointer to new line shape under constuction.
wxSFShapeBasem_pUnselectedShapeUnderCursor
 Pointer to topmost unselected shape under the mouse cursor.
wxSFShapeBasem_pSelectedShapeUnderCursor
 Pointer to topmost selected shape under the mouse cursor.
wxSFShapeBasem_pTopmostShapeUnderCursor
 Pointer to topmost shape under the mouse cursor.
ShapeList m_lstCurrentShapes
 Current list of all shapes in the canvas updated during mouse movement.

Static Private Attributes

static wxBitmap m_OutBMP
static int m_nRefCounter

Friends

class wxSFDiagramManager
class wxSFCanvasDropTarget

Detailed Description

Class encapsulating a Shape canvas. The shape canvas is window control which extends the wxScrolledWindow and is responsible for displaying of shapes diagrams. It also supports clipboard and drag&drop operations, undo/redo operations, and graphics exporting functions.

This class is a core framework class and provides many member functions suitable for adding, removing, moving, resizing and drawing of shape objects. It can be used as it is or as a base class if necessary. In that case, the default class functionality can be enhaced by overriding of its virtual functions or by manual events handling. In both cases the user is responsible for invoking of default event handlers/virtual functions otherwise the built in functionality wont be available.

See also:
wxSFDiagramManager

Member Enumeration Documentation

Flags for AlignSelected function.

Enumerator:
halignNONE 
halignLEFT 
halignCENTER 
halignRIGHT 

Working modes.

Enumerator:
modeREADY 

The shape canvas is in ready state (no operation is pending)

modeHANDLEMOVE 

Some shape handle is dragged.

modeMULTIHANDLEMOVE 

Handle of multiselection tool is dragged.

modeSHAPEMOVE 

Some shape/s is/are dragged.

modeMULTISELECTION 

Multiple shape selection is in progess.

modeCREATECONNECTION 

Interactive connection creation is in progress.

modeDND 

Canvas is in the Drag&Drop mode.

Printing modes used by SetPrintMode() function.

Enumerator:
prnFIT_TO_PAPER 

This sets the user scale and origin of the DC so that the image fits within the paper rectangle (but the edges could be cut off by printers that can't print to the edges of the paper -- which is most of them. Use this if your image already has its own margins.

prnFIT_TO_PAGE 

This sets the user scale and origin of the DC so that the image fits within the page rectangle, which is the printable area on Mac and MSW and is the entire page on other platforms.

prnFIT_TO_MARGINS 

This sets the user scale and origin of the DC so that the image fits within the page margins as specified by g_PageSetupData, which you can change (on some platforms, at least) in the Page Setup dialog. Note that on Mac, the native Page Setup dialog doesn't let you change the margins of a wxPageSetupDialogData object, so you'll have to write your own dialog or use the Mac-only wxMacPageMarginsDialog, as we do in this program.

prnMAP_TO_PAPER 

This sets the user scale and origin of the DC so that you could map the screen image to the entire paper at the same size as it appears on screen.

prnMAP_TO_PAGE 

This sets the user scale and origin of the DC so that the image appears on the paper at the same size that it appears on screen (i.e., 10-point type on screen is 10-point on the printed page).

prnMAP_TO_MARGINS 

This sets the user scale and origin of the DC so that you could map the screen image to the page margins specified by the native Page Setup dialog at the same size as it appears on screen.

prnMAP_TO_DEVICE 

This sets the user scale and origin of the DC so that you can to do you own scaling in order to draw objects at full native device resolution.

Search mode flags for GetShapeAtPosition function.

Enumerator:
searchSELECTED 

Search for selected shapes only.

searchUNSELECTED 

Search for unselected shapes only.

searchBOTH 

Search for both selected and unselected shapes.

Flags for ShowShadow function.

Enumerator:
shadowTOPMOST 

Show/hide shadow under topmost shapes only.

shadowALL 

Show/hide shadow under all shapes in the diagram.

Style flags.

Enumerator:
sfsMULTI_SELECTION 

Allow multiselection box.

sfsMULTI_SIZE_CHANGE 

Allow shapes' size change done via the multiselection box.

sfsGRID_SHOW 

Show grid.

sfsGRID_USE 

Use grid.

sfsDND 

Enable Drag & Drop operations.

sfsUNDOREDO 

Enable Undo/Redo operations.

sfsCLIPBOARD 

Enable the clipboard.

sfsHOVERING 

Enable mouse hovering.

sfsHIGHLIGHTING 

Enable highligting of shapes able to accept dragged shape(s).

sfsGRADIENT_BACKGROUND 

Use gradient color for the canvas background.

sfsPRINT_BACKGROUND 

Print also canvas background.

sfsPROCESS_MOUSEWHEEL 

Process mouse wheel by the canvas (canvas scale will be changed).

sfsDEFAULT_CANVAS_STYLE 

Default canvas style.

Flags for AlignSelected function.

Enumerator:
valignNONE 
valignTOP 
valignMIDDLE 
valignBOTTOM 

Constructor & Destructor Documentation

Default constructor.

wxSFShapeCanvas::wxSFShapeCanvas ( wxSFDiagramManager manager,
wxWindow *  parent,
wxWindowID  id = -1,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
long  style = wxHSCROLL|wxVSCROLL 
)

Constructor.

Parameters:
managerPointer to shape manager
parentParent window
idWindow ID
posInitial position
sizeInitial size
styleWindow style

Destructor.


Member Function Documentation

void wxSFShapeCanvas::_OnDrop ( wxCoord  x,
wxCoord  y,
wxDragResult  def,
wxDataObject *  data 
) [private]

Function is called by associated wxSFCanvasDropTarget after any dragged shapes are dropped to the canvas.

Parameters:
xX-coordinate of a position the data was dropped to
yY-coordinate of a position the data was dropped to
defDrag result
dataPointer to a data object encapsulating dropped data
See also:
wxSFCanvasDropTarget
void wxSFShapeCanvas::_OnEnterWindow ( wxMouseEvent &  event) [private]

Event handler called when the mouse pointer enters the canvas window.

Parameters:
eventMouse event
void wxSFShapeCanvas::_OnEraseBackground ( wxEraseEvent &  event) [private]

Event handler called when the canvas should be erased.

Parameters:
eventErase event
void wxSFShapeCanvas::_OnKeyDown ( wxKeyEvent &  event) [private]

Original private event handler called when any key is pressed. The handler calls user-overridable event handler function and skips the event for next possible processing.

Parameters:
eventKeyboard event
See also:
wxSFShapeCanvas::OnKeyDown
void wxSFShapeCanvas::_OnLeaveWindow ( wxMouseEvent &  event) [private]

Event handler called when the mouse pointer leaves the canvas window.

Parameters:
eventMouse event
void wxSFShapeCanvas::_OnLeftDoubleClick ( wxMouseEvent &  event) [private]

Original private event handler called when the canvas is double-clicked by left mouse button. The handler calls user-overridable event handler function and skips the event for next possible processing.

Parameters:
eventMouse event
See also:
wxSFShapeCanvas::OnLeftDoubleClick
void wxSFShapeCanvas::_OnLeftDown ( wxMouseEvent &  event) [private]

Original private event handler called when the canvas is clicked by left mouse button. The handler calls user-overridable event handler function and skips the event for next possible processing.

Parameters:
eventMouse event
See also:
wxSFShapeCanvas::OnLeftDown
void wxSFShapeCanvas::_OnLeftUp ( wxMouseEvent &  event) [private]

Original private event handler called when the left mouse button is release above the canvas. The handler calls user-overridable event handler function and skips the event for next possible processing.

Parameters:
eventMouse event
See also:
wxSFShapeCanvas::OnLeftUp
void wxSFShapeCanvas::_OnMouseMove ( wxMouseEvent &  event) [private]

Original private event handler called when the mouse pointer is moving above the canvas. The handler calls user-overridable event handler function and skips the event for next possible processing.

Parameters:
eventMouse event
See also:
wxSFShapeCanvas::OnMouseMove
void wxSFShapeCanvas::_OnMouseWheel ( wxMouseEvent &  event) [private]

Original private event handler called when the mouse wheel pocition is changed. The handler calls user-overridable event handler function and skips the event for next possible processing.

Parameters:
eventMouse event
See also:
wxSFShapeCanvas::OnMouseWheel
void wxSFShapeCanvas::_OnPaint ( wxPaintEvent &  event) [private]

Event handler called when the canvas should be repainted.

Parameters:
eventPaint event
void wxSFShapeCanvas::_OnResize ( wxSizeEvent &  event) [private]

Event handler called when the canvas size has changed.

Parameters:
eventSize event
void wxSFShapeCanvas::_OnRightDoubleClick ( wxMouseEvent &  event) [private]

Original private event handler called when the canvas is double-clicked by right mouse button. The handler calls user-overridable event handler function and skips the event for next possible processing.

Parameters:
eventMouse event
See also:
wxSFShapeCanvas::OnRightDoubleClick
void wxSFShapeCanvas::_OnRightDown ( wxMouseEvent &  event) [private]

Original private event handler called when the canvas is clicked by right mouse button. The handler calls user-overridable event handler function and skips the event for next possible processing.

Parameters:
eventMouse event
See also:
wxSFShapeCanvas::OnRightDown
void wxSFShapeCanvas::_OnRightUp ( wxMouseEvent &  event) [private]

Original private event handler called when the right mouse button is release above the canvas. The handler calls user-overridable event handler function and skips the event for next possible processing.

Parameters:
eventMouse event
See also:
wxSFShapeCanvas::OnRightUp

Abort interactive connection creation process.

void wxSFShapeCanvas::AddStyle ( STYLE  style) [inline]

Add new style flag.

void wxSFShapeCanvas::AlignSelected ( HALIGN  halign,
VALIGN  valign 
)

Align selected shapes in given directions.

Shapes will be aligned according to most far shape in appropriate direction.

Parameters:
halignHorizontal alignment
valignVertical alignment
void wxSFShapeCanvas::AppendAssignedConnections ( wxSFShapeBase shape,
ShapeList &  selection,
bool  childrenonly 
) [private]

Append connections assigned to shapes in given list to this list as well.

Function returns TRUE if AlignSelected function can be invoked (if more than one shape is selected)

Function returns TRUE if some shapes can be copied to the clipboard (it means they are selected)

Function returns TRUE if some shapes can be cutted to the clipboard (it means they are selected)

Function returns TRUE if some shapes can be copied from the clipboard to the canvas (it means the clipboard contains stored shapes)

Function returns TRUE if Redo operation can be done.

Function returns TRUE if Undo operation can be done.

Center diagram in accordance to the shape canvas extent.

Clear all stored canvas states (no Undo/Redo operations will be available)

Clear all temporary containers.

bool wxSFShapeCanvas::ContainsStyle ( STYLE  style) const [inline]

Check whether given style flag is used.

Copy selected shapes to the clipboard.

virtual bool wxSFShapeCanvas::Create ( wxWindow *  parent,
wxWindowID  id = -1,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
long  style = wxHSCROLL|wxVSCROLL,
const wxString &  name = wxT("scrolledWindow") 
) [virtual]

Creates the window in two-step construction mode. SetDiagramManager() function must be also called to complete the canvas initialization.

Parameters:
parentParent window
idWindow ID
posInitial position
sizeInitial size
styleWindow style
nameWindow name

Copy selected shapes to the clipboard and remove them from the canvas.

Deinitialize prnting framework.

Close and delete all opened text editing controls actualy used by editable text shapes.

Deselect all shapes.

wxDragResult wxSFShapeCanvas::DoDragDrop ( ShapeList &  shapes,
const wxPoint &  start = wxPoint(-1,-1) 
)

Start Drag&Drop operation with shapes included in the given list.

Parameters:
shapesList of shapes which should be dragged
startA point where the dragging operation has started
Returns:
rct Drag result
wxPoint wxSFShapeCanvas::DP2LP ( const wxPoint &  pos) const

Show page margins setup dialog (available only for MAC).

Convert device position to logical position.

The function returns unscrolled unscaled canvas position.

Parameters:
posDevice position (for example mouse position)
Returns:
Logical position
wxRect wxSFShapeCanvas::DP2LP ( const wxRect &  rct) const
virtual void wxSFShapeCanvas::DrawBackground ( wxDC &  dc,
bool  fromPaint 
) [virtual]

Function responsible for drawing of the canvas's background to given DC. The default implementation draws canvas background and grid.

Parameters:
dcReference to device context where the shapes will be drawn to
fromPaintSet the argument to TRUE if the dc argument refers to the wxPaintDC instance or derived classes (i.e. the function is called as a response to wxEVT_PAINT event)
virtual void wxSFShapeCanvas::DrawContent ( wxDC &  dc,
bool  fromPaint 
) [virtual]

Function responsible for drawing of the canvas's content to given DC. The default implementation draws actual objects managed by assigned diagram manager.

Parameters:
dcReference to device context where the shapes will be drawn to
fromPaintSet the argument to TRUE if the dc argument refers to the wxPaintDC instance or derived classes (i.e. the function is called as a response to wxEVT_PAINT event)
virtual void wxSFShapeCanvas::DrawForeground ( wxDC &  dc,
bool  fromPaint 
) [virtual]

Function responsible for drawing of the canvas's foreground to given DC. The default do nothing.

Parameters:
dcReference to device context where the shapes will be drawn to
fromPaintSet the argument to TRUE if the dc argument refers to the wxPaintDC instance or derived classes (i.e. the function is called as a response to wxEVT_PAINT event)
static void wxSFShapeCanvas::EnableGC ( bool  enab) [static]

Enable usage of wxGraphicsContext for drawing (if supported).

Parameters:
enabIf TRUE then the wxGraphicsContext will be used
wxPoint wxSFShapeCanvas::FitPositionToGrid ( const wxPoint &  pos)

Update given position so it will fit canvas grid (if enabled).

Parameters:
posPosition which should be updated
Returns:
Updated position
wxColour wxSFShapeCanvas::GetCanvasColour ( ) const [inline]

Get canvas background color.

Returns:
Background color

Get diagram manager associated with this instance of shape canvas.

Returns:
Pointer to diagram manager
See also:
wxSFDiagramManager
wxColour wxSFShapeCanvas::GetGradientFrom ( ) const [inline]

Get starting gradient color.

Returns:
Color
wxColour wxSFShapeCanvas::GetGradientTo ( ) const [inline]

Get ending gradient color.

Returns:
Color
wxSize wxSFShapeCanvas::GetGrid ( ) const [inline]

Get grid size.

Returns:
Grid size
wxColour wxSFShapeCanvas::GetGridColour ( ) const [inline]

Get grid color.

Returns:
Grid color
int wxSFShapeCanvas::GetGridStyle ( ) const [inline]

Get grid line style.

Returns:
Line style
int wxSFShapeCanvas::GetGrigLineMult ( ) const [inline]

Get grid line multiple.

Returns:
Value by which a grid size will be multiplicated to determine grid lines distance

Get canvas hostory manager.

Returns:
Reference to the canvas history manager
See also:
wxSFCanvasHistory
wxColour wxSFShapeCanvas::GetHoverColour ( ) const [inline]

Get default hover color.

Returns:
Hover color
double wxSFShapeCanvas::GetMaxScale ( ) [inline]

Set maximal allowed scale (for mouse wheel scale change).

Returns:
Maximal scale
double wxSFShapeCanvas::GetMinScale ( ) [inline]

Get minimal allowed scale (for mouse wheel scale change).

Returns:
Minimal scale
MODE wxSFShapeCanvas::GetMode ( ) const [inline]

Get canvas workind mode.

Returns:
Working mode
See also:
MODE

Get reference to multiselection box.

Returns:
Reference to multiselection box object

Get horizontal align of printed drawing.

Returns:
Current horizontal align
See also:
HALIGN

Get printing mode for this canvas.

Returns:
Current printing mode
See also:
PRINTMODE

Get vertical align of printed drawing.

Returns:
Current vertical align
See also:
VALIGN
double wxSFShapeCanvas::GetScale ( ) const [inline]

Get the canvas scale.

Returns:
Canvas scale
void wxSFShapeCanvas::GetSelectedShapes ( ShapeList &  selection)

Get list of selected shapes.

Parameters:
selectionReference to shape list where pointers to all selected shapes will be stored

Get bounding box of all selected shapes.

Returns:
Selection bounding box
wxBrush wxSFShapeCanvas::GetShadowFill ( ) const [inline]

Get shadow fill.

Returns:
Current shadow brush
wxRealPoint wxSFShapeCanvas::GetShadowOffset ( ) const [inline]

Get shadow offset.

Returns:
Shadow offset
wxSFShapeBase* wxSFShapeCanvas::GetShapeAtPosition ( const wxPoint &  pos,
int  zorder = 1,
SEARCHMODE  mode = searchBOTH 
)

Get shape at given logical position.

Parameters:
posLogical position
zorderZ-order of searched shape (usefull if several shapes are located at the given position)
modeSearch mode
Returns:
Pointer to shape if found, otherwise NULL
See also:
SEARCHMODE, wxSFShapeCanvas::DP2LP,, wxSFShapeCanvas::GetShapeUnderCursor
void wxSFShapeCanvas::GetShapesAtPosition ( const wxPoint &  pos,
ShapeList &  shapes 
)

Get list of all shapes located at given position.

Parameters:
posLogical position
shapesReference to shape list where pointers to all found shapes will be stored
See also:
wxSFShapeCanvas::DP2LP
void wxSFShapeCanvas::GetShapesInside ( const wxRect &  rct,
ShapeList &  shapes 
)

Get list of shapes located inside given rectangle.

Parameters:
rctExamined rectangle
shapesReference to shape list where pointers to all found shapes will be stored

Get shape under current mouse cursor position (fast implementation - use everywhere it is possible instead of much slower GetShapeAtPosition()).

Parameters:
modeSearch mode
Returns:
Pointer to shape if found, otherwise NULL
See also:
SEARCHMODE, wxSFShapeCanvas::DP2LP, wxSFShapeCanvas::GetShapeAtPosition
long wxSFShapeCanvas::GetStyle ( ) const [inline]

Get current canvas style.

Get topmost handle at given position.

Parameters:
posLogical position
Returns:
Pointer to shape handle object if found, otherwise NULL
See also:
wxSFShapeCanvas::DP2LP

Get box bounding all shapes in the canvas.

Returns:
Total bounding box

Hide handles of all shapes.

Initialize printing framework.

void wxSFShapeCanvas::InvalidateRect ( const wxRect &  rct)

Mark given rectangle as an invalidated one, i.e. as a rectangle which should be refreshed (by using wxSFShapeCanvas::RefreshInvalidatedRect()).

Parameters:
rctRectangle to be invalidated

Mark whole visible canvas portion as an invalidated rectangle.

static bool wxSFShapeCanvas::IsGCEnabled ( ) [inline, static]

Function returns information whether the wxGraphicsContext is enabled (if supported).

Returns:
TRUE if the wxGraphicsContext is enabled
void wxSFShapeCanvas::LoadCanvas ( const wxString &  file)

Load serialized canvas content (diagrams) from given file.

Parameters:
fileFull file name
wxPoint wxSFShapeCanvas::LP2DP ( const wxPoint &  pos) const

Convert logical position to device position.

The function returns scrolled scaled canvas position.

Parameters:
posLogical position (for example shape position)
Returns:
Device position
wxRect wxSFShapeCanvas::LP2DP ( const wxRect &  rct) const

Move all shapes so none of it will be located in negative position.

virtual void wxSFShapeCanvas::OnConnectionFinished ( wxSFLineShape connection) [virtual]

Event handler called after successfull conection creation. The function can be overrided if necessary. The default implementation generates wxEVT_SF_LINE_DONE event.

Parameters:
connectionPointer to new connection object
See also:
StartInteractiveConnection(), wxSFShapeEvent
virtual void wxSFShapeCanvas::OnDrop ( wxCoord  x,
wxCoord  y,
wxDragResult  def,
const ShapeList &  dropped 
) [virtual]

Event handler called by the framework after any dragged shapes are dropped to the canvas. The default implementation generates wxEVT_SF_ON_DROP event.

Parameters:
xX-coordinate of a position the data was dropped to
yY-coordinate of a position the data was dropped to
defDrag result
droppedReference to a list containing the dropped data
See also:
wxSFCanvasDropTarget, wxSFShapeDropEvent
virtual void wxSFShapeCanvas::OnKeyDown ( wxKeyEvent &  event) [virtual]

Event handler called when any key is pressed. The function can be overrided if necessary.

The function is called by the framework and provides basic functionality needed for proper management of displayed shape. It is necessary to call this function from overrided methods if the default canvas behaviour should be preserved.

Parameters:
eventKeyboard event
See also:
_OnKeyDown()
virtual void wxSFShapeCanvas::OnLeftDoubleClick ( wxMouseEvent &  event) [virtual]

Event handler called when the canvas is double-clicked by the left mouse button. The function can be overrided if necessary.

The function is called by the framework and provides basic functionality needed for proper management of displayed shape. It is necessary to call this function from overrided methods if the default canvas behaviour should be preserved.

Parameters:
eventMouse event
See also:
_OnLeftDoubleClick()
virtual void wxSFShapeCanvas::OnLeftDown ( wxMouseEvent &  event) [virtual]

Event handler called when the canvas is clicked by the left mouse button. The function can be overrided if necessary.

The function is called by the framework and provides basic functionality needed for proper management of displayed shape. It is necessary to call this function from overrided methods if the default canvas behaviour should be preserved.

Parameters:
eventMouse event
See also:
_OnLeftDown()
virtual void wxSFShapeCanvas::OnLeftUp ( wxMouseEvent &  event) [virtual]

Event handler called when the left mouse button is released. The function can be overrided if necessary.

The function is called by the framework and provides basic functionality needed for proper management of displayed shape. It is necessary to call this function from overrided methods if the default canvas behaviour should be preserved.

Parameters:
eventMouse event
See also:
_OnLeftUp()
virtual void wxSFShapeCanvas::OnMouseMove ( wxMouseEvent &  event) [virtual]

Event handler called when the mouse pointer is moved. The function can be overrided if necessary.

The function is called by the framework and provides basic functionality needed for proper management of displayed shape. It is necessary to call this function from overrided methods if the default canvas behaviour should be preserved.

Parameters:
eventMouse event
See also:
_OnMouseMove()
virtual void wxSFShapeCanvas::OnMouseWheel ( wxMouseEvent &  event) [virtual]

Event handler called when the mouse wheel position is changed. The function can be overrided if necessary.

The function is called by the framework and provides basic functionality needed for proper management of displayed shape. It is necessary to call this function from overrided methods if the default canvas behaviour should be preserved.

Parameters:
eventMouse event
See also:
_OnMouseWheel()
virtual void wxSFShapeCanvas::OnPaste ( const ShapeList &  pasted) [virtual]

Event handler called by the framework after pasting of shapes from the clipboard to the canvas. The default implementation generates wxEVT_SF_ON_PASTE event.

Parameters:
pastedReference to a list containing the pasted data
See also:
wxSFShapeCanvas::Paste(), wxSFShapePasteEvent
virtual bool wxSFShapeCanvas::OnPreConnectionFinished ( wxSFLineShape connection) [virtual]

Event handler called after successfull conection creation in order to alow developper to perform some kind of checks before the connection is really added to the diagram. The function can be overrided if necessary. The default implementation generates wxEVT_SF_LINE_DONE event.

Parameters:
connectionPointer to new connection object
See also:
StartInteractiveConnection(), wxSFShapeEvent
Returns:
false if the generated event has been vetoed in this case, the connection creation is cancelled
virtual void wxSFShapeCanvas::OnRightDoubleClick ( wxMouseEvent &  event) [virtual]

Event handler called when the canvas is double-clicked by the right mouse button. The function can be overrided if necessary.

The function is called by the framework and provides basic functionality needed for proper management of displayed shape. It is necessary to call this function from overrided methods if the default canvas behaviour should be preserved.

Parameters:
eventMouse event
See also:
_OnRightDoubleClick()
virtual void wxSFShapeCanvas::OnRightDown ( wxMouseEvent &  event) [virtual]

Event handler called when the canvas is clicked by the right mouse button. The function can be overrided if necessary.

The function is called by the framework and provides basic functionality needed for proper management of displayed shape. It is necessary to call this function from overrided methods if the default canvas behaviour should be preserved.

Parameters:
eventMouse event
See also:
_OnRightDown()
virtual void wxSFShapeCanvas::OnRightUp ( wxMouseEvent &  event) [virtual]

Event handler called when the right mouse button is released. The function can be overrided if necessary.

The function is called by the framework and provides basic functionality needed for proper management of displayed shape. It is necessary to call this function from overrided methods if the default canvas behaviour should be preserved.

Parameters:
eventMouse event
See also:
_OnRightUp()
virtual void wxSFShapeCanvas::OnTextChange ( wxSFEditTextShape shape) [virtual]

Event handler called when any editable text shape is changed. The function can be overrided if necessary. The function is called by the framework and its default implementation generates wxEVT_SF_TEXT_CHANGE event.

Parameters:
shapeChanged wxSFEditTextShape object
See also:
wxSFEditTextShape::EditLabel(), wxSFShapeTextEvent
virtual void wxSFShapeCanvas::OnUpdateVirtualSize ( wxRect &  virtrct) [virtual]

Event handler called if canvas virtual size is going to be updated. The default implementation does nothing but the function can be overrided by a user to modify calculated virtual canvas size.

Parameters:
virtrctCalculated canvas virtual size

Show page setup dialog for printing.

Paste shapes stored in the clipboard to the canvas.

void wxSFShapeCanvas::Print ( bool  prompt = sfPROMPT)

Print current canvas content.

Parameters:
promptIf TRUE (sfPROMT) then the the native print dialog will be displayed before printing
void wxSFShapeCanvas::Print ( wxSFPrintout printout,
bool  prompt = sfPROMPT 
)

Print current canvas content using user-defined printout class.

Parameters:
printoutPointer to user-defined printout object (inherited from wxSFPrintout class). Do not delete this object explicitly.
promptIf TRUE (sfPROMT) then the native print dialog will be displayed before printing
See also:
wxSFPrintout

Show print preview.

void wxSFShapeCanvas::PrintPreview ( wxSFPrintout preview,
wxSFPrintout printout = NULL 
)

Show print preview using user-defined printout classes.

Parameters:
previewPointer to user-defined printout object (inherited from wxSFPrintout class) used for print preview. Do not delete this object explicitly.
printoutPointer to user-defined printout class (inherited from wxSFPrintout class) used for printing. Do not delete this object explicitly. This parameter can be NULL (in this case a print button will not be available in the print preview window).
See also:
wxSFPrintout
void wxSFShapeCanvas::PropagateSelection ( wxSFShapeBase shape,
bool  selection 
) [private]

Propagate selection recursively to all parents if sfsPROPAGATE_SELECTION flag is set.

Perform Redo operation (if available)

void wxSFShapeCanvas::RefreshCanvas ( bool  erase,
const wxRect &  rct 
)

Repaint the shape canvas.

Parameters:
eraseTRUE if the canvas should be erased before repainting
rctRefreshed region (rectangle)

Refresh all canvas rectangles marked as invalidated.

See also:
wxSFShapeCanvas::InvalidateRect()

Remove given shape for temporary containers.

void wxSFShapeCanvas::RemoveStyle ( STYLE  style) [inline]

Remove given style flag.

void wxSFShapeCanvas::ReparentShape ( wxSFShapeBase shape,
const wxPoint &  parentpos 
) [private]

Assign give shape to parent at given location (if exists)

Restore previously stored shapes' positions and clear the storage.

void wxSFShapeCanvas::SaveCanvas ( const wxString &  file)

Save canvas content (diagrams) to given file.

Parameters:
fileFull file name

Save current canvas state (for Undo/Redo operations)

void wxSFShapeCanvas::SaveCanvasToBMP ( const wxString &  file)

Export canvas content to BMP file. DEPRECATED: use SaveCanvasToImage() instead.

Parameters:
fileFull file name
void wxSFShapeCanvas::SaveCanvasToImage ( const wxString &  file,
wxBitmapType  type = wxBITMAP_TYPE_BMP,
bool  background = true,
double  scale = -1 
)

Export canvas content to image file.

Parameters:
fileFull file name
typeImage type. See wxBitmapType for more details. Default type is wxBITMAP_TYPE_BMP.
backgroundExport also diagram background
scaleImage scale. If -1 then current canvas scale id used.

Scroll the shape canvas so the given shape will be located in its center.

Parameters:
shapePointer to focused shape

Select all shapes in the canvas.

void wxSFShapeCanvas::SetCanvasColour ( const wxColour &  col) [inline]

Set canvas background color.

Parameters:
colBackground color

Set diagram manager for this shape canvas.

Parameters:
managerPointer to diagram manager instance
See also:
wxSFDiagramManager
void wxSFShapeCanvas::SetGradientFrom ( const wxColour &  col) [inline]

Set starting gradient color.

Parameters:
colColor
void wxSFShapeCanvas::SetGradientTo ( const wxColour &  col) [inline]

Set ending gradient color.

Parameters:
colColor
void wxSFShapeCanvas::SetGrid ( wxSize  grid) [inline]

Set grid size.

Parameters:
gridGrid size
void wxSFShapeCanvas::SetGridColour ( const wxColour &  col) [inline]

Set grid color.

Parameters:
colGrid color
void wxSFShapeCanvas::SetGridLineMult ( int  multiple) [inline]

Set grid line multiple.

Grid lines will be drawn in a distance calculated as grid size multiplicated by this value. Default value is 1.

Parameters:
multipleMultiple value
void wxSFShapeCanvas::SetGridStyle ( int  style) [inline]

Set grid line style.

Parameters:
styleLine style
void wxSFShapeCanvas::SetHoverColour ( const wxColour &  col)

Set default hover color.

Parameters:
colHover color.
void wxSFShapeCanvas::SetMaxScale ( double  scale) [inline]

Set maximal allowed scale (for mouse wheel scale change).

Parameters:
scaleMaximal scale
void wxSFShapeCanvas::SetMinScale ( double  scale) [inline]

Set minimal allowed scale (for mouse wheel scale change).

Parameters:
scaleMinimal scale
void wxSFShapeCanvas::SetPrintHAlign ( HALIGN  val) [inline]

Set horizontal align of printed drawing.

Parameters:
valHorizontal align
See also:
HALIGN
void wxSFShapeCanvas::SetPrintMode ( PRINTMODE  mode) [inline]

Set printing mode for this canvas.

Parameters:
modePrinting mode
See also:
PRINTMODE
void wxSFShapeCanvas::SetPrintVAlign ( VALIGN  val) [inline]

Set vertical align of printed drawing.

Parameters:
valVerical align
See also:
VALIGN
void wxSFShapeCanvas::SetScale ( double  scale)

Set canvas scale.

Parameters:
scaleScale value

Set the canvas scale so a whole diagram is visible.

void wxSFShapeCanvas::SetShadowFill ( const wxBrush &  brush) [inline]

Set shadow fill (used for shadows of non-text shapes only).

Parameters:
brushReference to brush object
void wxSFShapeCanvas::SetShadowOffset ( const wxRealPoint &  offset) [inline]

Set shadow offset.

Parameters:
offsetShadow offset
void wxSFShapeCanvas::SetStyle ( long  style) [inline]

Set canvas style.

Default value is sfsMULTI_SELECTION | sfsMULTI_SIZE_CHANGE | sfsDND | sfsUNDOREDO | sfsCLIPBOARD | sfsHOVERING | sfsHIGHLIGHTING

Parameters:
styleCombination of the canvas styles
See also:
STYLE
void wxSFShapeCanvas::ShowShadows ( bool  show,
SHADOWMODE  style 
)

Show shapes shadows (only current digram shapes are affected).

The functions sets/unsets sfsSHOW_SHADOW flag for all shapes currently included in the diagram.

Parameters:
showTRUE if the shadow shoud be shown, otherwise FALSE
styleShadow style
See also:
SHADOWMODE
void wxSFShapeCanvas::StartInteractiveConnection ( wxClassInfo *  shapeInfo,
const wxPoint &  pos,
wxSF::ERRCODE err = NULL 
)

Start interactive connection creation.

This function switch the canvas to a mode in which a new shape connection can be created interactively (by mouse operations). Every connection must start and finish in some shape object or another connection. At the end of the process the OnConnectionFinished event handler is invoked so the user can set needed connection properties immediately.

Function must be called from mouse event handler and the event must be passed to the function.

Parameters:
shapeInfoConnection type
posPosition where to start
errPointer to variable where operation result will be stored. Can be NULL.
See also:
CreateConnection
void wxSFShapeCanvas::StartInteractiveConnection ( wxSFLineShape shape,
const wxPoint &  pos,
wxSF::ERRCODE err = NULL 
)

Start interactive connection creation from existing line object.

This function switch the canvas to a mode in which a new shape connection can be created interactively (by mouse operations). Every connection must start and finish in some shape object or another connection. At the end of the process the OnConnectionFinished event handler is invoked so the user can set needed connection properties immediately.

Function must be called from mouse event handler and the event must be passed to the function.

Parameters:
shapePointer to existing line shape object which will be used as a connection.
posPosition where to start
errPointer to variable where operation result will be stored. Can be NULL.
See also:
CreateConnection
void wxSFShapeCanvas::StorePrevPosition ( const wxSFShapeBase shape) [inline, private]

Store previous shape's position modified in ValidateSelectionForClipboard() function.

Perform Undo operation (if available)

Update size of multi selection rectangle.

Update scroll window virtual size so it can display all shape canvas.

void wxSFShapeCanvas::ValidateSelection ( ShapeList &  selection)

Validate selection (remove redundantly selected shapes etc...).

Parameters:
selectionList of selected shapes that should be validated
void wxSFShapeCanvas::ValidateSelectionForClipboard ( ShapeList &  selection,
bool  storeprevpos 
) [private]

Validate selection so the shapes in the given list can be processed by the clipboard functions.


Friends And Related Function Documentation

friend class wxSFCanvasDropTarget [friend]
friend class wxSFDiagramManager [friend]

Member Data Documentation

Canvas history manager.

Flag used for determination whether the D&D operation has started and ended in one canvas instance.

bool wxSFShapeCanvas::m_fEnableGC [static, protected]
wxDataFormat wxSFShapeCanvas::m_formatShapes [private]

Custom data format object (used for the clipboard and D&D operations.

Current list of all shapes in the canvas updated during mouse movement.

PositionMap wxSFShapeCanvas::m_mapPrevPositions [private]

Started position of current D&D operation.

int wxSFShapeCanvas::m_nRefCounter [static, private]
wxBitmap wxSFShapeCanvas::m_OutBMP [static, private]

Pointer to parent data (shapes) manager.

Pointer to new line shape under constuction.

Pointer to currently selected shape handle.

Pointer to topmost selected shape under the mouse cursor.

Pointer to topmost shape under the mouse cursor.

Pointer to topmost unselected shape under the mouse cursor.


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