#ifndef _RESEDITR_H_
#define _RESEDITR_H_
-#define wxDIALOG_EDITOR_VERSION 1.6
+#define wxDIALOG_EDITOR_VERSION 1.7
#ifdef __GNUG__
#pragma interface "reseditr.h"
#include "wx/resource.h"
#include "wx/toolbar.h"
#include "wx/imaglist.h"
-
-#include "proplist.h"
+#include "wx/treectrl.h"
+#include "wx/proplist.h"
+#include "wx/txtstrm.h"
#include "symbtabl.h"
#include "winstyle.h"
m_styleTable.Init();
}
virtual bool Save(const wxString& filename);
- virtual bool SaveResource(ostream& stream, wxItemResource *item);
+ virtual bool SaveResource(wxTextOutputStream& stream, wxItemResource* item, wxItemResource* parentItem);
void GeneratePanelStyleString(long windowStyle, char *buf);
void GenerateDialogStyleString(long windowStyle, char *buf);
bool GenerateStyle(char *buf, long windowStyle, long flag, char *strStyle);
*/
- void OutputFont(ostream& stream, wxFont *font);
- wxControl *CreateItem(wxPanel *panel, wxItemResource *childResource);
+ void OutputFont(wxTextOutputStream& stream, const wxFont& font);
+ wxControl *CreateItem(wxPanel *panel, const wxItemResource *childResource, const wxItemResource* parentResource);
protected:
wxWindowStyleTable m_styleTable;
virtual bool DeleteResource(wxWindow *win);
// Add bitmap resource if there isn't already one with this filename.
- virtual char *AddBitmapResource(char *filename);
+ virtual wxString AddBitmapResource(const wxString& filename);
// Delete the bitmap resource if it isn't being used by another resource.
- virtual void PossiblyDeleteBitmapResource(char *resourceName);
+ virtual void PossiblyDeleteBitmapResource(const wxString& resourceName);
// Helper function for above
- virtual bool IsBitmapResourceUsed(char *resourceName);
+ virtual bool IsBitmapResourceUsed(const wxString& resourceName);
- wxItemResource *FindBitmapResourceByFilename(char *filename);
+ wxItemResource *FindBitmapResourceByFilename(const wxString& filename);
- char *FindBitmapFilenameForResource(wxItemResource *resource);
+ wxString FindBitmapFilenameForResource(wxItemResource *resource);
// Is this window identifier in use?
bool IsSymbolUsed(wxItemResource* thisResource, wxWindowID id) ;
// Deletes 'win' and creates a new window from the resource that
// was associated with it. E.g. if you can't change properties on the
// fly, you'll need to delete the window and create it again.
- virtual wxWindow *RecreateWindowFromResource(wxWindow *win, wxWindowPropertyInfo *info = NULL);
+ virtual wxWindow *RecreateWindowFromResource(wxWindow *win, wxWindowPropertyInfo *info = NULL, bool instantiateFirst = TRUE);
virtual bool RecreateSelection();
+ // Remove selection handles if this control is selected
+ void DeselectItemIfNecessary(wxWindow *win);
+
// Need to search through resource table removing this from
// any resource which has this as a parent.
virtual bool RemoveResourceFromParent(wxItemResource *res);
inline wxResourceEditorControlList *GetEditorControlList() const { return m_editorControlList; }
inline wxList& GetSelections() { return m_selections; }
inline wxMenu *GetPopupMenu() const { return m_popupMenu; }
-// inline wxHelpController *GetHelpController() const { return m_helpController; }
+#ifdef __WXMSW__
+ inline wxHelpController *GetHelpController() const { return m_helpController; }
+#endif
inline void Modify(bool mod = TRUE) { m_modified = mod; }
inline bool Modified() const { return m_modified; }
// Member variables
protected:
-// wxHelpController* m_helpController;
+#ifdef __WXMSW__
+ wxHelpController* m_helpController;
+#endif
wxResourceTableWithSaving m_resourceTable;
wxFrame* m_editorFrame;
wxResourceEditorScrolledWindow* m_editorPanel;
long style = wxDEFAULT_FRAME_STYLE, const wxString& name = "frame");
~wxResourceEditorFrame();
- bool OnClose();
+ void OnCloseWindow(wxCloseEvent& event);
void OnNew(wxCommandEvent& event);
void OnOpen(wxCommandEvent& event);
long style = 0);
~wxResourceEditorScrolledWindow();
- void OnScroll(wxScrollEvent& event);
void OnPaint(wxPaintEvent& event);
void DrawTitle(wxDC& dc);
long style = wxTB_HORIZONTAL);
bool OnLeftClick(int toolIndex, bool toggled);
void OnMouseEnter(int toolIndex);
- void OnPaint(wxPaintEvent& event);
DECLARE_EVENT_TABLE()
};
#define TOOLBAR_TO_BACK 17
#define TOOLBAR_COPY_SIZE 18
+/*
+ * this class is used to store data associated with a tree item
+ */
+class wxResourceTreeData : public wxTreeItemData
+{
+public:
+ wxResourceTreeData(wxItemResource *resource) { m_resource = resource; }
+
+ wxItemResource *GetResource() const { return m_resource; }
+
+private:
+ wxItemResource *m_resource;
+};
+
#endif