- // These buttons are at the bottom of the window, but create them now
- // so the constraints are evaluated in the correct order
- if (m_buttonFlags & wxPROP_BUTTON_OK)
- {
- m_windowCloseButton = new wxButton(panel, wxID_OK, "OK",
- wxPoint(-1, -1), wxSize(largeButtonWidth, largeButtonHeight));
- m_windowCloseButton->SetDefault();
- m_windowCloseButton->SetFocus();
- }
- else if (m_buttonFlags & wxPROP_BUTTON_CLOSE)
- {
- m_windowCloseButton = new wxButton(panel, wxID_OK, "Close",
- wxPoint(-1, -1), wxSize(largeButtonWidth, largeButtonHeight));
- }
- if (m_buttonFlags & wxPROP_BUTTON_CANCEL)
- {
- m_windowCancelButton = new wxButton(panel, wxID_CANCEL, "Cancel",
- wxPoint(-1, -1), wxSize(largeButtonWidth, largeButtonHeight));
- }
- if (m_buttonFlags & wxPROP_BUTTON_HELP)
- {
- m_windowHelpButton = new wxButton(panel, wxID_HELP, "Help",
- wxPoint(-1, -1), wxSize(largeButtonWidth, largeButtonHeight));
- }
-
- if (m_windowCloseButton)
- {
- wxLayoutConstraints *c1 = new wxLayoutConstraints;
-
- c1->left.SameAs (panel, wxLeft, 2);
- c1->bottom.SameAs (panel, wxBottom, 2);
- c1->width.AsIs();
- c1->height.AsIs();
- m_windowCloseButton->SetConstraints(c1);
- leftMostWindow = m_windowCloseButton;
- }
- if (m_windowCancelButton)
- {
- wxLayoutConstraints *c2 = new wxLayoutConstraints;
-
- c2->right.SameAs (panel, wxRight, 2);
- c2->bottom.SameAs (panel, wxBottom, 2);
- c2->width.AsIs();
- c2->height.AsIs();
- m_windowCancelButton->SetConstraints(c2);
- leftMostWindow = m_windowCancelButton;
- }
- if (m_windowHelpButton)
- {
- wxLayoutConstraints *c2 = new wxLayoutConstraints;
- if (leftMostWindow == panel)
- c2->left.SameAs (panel, wxLeft, 2);
- else
- c2->left.RightOf (leftMostWindow, 2);
-
- c2->bottom.SameAs (panel, wxBottom, 2);
- c2->width.AsIs();
- c2->height.AsIs();
- m_windowHelpButton->SetConstraints(c2);
- leftMostWindow = m_windowHelpButton;
- }
-
- if (m_buttonFlags & wxPROP_BUTTON_CHECK_CROSS)
- {
-/*
- if (!tickBitmap)
- {
-#ifdef __WXMSW__
- tickBitmap = new wxBitmap("tick_bmp", wxBITMAP_TYPE_RESOURCE);
- crossBitmap = new wxBitmap("cross_bmp", wxBITMAP_TYPE_RESOURCE);
- if (!tickBitmap || !crossBitmap || !tickBitmap->Ok() || !crossBitmap->Ok())
- {
- if (tickBitmap)
- delete tickBitmap;
- if (crossBitmap)
- delete crossBitmap;
- tickBitmap = NULL;
- crossBitmap = NULL;
- }
-#endif
- }
-*/
-/*
- if (tickBitmap && crossBitmap)
- {
- m_confirmButton = new wxBitmapButton(panel, wxID_PROP_CHECK, tickBitmap,
- wxPoint(-1, -1), wxSize(smallButtonWidth-5, smallButtonHeight-5));
- m_cancelButton = new wxBitmapButton(panel, wxID_PROP_CROSS, crossBitmap,
- wxPoint(-1, -1), wxSize(smallButtonWidth-5, smallButtonHeight-5));
- }
- else
-*/
- {
- m_confirmButton = new wxButton(panel, wxID_PROP_CHECK, ":-)",
- wxPoint(-1, -1), wxSize(smallButtonWidth, smallButtonHeight));
- m_cancelButton = new wxButton(panel, wxID_PROP_CROSS, "X",
- wxPoint(-1, -1), wxSize(smallButtonWidth, smallButtonHeight));
- }
-
- wxLayoutConstraints *c = new wxLayoutConstraints;
- c->left.SameAs (panel, wxLeft, 2);
-/*
- if (windowCloseButton)
- c->top.Below (m_windowCloseButton, 2);
- else
-*/
- c->top.SameAs (panel, wxTop, 2);
-
- c->width.AsIs();
- c->height.AsIs();
-
- m_cancelButton->SetConstraints(c);
-
- c = new wxLayoutConstraints;
- c->left.RightOf (m_cancelButton, 2);
- c->top.SameAs (m_cancelButton, wxTop, 0);
- c->width.AsIs();
- c->height.AsIs();
-
- m_confirmButton->SetConstraints(c);
-
- m_cancelButton->Enable(FALSE);
- m_confirmButton->Enable(FALSE);
- }
-
- if (m_buttonFlags & wxPROP_PULLDOWN)
- {
- m_editButton = new wxButton(panel, wxID_PROP_EDIT, "...",
- wxPoint(-1, -1), wxSize(smallButtonWidth, smallButtonHeight));
- m_editButton->Enable(FALSE);
- wxLayoutConstraints *c = new wxLayoutConstraints;