wxArt2D
Public Member Functions | Protected Attributes | List of all members
a2dCanvasView Class Reference

View on a a2dCanvasDocument. More...

#include <candoc.h>

Inheritance diagram for a2dCanvasView:
Inheritance graph
[legend]
Collaboration diagram for a2dCanvasView:
Collaboration graph
[legend]

Public Member Functions

 a2dCanvasView (int width=1000, int height=1000)
 constructor More...
 
 a2dCanvasView (const wxSize &size)
 constructor More...
 
 a2dCanvasView (const a2dCanvasView &other)
 copy constructor
 
a2dCanvasGetCanvas () const
 Get the Display window of the a2dView. But casted to a a2dCanvas. More...
 
a2dCanvasDocumentGetCanvasDocument () const
 
virtual ~a2dCanvasView ()
 destructor
 
a2dDrawingPartGetDrawingPart () const
 
virtual bool ProcessEvent (wxEvent &event)
 Special event handling for a2dCanvasView class. More...
 
void OnCreateView (a2dViewEvent &event)
 
virtual wxPrintout * OnCreatePrintout (a2dPrintWhat typeOfPrint, const wxPageSetupDialogData &pageSetupData)
 to create a a2dViewPrintout, used to print a view or its document More...
 
virtual void OnDraw (wxDC *)
 Not implemented, use a2dViewPrintout to print. More...
 
void SetPrintTitle (bool val)
 If true render the printout with a title string, otherwise not.
 
void SetPrintFilename (bool val)
 If true render the printout with a filename string, otherwise not.
 
void SetPrintScaleLimit (double val)
 Set the scaling limit for printing, so that small stuff is not zoomed to full page.
 
void SetPrintFrame (bool val)
 If true, draw a frame around printouts.
 
void SetPrintFitToPage (bool val)
 If true, draw a view on all page without real scale.
 
- Public Member Functions inherited from a2dView
 a2dView ()
 constructor More...
 
 ~a2dView ()
 destructor
 
 a2dView (const a2dView &other)
 construct with other view
 
bool IsClosed ()
 A closed flag is set when a view is closed. More...
 
void SetClosed ()
 sets closed flag to true, and calls Release() view. More...
 
bool Enable (bool enable)
 returns true if view was enabled/disabled, false if nothing done More...
 
bool GetEnabled ()
 return true if the view is enabled. See Enable()
 
virtual void SetDisplayWindow (wxWindow *display)
 Set the display window. More...
 
wxWindow * GetDisplayWindow ()
 Get the display window.
 
