#endif
#include "wx/scrolbar.h"
+#include "wx/config.h"
#include <ctype.h>
#include <stdlib.h>
#include <windows.h>
#endif
-#ifndef __WXGTK__
+#ifdef __WXMSW__
#include "wx/help.h"
#endif
#include "bitmaps/load.xpm"
#include "bitmaps/save.xpm"
#include "bitmaps/new.xpm"
-#include "bitmaps/vert.xbm"
-#include "bitmaps/alignt.xbm"
-#include "bitmaps/alignb.xbm"
-#include "bitmaps/horiz.xbm"
-#include "bitmaps/alignl.xbm"
-#include "bitmaps/alignr.xbm"
-#include "bitmaps/copysize.xbm"
-#include "bitmaps/tofront.xbm"
-#include "bitmaps/toback.xbm"
-#include "bitmaps/help.xbm"
-#include "bitmaps/wxwin.xbm"
+#include "bitmaps/vert.xpm"
+#include "bitmaps/alignt.xpm"
+#include "bitmaps/alignb.xpm"
+#include "bitmaps/horiz.xpm"
+#include "bitmaps/alignl.xpm"
+#include "bitmaps/alignr.xpm"
+#include "bitmaps/copysize.xpm"
+#include "bitmaps/tofront.xpm"
+#include "bitmaps/toback.xpm"
+#include "bitmaps/help.xpm"
+#include "bitmaps/wxwin.xpm"
#endif
/*
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;
m_propertyWindowSize.width = 300;
m_propertyWindowSize.height = 300;
-#ifndef __WXGTK__
+#ifdef __WXMSW__
m_helpController = NULL;
#endif
sm_currentResourceManager = NULL;
SaveOptions();
-#ifndef __WXGTK__
+#ifdef __WXMSW__
if (m_helpController)
{
m_helpController->Quit();
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
LoadOptions();
-#ifndef __WXGTK__
+#ifdef __WXMSW__
m_helpController = new wxHelpController;
m_helpController->Initialize("dialoged");
#endif
m_bitmapImage = new wxBitmap("WXWINBMP", wxBITMAP_TYPE_BMP_RESOURCE);
#endif
#ifdef __WXGTK__
- m_bitmapImage = new wxBitmap(wxwin_bits, wxwin_width, wxwin_height);
+ m_bitmapImage = new wxBitmap( wxwin_xpm );
#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;
}
wxBitmap ToolbarLoadBitmap( load_xpm );
wxBitmap ToolbarSaveBitmap( save_xpm);
wxBitmap ToolbarNewBitmap( new_xpm );
- wxBitmap ToolbarVertBitmap(vert_bits, vert_width, vert_height);
- wxBitmap ToolbarAlignTBitmap(alignt_bits, alignt_width, alignt_height);
- wxBitmap ToolbarAlignBBitmap(alignb_bits, alignb_width, alignb_height);
- wxBitmap ToolbarHorizBitmap(horiz_bits, horiz_width, horiz_height);
- wxBitmap ToolbarAlignLBitmap(alignl_bits, alignl_width, alignl_height);
- wxBitmap ToolbarAlignRBitmap(alignr_bits, alignr_width, alignr_height);
- wxBitmap ToolbarCopySizeBitmap(copysize_bits, copysize_width, copysize_height);
- wxBitmap ToolbarToBackBitmap(toback_bits, toback_width, toback_height);
- wxBitmap ToolbarToFrontBitmap(tofront_bits, tofront_width, tofront_height);
- wxBitmap ToolbarHelpBitmap(help_bits, help_width, help_height);
+ wxBitmap ToolbarVertBitmap( vert_xpm );
+ wxBitmap ToolbarAlignTBitmap( alignt_xpm );
+ wxBitmap ToolbarAlignBBitmap( alignb_xpm );
+ wxBitmap ToolbarHorizBitmap( horiz_xpm );
+ wxBitmap ToolbarAlignLBitmap( alignl_xpm );
+ wxBitmap ToolbarAlignRBitmap( alignr_xpm );
+ wxBitmap ToolbarCopySizeBitmap( copysize_xpm );
+ wxBitmap ToolbarToBackBitmap( toback_xpm );
+ wxBitmap ToolbarToFrontBitmap( tofront_xpm );
+ wxBitmap ToolbarHelpBitmap( help_xpm );
#endif
// Create the toolbar
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
}
}
void wxResourceEditorFrame::OnContents(wxCommandEvent& WXUNUSED(event))
{
-#ifndef __WXGTK__
+#ifdef __WXMSW__
wxBeginBusyCursor();
manager->GetHelpController()->LoadFile();
manager->GetHelpController()->DisplayContents();
*
*/
+#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)
}
case TOOLBAR_HELP:
{
-#ifndef __WXGTK__
+#ifdef __WXMSW__
wxBeginBusyCursor();
manager->GetHelpController()->LoadFile();
manager->GetHelpController()->DisplayContents();
else frame->SetStatusText("");
}
-void EditorToolBar::OnPaint(wxPaintEvent& event)
-{
-#ifndef __WXGTK__
- wxToolBar::OnPaint(event);
-
- wxPaintDC dc(this);
- int w, h;
- GetSize(&w, &h);
- dc.SetPen(wxBLACK_PEN);
- dc.SetBrush(wxTRANSPARENT_BRUSH);
- dc.DrawLine(0, h-1, w, h-1);
-#endif
-}
-
-