}
-bool wxPropertyListView::EditProperty(wxProperty *property)
+bool wxPropertyListView::EditProperty(wxProperty *WXUNUSED(property))
{
return TRUE;
}
// Called by the listbox callback
-void wxPropertyListView::OnPropertySelect(wxCommandEvent& event)
+void wxPropertyListView::OnPropertySelect(wxCommandEvent& WXUNUSED(event))
{
int sel = propertyScrollingList->GetSelection();
if (sel > -1)
{
wxPanel *panel = (wxPanel *)propertyWindow;
- int largeButtonWidth = 50;
+ int largeButtonWidth = 60;
int largeButtonHeight = 25;
int smallButtonWidth = 25;
wxSystemSettings settings;
wxFont guiFont = settings.GetSystemFont(wxSYS_DEFAULT_GUI_FONT);
+#ifdef __WXMSW__
+ wxFont *boringFont = wxTheFontList->FindOrCreateFont(guiFont.GetPointSize(), wxDEFAULT, wxNORMAL, wxNORMAL, FALSE, "Courier New");
+#else
wxFont *boringFont = wxTheFontList->FindOrCreateFont(guiFont.GetPointSize(), wxMODERN, wxNORMAL, wxNORMAL);
+#endif
// May need to be changed in future to eliminate clashes with app.
panel->SetClientData((char *)this);
+ // These buttons are at the bottom of the window, but create them now
+ // so the constraints are evaluated in the correct order
if (buttonFlags & wxPROP_BUTTON_OK)
{
windowCloseButton = new wxButton(panel, wxID_OK, "OK",
windowCloseButton->SetDefault();
windowCloseButton->SetFocus();
}
- if (buttonFlags & wxPROP_BUTTON_CLOSE)
+ else if (buttonFlags & wxPROP_BUTTON_CLOSE)
{
windowCloseButton = new wxButton(panel, wxID_OK, "Close",
wxPoint(-1, -1), wxSize(largeButtonWidth, largeButtonHeight));
if (windowCloseButton)
{
wxLayoutConstraints *c1 = new wxLayoutConstraints;
+
c1->left.SameAs (panel, wxLeft, 2);
- c1->top.SameAs (panel, wxTop, 2);
+ c1->bottom.SameAs (panel, wxBottom, 2);
c1->width.AsIs();
c1->height.AsIs();
windowCloseButton->SetConstraints(c1);
if (windowCancelButton)
{
wxLayoutConstraints *c2 = new wxLayoutConstraints;
- if (leftMostWindow == panel)
- c2->left.SameAs (panel, wxLeft, 2);
- else
- c2->left.RightOf (leftMostWindow, 2);
-
- c2->top.SameAs (panel, wxTop, 2);
+
+ c2->right.SameAs (panel, wxRight, 2);
+ c2->bottom.SameAs (panel, wxBottom, 2);
c2->width.AsIs();
c2->height.AsIs();
windowCancelButton->SetConstraints(c2);
else
c2->left.RightOf (leftMostWindow, 2);
- c2->top.SameAs (panel, wxTop, 2);
+ c2->bottom.SameAs (panel, wxBottom, 2);
c2->width.AsIs();
c2->height.AsIs();
windowHelpButton->SetConstraints(c2);
wxLayoutConstraints *c = new wxLayoutConstraints;
c->left.SameAs (panel, wxLeft, 2);
+/*
if (windowCloseButton)
c->top.Below (windowCloseButton, 2);
else
+*/
c->top.SameAs (panel, wxTop, 2);
c->width.AsIs();
editButton->Enable(FALSE);
wxLayoutConstraints *c = new wxLayoutConstraints;
+/*
if (windowCloseButton)
c->top.Below (windowCloseButton, 2);
else
+*/
c->top.SameAs (panel, wxTop, 2);
c->right.SameAs (panel, wxRight, 2);
c->left.RightOf (confirmButton, 2);
else
c->left.SameAs (panel, wxLeft, 2);
-
+/*
if (windowCloseButton)
c->top.Below (windowCloseButton, 2);
else
+*/
c->top.SameAs (panel, wxTop, 2);
if (editButton)
c->top.Below (valueList, 2);
c->right.SameAs (panel, wxRight, 2);
- c->bottom.SameAs (panel, wxBottom, 2);
+
+ if (windowCloseButton)
+ c->bottom.Above (windowCloseButton, -2);
+ else
+ c->bottom.SameAs (panel, wxBottom, 2);
propertyScrollingList->SetConstraints(c);
+
// Note: if this is called now, it causes a GPF.
// Why?
// panel->Layout();
return TRUE;
}
-void wxPropertyListView::OnValueListSelect(wxCommandEvent& event)
+void wxPropertyListView::OnValueListSelect(wxCommandEvent& WXUNUSED(event))
{
if (currentProperty && currentValidator)
{
managedWindow->Close(TRUE);
}
-void wxPropertyListView::OnCancel(wxCommandEvent& event)
+void wxPropertyListView::OnCancel(wxCommandEvent& WXUNUSED(event))
{
// SetReturnCode(wxID_CANCEL);
managedWindow->Close(TRUE);
dialogCancelled = TRUE;
}
-void wxPropertyListView::OnHelp(wxCommandEvent& event)
+void wxPropertyListView::OnHelp(wxCommandEvent& WXUNUSED(event))
{
}
-void wxPropertyListView::OnCheck(wxCommandEvent& event)
+void wxPropertyListView::OnCheck(wxCommandEvent& WXUNUSED(event))
{
if (currentProperty)
{
}
}
-void wxPropertyListView::OnCross(wxCommandEvent& event)
+void wxPropertyListView::OnCross(wxCommandEvent& WXUNUSED(event))
{
if (currentProperty && currentValidator)
{
}
}
-void wxPropertyListView::OnPropertyDoubleClick(wxCommandEvent& event)
+void wxPropertyListView::OnPropertyDoubleClick(wxCommandEvent& WXUNUSED(event))
{
if (currentProperty && currentValidator)
{
}
}
-void wxPropertyListView::OnEdit(wxCommandEvent& event)
+void wxPropertyListView::OnEdit(wxCommandEvent& WXUNUSED(event))
{
if (currentProperty && currentValidator)
{
wxDialog(parent, -1, title, pos, size, style, name)
{
view = v;
- view->AssociatePanel(this);
+ view->AssociatePanel( ((wxPanel*)this) );
view->SetManagedWindow(this);
SetAutoLayout(TRUE);
}
return FALSE;
}
-void wxPropertyListDialog::OnCancel(wxCommandEvent& event)
+void wxPropertyListDialog::OnCancel(wxCommandEvent& WXUNUSED(event))
{
SetReturnCode(wxID_CANCEL);
this->Close();
IMPLEMENT_CLASS(wxPropertyListPanel, wxPanel)
+BEGIN_EVENT_TABLE(wxPropertyListPanel, wxPanel)
+ EVT_SIZE(wxPropertyListPanel::OnSize)
+END_EVENT_TABLE()
+
void wxPropertyListPanel::OnDefaultAction(wxControl *item)
{
/*
return TRUE;
}
+void wxPropertyListPanel::OnSize(wxSizeEvent& WXUNUSED(event))
+{
+ Layout();
+}
+
/*
* Property frame
*/
bool wxPropertyListFrame::OnClose(void)
{
if (view)
- return view->OnClose();
+ {
+ if (propertyPanel)
+ propertyPanel->SetView(NULL);
+ view->OnClose();
+ view = NULL;
+ return TRUE;
+ }
else
return FALSE;
}
-wxPanel *wxPropertyListFrame::OnCreatePanel(wxFrame *parent, wxPropertyListView *v)
+wxPropertyListPanel *wxPropertyListFrame::OnCreatePanel(wxFrame *parent, wxPropertyListView *v)
{
return new wxPropertyListPanel(v, parent);
}
*
*/
-void wxPropertyStringListEditorDialog::OnStrings(wxCommandEvent& event)
+void wxPropertyStringListEditorDialog::OnStrings(wxCommandEvent& WXUNUSED(event))
{
int sel = listBox->GetSelection();
if (sel > -1)
}
}
-void wxPropertyStringListEditorDialog::OnDelete(wxCommandEvent& event)
+void wxPropertyStringListEditorDialog::OnDelete(wxCommandEvent& WXUNUSED(event))
{
int sel = listBox->GetSelection();
if (sel == -1)
stringText->SetValue("");
}
-void wxPropertyStringListEditorDialog::OnAdd(wxCommandEvent& event)
+void wxPropertyStringListEditorDialog::OnAdd(wxCommandEvent& WXUNUSED(event))
{
SaveCurrentSelection();
stringText->SetFocus();
}
-void wxPropertyStringListEditorDialog::OnOK(wxCommandEvent& event)
+void wxPropertyStringListEditorDialog::OnOK(wxCommandEvent& WXUNUSED(event))
{
SaveCurrentSelection();
EndModal(wxID_OK);
Close(TRUE);
}
-void wxPropertyStringListEditorDialog::OnCancel(wxCommandEvent& event)
+void wxPropertyStringListEditorDialog::OnCancel(wxCommandEvent& WXUNUSED(event))
{
dialogCancelled = TRUE;
EndModal(wxID_CANCEL);