Yesid Hernandez wrote:
> [EMAIL PROTECTED] escribió:
> Well, I agree with you, that should be working, but it
> doesn't. I tried in the single sample under the editor samples, and
> didn't. Just the same but sometimes I get a "Segmentation fault" but
> some other there is no error but the code doesn't do what it's
> expected to... I tried with the a2command_FileSave and
> a2dCommand_FileSaveAs with the same results as above.
>
Those commands require document templates, connectors etc. It is more
a full blown docview application. Like in vdrawm and vdraws.
For just a canvas, the simple sample now shows you how to save and
load contents into it. Did add it just now.
The principles are the same, but only at a lower level, which is what
you need in your case.
> I was trying to get it working with the other way as you suggest,
> but there I got another problem, my code is the following:
>
> a2dIOHandlerStrOut *hdl = new a2dIOHandlerStrOut();
> m_canvas->GetCanvasDocument()->Save(wxT("test"),hdl);
>
> So, in order to get this class working I suppose I have to create a
> derived class and put this method to do something, but i cannot
> figure out what?.
>
The derived class you need is
a2dIOHandlerCVGIn and a2dIOHandlerCVGOut which is the default format
to save a a2dCanvasDocument.
And i assumed you did know about that, since for saving and loading
files you normally need to setup document templates ( see vdraw and
vdrawm for example ).
Although it looks like a2dCanvasDocument::SaveObject() takes this as
the default handler if not specified.
Anyway the simple sample shows you now how to do it for a simple canvas.
> Hope this help, so we can improve the great wxArt2d library and
> help you debugging.
>
Thanks, if you find problem in the simple sample, save and loading
files, come b
ack on it.
Klaas
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Wxart2d-users_dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wxart2d-users_dev