From 100d48b5a7f10383b922692fd84da1760372f6c8 Mon Sep 17 00:00:00 2001 From: twanvl Date: Sun, 2 Sep 2007 01:03:37 +0000 Subject: [PATCH] Improvements to keyboard handling (TAB) git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@660 0fc631ac-6414-0410-93d0-97cfa31319b6 --- src/data/field/information.hpp | 2 +- src/gui/about_window.cpp | 6 +++- src/gui/about_window.hpp | 5 ++- src/gui/control/card_editor.cpp | 42 ++++++++++++++++++------ src/gui/control/card_editor.hpp | 2 ++ src/gui/control/card_viewer.hpp | 2 ++ src/gui/control/gallery_list.cpp | 20 ++++++++--- src/gui/control/gallery_list.hpp | 12 ++++--- src/gui/control/graph.cpp | 9 ++++- src/gui/control/package_list.cpp | 4 +-- src/gui/control/package_list.hpp | 2 +- src/gui/new_window.cpp | 21 +++++------- src/gui/set/cards_panel.cpp | 8 ++--- src/gui/set/keywords_panel.cpp | 10 +++--- src/gui/set/panel.hpp | 2 +- src/gui/set/stats_panel.cpp | 4 +-- src/gui/set/style_panel.cpp | 2 +- src/gui/set/window.cpp | 2 ++ src/resource/common/expected_locale_keys | 4 +-- 19 files changed, 105 insertions(+), 54 deletions(-) diff --git a/src/data/field/information.hpp b/src/data/field/information.hpp index e50f5000..61110d00 100644 --- a/src/data/field/information.hpp +++ b/src/data/field/information.hpp @@ -26,7 +26,7 @@ DECLARE_POINTER_TYPE(InfoValue); */ class InfoField : public Field { public: - InfoField() {} + InfoField() { editable = false; } DECLARE_FIELD_TYPE(Text); OptionalScript script; ///< Script to apply to all values diff --git a/src/gui/about_window.cpp b/src/gui/about_window.cpp index bf12344d..70916985 100644 --- a/src/gui/about_window.cpp +++ b/src/gui/about_window.cpp @@ -62,10 +62,11 @@ END_EVENT_TABLE () // ----------------------------------------------------------------------------- : Button with image and hover effect -HoverButton::HoverButton(Window* parent, int id, const String& name, const Color& background) +HoverButton::HoverButton(Window* parent, int id, const String& name, const Color& background, bool accepts_focus) : wxControl(parent, id, wxDefaultPosition, wxDefaultSize, wxNO_BORDER ) , hover(false), focus(false), mouse_down(false), key_down(false) , background(background) + , accepts_focus(accepts_focus) , last_drawn(nullptr) { loadBitmaps(name); @@ -136,6 +137,9 @@ void HoverButton::onKeyUp(wxKeyEvent& ev) { wxSize HoverButton::DoGetBestSize() const { return wxSize(bg_normal.GetWidth(), bg_normal.GetHeight()); } +bool HoverButton::AcceptsFocus() const { + return wxControl::AcceptsFocus() && accepts_focus; +} const Bitmap* HoverButton::toDraw() const { return (mouse_down && hover) || key_down ? &bg_down diff --git a/src/gui/about_window.hpp b/src/gui/about_window.hpp index 13430da7..fe39d3ff 100644 --- a/src/gui/about_window.hpp +++ b/src/gui/about_window.hpp @@ -37,11 +37,13 @@ class HoverButton : public wxControl { /** name+"_normal", name+"_hover", name+"_focus", name+"_down" * are the resource names of the images used. */ - HoverButton(Window* parent, int id, const String& name, const Color& background = Color(240,247,255)); + HoverButton(Window* parent, int id, const String& name, const Color& background = Color(240,247,255), bool accepts_focus = true); /// Load different bitmaps for this button void loadBitmaps(const String& name); + virtual bool AcceptsFocus() const; + private: DECLARE_EVENT_TABLE(); @@ -49,6 +51,7 @@ class HoverButton : public wxControl { Bitmap bg_normal, bg_hover, bg_focus, bg_down; ///< Bitmaps for the states of the button bool hover, focus, mouse_down, key_down; Color background; + const bool accepts_focus; void onMouseEnter(wxMouseEvent&); void onMouseLeave(wxMouseEvent&); diff --git a/src/gui/control/card_editor.cpp b/src/gui/control/card_editor.cpp index 8fca0501..8242c685 100644 --- a/src/gui/control/card_editor.cpp +++ b/src/gui/control/card_editor.cpp @@ -22,7 +22,7 @@ DECLARE_TYPEOF_COLLECTION(ValueViewer*); // ----------------------------------------------------------------------------- : DataEditor DataEditor::DataEditor(Window* parent, int id, long style) - : CardViewer(parent, id, style) + : CardViewer(parent, id, style | wxWANTS_CHARS) , current_viewer(nullptr) , current_editor(nullptr) , hovered_viewer(nullptr) @@ -59,6 +59,10 @@ ValueViewer* DataEditor::focusedViewer() const { // ----------------------------------------------------------------------------- : Selection +bool DataEditor::AcceptsFocus() const { + return wxControl::AcceptsFocus(); +} + void DataEditor::select(ValueViewer* v) { ValueEditor* old_editor = current_editor; current_viewer = v; @@ -125,7 +129,8 @@ struct CompareTabIndex { void DataEditor::createTabIndex() { by_tab_index.clear(); FOR_EACH(v, viewers) { - if (v->getField()->editable && v->getStyle()->visible) { + ValueEditor* e = v->getEditor(); + if (e && v->getField()->editable && v->getStyle()->visible) { by_tab_index.push_back(v.get()); } } @@ -136,6 +141,9 @@ void DataEditor::onInit() { current_viewer = nullptr; current_editor = nullptr; hovered_viewer = nullptr; + // hide caret if it is shown + wxCaret* caret = GetCaret(); + if (caret->IsVisible()) caret->Hide(); } // ----------------------------------------------------------------------------- : Search / replace @@ -195,10 +203,16 @@ void DataEditor::onLeftDown(wxMouseEvent& ev) { } void DataEditor::onLeftUp(wxMouseEvent& ev) { if (HasCapture()) ReleaseMouse(); - if (current_editor) current_editor->onLeftUp(mousePoint(ev), ev); + RealPoint pos = mousePoint(ev); + if (current_editor && current_viewer && current_viewer->containsPoint(pos)) { + current_editor->onLeftUp(pos, ev); + } } void DataEditor::onLeftDClick(wxMouseEvent& ev) { - if (current_editor) current_editor->onLeftDClick(mousePoint(ev), ev); + RealPoint pos = mousePoint(ev); + if (current_editor && current_viewer && current_viewer->containsPoint(pos)) { + current_editor->onLeftDClick(pos, ev); + } } void DataEditor::onRightDown(wxMouseEvent& ev) { ev.Skip(); // for context menu @@ -206,8 +220,11 @@ void DataEditor::onRightDown(wxMouseEvent& ev) { selectField(ev, &ValueEditor::onRightDown); } void DataEditor::onMouseWheel(wxMouseEvent& ev) { - if (current_editor && current_editor->onMouseWheel(mousePoint(ev), ev)); - else ev.Skip(); + RealPoint pos = mousePoint(ev); + if (current_editor && current_viewer && current_viewer->containsPoint(pos)) { + if (current_editor->onMouseWheel(pos, ev)) return; + } + ev.Skip(); } void DataEditor::onMotion(wxMouseEvent& ev) { @@ -269,7 +286,9 @@ void DataEditor::selectField(wxMouseEvent& ev, bool (ValueEditor::*event)(const if (current_editor) current_editor->onFocus(); } // pass event - if (current_editor) (current_editor->*event)(pos, ev); + if (current_editor && current_viewer && current_viewer->containsPoint(pos)) { + (current_editor->*event)(pos, ev); + } // refresh? if (old_editor != current_editor) { // selection has changed, refresh viewers @@ -279,14 +298,15 @@ void DataEditor::selectField(wxMouseEvent& ev, bool (ValueEditor::*event)(const } void DataEditor::selectFieldNoEvents(const RealPoint& p) { FOR_EACH_EDITOR_REVERSE { // find high z index fields first - if (v->containsPoint(p) && v->getField()->editable) { + if (v->getField()->editable && (v->containsPoint(p) || + (nativeLook() && p.y >= v->getStyle()->top && p.y < v->getStyle()->bottom) )) { current_viewer = v.get(); current_editor = e; return; } } - current_viewer = nullptr; - current_editor = nullptr; +//% current_viewer = nullptr; +//% current_editor = nullptr; } RealPoint DataEditor::mousePoint(const wxMouseEvent& ev) { @@ -348,6 +368,8 @@ void DataEditor::onFocus(wxFocusEvent& ev) { if (current_editor) { current_editor->onFocus(); onChange(); + } else { + selectFirst(); } } void DataEditor::onLoseFocus(wxFocusEvent& ev) { diff --git a/src/gui/control/card_editor.hpp b/src/gui/control/card_editor.hpp index 733bcc97..ae9bb7a5 100644 --- a/src/gui/control/card_editor.hpp +++ b/src/gui/control/card_editor.hpp @@ -41,6 +41,8 @@ class DataEditor : public CardViewer { /// Select the previous editable editor, returns false if the current editor is the first one bool selectPrevious(); + virtual bool AcceptsFocus() const; + // --------------------------------------------------- : Clipboard bool canCut() const; diff --git a/src/gui/control/card_viewer.hpp b/src/gui/control/card_viewer.hpp index 49055a33..24e21b04 100644 --- a/src/gui/control/card_viewer.hpp +++ b/src/gui/control/card_viewer.hpp @@ -38,6 +38,8 @@ class CardViewer : public wxControl, public DataViewer { /// The rotation to use virtual Rotation getRotation() const; + virtual bool AcceptsFocus() const { return false; } + protected: /// Return the desired size of control virtual wxSize DoGetBestSize() const; diff --git a/src/gui/control/gallery_list.cpp b/src/gui/control/gallery_list.cpp index 75b33c6a..9a18bf53 100644 --- a/src/gui/control/gallery_list.cpp +++ b/src/gui/control/gallery_list.cpp @@ -21,11 +21,12 @@ const int MARGIN = 1; // margin between items (excluding border) const int BORDER = 1; // border aroung items const int SPACING = MARGIN + 2*BORDER; // distance between items -GalleryList::GalleryList(Window* parent, int id, int direction) - : wxScrolledWindow(parent, id, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER | (direction == wxHORIZONTAL ? wxHSCROLL : wxVSCROLL) ) +GalleryList::GalleryList(Window* parent, int id, int direction, bool always_focused) + : wxScrolledWindow(parent, id, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER | wxWANTS_CHARS | (direction == wxHORIZONTAL ? wxHSCROLL : wxVSCROLL) ) , selection(NO_SELECTION) , direction(direction) , scroll_increment(10) + , always_focused(always_focused) {} void GalleryList::update() { @@ -117,7 +118,7 @@ void GalleryList::onChar(wxKeyEvent& ev) { } break; case WXK_TAB: { // send a navigation event to our parent, to select another control - // we need this because tabs are not handled on the set window panels + // we need this because tabs of wxWANTS_CHARS wxNavigationKeyEvent nev; nev.SetDirection(!ev.ShiftDown()); GetParent()->ProcessEvent(nev); @@ -168,7 +169,12 @@ void GalleryList::OnDraw(DC& dc) { for (size_t i = start ; i < end ; ++i) { // draw selection rectangle bool selected = i == selection; - Color c = selected ? wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT) : unselected; + Color c = selected ? ( always_focused || FindFocus() == this + ? wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT) + : lerp(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW), + wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT), 0.7) + ) + : unselected; dc.SetPen(c); dc.SetBrush(saturate(lerp(background, c, 0.3), selected ? 0.5 : 0)); wxPoint pos = itemPos(i); @@ -178,6 +184,10 @@ void GalleryList::OnDraw(DC& dc) { } } +void GalleryList::onFocus(wxFocusEvent&) { + if (!always_focused) Refresh(false); +} + void GalleryList::onSize(wxSizeEvent&) { update(); } @@ -193,6 +203,8 @@ BEGIN_EVENT_TABLE(GalleryList, wxScrolledWindow) EVT_LEFT_DOWN (GalleryList::onLeftDown) EVT_LEFT_DCLICK (GalleryList::onLeftDClick) EVT_CHAR (GalleryList::onChar) + EVT_SET_FOCUS (GalleryList::onFocus) + EVT_KILL_FOCUS (GalleryList::onFocus) EVT_PAINT (GalleryList::onPaint) EVT_SIZE (GalleryList::onSize) END_EVENT_TABLE () diff --git a/src/gui/control/gallery_list.hpp b/src/gui/control/gallery_list.hpp index 707bd85f..3b3c942b 100644 --- a/src/gui/control/gallery_list.hpp +++ b/src/gui/control/gallery_list.hpp @@ -29,17 +29,18 @@ DECLARE_EVENT_TYPE(EVENT_GALLERY_ACTIVATE, ) */ class GalleryList : public wxScrolledWindow { public: - GalleryList(Window* parent, int id, int direction = wxHORIZONTAL); + GalleryList(Window* parent, int id, int direction = wxHORIZONTAL, bool always_focused = true); /// Is there an item selected? inline bool hasSelection() const { return selection < itemCount(); } protected: static const size_t NO_SELECTION = (size_t)-1; - size_t selection; ///< The selected item, or NO_SELECTION if there is no selection - wxSize item_size; ///< The size of a single item - int direction; ///< Direction of the list, can be wxHORIZONTAL or wxVERTICAL - int scroll_increment; ///< How large are the scroll steps? + size_t selection; ///< The selected item, or NO_SELECTION if there is no selection + wxSize item_size; ///< The size of a single item + int direction; ///< Direction of the list, can be wxHORIZONTAL or wxVERTICAL + int scroll_increment; ///< How large are the scroll steps? + bool always_focused; ///< Always draw as if focused /// Redraw the list after changing the selection or the number of items void update(); @@ -58,6 +59,7 @@ class GalleryList : public wxScrolledWindow { void onLeftDown (wxMouseEvent& ev); void onLeftDClick(wxMouseEvent& ev); void onChar(wxKeyEvent& ev); + void onFocus(wxFocusEvent&); void onPaint(wxPaintEvent&); void onSize(wxSizeEvent&); void OnDraw(DC& dc); diff --git a/src/gui/control/graph.cpp b/src/gui/control/graph.cpp index 5d8f1574..579ae01a 100644 --- a/src/gui/control/graph.cpp +++ b/src/gui/control/graph.cpp @@ -798,7 +798,7 @@ void GraphContainer::add(const GraphP& graph) { // ----------------------------------------------------------------------------- : GraphControl GraphControl::GraphControl(Window* parent, int id) - : wxControl(parent, id) + : wxControl(parent, id, wxDefaultPosition, wxDefaultSize, wxWANTS_CHARS) {} void GraphControl::setLayout(GraphType type) { @@ -912,6 +912,13 @@ void GraphControl::onChar(wxKeyEvent& ev) { onSelectionChange(); } break; + case WXK_TAB: { + // send a navigation event to our parent, to select another control + // we need this because of wxWANTS_CHARS + wxNavigationKeyEvent nev; + nev.SetDirection(!ev.ShiftDown()); + GetParent()->ProcessEvent(nev); + } break; } } diff --git a/src/gui/control/package_list.cpp b/src/gui/control/package_list.cpp index a876833c..28e3cfa9 100644 --- a/src/gui/control/package_list.cpp +++ b/src/gui/control/package_list.cpp @@ -14,8 +14,8 @@ DECLARE_TYPEOF_COLLECTION(PackagedP); // ----------------------------------------------------------------------------- : PackageList -PackageList::PackageList(Window* parent, int id, int direction) - : GalleryList(parent, id, direction) +PackageList::PackageList(Window* parent, int id, int direction, bool always_focused) + : GalleryList(parent, id, direction, always_focused) { item_size = wxSize(108, 150); SetThemeEnabled(true); diff --git a/src/gui/control/package_list.hpp b/src/gui/control/package_list.hpp index 407424a7..1f30ca55 100644 --- a/src/gui/control/package_list.hpp +++ b/src/gui/control/package_list.hpp @@ -20,7 +20,7 @@ DECLARE_POINTER_TYPE(Packaged); /// A list of Packages of a specific type class PackageList : public GalleryList { public: - PackageList(Window* parent, int id, int direction = wxHORIZONTAL); + PackageList(Window* parent, int id, int direction = wxHORIZONTAL, bool always_focused = true); /// Shows packages that match a specific patern, and that are of the given type template diff --git a/src/gui/new_window.cpp b/src/gui/new_window.cpp index acf313e8..83f096c5 100644 --- a/src/gui/new_window.cpp +++ b/src/gui/new_window.cpp @@ -29,8 +29,8 @@ NewSetWindow::NewSetWindow(Window* parent) { wxBusyCursor wait; // init controls - game_list = new PackageList (this, ID_GAME_LIST); - stylesheet_list = new PackageList (this, ID_STYLESHEET_LIST); + game_list = new PackageList (this, ID_GAME_LIST, wxHORIZONTAL, false); + stylesheet_list = new PackageList (this, ID_STYLESHEET_LIST, wxHORIZONTAL, false); wxStaticText* game_text = new wxStaticText(this, ID_GAME_LIST, _LABEL_("game type")); wxStaticText* stylesheet_text = new wxStaticText(this, ID_STYLESHEET_LIST, _LABEL_("style type")); // init sizer @@ -43,10 +43,9 @@ NewSetWindow::NewSetWindow(Window* parent) s->SetSizeHints(this); SetSizer(s); // Resize - SetSize(630,-1); Layout(); - GetSizer()->SetSizeHints(this); - SetSize(630,-1); + wxSize min_size = GetSizer()->GetMinSize() + GetSize() - GetClientSize(); + SetSize(630,min_size.y); // init lists game_list->showData(); try { @@ -66,12 +65,9 @@ void NewSetWindow::onGameSelect(wxCommandEvent&) { stylesheet_list->select(settings.gameSettingsFor(*game).default_stylesheet); UpdateWindowUI(wxUPDATE_UI_RECURSE); // resize (yuck) - SetSize(630,-1); Layout(); - GetSizer()->SetSizeHints(this); - Layout(); - GetSizer()->SetSizeHints(this); - SetSize(630,-1); + wxSize min_size = GetSizer()->GetMinSize() + GetSize() - GetClientSize(); + SetSize(630,min_size.y); } void NewSetWindow::onStyleSheetSelect(wxCommandEvent&) { @@ -157,10 +153,9 @@ SelectStyleSheetWindow::SelectStyleSheetWindow(Window* parent, const Game& game, stylesheet_list->showData(game.name() + _("-*")); stylesheet_list->select(settings.gameSettingsFor(game).default_stylesheet); // Resize - SetSize(630,-1); Layout(); - GetSizer()->SetSizeHints(this); - SetSize(630,-1); + wxSize min_size = GetSizer()->GetMinSize() + GetSize() - GetClientSize(); + SetSize(630,min_size.y); UpdateWindowUI(wxUPDATE_UI_RECURSE); } diff --git a/src/gui/set/cards_panel.cpp b/src/gui/set/cards_panel.cpp index 6de4cd5e..9ed75ffb 100644 --- a/src/gui/set/cards_panel.cpp +++ b/src/gui/set/cards_panel.cpp @@ -26,16 +26,16 @@ // ----------------------------------------------------------------------------- : CardsPanel CardsPanel::CardsPanel(Window* parent, int id) - : SetWindowPanel(parent, id, false) + : SetWindowPanel(parent, id) { // init controls wxPanel* notesP; editor = new CardEditor(this, ID_EDITOR); - splitter = new wxSplitterWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0); + splitter = new wxSplitterWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL); card_list = new ImageCardList(splitter, ID_CARD_LIST); - notesP = new Panel(splitter, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 /* no tab traversal*/); + notesP = new Panel(splitter, wxID_ANY); notes = new TextCtrl(notesP, ID_NOTES, true); - collapse_notes = new HoverButton(notesP, ID_COLLAPSE_NOTES, _("btn_collapse"), wxNullColour); + collapse_notes = new HoverButton(notesP, ID_COLLAPSE_NOTES, _("btn_collapse"), wxNullColour, false); collapse_notes->SetExtraStyle(wxWS_EX_PROCESS_UI_UPDATES); // init sizer for notes panel wxSizer* sn = new wxBoxSizer(wxVERTICAL); diff --git a/src/gui/set/keywords_panel.cpp b/src/gui/set/keywords_panel.cpp index fdb3902d..283205b1 100644 --- a/src/gui/set/keywords_panel.cpp +++ b/src/gui/set/keywords_panel.cpp @@ -32,18 +32,18 @@ KeywordsPanel::KeywordsPanel(Window* parent, int id) : SetWindowPanel(parent, id) { // init controls - splitter = new wxSplitterWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0); + splitter = new wxSplitterWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL); list = new KeywordList(splitter, ID_KEYWORD_LIST); - panel = new Panel(splitter, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 /* no tab traversal*/); + panel = new Panel(splitter, wxID_ANY); keyword = new TextCtrl(panel, ID_KEYWORD, false); + mode = new wxChoice(panel, ID_KEYWORD_MODE, wxDefaultPosition, wxDefaultSize, 0, nullptr); match = new TextCtrl(panel, ID_MATCH, false); + add_param = new wxButton(panel, ID_KEYWORD_ADD_PARAM, _BUTTON_("insert parameter")); + ref_param = new wxButton(panel, ID_KEYWORD_REF_PARAM, _BUTTON_("refer parameter")); reminder = new TextCtrl(panel, ID_REMINDER, true); // allow multiline for wordwrap rules = new TextCtrl(panel, ID_RULES, true); errors = new wxStaticText(panel, wxID_ANY, _("")); errors->SetForegroundColour(*wxRED); - mode = new wxChoice(panel, ID_KEYWORD_MODE, wxDefaultPosition, wxDefaultSize, 0, nullptr); - add_param = new wxButton(panel, ID_KEYWORD_ADD_PARAM, _BUTTON_("insert parameter")); - ref_param = new wxButton(panel, ID_KEYWORD_REF_PARAM, _BUTTON_("refer parameter")); // warning about fixed keywords fixedL = new wxStaticText(panel, wxID_ANY, _("")); wxStaticBitmap* fixedI = new wxStaticBitmap(panel, wxID_ANY, wxArtProvider::GetBitmap(wxART_WARNING)); diff --git a/src/gui/set/panel.hpp b/src/gui/set/panel.hpp index 0e5edd24..8583b681 100644 --- a/src/gui/set/panel.hpp +++ b/src/gui/set/panel.hpp @@ -21,7 +21,7 @@ class wxFindReplaceData; */ class SetWindowPanel : public wxPanel, public SetView { public: - SetWindowPanel(Window* parent, int id, bool autoTabbing = false); + SetWindowPanel(Window* parent, int id, bool autoTabbing = true); /// We will probably want to respond to set changes virtual void onSetChange() {} diff --git a/src/gui/set/stats_panel.cpp b/src/gui/set/stats_panel.cpp index 88269083..d3eca0e6 100644 --- a/src/gui/set/stats_panel.cpp +++ b/src/gui/set/stats_panel.cpp @@ -97,13 +97,13 @@ void StatCategoryList::drawItem(DC& dc, int x, int y, size_t item, bool selected // ----------------------------------------------------------------------------- : StatsPanel StatsPanel::StatsPanel(Window* parent, int id) - : SetWindowPanel(parent, id, true) + : SetWindowPanel(parent, id) , up_to_date(true), active(false) { // init controls wxSplitterWindow* splitter; categories = new StatCategoryList(this, ID_FIELD_LIST); - splitter = new wxSplitterWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0); + splitter = new wxSplitterWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL); graph = new GraphControl (splitter, wxID_ANY); card_list = new FilteredCardList(splitter, wxID_ANY); // init splitter diff --git a/src/gui/set/style_panel.cpp b/src/gui/set/style_panel.cpp index df5f4530..a8028623 100644 --- a/src/gui/set/style_panel.cpp +++ b/src/gui/set/style_panel.cpp @@ -27,10 +27,10 @@ StylePanel::StylePanel(Window* parent, int id) { // init controls preview = new CardViewer (this, wxID_ANY); - editor = new StylingEditor(this, wxID_ANY, wxNO_BORDER); list = new PackageList (this, wxID_ANY); use_for_all = new wxButton (this, ID_STYLE_USE_FOR_ALL, _BUTTON_("use for all cards")); use_custom_options = new wxCheckBox(this, ID_STYLE_USE_CUSTOM, _BUTTON_("use custom styling options")); + editor = new StylingEditor(this, wxID_ANY, wxNO_BORDER); // init sizer wxSizer* s = new wxBoxSizer(wxHORIZONTAL); s->Add(preview, 0, wxRIGHT, 2); diff --git a/src/gui/set/window.cpp b/src/gui/set/window.cpp index 919827db..d0df59e8 100644 --- a/src/gui/set/window.cpp +++ b/src/gui/set/window.cpp @@ -228,6 +228,8 @@ void SetWindow::selectPanel(int id) { } // fix sizer stuff fixMinWindowSize(); + // select something + current_panel->SetFocus(); } // ----------------------------------------------------------------------------- : Window managment diff --git a/src/resource/common/expected_locale_keys b/src/resource/common/expected_locale_keys index 50968587..fb2bd476 100644 --- a/src/resource/common/expected_locale_keys +++ b/src/resource/common/expected_locale_keys @@ -1,6 +1,6 @@ # This file contains the keys expected to be in MSE locales # It was automatically generated by tools/locale/locale.pl -# Generated on Sat Sep 1 23:06:46 2007 +# Generated on Sun Sep 2 02:25:24 2007 action: add control point: 0 @@ -377,7 +377,7 @@ title: untitled: 0 update check: 0 updates: 0 - updates availible: 0 + updates available: 0 tool: add symmetry: 0 basic shapes: 0