Here are some problems I'm having:
- When opening a file with one of these windows, the MainBook does not switch to it, even though m_mgr->SelectPage() returns true.
- Saving is not enabled when an svPanel is selected
- Undo/redo are not enabled when an svPanel is selected.
svPanel.h:
Code: Select all
class svPanel : public wxScrolledWindow
{
private:
svDocument *m_document; // created in svPanel constructor
...
public:
svPanel(wxWindow* parent, wxFileName file);
...
};
Code: Select all
svPanel::svPanel(wxWindow* parent, wxFileName file) : wxScrolledWindow(parent)
{
m_document = new svDocument(this, file);
...
}
Code: Select all
// Open bool SwarmVis::DoOpenWithSwarmVis(wxFileName& file)
{
if (file.GetExt() == wxT(SV_EXTENSION)) // SV_EXTENSION is a #define
{
svPanel *svp = new svPanel(m_mgr->GetTheApp()->GetTopWindow(), file);
m_mgr->AddEditorPage(svp, file.GetFullName());
m_mgr->SelectPage(svp); // This returns true, but doesn't actually select the page. Shouldn't AddEditorPage() select it anyway?
return true;
}
return false;
}