mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-11 05:07:00 -04:00
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:
@@ -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"));
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,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;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
class MultipleChoiceValueEditor : public MultipleChoiceValueViewer, public ValueEditor {
|
||||
public:
|
||||
DECLARE_VALUE_EDITOR(MultipleChoice);
|
||||
|
||||
virtual void determineSize(bool force_fit);
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------- : EOF
|
||||
|
||||
Reference in New Issue
Block a user