Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions LATEST_RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ Other changes:
* [#812](../../issues/812) Make it easier to read xbm files.
* [#814](../../issues/814) Add the ability to dump when the beats occur with calchart_tool
* [#815](../../issues/815) We can probably improve the way animation panel timer works by using one-shot
* [#823](../../issues/823) Update wxUI to 0.4.0

2 changes: 1 addition & 1 deletion cmake/dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ FetchContent_MakeAvailable(docopt)
FetchContent_Declare(
wxUI
GIT_REPOSITORY https://github.com/rmpowell77/wxUI.git
GIT_TAG aea5c52fb5d5525c2770954574acacaae24f9b3b # v0.2.2
GIT_TAG 1b2cf2ca7db7c22474b43c3eca01563ffd91e832 # v0.4.0
)
FetchContent_MakeAvailable(wxUI)

Expand Down
7 changes: 4 additions & 3 deletions src/AnimationErrorsPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void AnimationErrorsPanel::CreateControls()
// create a sizer and populate
wxUI::VSizer{
ExpandSizerFlags(),
mTreeCtrl = wxUI::Generic<wxTreeListCtrl>{ [](wxWindow* window) {
wxUI::Factory<wxTreeListCtrl>{ [](wxWindow* window) {
auto* treeList = new wxTreeListCtrl(window, wxID_ANY, wxDefaultPosition, wxDefaultSize);
treeList->AppendColumn("Errors", wxCOL_WIDTH_AUTOSIZE, wxALIGN_LEFT, wxCOL_RESIZABLE | wxCOL_SORTABLE);
wxSize iconSize = wxArtProvider::GetSizeHint(wxART_LIST);
Expand All @@ -62,8 +62,9 @@ void AnimationErrorsPanel::CreateControls()
imageList->Add(wxArtProvider::GetIcon(wxART_ERROR, wxART_LIST, iconSize));
treeList->SetImageList(imageList);
return treeList;
} }
}.fitTo(this);
} }.withProxy(mTreeCtrl),
}
.fitTo(this);
}

void AnimationErrorsPanel::OnUpdate()
Expand Down
2 changes: 1 addition & 1 deletion src/AnimationErrorsPanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class AnimationErrorsPanel : public wxPanel {
void UpdateErrors(std::vector<CalChart::Animate::Errors> const& errors, std::map<int, CalChart::SelectionList> const& collisions);

CalChartView* mView{};
wxUI::Generic<wxTreeListCtrl>::Proxy mTreeCtrl{};
wxUI::Factory<wxTreeListCtrl>::Proxy mTreeCtrl{};
std::vector<CalChart::Animate::Errors> mCurrentErrors{};
std::map<wxTreeListItem, std::tuple<int, CalChart::SelectionList>> mErrorLookup{};
};
5 changes: 3 additions & 2 deletions src/ConfigurationDebugDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ ConfigurationDebug::ConfigurationDebug(wxWindow* parent, wxConfigBase* config)
std::cout << mConfig << "\n";
wxUI::VSizer{
BasicSizerFlags(),
mTreeCtrl = wxUI::Generic{
wxUI::Generic{
ExpandSizerFlags(),
[this] {
auto* tree = new wxTreeListCtrl(this, wxID_ANY, wxDefaultPosition, { 400, 400 });
Expand All @@ -226,7 +226,8 @@ ConfigurationDebug::ConfigurationDebug(wxWindow* parent, wxConfigBase* config)
wxCOL_RESIZABLE | wxCOL_SORTABLE);
ConstructConfig(mConfig, *tree);
return tree;
}() },
}() }
.withProxy(mTreeCtrl),
wxUI::HSizer{
wxUI::Button{ wxID_OK },
}
Expand Down
13 changes: 7 additions & 6 deletions src/ContinuityBrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class ContinuityBrowserPerCont : public wxPanel {

// Internals
CalChartView* mView{};
wxUI::Generic<ContinuityBrowserPanel>::Proxy mCanvas{};
wxUI::Factory<ContinuityBrowserPanel>::Proxy mCanvas{};
CalChart::SYMBOL_TYPE mSym{};
};

Expand All @@ -81,11 +81,12 @@ void ContinuityBrowserPerCont::CreateControls(CalChart::Configuration const& con
})
.withFlags(BasicSizerFlags()) },
// here's a canvas
mCanvas = wxUI::Generic<ContinuityBrowserPanel>{
wxUI::Factory{
ExpandSizerFlags(),
[this, &config](wxWindow* parent) {
return new ContinuityBrowserPanel(mSym, config, parent);
} },
} }
.withProxy(mCanvas),
}
.fitTo(this);
}
Expand Down Expand Up @@ -124,17 +125,17 @@ void ContinuityBrowser::CreateControls(CalChart::Configuration const& config)
{
wxUI::VSizer{
wxUI::Line{}.withStyle(wxLI_HORIZONTAL),
wxUI::ForEach{
wxUI::VForEach(
wxSizerFlags{ 1 }.Border(wxALL, 2).Expand(),
CalChart::k_symbols,
[this, &config](auto eachcont) { return wxUI::Generic{
[this, &config](auto eachcont) { return wxUI::Factory{
[this, eachcont, &config](wxWindow* parent) {
auto perCont = new ContinuityBrowserPerCont(parent, eachcont, config);
perCont->Show(false);
mPerCont.push_back(perCont);
return perCont;
}
}; } },
}; }),

wxUI::HSizer{
wxUI::Button{ wxID_HELP, "&Help" }
Expand Down
12 changes: 7 additions & 5 deletions src/ContinuityComposerDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class ContinuityComposerPanel : public wxPanel {

std::unique_ptr<CalChart::Cont::Procedure> mCont;
CalChart::Cont::Drawable mDrawableCont;
wxUI::Generic<ContinuityComposerCanvas>::Proxy mCanvas{};
wxUI::Factory<ContinuityComposerCanvas>::Proxy mCanvas{};
wxUI::ComboBox::Proxy mComboSelection{};
CalChart::Cont::Token const* mCurrentSelected = nullptr;
CalChart::Cont::Token* mCurrentParent = nullptr;
Expand Down Expand Up @@ -146,12 +146,13 @@ void ContinuityComposerPanel::Init()
void ContinuityComposerPanel::CreateControls()
{
wxUI::VSizer{
mCanvas = wxUI::Generic<ContinuityComposerCanvas>{
wxUI::Factory{
wxSizerFlags(1).Expand(),
[this](wxWindow* parent) {
return new ContinuityComposerCanvas(mConfig, parent);
},
},
}
.withProxy(mCanvas),
wxUI::ComboBox{}.withStyle(wxTE_PROCESS_ENTER).bind(wxEVT_TEXT_ENTER, [this](auto const& event) {
OnCmdTextEnterKeyPressed(event);
})
Expand Down Expand Up @@ -678,9 +679,10 @@ ContinuityComposerDialog::ContinuityComposerDialog(std::unique_ptr<CalChart::Con
ContinuityComposerPanel* panel = new ContinuityComposerPanel(std::move(starting_continuity), config, this);
wxUI::VSizer{
sRightBasicSizerFlags,
mPanel = wxUI::Generic<ContinuityComposerPanel>{
wxUI::Generic{
wxSizerFlags{ 0 }.Expand().Border(wxALL, 5),
panel },
panel }
.withProxy(mPanel),
wxUI::VSizer{
sRightBasicSizerFlags,
wxUI::HSizer{
Expand Down
19 changes: 10 additions & 9 deletions src/HelpDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ HelpDialog::HelpDialog(wxWindow* parent, HelpManager& helpManager)
.bind(wxEVT_TEXT_ENTER, [this](auto const& event) { OnSearchEnter(const_cast<wxCommandEvent&>(event)); }),
},
// WebView for displaying help content
mWebView = wxUI::Generic<wxWebView>{
wxUI::Factory<wxWebView>{
wxSizerFlags(1).Expand(),
[this](wxWindow* parent) {
auto* webView = wxWebView::New(parent, wxID_ANY);
Expand All @@ -67,7 +67,8 @@ HelpDialog::HelpDialog(wxWindow* parent, HelpManager& helpManager)
webView->Bind(wxEVT_WEBVIEW_LOADED, &HelpDialog::OnWebViewLoaded, this);
return webView;
},
},
}
.withProxy(mWebView),
}
.fitTo(this);

Expand Down Expand Up @@ -101,7 +102,7 @@ void HelpDialog::LoadTopic(const std::string& topicId)

// Get the file path for the topic
std::string filePath = mHelpManager.GetHelpTopicPath(topicId);

if (filePath.empty()) {
wxLogWarning("Could not find file path for topic: %s", topicId);
// Fallback to SetPage with error message
Expand All @@ -110,9 +111,9 @@ void HelpDialog::LoadTopic(const std::string& topicId)
// Convert file path to file:// URL
wxString fileUrl = "file:///" + wxString(filePath);
fileUrl.Replace("\\", "/");

wxLogInfo("LoadTopic: topicId='%s', loading URL='%s'", topicId, fileUrl);

// Use LoadURL instead of SetPage - more reliable on Windows
mWebView->LoadURL(fileUrl);
}
Expand All @@ -133,9 +134,9 @@ void HelpDialog::OnBack(wxCommandEvent&)
// Get and display the previous topic
std::string topicId = mBackStack.top();
mBackStack.pop();

mCurrentTopicId = topicId;

std::string filePath = mHelpManager.GetHelpTopicPath(topicId);
if (!filePath.empty()) {
wxString fileUrl = "file:///" + wxString(filePath);
Expand All @@ -159,9 +160,9 @@ void HelpDialog::OnForward(wxCommandEvent&)
// Get and display the next topic
std::string topicId = mForwardStack.top();
mForwardStack.pop();

mCurrentTopicId = topicId;

std::string filePath = mHelpManager.GetHelpTopicPath(topicId);
if (!filePath.empty()) {
wxString fileUrl = "file:///" + wxString(filePath);
Expand Down
2 changes: 1 addition & 1 deletion src/HelpDialog.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class HelpDialog : public wxFrame {

// Member variables
HelpManager& mHelpManager;
wxUI::Generic<wxWebView>::Proxy mWebView{};
wxUI::Factory<wxWebView>::Proxy mWebView{};
wxUI::TextCtrl::Proxy mSearchBox{};
wxUI::Button::Proxy mBackButton{};
wxUI::Button::Proxy mForwardButton{};
Expand Down
4 changes: 2 additions & 2 deletions src/ModeSetupDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,9 @@ ModeSetupDialog::ModeSetupDialog(wxWindow* parent, CalChart::ShowMode const& cur
{
wxUI::VSizer{
BasicSizerFlags(),
m_setup = [current_mode, &config](wxWindow* parent) {
wxUI::Factory{ [current_mode, &config](wxWindow* parent) {
return ShowModeDialogSetup::CreateDialog(parent, current_mode, config);
},
} }.withProxy(m_setup),
wxUI::HSizer{
wxUI::Button{ wxID_CANCEL },
wxUI::Button{ wxID_OK },
Expand Down
2 changes: 1 addition & 1 deletion src/ModeSetupDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ class ModeSetupDialog : public wxDialog {
CalChart::ShowMode GetShowMode() const;

private:
wxUI::Generic<ShowModeDialogSetup>::Proxy m_setup;
wxUI::Factory<ShowModeDialogSetup>::Proxy m_setup;
};
4 changes: 2 additions & 2 deletions src/PreferencesPrintContinuitySetup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ void PrintContinuitySetup::CreateControls()
.withProxy(mMaxFontSize)),
},
wxUI::HSplitter{
mPrintContDisplay = [this](wxWindow* parent) { return new PrintContinuityPreview(parent, mConfig); },
mUserInput = [](wxWindow* parent) { return new FancyTextWin(parent, PrintContinuitySetup_KeyPress); } }
wxUI::Factory{ [this](wxWindow* parent) { return new PrintContinuityPreview(parent, mConfig); } }.withProxy(mPrintContDisplay),
wxUI::Factory{ [](wxWindow* parent) { return new FancyTextWin(parent, PrintContinuitySetup_KeyPress); } }.withProxy(mUserInput) }
.withStashGravity(0.5)
.withFlags(wxSizerFlags{ 1 }.Expand()),
}
Expand Down
4 changes: 2 additions & 2 deletions src/PreferencesPrintContinuitySetup.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ class PrintContinuitySetup : public PreferencePage {
auto ClearValuesToDefault() -> bool override;

private:
wxUI::Generic<FancyTextWin>::Proxy mUserInput{};
wxUI::Generic<PrintContinuityPreview>::Proxy mPrintContDisplay{};
wxUI::Factory<FancyTextWin>::Proxy mUserInput{};
wxUI::Factory<PrintContinuityPreview>::Proxy mPrintContDisplay{};
wxUI::CheckBox::Proxy mLandscape{};
wxUI::CheckBox::Proxy mUseNewDraw{};
wxUI::TextCtrl::Proxy mDotRatio{};
Expand Down
5 changes: 3 additions & 2 deletions src/PreferencesPrintingSetup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,10 @@ void PrintingSetup::CreateControls()
})
.withProxy(mMaxFontSize)),
},
mPrintingDisplay = wxUI::Generic<PrintingPreview>{
wxUI::Factory{
wxSizerFlags{ 1 }.Expand(),
[this](wxWindow* parent) { return new PrintingPreview(parent, mConfig); } },
[this](wxWindow* parent) { return new PrintingPreview(parent, mConfig); } }
.withProxy(mPrintingDisplay),
}
.fitTo(this);

Expand Down
2 changes: 1 addition & 1 deletion src/PreferencesPrintingSetup.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class PrintingSetup : public PreferencePage {

private:
wxUI::Generic<FancyTextWin>::Proxy mUserInput{};
wxUI::Generic<PrintingPreview>::Proxy mPrintingDisplay{};
wxUI::Factory<PrintingPreview>::Proxy mPrintingDisplay{};
wxUI::CheckBox::Proxy mLandscape{};
wxUI::TextCtrl::Proxy mDotRatio{};
wxUI::TextCtrl::Proxy mPLineRatio{};
Expand Down
4 changes: 2 additions & 2 deletions src/PrintContinuityEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ void PrintContinuityEditor::CreateControls()
wxUI::Button{ wxID_HELP, "&Help" },
},
wxUI::HSplitter{
mPrintContDisplay = [this](wxWindow* parent) { return new PrintContinuityPreview(parent, mConfig); },
mUserInput = [](wxWindow* parent) { return new FancyTextWin(parent, PrintContinuityEditor_KeyPress); } }
wxUI::Factory{ [this](wxWindow* parent) { return new PrintContinuityPreview(parent, mConfig); } }.withProxy(mPrintContDisplay),
wxUI::Factory{ [](wxWindow* parent) { return new FancyTextWin(parent, PrintContinuityEditor_KeyPress); } }.withProxy(mUserInput) }
.withStashGravity(0.5)
.withFlags(wxSizerFlags{ 1 }.Expand()),
}
Expand Down
4 changes: 2 additions & 2 deletions src/PrintContinuityEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ class PrintContinuityEditor : public wxPanel {
void OnSizeEvent(wxSizeEvent& event);

CalChartView* mView{};
wxUI::Generic<FancyTextWin>::Proxy mUserInput{};
wxUI::Generic<PrintContinuityPreview>::Proxy mPrintContDisplay{};
wxUI::Factory<FancyTextWin>::Proxy mUserInput{};
wxUI::Factory<PrintContinuityPreview>::Proxy mPrintContDisplay{};
wxTimer* mTimer{};

wxString mPreviousText{};
Expand Down
18 changes: 8 additions & 10 deletions src/SetupInstruments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,16 +182,14 @@ void SetupInstruments::CreateControls()
wxUI::Button{ "&None" }
.bind([this] { SelectNone(); }),
},
wxUI::HSizer{
wxUI::ForEach{
enumerate(GetSymbolsBitmap()) | std::views::filter([this](auto bitmap) {
return std::count(mSymbols.begin(), mSymbols.end(), static_cast<CalChart::SYMBOL_TYPE>(std::get<0>(bitmap)));
}),
[this](auto bitmap) {
return wxUI::BitmapButton{ std::get<1>(bitmap) }
.bind([this, which = static_cast<CalChart::SYMBOL_TYPE>(std::get<0>(bitmap))] { SelectSymbol(which); });
} },
},
wxUI::HForEach(
enumerate(GetSymbolsBitmap()) | std::views::filter([this](auto bitmap) {
return std::count(mSymbols.begin(), mSymbols.end(), static_cast<CalChart::SYMBOL_TYPE>(std::get<0>(bitmap)));
}),
[this](auto bitmap) {
return wxUI::BitmapButton{ std::get<1>(bitmap) }
.bind([this, which = static_cast<CalChart::SYMBOL_TYPE>(std::get<0>(bitmap))] { SelectSymbol(which); });
}),
wxUI::HSizer{
wxUI::Text{ "Select Instrument" },
wxUI::Choice{ std::set(mInstruments.begin(), mInstruments.end()) }
Expand Down
8 changes: 4 additions & 4 deletions src/StackDrawPlayground.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,9 @@ StackDrawPlayground::StackDrawPlayground(wxWindow* parent)
VSizer{
wxSizerFlags{}.Border(wxALL, 2).Left().Proportion(0),
HSplitter{
mPreview = [](wxWindow* parent) {
wxUI::Factory{ [](wxWindow* parent) {
return new StackDrawPreview(parent);
},
} }.withProxy(mPreview),
TextCtrl{}.bind([this] {
try {
mPreview->SetDrawCommand(ParseString(*mUserInput));
Expand All @@ -324,9 +324,9 @@ StackDrawPlayground::StackDrawPlayground(wxWindow* parent)
})
.withProxy(mUseOffset) },
Generic{ CreateStdDialogButtonSizer(wxOK) },
mStatus = Generic<wxStatusBar>{ [](wxWindow* parent) {
Factory{ [](wxWindow* parent) {
return new wxStatusBar(parent);
} },
} }.withProxy(mStatus),
}
.fitTo(this);

Expand Down
4 changes: 2 additions & 2 deletions src/StackDrawPlayground.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ class StackDrawPlayground : public wxDialog {
private:
wxUI::CheckBox::Proxy mUseOffset{};
wxUI::TextCtrl::Proxy mUserInput{};
wxUI::Generic<StackDrawPreview>::Proxy mPreview{};
wxUI::Generic<wxStatusBar>::Proxy mStatus{};
wxUI::Factory<StackDrawPreview>::Proxy mPreview{};
wxUI::Factory<wxStatusBar>::Proxy mStatus{};
};
Loading