On Sun, Oct 19, 2008 at 1:29 PM, klaas.holwerda wrote: > Bionic Badger wrote: >> I'm trying to use a wxArt2D canvas inside a regular wxWidgets wxFrame >> (so I can use wxFormBuilder to lay out the interface) instead of an >> a2dDocumentFrame, and it pretty much works out fine, except when I try >> However, when the app initially opens, the world preview does not >> correctly render the canvas. Everything 5px inset appears blank. See >> here: >> > With wxFrame use you might be missing all events needed for updates and > what not. > So i don't know what to say more. If using a2dDocumentFrame, is it > still the same? > If so prepare/modify a sample to show your problem. Sometimes it just > a refresh/update of a2dCanavsView more, to make it right.
So I created a wrapper class to enable the form builder to create an a2dDocumentFrame instead of a wxFrame, and it seems to have fixed the crashing-on-exit with respect to the dragging tool. However, the world-preview view still does not get drawn correctly at startup. Is there any way to force a post-layout re-render or something of that sort to get it to redraw the contents, or a view invalidation? I'll also take a look at the classes you suggested for implementing the hand tool among other things, thanks for the pointers. Do you think in the future there could be a wxFrame-compatible constructor for the a2dDocumentFrame? That way I wouldn't need to use a wrapper at all, and people could build interfaces directly using a2dDocumentFrame in wxFormBuilder. It really makes the interface design aspect a lot easier. It'd be really great if there were native widgets that could be placed into the interface in wxFormBuilder, but that'd be a pain to compile for it. Here's the wrapper class I used if anyone is interested. Unfortunately, it makes some assumptions about how the frame is initialized: Header ("wxFrameA2D.h"): #pragma once #include "docview/include/docviewref.h" class wxFrameA2D : public a2dDocumentFrame { public: wxFrameA2D ( wxWindow * parent, wxWindowID id, const wxString & title, const wxPoint & position = wxDefaultPosition, const wxSize & size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, const wxString & name = "frame", bool parentFrame = true, a2dView * view = NULL ); ~wxFrameA2D(); }; Implementation ("wxFrameA2D.cpp"): #include "wxFrameA2D.h" wxFrameA2D::wxFrameA2D ( wxWindow * parent, wxWindowID id, const wxString & title, const wxPoint & position, const wxSize & size, long style, const wxString & name, bool parentFrame, a2dView * view ) : a2dDocumentFrame ( parentFrame, NULL, view, id, title, position, size, style, name ) { } wxFrameA2D::~wxFrameA2D() { } ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Wxart2d-users_dev mailing list Wxart2d-users_dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wxart2d-users_dev