wxUint32 GetId ()
 Get the id of the view (used for identification in event processing.
 
a2dDocumentGetDocument () const
 get the document of the view More...
 
void SetDocument (a2dDocument *doc)
 Set the document for the view and add it to the document its viewlist. More...
 
wxString GetViewTypeName () const
 get type name of the view. More...
 
a2dViewTemplateGetViewTemplate () const
 get the a2dViewTemplate with which this view was created More...
 
void SetViewTemplate (a2dViewTemplate *viewtemplate)
 to set the view template from which this view was created.
 
void SetViewTypeName (const wxString &name)
 set type name of the view. More...
 
virtual void Update (unsigned int hint=0, wxObject *hintObject=NULL)
 force a2dDocumentEvent ::wxEVT_UPDATE_VIEWS event
 
virtual bool Close (bool force=false)
 Close a view and remove the view from its document. More...
 
void Activate (bool activate)
 is called via ProcessEvent() when the view becomes active More...
 
bool GetActive ()
 return if the view is active/ More...
 
virtual void OnPrint (wxDC *dc, wxObject *info)
 called from a2dDocumentPrintout when printing a view. More...
 
- Public Member Functions inherited from a2dObject
bool SearchDynamicEventTable (wxEvent &event)
 
void Connect (int winid, int lastId, int eventType, wxObjectEventFunction func, wxObject *userData=(wxObject *) NULL, wxEvtHandler *eventSink=(wxEvtHandler *) NULL)
 
bool Disconnect (int winid, int lastId, wxEventType eventType, wxObjectEventFunction func=NULL, wxObject *userData=(wxObject *) NULL, wxEvtHandler *eventSink=(wxEvtHandler *) NULL)
 
void ProcessConnectedEvent (wxEvent &event)
 wxCHECK_VERSION(2,9,0) More...
 
void ConnectEvent (wxEventType type, wxEvtHandler *eventSink)
 
bool DisconnectEvent (wxEventType type, wxEvtHandler *eventSink)
 
bool DisconnectEventAll (wxEvtHandler *eventSink)
 Remove all dynamic events in classA, going to classB (eventSink) More...
 
 a2dObject ()
 constructor
 
virtual ~a2dObject ()
 destructor
 
void operator= (const a2dObject &other)
 assignment operator
 
int GetOwnedBy ()
 like it to be protected, but this does not work with wxList macros More...
 
virtual a2dObjectSetNonDynamic ()
 Call to mark this object as non-dynamic (static/local/auto) More...
 
void CheckReferences ()
 Check zero reference count and delete if count is 0. More...
 
a2dObjectClone (CloneOptions options, a2dRefMap *refs=NULL) const
 create an exact copy of this property
 
 a2dObject (const a2dObject &other, CloneOptions options, a2dRefMap *refs)
 
virtual wxString GetName () const
 Returns the name of this object, if no name is given the internal id will be returned. More...
 
virtual void SetName (const wxString &name)
 Creates the a2dStringProperty PROPID_Name. More...
 
virtual bool IsTemporary_DontSave () const
 Check if this is a temporary object, which should not be saved.
 
void SaveAsDocument (a2dIOHandlerXmlSerOut &out)
 Save this object and all below as an XML document. More...
 
virtual void Save (wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dObjectList *towrite)
 write all needed to an XML type of file called the CVG format More...
 
void LoadFromDocument (a2dIOHandlerXmlSerIn &parser)
 Load this object and all below from an XML document. More...
 
virtual void Load (wxObject *parent, a2dIOHandlerXmlSerIn &parser)
 load object from CVG file More...
 
wxInt64 GetUniqueSerializationId () const
 return a unique id for this object More...
 
virtual bool AlwaysWriteSerializationId () const
 If true, always write an id. More...
 
virtual bool LinkReference (a2dObject *other)
 link a reference in the object to the given value More...
 
virtual void ResolveInform ()
 inform an object that reference resolution was done More...
 
void Walker (wxObject *parent, a2dWalkerIOHandler &handler)
 This is used to recursively walk through an object tree.
 
void SetCheck (bool check)
 general flag use at will. More...
 
bool GetCheck () const
 general flag use at will.
 
void SetRelease (bool value)
 set release flag More...
 
bool GetRelease () const
 get release flag More...
 
a2dAutoZeroPtr< a2dObject > ** GetAutoZeroPtrList ()
 return the list head pointer for autozero pointers to this object More...
 
 DECLARE_PROPERTIES ()
 
a2dNamedPropertyGetProperty (const a2dPropertyId *propertyId, a2dPropertyId::Flags flags=a2dPropertyId::flag_none) const
 get property on this object More...
 
void SetProperty (a2dNamedProperty *propertyHolder, a2dPropertyId::SetFlags flags=a2dPropertyId::set_none)
 Set the property to the this object. More...
 
void SetProperty (const a2dNamedProperty &propertyHolder, a2dPropertyId::SetFlags flags=a2dPropertyId::set_none)
 Set the property to the this object and if enabled, to all childs and object members. More...
 
virtual a2dNamedPropertyFindProperty (const a2dPropertyId *id, a2dPropertyId::Flags flags=a2dPropertyId::flag_none)
 Find a dynamic property with given id in the property list. More...
 
virtual const a2dNamedPropertyFindProperty (const a2dPropertyId *id, a2dPropertyId::Flags flags=a2dPropertyId::flag_none) const
 Find a dynamic property with given id in the property list. More...
 
virtual bool HasProperty (const a2dPropertyId *id, const wxString &stringvalue=wxEmptyString) const
 Check if the object has a property with given id and string representation. More...
 
virtual void OnPropertyChanged (const a2dPropertyId *id)
 This function is called after a property changed. More...
 
virtual bool EditProperties (const a2dPropertyId *id, bool withUndo=true)
 edit properties of the object More...
 
void TakeOverProperties (a2dObject *from, a2dPropertyIdList *listOfIds)
 Properties in the id list are taken from the given object, en set to this. More...
 
wxURI GetURI () const
 quick way to get to PROPID_URI property More...
 
void SetURI (const wxURI &url)
 quickly set a property PROPID_URI More...
 
const a2dNamedPropertyListGetPropertyList () const
 Get the Property List. More...
 
bool HasDynamicProperties () const
 test if there are dynamic properties in the m_propertylist
 
virtual bool RemoveProperty (const a2dPropertyId *id, bool all=true)
 This function is called by a2dPropertyId to remove a property from the list. More...
 
void RemoveTemporaryProperties ()
 remove all temporary properties
 
virtual bool AddProperty (a2dNamedProperty *property)
 This function is called by a2dPropertyId to add a property to the list. More...
 

Protected Attributes

bool m_printtitle
 if true, a printout is done with title (document name (description?)), otherwise not
 
bool m_printfilename
 if true, a printout is done with filename (document file path), otherwise not
 
double m_printscalelimit
 Set the scaling limit for printing, so that small stuff is not zoomed to full page.
 
bool m_printframe
 If true, draw a frame around printouts.
 
bool m_printfittopage
 If true, draw a view on all page without real scale.
 
- Protected Attributes inherited from a2dView
bool m_isClosed
 close flag, to indicate that the view is being closed are is closed.
 
a2dSmrtPtr< a2dDocumentm_viewDocument
 the document to which this view belongs.
 
wxString m_viewTypeName
 set via the a2dViewTemplate on generation of this view.
 
a2dViewTemplatePtr m_viewTemplate
 view was created from this view template or if not used NULL
 
bool m_active
 true if this view is activated ( its display window has the focus and recieves mouse events )
 
bool m_viewEnabled
 Is the view enabled? More...
 
wxWindow * m_display
 In case of using a window for displaying the view, this holds the window.
 
wxUint32 m_id
 This identifies the view in event processing.
 
a2dSmrtPtr< a2dViewm_keepalive
 
- Protected Attributes inherited from a2dObject
a2dNamedPropertyList m_propertylist
 properties
 
int m_refcount
 how many references to this object do exist
 
bool m_check: 1
 used for linking multiple referenced objects when serializing
 
bool m_release: 1
 when set object is treated as being deleted, and wil be deleted in idle time.
 
bool m_recursion_active: 1
 this is used as a recursion stopper
 
bool m_pendingDisconnects: 1
 
unsigned int m_iteratorCount
 
a2dAutoZeroPtr< a2dObject > * m_autozeroptrlist
 this is a list of all a2dAutoZeroPtr object pointing to this object
 

Additional Inherited Members

- Public Types inherited from a2dObject
enum  CloneOptions {
  clone_members = 0x00000001, clone_properties = 0x00000002, clone_childs = 0x00000004, clone_unused = 0x00000008,
  clone_setoriginal = 0x00000010, clone_seteditcopy = 0x00000020, clone_noReference = 0x00000040, clone_noCameleonRef = 0x00000080,
  clone_toDrag = 0x00000100, clone_flat = 0x00000000, clone_deep = clone_members | clone_properties | clone_childs
}
 options for cloning More...
 
typedef a2dAutoZeroPtr< a2dObjectTAutoZeroPtrListClass
 this is needed inside the smart pointer template code
 
- Static Public Attributes inherited from a2dObject
static a2dPropertyIdBoolPROPID_Check = NULL
 used for linking multiple referenced objects when serializing
 
static a2dPropertyIdUriPROPID_URI = NULL
 attach an URL to the object
 
static a2dPropertyIdStringPROPID_Name = NULL
 Name property, to return name of this object.
 
static a2dPropertyIdVoidPtrPROPID_autozeroptrlist = NULL
 
static const a2dSignal sm_Edit_properties = wxNewId()
 edit properties event, see EditProperties()
 
- Protected Types inherited from a2dObject
enum  { refcount_nondynamic = 0x76543210 }
 special refcount value for non-dynamic objects
 
- Protected Member Functions inherited from a2dView
void OnUpdate (a2dDocumentEvent &event)
 default handler for a2dDocumentEvent ::wxEVT_UPDATE_VIEWS More...
 
void OnEnableViews (a2dDocumentEvent &event)
 default handler for a2dDocumentEvent of type ::wxEVT_ENABLE_VIEWS More...
 
void OnReport (a2dDocumentEvent &event)
 handler for the ::wxEVT_REPORT_VIEWS More...
 
void OnEnable (a2dViewEvent &event)
 default handler for EVT_ENABLE_VIEW event.
 
void OnChangeFilename (a2dDocumentEvent &event)
 default handler for file changed event sent from a2dDocument with type wxEVT_CHANGEDFILENAME_DOCUMENT More...
 
void OnChangeTitle (a2dDocumentEvent &event)
 default handler for file changed event sent from a2dDocument with type wxEVT_CHANGEDTITLE_DOCUMENT More...
 
void OnCloseView (a2dCloseViewEvent &event)
 ::wxEVT_CLOSE_VIEW event handler to do cleanup/veto Close of the view. More...
 
void OnDisConnectView (a2dDocumentEvent &event)
 handler for ::wxEVT_DISCONNECT_ALLVIEWS More...
 
void OnSetFocus (wxFocusEvent &event)
 called on (de)activating (wxWindow) containing the view. More...
 
void OnKillFocus (wxFocusEvent &event)
 when a view goes out of focus ( when only one view per window More...
 
- Protected Member Functions inherited from a2dObject
virtual bool DoIgnoreIfNotMember (const a2dPropertyId *id) const
 used to decide if a property shall be ignored, if it is not a member More...
 
virtual void DoWalker (wxObject *parent, a2dWalkerIOHandler &handler)
 iterate over this object and its children More...
 
virtual void DoSave (wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
 Save settings.
 
virtual void DoLoad (wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
 Load settings.
 

Detailed Description

View on a a2dCanvasDocument.

a2dCanvasView is a specialized view as connecting class to a2dCanvas via a2dViewCanvas. a2DrawingPart eventually display a part of a2dDrawing in a2dCanvas. This a2dDrawing is part of a a2dCanvasDocument. a2dCanvasDocument can contain a hierarchy of drawings. It depends on the a2dCanvas created by this view or via a derived a2dViewConnector class, what part of a drawing and which drawing is displayed.

Definition at line 212 of file candoc.h.

Constructor & Destructor Documentation

a2dCanvasView::a2dCanvasView ( int  width = 1000,
int  height = 1000 
)

constructor

Remarks
Do not forget to call SetDocument() if used standalone (in a a2dDocumentCommandProcessor setting this is taken care of).

Definition at line 418 of file candoc.cpp.

a2dCanvasView::a2dCanvasView ( const wxSize &  size)

constructor

Remarks
Do not forget to call SetDocument() if used standalone (in a a2dDocumentCommandProcessor setting this is taken care of)

Definition at line 413 of file candoc.cpp.

Member Function Documentation

a2dCanvas * a2dCanvasView::GetCanvas ( ) const

Get the Display window of the a2dView. But casted to a a2dCanvas.

when a a2dCanvas is used in this a2dCanvasView return it else 0. a2dCanvasView needs to know the window (a2dCanvas) to display somethinf of the a2dCanvasDocument.

See Also
a2dView::SetDisplayWindow()

Definition at line 447 of file candoc.cpp.

wxPrintout * a2dCanvasView::OnCreatePrintout ( a2dPrintWhat  typeOfPrint,
const wxPageSetupDialogData &  pageSetupData 
)
virtual

to create a a2dViewPrintout, used to print a view or its document

The a2dViewPrintout created will take as much possible from the this view. a2dViewPrintout will create itself a view which fits the size of the paper, but important setting are taken from this view.

Reimplemented from a2dView.

Definition at line 500 of file candoc.cpp.

void a2dCanvasView::OnDraw ( wxDC *  dc)
virtual

Not implemented, use a2dViewPrintout to print.

OnDraw is called when printing a view via wxView::OnPrint with wxDocPrintout::OnPrintPage. But for a2dCanvasView, i implemented it in a2dViewPrintout::OnPrintPage.

This funcion is and should NOT be used to Redraw the a2dCanvasView views, this is taken care of automatically, and if needed can be forced with OnUpdate or Update. Paint events are intercepted to blit damaged parts caused by overlaping windows, and in Idle time changes or updated in a2dCanvasView.

Implements a2dView.

Definition at line 494 of file candoc.cpp.

bool a2dCanvasView::ProcessEvent ( wxEvent &  event)
virtual

Special event handling for a2dCanvasView class.

Redirects events to the a2dViewCanvas.

Reimplemented from a2dView.

Definition at line 470 of file candoc.cpp.


The documentation for this class was generated from the following files:
a2dCanvasView Class Reference -- Sun Oct 12 2014 17:04:30 -- Sun Oct 12 2014 -- 1.8.5 -- wxArt2D -- . -- Main Page Reference Documentation