For my application I wanted to embed wxShapeFrameWork into a tabbed interface. I found that this was not possible using the WX NoteBook because the NoteBook wants to hold panels and canvases, not frames.
So I embedded wxShapeFrameWork into a MDI parent frame.
Surprisingly easy, just derived myShapeFrame from wxMDIChildFrame instead of wxFrame.
The only problem I'm having is loading a BMP or PNG from a
a file. Using your demo code (from sfdemo), the line that is failing is (Line 98 in FrameCanvas.cpp):
pShape = GetDiagramManager()->AddShape(CLASSINFO(wxSFBitmapShape), event.GetPosition(), sfDONT_SAVE_STATE);
or the alternative:
pShape = m_Manager.AddShape(CLASSINFO(wxSFBitmapShape), event.GetPosition(), sfDONT_SAVE_STATE);
Neither of these produce a valid pointer to pshape.
No idea what the problem is.
I use wxSF with wxFlateNotebook and it works without any problem. You can also put a shape canvas into sizer located on some panel and use this panel together with wxNotebook.
It is quit difficult to diagnose your problem with bitmap shapes from your post, but: did you set wxSFBitmapShape as an accepted shape type in a diagram manager? ( for example, did you use some code line like this one: GetDiagramManager()->AcceptShape(wxT("All")); or GetDiagramManager()->AcceptShape(wxT("wxSFBitmapShape"));
did you use some code line like this one: GetDiagramManager()->AcceptShape(wxT("All")); or GetDiagramManager()->AcceptShape(wxT("wxSFBitmapShape"));
Blush, sorry, that was the problem.
I had several AcceptShape lines in the frame constructor, but
not the magic "All".
I'd really like to see some examples using a NoteBook with wxSF, if
you could share.
Thanks for the support on holiday!
I was searching for an example that uses MDI and tabbed frames also. Is there an example available that I can follow?
You can examine source code of my CodeDesigner RAD tool where the wxSF is used in tabs. For more info see www.codedesigner.org
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.