#endif
#include "wx/scrolbar.h"
+#include "wx/config.h"
#include <ctype.h>
#include <stdlib.h>
m_editorToolBar = NULL;
// Default window positions
- m_resourceEditorWindowSize.width = 470;
- m_resourceEditorWindowSize.height = 300;
+ m_resourceEditorWindowSize.width = 500;
+ m_resourceEditorWindowSize.height = 450;
m_resourceEditorWindowSize.x = 0;
m_resourceEditorWindowSize.y = 0;
strcat(buf, "\\dialoged.ini");
m_optionsResourceFilename = buf;
#elif defined(__WXGTK__)
- char buf[500];
- wxGetHomeDir(buf);
- strcat(buf, "/.dialogedrc");
- m_optionsResourceFilename = buf;
+ wxGetHomeDir( &m_optionsResourceFilename );
+ m_optionsResourceFilename += "/.dialogedrc";
#else
#error "Unsupported platform."
#endif
bool wxResourceManager::LoadOptions()
{
+ wxConfig config("DialogEd", "wxWindows");
+
+ config.Read("editorWindowX", &m_resourceEditorWindowSize.x);
+ config.Read("editorWindowY", &m_resourceEditorWindowSize.y);
+ config.Read("editorWindowWidth", &m_resourceEditorWindowSize.width);
+ config.Read("editorWindowHeight", &m_resourceEditorWindowSize.height);
+ config.Read("propertyWindowX", &m_propertyWindowSize.x);
+ config.Read("propertyWindowY", &m_propertyWindowSize.y);
+ config.Read("propertyWindowWidth", &m_propertyWindowSize.width);
+ config.Read("propertyWindowHeight", &m_propertyWindowSize.height);
+
+ /*
wxGetResource("DialogEd", "editorWindowX", &m_resourceEditorWindowSize.x, m_optionsResourceFilename.GetData());
wxGetResource("DialogEd", "editorWindowY", &m_resourceEditorWindowSize.y, m_optionsResourceFilename.GetData());
wxGetResource("DialogEd", "editorWindowWidth", &m_resourceEditorWindowSize.width, m_optionsResourceFilename.GetData());
wxGetResource("DialogEd", "propertyWindowY", &m_propertyWindowSize.y, m_optionsResourceFilename.GetData());
wxGetResource("DialogEd", "propertyWindowWidth", &m_propertyWindowSize.width, m_optionsResourceFilename.GetData());
wxGetResource("DialogEd", "propertyWindowHeight", &m_propertyWindowSize.height, m_optionsResourceFilename.GetData());
+ */
return TRUE;
}
bool wxResourceManager::SaveOptions()
{
+ wxConfig config("DialogEd", "wxWindows");
+
+ config.Write("editorWindowX", m_resourceEditorWindowSize.x);
+ config.Write("editorWindowY", m_resourceEditorWindowSize.y);
+ config.Write("editorWindowWidth", m_resourceEditorWindowSize.width);
+ config.Write("editorWindowHeight", m_resourceEditorWindowSize.height);
+ config.Write("propertyWindowX", m_propertyWindowSize.x);
+ config.Write("propertyWindowY", m_propertyWindowSize.y);
+ config.Write("propertyWindowWidth", m_propertyWindowSize.width);
+ config.Write("propertyWindowHeight", m_propertyWindowSize.height);
+ /*
wxWriteResource("DialogEd", "editorWindowX", m_resourceEditorWindowSize.x, m_optionsResourceFilename.GetData());
wxWriteResource("DialogEd", "editorWindowY", m_resourceEditorWindowSize.y, m_optionsResourceFilename.GetData());
wxWriteResource("DialogEd", "editorWindowWidth", m_resourceEditorWindowSize.width, m_optionsResourceFilename.GetData());
wxWriteResource("DialogEd", "propertyWindowY", m_propertyWindowSize.y, m_optionsResourceFilename.GetData());
wxWriteResource("DialogEd", "propertyWindowWidth", m_propertyWindowSize.width, m_optionsResourceFilename.GetData());
wxWriteResource("DialogEd", "propertyWindowHeight", m_propertyWindowSize.height, m_optionsResourceFilename.GetData());
+ */
return TRUE;
}
c->bottom.SameAs (m_editorFrame, wxBottom, 0);
c->width.Unconstrained();
#ifdef __WXGTK__
- c->height.Absolute(70);
+ c->height.Absolute(140);
#else
c->height.Absolute(60);
#endif
frame->SetAutoLayout(TRUE);
#ifdef __WXMSW__
- wxIcon *icon = new wxIcon("DIALOGEDICON");
- frame->SetIcon(icon);
+ frame->SetIcon(wxIcon("DIALOGEDICON"));
#endif
return frame;
}
node = node->Next();
}
}
- m_editorResourceTree->ExpandItem(id, wxTREE_EXPAND_EXPAND);
+// m_editorResourceTree->ExpandItem(id, wxTREE_EXPAND_EXPAND);
}
bool wxResourceManager::EditSelectedResource()
}
else
{
- long style = res->GetStyle();
- res->SetStyle(style|wxRAISED_BORDER);
+// long style = res->GetStyle();
+// res->SetStyle(style|wxRAISED_BORDER);
panel = new wxPanel;
wxResourceEditorDialogHandler *handler = new wxResourceEditorDialogHandler(panel, res, panel->GetEventHandler(),
this);
panel->PushEventHandler(handler);
- res->SetStyle(style);
+// res->SetStyle(style);
handler->AddChildHandlers(); // Add event handlers for all controls
AssociateResource(res, panel);
{
RemoveSelection(item);
childHandler->SelectItem(FALSE);
+#ifndef __WXGTK__
item->GetParent()->Refresh();
+#endif
}
}
*
*/
+#ifdef __WXGTK__ // I don't dare to delete it...
+
+BEGIN_EVENT_TABLE(EditorToolBar, wxToolBar)
+END_EVENT_TABLE()
+
+#else
+
BEGIN_EVENT_TABLE(EditorToolBar, wxToolBar)
EVT_PAINT(EditorToolBar::OnPaint)
END_EVENT_TABLE()
+#endif
+
EditorToolBar::EditorToolBar(wxFrame *frame, const wxPoint& pos, const wxSize& size,
long style):
wxToolBar(frame, -1, pos, size, style)