2007-05-07 09:33:24 -07:00
|
|
|
#ifndef INCLUDED_ATLASWINDOW
|
|
|
|
|
#define INCLUDED_ATLASWINDOW
|
2006-04-23 16:14:18 -07:00
|
|
|
|
|
|
|
|
#include "General/AtlasWindowCommandProc.h"
|
|
|
|
|
|
|
|
|
|
#include "General/IAtlasSerialiser.h"
|
|
|
|
|
#include "FileHistory/FileHistory.h"
|
|
|
|
|
|
|
|
|
|
#include "wx/filename.h"
|
|
|
|
|
|
2006-11-11 20:02:36 -08:00
|
|
|
#include <boost/signal.hpp>
|
|
|
|
|
|
2006-04-23 16:14:18 -07:00
|
|
|
class AtObj;
|
|
|
|
|
|
|
|
|
|
class AtlasWindow : public wxFrame, public IAtlasSerialiser
|
|
|
|
|
{
|
|
|
|
|
friend class AtlasWindowCommandProc;
|
|
|
|
|
|
|
|
|
|
DECLARE_CLASS(AtlasWindow);
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
enum
|
|
|
|
|
{
|
|
|
|
|
// ID_Import,
|
|
|
|
|
// ID_Export,
|
|
|
|
|
|
|
|
|
|
// First available ID for custom window-specific menu items
|
2006-09-27 19:05:56 -07:00
|
|
|
ID_Custom = 1
|
2006-04-23 16:14:18 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
AtlasWindow(wxWindow* parent, const wxString& title, const wxSize& size);
|
|
|
|
|
|
2006-09-22 10:43:00 -07:00
|
|
|
boost::signal<void ()> sig_FileSaved;
|
|
|
|
|
|
2006-04-23 16:14:18 -07:00
|
|
|
private:
|
|
|
|
|
|
|
|
|
|
void OnNew(wxCommandEvent& event);
|
|
|
|
|
// void OnImport(wxCommandEvent& event);
|
|
|
|
|
// void OnExport(wxCommandEvent& event);
|
|
|
|
|
// TODO: import/export vs open/save/saveas - how should it decide which to do?
|
|
|
|
|
void OnOpen(wxCommandEvent& event);
|
|
|
|
|
void OnSave(wxCommandEvent& event);
|
|
|
|
|
void OnSaveAs(wxCommandEvent& event);
|
|
|
|
|
|
|
|
|
|
void OnQuit(wxCommandEvent& event);
|
|
|
|
|
|
|
|
|
|
void OnMRUFile(wxCommandEvent& event);
|
|
|
|
|
|
|
|
|
|
void OnUndo(wxCommandEvent& event);
|
|
|
|
|
void OnRedo(wxCommandEvent& event);
|
|
|
|
|
|
|
|
|
|
void OnClose(wxCloseEvent& event);
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
void SetCurrentFilename(wxFileName filename = wxString());
|
|
|
|
|
wxFileName GetCurrentFilename() { return m_CurrentFilename; }
|
|
|
|
|
|
|
|
|
|
void AddCustomMenu(wxMenu* menu, const wxString& title);
|
|
|
|
|
|
|
|
|
|
virtual wxString GetDefaultOpenDirectory() = 0;
|
|
|
|
|
|
|
|
|
|
bool SaveChanges(bool forceSaveAs);
|
|
|
|
|
public:
|
2006-09-22 10:43:00 -07:00
|
|
|
bool OpenFile(const wxString& filename);
|
2006-04-23 16:14:18 -07:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
AtlasWindowCommandProc m_CommandProc;
|
|
|
|
|
|
|
|
|
|
wxMenuItem* m_menuItem_Save;
|
|
|
|
|
wxMenuBar* m_MenuBar;
|
|
|
|
|
|
|
|
|
|
wxFileName m_CurrentFilename;
|
|
|
|
|
wxString m_WindowTitle;
|
|
|
|
|
|
|
|
|
|
FileHistory m_FileHistory;
|
|
|
|
|
|
|
|
|
|
DECLARE_EVENT_TABLE();
|
|
|
|
|
};
|
|
|
|
|
|
2007-05-07 09:33:24 -07:00
|
|
|
#endif // INCLUDED_ATLASWINDOW
|