paritially implemented MultipleChoice viewer/editor

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@222 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-03-21 18:04:09 +00:00
parent fddc389e24
commit 0c6068d6a2
14 changed files with 139 additions and 25 deletions
+1 -1
View File
@@ -16,7 +16,7 @@
AboutWindow::AboutWindow(Window* parent)
: wxDialog(parent, wxID_ANY, _TITLE_("about"), wxDefaultPosition, wxSize(510,340), wxCLIP_CHILDREN | wxDEFAULT_DIALOG_STYLE | wxTAB_TRAVERSAL)
, logo (load_resource_image(_("about")))
, logo2(load_resource_image(_("two")))
, logo2(load_resource_image(_("two_beta")))
{
// init controls
wxControl* ok_button = new HoverButton(this, wxID_OK, _("btn_ok"));
+11
View File
@@ -197,3 +197,14 @@ void draw_drop_down_arrow(Window* win, DC& dc, const wxRect& rect, bool active)
wxRect(rect.x + rect.width - w, rect.y, w, rect.height)
, active ? wxCONTROL_PRESSED : 0);
}
void draw_checkbox(Window* win, DC& dc, const wxRect& rect, bool checked) {
// TODO: Windows version?
// portable
dc.SetPen(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
dc.SetBrush(*wxTRANSPARENT_BRUSH);
dc.DrawRectangle(rect.x, rect.y, rect.width, rect.height);
if (checked) {
dc.DrawCheckMark(rect);
}
}
+4
View File
@@ -57,7 +57,11 @@ void draw_control_border(Window* win, DC& dc, const wxRect& rect);
/// Draws an arrow for a menu item indicating it has a sub menu
void draw_menu_arrow(Window* win, DC& dc, const wxRect& rect, bool active);
/// Draws a drop down arrow corresponding to that used by a combo box
void draw_drop_down_arrow(Window* win, DC& dc, const wxRect& rect, bool active);
/// Draws a check box
void draw_checkbox(Window* win, DC& dc, const wxRect& rect, bool checked);
// ----------------------------------------------------------------------------- : EOF
#endif
+8 -1
View File
@@ -8,6 +8,13 @@
#include <gui/value/multiple_choice.hpp>
// ----------------------------------------------------------------------------- :
// ----------------------------------------------------------------------------- : MultipleChoiceValueEditor
IMPLEMENT_VALUE_EDITOR(MultipleChoice) {}
void MultipleChoiceValueEditor::determineSize(bool force_fit) {
if (!nativeLook()) return;
// height depends on number of items and item height
int item_count = field().choices->lastId();
style().height = item_count * 20;
}
+2
View File
@@ -19,6 +19,8 @@
class MultipleChoiceValueEditor : public MultipleChoiceValueViewer, public ValueEditor {
public:
DECLARE_VALUE_EDITOR(MultipleChoice);
virtual void determineSize(bool force_fit);
};
// ----------------------------------------------------------------------------- : EOF