21 #include "wx/editor/recurdoc.h"
28 #include <wx/wfstream.h>
45 doc->GetFilename().GetFullName() != wxT( "" ) ? doc->GetFilename().GetFullName() : doc->GetPrintableName(),
46 totalheight, symbol, font, imagew, imageh )
49 SetObjectTip( doc->GetFilename().GetFullPath(), m_height / 2 , 0, m_height / 5 );
54 a2dCanvasDocumentReference::a2dCanvasDocumentReference(
double x,
double y,
double totalheight,
const wxFileName& filename,
56 :
a2dLibraryReference( x, y, NULL, filename.GetFullName(), totalheight, symbol, font, imagew, imageh )
59 SetObjectTip( filename.GetFullPath(), m_height / 2 , 0, m_height / 5 );
70 a2dCanvasDocumentReference::~a2dCanvasDocumentReference()
93 a2dCanvasDocumentReference2::a2dCanvasDocumentReference2(
double x,
double y,
a2dCanvasDocument* doc )
98 SetObjectTip( doc->GetFilename().GetFullPath(), 100 , 0, 100 );
99 m_fileName = wxFileName( doc->GetFilename().GetFullPath() );
101 SetURI( m_fileName.GetFullPath() );
105 a2dCanvasDocumentReference2::a2dCanvasDocumentReference2(
double x,
double y,
const wxFileName& filename )
110 m_fileName = filename;
111 SetURI( m_fileName.GetFullPath() );
115 a2dCanvasDocumentReference2::a2dCanvasDocumentReference2(
const a2dCanvasDocumentReference2& other, CloneOptions options,
a2dRefMap* refs )
121 a2dCanvasDocumentReference2::~a2dCanvasDocumentReference2()
127 return new a2dCanvasDocumentReference2( *
this, options, refs );
130 #if wxART2D_USE_CVGIO
140 #endif //wxART2D_USE_CVGIO
160 BEGIN_EVENT_TABLE( a2dCanvasDocumentReferenceAsText,
a2dText )
164 a2dCanvasDocumentReferenceAsText::a2dCanvasDocumentReferenceAsText(
a2dCanvasDocument* doc,
double x,
double y, const
a2dFont& font,
double angle,
165 bool up,
int alignment )
166 :
a2dText( wxT("not specified"), x, y, font, angle, up, alignment )
171 m_fileName = doc->GetFilename().GetFullPath();
173 m_displayShort =
true;
176 if ( m_displayShort && m_displayExt )
178 else if ( m_displayShort )
179 m_text = m_fileName.GetFullName();
181 m_text = m_fileName.GetFullPath();
183 wxString pathToFile = wxT(
"file:///" ) + m_fileName.GetVolume() + m_fileName.GetVolumeSeparator() + m_fileName.GetPath(wxPATH_GET_SEPARATOR, wxPATH_UNIX);
184 SetURI( pathToFile + m_fileName.GetFullName() );
186 SetObjectTip( pathToFile, 100 , 0, 100 );
189 a2dCanvasDocumentReferenceAsText::a2dCanvasDocumentReferenceAsText(
const wxFileName& filename,
double x,
double y,
const a2dFont& font,
double angle,
190 bool up,
int alignment )
191 :
a2dText( filename.GetFullPath(), x, y, font, angle, up, alignment )
193 m_fileName = filename;
195 if ( m_displayShort && m_displayExt )
197 else if ( m_displayShort )
198 m_text = m_fileName.GetFullName();
200 m_text = m_fileName.GetFullPath();
202 wxString pathToFile = wxT(
"file:///" ) + m_fileName.GetVolume() + m_fileName.GetVolumeSeparator() + m_fileName.GetPath(wxPATH_GET_SEPARATOR, wxPATH_UNIX);
203 SetURI( pathToFile + m_fileName.GetFullName() );
209 a2dCanvasDocumentReferenceAsText::a2dCanvasDocumentReferenceAsText(
const a2dCanvasDocumentReferenceAsText& other, CloneOptions options,
a2dRefMap* refs )
210 :
a2dText( other, options, refs )
212 m_fileName = other.m_fileName;
214 m_displayShort = other.m_displayShort;
215 m_displayExt = other.m_displayExt;
218 a2dCanvasDocumentReferenceAsText::~a2dCanvasDocumentReferenceAsText()
224 return new a2dCanvasDocumentReferenceAsText( *
this, options, refs );
227 #if wxART2D_USE_CVGIO
231 if ( xmlparts == a2dXmlSer_attrib )
233 out.WriteAttribute( wxT(
"filename" ), m_fileName.GetFullPath() );
243 if ( xmlparts == a2dXmlSer_attrib )
257 #endif //wxART2D_USE_CVGIO
266 wxMouseEvent mouseevent =
event.GetMouseEvent();
268 if( mouseevent.ControlDown() && mouseevent.ShiftDown() && m_doc )
283 m_text = m_fileName.GetFullPath();
292 a2dCanvasDocumentReferenceAsText* original =
wxStaticCast( PROPID_Original->
GetPropertyValue(
this ).Get(), a2dCanvasDocumentReferenceAsText );
293 original->m_fileName = wxFileName(
m_text );
294 if ( m_displayShort && m_displayExt )
295 original->
m_text = original->m_fileName.GetName();
296 else if ( m_displayShort )
297 original->
m_text = original->m_fileName.GetFullName();
299 original->
m_text = original->m_fileName.GetFullPath();
301 wxString pathToFile = wxT(
"file:///" ) + m_fileName.GetVolume() + m_fileName.GetVolumeSeparator() + m_fileName.GetPath(wxPATH_GET_SEPARATOR, wxPATH_UNIX);
302 original->
SetURI( pathToFile + m_fileName.GetFullName() );
305 wxURI uri = original->
GetURI();
306 wxString link = uri.BuildURI();
bool DoUpdate(UpdateMode mode, const a2dBoundingBox &childbox, const a2dBoundingBox &clipbox, const a2dBoundingBox &propbox)
Update derived Object specific things ( mainly boundingbox)
virtual bool DoIsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent)
Does hit test on the object (exclusif child objects)
bool DoStartEdit(wxUint16 editmode, wxEditStyle editstyle)
only used for editable objects and under control of a editing tool.
void SetURI(const wxURI &url)
quickly set a property PROPID_URI
mouse event sent from a2dCanvasObject to itself
virtual wxString GetName() const
Returns the name of this object, if no name is given the internal id will be returned.
class to map references to objects stored in XML, in order to make the connection later on...
a2dCanvasOFlags m_flags
holds flags for objects
a2dCanvasObject * GetRootObject() const
get the root object, which holds the objects in the document
bool GetPending() const
is this object pending for update?
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
Clone this object and return a pointer to the new object.
void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
Load object specific CVG data.
bool m_pending
set when a2dCanvasObject needs an update (redraw).
to display a2dCanvasObject references
bool DoIsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent)
Does hit test on the object (exclusif child objects)
Defines a font to be set to a2dDrawer2D or stored in a2dCanvsObject etc.
Input and output handler for the XmlSer format.
UpdateMode
Various mode flags for Update.
virtual void SetPending(bool pending)
set this object pending for update
bool DoUpdate(UpdateMode mode, const a2dBoundingBox &childbox, const a2dBoundingBox &clipbox, const a2dBoundingBox &propbox)
Update derived Object specific things ( mainly boundingbox)
virtual bool DoStartEdit(wxUint16 editmode, wxEditStyle editstyle)
only used for editable objects and under control of a editing tool.
a2dDrawing * GetDrawing() const
get the root object, which holds the objects in the document.
virtual void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
bool DoIsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent)
Does hit test on the object (exclusif child objects)
a2dCanvasObject is the base class for Canvas Objects.
Docview framework its controlling class.
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
Write object specific CVG data.
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
Clone this object and return a pointer to the new object.
Io handler to iterate through a a2dDocument.
a2dText is an abstract base class.
bool GetValid() const
returns true if boundingbox is calculated properly and therefore its valid flag is set...
void DependencyPending(a2dWalkerIOHandler *handler)
called by to check if this object becomes pending as a result of other objects
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
Clone this object and return a pointer to the new object.
#define wxStaticCast(obj, className)
The wxWindows 2.4.2 wxStaticCast is buggy. It evaluates its argument twice.
bool m_editable
object can be edited
#define EVT_CANVASOBJECT_MOUSE_EVENT(func)
static event table macro for a2dCanvasObject mouse event
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
Input and output handler for the XmlSer format.
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
virtual bool DoIsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent)
Does hit test on the object (exclusif child objects)
void DoEndEdit()
only used for editable objects and under control of a editing tool.
a2dError FileOpenCheck(a2dDocumentPtr &doc, const wxFileName &file, bool checkModification)
Return existing document, or open it from file.
wxURI GetURI() const
quick way to get to PROPID_URI property
to display a2dCanvasObject references
while iterating a a2dCanvasDocument, this holds the context.
special a2dCanvasObject to make a multi view hierachy.
a2dDocviewGlobal * a2dDocviewGlobals
a global pointer to get to global instance of important classes.
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
Write object specific CVG data.
wxString GetAttributeValue(const wxString &attrib, const wxString &defaultv=wxT(""))
Returns the value of an attribute.
a2dText * SetObjectTip(const wxString &tip, double x, double y, double size=30, double angle=0, const a2dFont &font=*a2dDEFAULT_CANVASFONT)
quickly set a property name OBJECTTIP
Each a2dCanvasView needs to have a a2dCanvasDocument set in order to render data. ...
to display a2dCanvasObject references
a2dDocumentCommandProcessor * GetDocviewCommandProcessor() const
Gets a2dDocumentCommandProcessor pointer.
void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
Load object specific CVG data.
The a2dBoundingBox class stores one a2dBoundingBox of a a2dCanvasObject.
void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
virtual bool RemoveProperty(const a2dPropertyId *id, bool all=true)
This function is called by a2dPropertyId to remove a property from the list.
the a2dDrawingPart is a a2dView specially designed for displaying parts of a a2dDrawing. It uses a a2dDrawer2D to actually redraw things from the document, by giving that a2dDrawer2D as drawing context to the document, and telling the document to redraw a certain rectangular area. At that last is what this class is for. It optimizes the areas to be redrawn after object in the document were changed. To do that it combines redraw areas to a minimal set of redrawing areas. All the administration for this and the way things will be redrawn is from this view.
basetype GetPropertyValue(const a2dObject *obj) const
Get the property value in obj.
a2dLibraryReference is a symbol object, it holds a reference
a2dBoundingBox m_bbox
boundingbox in world coordinates
a2dText(const wxString &text=wxT("not specified"))
constructor
wxString m_text
the text to display
CloneOptions
options for cloning
virtual void DoEndEdit()
only used for editable objects and under control of a editing tool.
structure to give as parameter to member functions of a2dCanvasObject
general canvas module declarations and classes