Commit 910d3e4d authored by twanvl's avatar twanvl

Delay the construction of controls is SetWindowPanels until the panel is...

Delay the construction of controls is SetWindowPanels until the panel is actually shown (initUI). This makes the program start slightly faster.
parent 4f9f6589
...@@ -31,7 +31,12 @@ DECLARE_TYPEOF_COLLECTION(KeywordModeP); ...@@ -31,7 +31,12 @@ DECLARE_TYPEOF_COLLECTION(KeywordModeP);
KeywordsPanel::KeywordsPanel(Window* parent, int id) KeywordsPanel::KeywordsPanel(Window* parent, int id)
: SetWindowPanel(parent, id) : SetWindowPanel(parent, id)
, menuKeyword(nullptr)
{ {
// delayed initialization by initControls()
}
void KeywordsPanel::initControls() {
// init controls // init controls
splitter = new wxSplitterWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL); splitter = new wxSplitterWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
list = new KeywordList(splitter, ID_KEYWORD_LIST); list = new KeywordList(splitter, ID_KEYWORD_LIST);
...@@ -118,6 +123,12 @@ KeywordsPanel::~KeywordsPanel() { ...@@ -118,6 +123,12 @@ KeywordsPanel::~KeywordsPanel() {
void KeywordsPanel::initUI(wxToolBar* tb, wxMenuBar* mb) { void KeywordsPanel::initUI(wxToolBar* tb, wxMenuBar* mb) {
// Controls
if (!isInitialized()) {
wxBusyCursor busy;
initControls();
onChangeSet();
}
// Toolbar // Toolbar
tb->AddTool(ID_KEYWORD_ADD, _(""), load_resource_tool_image(_("keyword_add")), wxNullBitmap, wxITEM_NORMAL,_TOOLTIP_("add keyword"), _HELP_("add keyword")); tb->AddTool(ID_KEYWORD_ADD, _(""), load_resource_tool_image(_("keyword_add")), wxNullBitmap, wxITEM_NORMAL,_TOOLTIP_("add keyword"), _HELP_("add keyword"));
tb->AddTool(ID_KEYWORD_REMOVE, _(""), load_resource_tool_image(_("keyword_del")), wxNullBitmap, wxITEM_NORMAL,_TOOLTIP_("remove keyword"),_HELP_("remove keyword")); tb->AddTool(ID_KEYWORD_REMOVE, _(""), load_resource_tool_image(_("keyword_del")), wxNullBitmap, wxITEM_NORMAL,_TOOLTIP_("remove keyword"),_HELP_("remove keyword"));
...@@ -138,6 +149,7 @@ void KeywordsPanel::destroyUI(wxToolBar* tb, wxMenuBar* mb) { ...@@ -138,6 +149,7 @@ void KeywordsPanel::destroyUI(wxToolBar* tb, wxMenuBar* mb) {
} }
void KeywordsPanel::onUpdateUI(wxUpdateUIEvent& ev) { void KeywordsPanel::onUpdateUI(wxUpdateUIEvent& ev) {
if (!isInitialized()) return;
switch (ev.GetId()) { switch (ev.GetId()) {
case ID_KEYWORD_PREV: ev.Enable(list->canSelectPrevious()); break; case ID_KEYWORD_PREV: ev.Enable(list->canSelectPrevious()); break;
case ID_KEYWORD_NEXT: ev.Enable(list->canSelectNext()); break; case ID_KEYWORD_NEXT: ev.Enable(list->canSelectNext()); break;
...@@ -146,6 +158,7 @@ void KeywordsPanel::onUpdateUI(wxUpdateUIEvent& ev) { ...@@ -146,6 +158,7 @@ void KeywordsPanel::onUpdateUI(wxUpdateUIEvent& ev) {
} }
void KeywordsPanel::onCommand(int id) { void KeywordsPanel::onCommand(int id) {
if (!isInitialized()) return;
switch (id) { switch (id) {
case ID_KEYWORD_PREV: case ID_KEYWORD_PREV:
list->selectPrevious(); list->selectPrevious();
...@@ -230,6 +243,7 @@ String KeywordsPanel::runRefScript(int find_i) { ...@@ -230,6 +243,7 @@ String KeywordsPanel::runRefScript(int find_i) {
// determine what control to use for clipboard actions // determine what control to use for clipboard actions
#define CUT_COPY_PASTE(op,return,check) \ #define CUT_COPY_PASTE(op,return,check) \
if (!isInitialized()) return false; \
int id = focused_control(this); \ int id = focused_control(this); \
if (id == ID_KEYWORD_LIST && keyword ->IsEnabled()) { return list ->op(); } \ if (id == ID_KEYWORD_LIST && keyword ->IsEnabled()) { return list ->op(); } \
else if (check) { return false; } \ else if (check) { return false; } \
...@@ -249,6 +263,7 @@ void KeywordsPanel::doPaste() { CUT_COPY_PASTE(doPaste, return (void), ! ...@@ -249,6 +263,7 @@ void KeywordsPanel::doPaste() { CUT_COPY_PASTE(doPaste, return (void), !
// ----------------------------------------------------------------------------- : Events // ----------------------------------------------------------------------------- : Events
void KeywordsPanel::onChangeSet() { void KeywordsPanel::onChangeSet() {
if (!isInitialized()) return;
list->setSet(set); list->setSet(set);
// warning label (depends on game name) // warning label (depends on game name)
fixedL->SetLabel(_LABEL_1_("standard keyword", set->game->short_name)); fixedL->SetLabel(_LABEL_1_("standard keyword", set->game->short_name));
...@@ -280,6 +295,7 @@ void KeywordsPanel::onChangeSet() { ...@@ -280,6 +295,7 @@ void KeywordsPanel::onChangeSet() {
} }
void KeywordsPanel::onAction(const Action& action, bool undone) { void KeywordsPanel::onAction(const Action& action, bool undone) {
if (!isInitialized()) return;
TYPE_CASE(action, ValueAction) { TYPE_CASE(action, ValueAction) {
if (!action.card) { if (!action.card) {
{ {
......
...@@ -50,6 +50,9 @@ class KeywordsPanel : public SetWindowPanel { ...@@ -50,6 +50,9 @@ class KeywordsPanel : public SetWindowPanel {
/// Find the code to insert based on the ref_scripts for the parameters of the current keyword /// Find the code to insert based on the ref_scripts for the parameters of the current keyword
String runRefScript(int i); String runRefScript(int i);
/// Actual intialization of the controls
void initControls();
// --------------------------------------------------- : Controls // --------------------------------------------------- : Controls
wxSplitterWindow* splitter; wxSplitterWindow* splitter;
wxPanel* panel; wxPanel* panel;
......
...@@ -19,3 +19,7 @@ SetWindowPanel::SetWindowPanel(Window* parent, int id, bool autoTabbing) ...@@ -19,3 +19,7 @@ SetWindowPanel::SetWindowPanel(Window* parent, int id, bool autoTabbing)
CardP SetWindowPanel::selectedCard() const { CardP SetWindowPanel::selectedCard() const {
return CardP(); return CardP();
} }
bool SetWindowPanel::isInitialized() const {
return !GetChildren().IsEmpty();
}
...@@ -71,6 +71,10 @@ class SetWindowPanel : public wxPanel, public SetView { ...@@ -71,6 +71,10 @@ class SetWindowPanel : public wxPanel, public SetView {
virtual void selectCard(const CardP& card) {} ///< Switch the view to another card, can be null virtual void selectCard(const CardP& card) {} ///< Switch the view to another card, can be null
virtual void selectFirstCard() {} ///< Switch the view to the first card virtual void selectFirstCard() {} ///< Switch the view to the first card
virtual void selectionChoices(ExportCardSelectionChoices& out) {} ///< Card subsets that can be exported from this panel virtual void selectionChoices(ExportCardSelectionChoices& out) {} ///< Card subsets that can be exported from this panel
protected:
/// Have any controls been created?
bool isInitialized() const;
}; };
// ----------------------------------------------------------------------------- : EOF // ----------------------------------------------------------------------------- : EOF
......
...@@ -155,6 +155,10 @@ END_EVENT_TABLE() ...@@ -155,6 +155,10 @@ END_EVENT_TABLE()
RandomPackPanel::RandomPackPanel(Window* parent, int id) RandomPackPanel::RandomPackPanel(Window* parent, int id)
: SetWindowPanel(parent, id) : SetWindowPanel(parent, id)
{ {
// delayed initialization by initControls()
}
void RandomPackPanel::initControls() {
// init controls // init controls
preview = new CardViewer(this, wxID_ANY); preview = new CardViewer(this, wxID_ANY);
card_list = new RandomCardList(this, wxID_ANY); card_list = new RandomCardList(this, wxID_ANY);
...@@ -163,9 +167,9 @@ RandomPackPanel::RandomPackPanel(Window* parent, int id) ...@@ -163,9 +167,9 @@ RandomPackPanel::RandomPackPanel(Window* parent, int id)
seed_fixed = new wxRadioButton(this, ID_SEED_FIXED, _BUTTON_("fixed seed")); seed_fixed = new wxRadioButton(this, ID_SEED_FIXED, _BUTTON_("fixed seed"));
seed = new wxTextCtrl(this, wxID_ANY); seed = new wxTextCtrl(this, wxID_ANY);
totals = new PackTotalsPanel(this, wxID_ANY); totals = new PackTotalsPanel(this, wxID_ANY);
static_cast<SetWindow*>(parent)->setControlStatusText(seed_random, _HELP_("random seed")); static_cast<SetWindow*>(GetParent())->setControlStatusText(seed_random, _HELP_("random seed"));
static_cast<SetWindow*>(parent)->setControlStatusText(seed_fixed, _HELP_("fixed seed")); static_cast<SetWindow*>(GetParent())->setControlStatusText(seed_fixed, _HELP_("fixed seed"));
static_cast<SetWindow*>(parent)->setControlStatusText(seed, _HELP_("seed")); static_cast<SetWindow*>(GetParent())->setControlStatusText(seed, _HELP_("seed"));
// init sizer // init sizer
wxSizer* s = new wxBoxSizer(wxHORIZONTAL); wxSizer* s = new wxBoxSizer(wxHORIZONTAL);
s->Add(preview, 0, wxRIGHT, 2); s->Add(preview, 0, wxRIGHT, 2);
...@@ -209,6 +213,7 @@ void RandomPackPanel::onBeforeChangeSet() { ...@@ -209,6 +213,7 @@ void RandomPackPanel::onBeforeChangeSet() {
} }
} }
void RandomPackPanel::onChangeSet() { void RandomPackPanel::onChangeSet() {
if (!isInitialized()) return;
preview ->setSet(set); preview ->setSet(set);
card_list->setSet(set); card_list->setSet(set);
totals ->setGame(set->game); totals ->setGame(set->game);
...@@ -249,6 +254,7 @@ void RandomPackPanel::onChangeSet() { ...@@ -249,6 +254,7 @@ void RandomPackPanel::onChangeSet() {
} }
void RandomPackPanel::storeSettings() { void RandomPackPanel::storeSettings() {
if (!isInitialized()) return;
GameSettings& gs = settings.gameSettingsFor(*set->game); GameSettings& gs = settings.gameSettingsFor(*set->game);
gs.pack_seed_random = seed_random->GetValue(); gs.pack_seed_random = seed_random->GetValue();
FOR_EACH(i, packs) { FOR_EACH(i, packs) {
...@@ -258,13 +264,21 @@ void RandomPackPanel::storeSettings() { ...@@ -258,13 +264,21 @@ void RandomPackPanel::storeSettings() {
// ----------------------------------------------------------------------------- : UI // ----------------------------------------------------------------------------- : UI
void RandomPackPanel::initUI(wxToolBar* tb, wxMenuBar* mb) {} void RandomPackPanel::initUI(wxToolBar* tb, wxMenuBar* mb) {
// Init controls?
if (!isInitialized()) {
wxBusyCursor busy;
initControls();
onChangeSet();
}
}
void RandomPackPanel::destroyUI(wxToolBar* tb, wxMenuBar* mb) {} void RandomPackPanel::destroyUI(wxToolBar* tb, wxMenuBar* mb) {}
void RandomPackPanel::onUpdateUI(wxUpdateUIEvent& ev) {} void RandomPackPanel::onUpdateUI(wxUpdateUIEvent& ev) {}
void RandomPackPanel::onCommand(int id) { void RandomPackPanel::onCommand(int id) {
if (!isInitialized()) return;
switch (id) { switch (id) {
case ID_PACK_AMOUNT: { case ID_PACK_AMOUNT: {
updateTotals(); updateTotals();
...@@ -339,6 +353,7 @@ void RandomPackPanel::generate() { ...@@ -339,6 +353,7 @@ void RandomPackPanel::generate() {
// ----------------------------------------------------------------------------- : Selection // ----------------------------------------------------------------------------- : Selection
CardP RandomPackPanel::selectedCard() const { CardP RandomPackPanel::selectedCard() const {
if (!isInitialized()) return CardP();
return card_list->getCard(); return card_list->getCard();
} }
...@@ -352,6 +367,7 @@ void RandomPackPanel::onCardSelect(CardSelectEvent& ev) { ...@@ -352,6 +367,7 @@ void RandomPackPanel::onCardSelect(CardSelectEvent& ev) {
} }
void RandomPackPanel::selectionChoices(ExportCardSelectionChoices& out) { void RandomPackPanel::selectionChoices(ExportCardSelectionChoices& out) {
if (!isInitialized()) return;
out.push_back(new_intrusive2<ExportCardSelectionChoice>( out.push_back(new_intrusive2<ExportCardSelectionChoice>(
_BUTTON_("export generated packs"), _BUTTON_("export generated packs"),
card_list->getCardsPtr() card_list->getCardsPtr()
...@@ -366,5 +382,5 @@ END_EVENT_TABLE () ...@@ -366,5 +382,5 @@ END_EVENT_TABLE ()
// ----------------------------------------------------------------------------- : Clipboard // ----------------------------------------------------------------------------- : Clipboard
bool RandomPackPanel::canCopy() const { return card_list->canCopy(); } bool RandomPackPanel::canCopy() const { return isInitialized() && card_list->canCopy(); }
void RandomPackPanel::doCopy() { card_list->doCopy(); } void RandomPackPanel::doCopy() { isInitialized() && card_list->doCopy(); }
...@@ -68,6 +68,9 @@ class RandomPackPanel : public SetWindowPanel { ...@@ -68,6 +68,9 @@ class RandomPackPanel : public SetWindowPanel {
int total_packs; int total_packs;
/// Actual intialization of the controls
void initControls();
/// Update the total count of each card type /// Update the total count of each card type
void updateTotals(); void updateTotals();
/// Get a seed value /// Get a seed value
......
...@@ -277,8 +277,13 @@ void StatDimensionList::drawItem(DC& dc, int x, int y, size_t item) { ...@@ -277,8 +277,13 @@ void StatDimensionList::drawItem(DC& dc, int x, int y, size_t item) {
StatsPanel::StatsPanel(Window* parent, int id) StatsPanel::StatsPanel(Window* parent, int id)
: SetWindowPanel(parent, id) : SetWindowPanel(parent, id)
, menuGraph(nullptr)
, up_to_date(true), active(false) , up_to_date(true), active(false)
{ {
// delayed initialization by initControls()
}
void StatsPanel::initControls() {
// init controls // init controls
wxSplitterWindow* splitter; wxSplitterWindow* splitter;
#if USE_SEPARATE_DIMENSION_LISTS #if USE_SEPARATE_DIMENSION_LISTS
...@@ -328,6 +333,7 @@ StatsPanel::~StatsPanel() { ...@@ -328,6 +333,7 @@ StatsPanel::~StatsPanel() {
} }
void StatsPanel::onChangeSet() { void StatsPanel::onChangeSet() {
if (!isInitialized()) return;
card_list->setSet(set); card_list->setSet(set);
#if USE_SEPARATE_DIMENSION_LISTS #if USE_SEPARATE_DIMENSION_LISTS
for (int i = 0 ; i < 3 ; ++i) dimensions[i]->show(set->game); for (int i = 0 ; i < 3 ; ++i) dimensions[i]->show(set->game);
...@@ -336,10 +342,12 @@ void StatsPanel::onChangeSet() { ...@@ -336,10 +342,12 @@ void StatsPanel::onChangeSet() {
#else #else
categories->show(set->game); categories->show(set->game);
#endif #endif
card = CardP();
onChange(); onChange();
} }
void StatsPanel::onAction(const Action& action, bool undone) { void StatsPanel::onAction(const Action& action, bool undone) {
if (!isInitialized()) return;
TYPE_CASE_(action, ScriptValueEvent) { TYPE_CASE_(action, ScriptValueEvent) {
// ignore style only stuff // ignore style only stuff
} else { } else {
...@@ -348,6 +356,15 @@ void StatsPanel::onAction(const Action& action, bool undone) { ...@@ -348,6 +356,15 @@ void StatsPanel::onAction(const Action& action, bool undone) {
} }
void StatsPanel::initUI (wxToolBar* tb, wxMenuBar* mb) { void StatsPanel::initUI (wxToolBar* tb, wxMenuBar* mb) {
// Controls
if (!isInitialized()) {
wxBusyCursor busy;
initControls();
CardP cur_card = card;
onChangeSet();
selectCard(cur_card);
}
// we are active
active = true; active = true;
if (!up_to_date) showCategory(); if (!up_to_date) showCategory();
// Toolbar // Toolbar
...@@ -377,6 +394,7 @@ void StatsPanel::destroyUI(wxToolBar* tb, wxMenuBar* mb) { ...@@ -377,6 +394,7 @@ void StatsPanel::destroyUI(wxToolBar* tb, wxMenuBar* mb) {
} }
void StatsPanel::onUpdateUI(wxUpdateUIEvent& ev) { void StatsPanel::onUpdateUI(wxUpdateUIEvent& ev) {
if (!isInitialized()) return;
switch (ev.GetId()) { switch (ev.GetId()) {
case ID_GRAPH_PIE: case ID_GRAPH_BAR: case ID_GRAPH_STACK: case ID_GRAPH_SCATTER: case ID_GRAPH_SCATTER_PIE: { case ID_GRAPH_PIE: case ID_GRAPH_BAR: case ID_GRAPH_STACK: case ID_GRAPH_SCATTER: case ID_GRAPH_SCATTER_PIE: {
GraphType type = (GraphType)(ev.GetId() - ID_GRAPH_PIE); GraphType type = (GraphType)(ev.GetId() - ID_GRAPH_PIE);
...@@ -390,6 +408,7 @@ void StatsPanel::onUpdateUI(wxUpdateUIEvent& ev) { ...@@ -390,6 +408,7 @@ void StatsPanel::onUpdateUI(wxUpdateUIEvent& ev) {
} }
void StatsPanel::onCommand(int id) { void StatsPanel::onCommand(int id) {
if (!isInitialized()) return;
switch (id) { switch (id) {
case ID_FIELD_LIST: { case ID_FIELD_LIST: {
onChange(); onChange();
...@@ -537,9 +556,12 @@ END_EVENT_TABLE() ...@@ -537,9 +556,12 @@ END_EVENT_TABLE()
// ----------------------------------------------------------------------------- : Selection // ----------------------------------------------------------------------------- : Selection
CardP StatsPanel::selectedCard() const { CardP StatsPanel::selectedCard() const {
if (!isInitialized()) return CardP();
return card_list->getCard(); return card_list->getCard();
} }
void StatsPanel::selectCard(const CardP& card) { void StatsPanel::selectCard(const CardP& card) {
this->card = card;
if (!isInitialized()) return;
card_list->setCard(card); card_list->setCard(card);
} }
...@@ -60,9 +60,12 @@ class StatsPanel : public SetWindowPanel { ...@@ -60,9 +60,12 @@ class StatsPanel : public SetWindowPanel {
FilteredCardList* card_list; FilteredCardList* card_list;
IconMenu* menuGraph; IconMenu* menuGraph;
CardP card; ///< Selected card
bool up_to_date; ///< Are the graph and card list up to date? bool up_to_date; ///< Are the graph and card list up to date?
bool active; ///< Is this panel selected? bool active; ///< Is this panel selected?
void initControls();
void onChange(); void onChange();
void onGraphSelect(wxCommandEvent&); void onGraphSelect(wxCommandEvent&);
void showCategory(const GraphType* prefer_layout = nullptr); void showCategory(const GraphType* prefer_layout = nullptr);
......
...@@ -23,11 +23,15 @@ ...@@ -23,11 +23,15 @@
DECLARE_TYPEOF_COLLECTION(FieldP); DECLARE_TYPEOF_COLLECTION(FieldP);
// ----------------------------------------------------------------------------- : StylePanel // ----------------------------------------------------------------------------- : StylePanel : initialization
StylePanel::StylePanel(Window* parent, int id) StylePanel::StylePanel(Window* parent, int id)
: SetWindowPanel(parent, id) : SetWindowPanel(parent, id)
{ {
// delayed initialization by initControls()
}
void StylePanel::initControls() {
// init controls // init controls
preview = new CardViewer (this, wxID_ANY); preview = new CardViewer (this, wxID_ANY);
list = new PackageList (this, wxID_ANY); list = new PackageList (this, wxID_ANY);
...@@ -48,7 +52,19 @@ StylePanel::StylePanel(Window* parent, int id) ...@@ -48,7 +52,19 @@ StylePanel::StylePanel(Window* parent, int id)
s->SetSizeHints(this); s->SetSizeHints(this);
SetSizer(s); SetSizer(s);
} }
void StylePanel::initUI(wxToolBar* tb, wxMenuBar* mb) {
if (!isInitialized()) {
wxBusyCursor busy;
initControls();
CardP cur_card = card;
onChangeSet();
selectCard(cur_card);
}
}
void StylePanel::updateListSize() { void StylePanel::updateListSize() {
if (!isInitialized()) return;
// how many columns fit? // how many columns fit?
size_t fit_columns = (size_t)((GetSize().y - 400) / 152); size_t fit_columns = (size_t)((GetSize().y - 400) / 152);
// we only need enough columns to show all items // we only need enough columns to show all items
...@@ -66,7 +82,10 @@ bool StylePanel::Layout() { ...@@ -66,7 +82,10 @@ bool StylePanel::Layout() {
return SetWindowPanel::Layout(); return SetWindowPanel::Layout();
} }
// ----------------------------------------------------------------------------- : StylePanel
void StylePanel::onChangeSet() { void StylePanel::onChangeSet() {
if (!isInitialized()) return;
list->showData<StyleSheet>(set->game->name() + _("-*")); list->showData<StyleSheet>(set->game->name() + _("-*"));
list->select(set->stylesheet->name(), false); list->select(set->stylesheet->name(), false);
editor->setSet(set); editor->setSet(set);
...@@ -76,6 +95,7 @@ void StylePanel::onChangeSet() { ...@@ -76,6 +95,7 @@ void StylePanel::onChangeSet() {
} }
void StylePanel::onAction(const Action& action, bool undone) { void StylePanel::onAction(const Action& action, bool undone) {
if (!isInitialized()) return;
TYPE_CASE_(action, ChangeSetStyleAction) { TYPE_CASE_(action, ChangeSetStyleAction) {
list->select(set->stylesheetFor(card).name(), false); list->select(set->stylesheetFor(card).name(), false);
editor->showCard(card); editor->showCard(card);
...@@ -113,6 +133,7 @@ void StylePanel::onAction(const Action& action, bool undone) { ...@@ -113,6 +133,7 @@ void StylePanel::onAction(const Action& action, bool undone) {
void StylePanel::selectCard(const CardP& card) { void StylePanel::selectCard(const CardP& card) {
this->card = card; this->card = card;
if (!isInitialized()) return;
preview->setCard(card); preview->setCard(card);
editor->showStylesheet(set->stylesheetForP(card)); editor->showStylesheet(set->stylesheetForP(card));
editor->showCard(card); editor->showCard(card);
...@@ -126,6 +147,7 @@ void StylePanel::selectCard(const CardP& card) { ...@@ -126,6 +147,7 @@ void StylePanel::selectCard(const CardP& card) {
// determine what control to use for clipboard actions // determine what control to use for clipboard actions
#define CUT_COPY_PASTE(op,return) \ #define CUT_COPY_PASTE(op,return) \
if (!isInitialized()) return false; \
int id = focused_control(this); \ int id = focused_control(this); \
if (id == ID_EDITOR) { return editor->op(); } \ if (id == ID_EDITOR) { return editor->op(); } \
else { return false; } else { return false; }
......
...@@ -26,6 +26,10 @@ class StylePanel : public SetWindowPanel { ...@@ -26,6 +26,10 @@ class StylePanel : public SetWindowPanel {
virtual void onChangeSet(); virtual void onChangeSet();
virtual void onAction(const Action&, bool undone); virtual void onAction(const Action&, bool undone);
// --------------------------------------------------- : UI
virtual void initUI(wxToolBar*, wxMenuBar*);
// --------------------------------------------------- : Clipboard // --------------------------------------------------- : Clipboard
virtual bool canCut() const; virtual bool canCut() const;
virtual bool canCopy() const; virtual bool canCopy() const;
...@@ -54,6 +58,9 @@ class StylePanel : public SetWindowPanel { ...@@ -54,6 +58,9 @@ class StylePanel : public SetWindowPanel {
/// Determine the best size for the list of stylesheets based on available space /// Determine the best size for the list of stylesheets based on available space
void updateListSize(); void updateListSize();
virtual bool Layout(); virtual bool Layout();
/// Actual intialization of the controls
void initControls();
}; };
// ----------------------------------------------------------------------------- : EOF // ----------------------------------------------------------------------------- : EOF
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment