void wxWindow::SetFont( const wxFont &font )
{
m_font = font;
- GtkStyle *style = (GtkStyle*) NULL;
+
+ // Unfortunately this results in a crash in GTK on deletion
+ // of windows, e.g. the wxStatusBar in Dialog Editor.
+#if 0
+
+ // ADDED BY JACS: not sure if this is the right thing to do,
+ // but will avoid a segv when SetFont(wxNullFont) is called.
+ if (((wxFont*) &font)->Ok())
+ m_font = font;
+ else
+ m_font = *wxSWISS_FONT;
+
+ GtkStyle *style = (GtkStyle`*) NULL;
if (!m_hasOwnStyle)
{
m_hasOwnStyle = TRUE;
style->font = gdk_font_ref( m_font.GetInternalFont( 1.0 ) );
gtk_widget_set_style( m_widget, style );
+#endif
}
wxFont *wxWindow::GetFont(void)
void wxWindow::SetFont( const wxFont &font )
{
m_font = font;
- GtkStyle *style = (GtkStyle*) NULL;
+
+ // Unfortunately this results in a crash in GTK on deletion
+ // of windows, e.g. the wxStatusBar in Dialog Editor.
+#if 0
+
+ // ADDED BY JACS: not sure if this is the right thing to do,
+ // but will avoid a segv when SetFont(wxNullFont) is called.
+ if (((wxFont*) &font)->Ok())
+ m_font = font;
+ else
+ m_font = *wxSWISS_FONT;
+
+ GtkStyle *style = (GtkStyle`*) NULL;
if (!m_hasOwnStyle)
{
m_hasOwnStyle = TRUE;
style->font = gdk_font_ref( m_font.GetInternalFont( 1.0 ) );
gtk_widget_set_style( m_widget, style );
+#endif
}
wxFont *wxWindow::GetFont(void)
return;
}
- wxResourceManager* manager = resourceManager;
-
switch (wxResourceManager::GetCurrentResourceManager()->GetEditorControlList()->GetSelection())
{
case RESED_BUTTON:
handlerDialog->PopupMenu(menu, x, y);
}
-void wxResourceEditorDialogHandler::OnItemLeftClick(wxControl *item, int x, int y, int keys)
+void wxResourceEditorDialogHandler::OnItemLeftClick(wxControl *item, int WXUNUSED(x), int WXUNUSED(y), int keys)
{
if (keys & wxKEY_CTRL)
{
OnLeftClick(x, y, keys);
}
- else if (event.RightUp())
+ else if (event.RightDown())
{
if (m_mouseCaptured)
{
{
oldDragX = x; oldDragY = y;
}
+ // Obsolete; no longer try to right-drag
else if (event.RightUp() && dragItem && dragMode == wxDRAG_MODE_CONTINUE_RIGHT)
{
dragMode = wxDRAG_MODE_NONE;
}
else if (event.RightDown())
{
+ if (m_mouseCaptured)
+ {
+ handlerDialog->ReleaseMouse();
+ m_mouseCaptured = FALSE;
+ }
+
+ if (item)
+ childHandler->OnRightClick(x, y, keys);
+ else
+ OnRightClick(x, y, keys);
+
+ dragItem = NULL; dragMode = wxDRAG_MODE_NONE; dragType = wxDRAG_TYPE_NONE;
+
+ /*
dragItem = item;
dragMode = wxDRAG_MODE_START_RIGHT;
firstDragX = x;
handlerDialog->CaptureMouse();
m_mouseCaptured = TRUE;
}
+ */
}
else if (event.LeftUp())
{
}
else if (event.RightUp())
{
+ /*
if (dragItem)
childHandler->OnRightClick(x, y, keys);
else
handlerDialog->ReleaseMouse();
m_mouseCaptured = FALSE;
}
+ */
}
}
}
// dc.DestroyClippingRegion();
wxPanel *panel = (wxPanel *)handlerControl->GetParent();
- wxResourceEditorDialogHandler *panelHandler = (wxResourceEditorDialogHandler *)panel->GetEventHandler();
// Erase selection handles
// DrawSelectionHandles(dc, TRUE);
dc.EndDrawing();
}
-void wxResourceEditorControlHandler::OnDragContinue(bool paintIt, int x, int y, int WXUNUSED(keys), wxDC& dc, int selectionHandle)
+void wxResourceEditorControlHandler::OnDragContinue(bool WXUNUSED(paintIt), int x, int y, int WXUNUSED(keys), wxDC& dc, int selectionHandle)
{
wxPanel *panel = (wxPanel *)handlerControl->GetParent();
- wxResourceEditorDialogHandler *panelHandler = (wxResourceEditorDialogHandler *)panel->GetEventHandler();
-
int xpos, ypos, width, height;
handlerControl->GetPosition(&xpos, &ypos);
handlerControl->GetSize(&width, &height);
void wxResourceEditorControlHandler::OnDragEnd(int x, int y, int WXUNUSED(keys), wxDC& dc, int selectionHandle)
{
wxPanel *panel = (wxPanel *)handlerControl->GetParent();
- wxResourceEditorDialogHandler *panelHandler = (wxResourceEditorDialogHandler *)panel->GetEventHandler();
dc.BeginDrawing();
#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;
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