Skip to content

Commit 2cc7fe8

Browse files
authored
Issue #649: It is too hard to select curve control buttons. (#652)
1 parent 905ce63 commit 2cc7fe8

13 files changed

+169
-172
lines changed

LATEST_RELEASE_NOTES.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Release notes for 3.7.3
1+
## Release notes for 3.8.0
22

33
Bugs addressed in this release:
44

@@ -30,4 +30,5 @@ Other changes:
3030
* [#640](../../issues/640) Clean up some of the CalChartAngles.h clang-tidy errors
3131
* [#643](../../issues/643) Remove sheet as point friend
3232
* [#645](../../issues/645) Adopt wxUI Menu widely
33+
* [#649](../../issues/649) It is too hard to select curve control buttons.
3334

resources/tb_curve.xbm

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
static unsigned char tb_curve_bits[] = {
44
0x00, 0x00,
55
0x00, 0x00,
6+
0xC4, 0x1F,
7+
0x3E, 0x20,
8+
0x04, 0x40,
9+
0x00, 0x40,
10+
0x00, 0x40,
11+
0x00, 0x30,
12+
0xC0, 0x0F,
613
0x30, 0x00,
7-
0xF8, 0x0F,
8-
0xF8, 0x1F,
9-
0x30, 0x18,
10-
0x00, 0x18,
11-
0xF0, 0x1F,
12-
0xF8, 0x0F,
13-
0x18, 0x00,
14-
0x18, 0x0C,
15-
0xF8, 0x1F,
16-
0xF0, 0x1F,
17-
0x00, 0x0C,
18-
0x00, 0x00,
14+
0x08, 0x00,
15+
0x04, 0x20,
16+
0x04, 0x70,
17+
0x08, 0x2E,
18+
0xF0, 0x01,
1919
0x00, 0x00};

src/CalChartFrame.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ CalChartFrame::CalChartFrame(wxDocument* doc, wxView* view, CalChart::Configurat
347347
// view->GetDocumentManager()->FileHistoryUseMenu(file_menu);
348348

349349
// Add a toolbar
350-
mSelectAndMoveToolBar = CreateSelectAndMoves(this, mConfig.Get_FeatureCurves(), wxID_ANY, wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_OVERFLOW);
350+
mSelectAndMoveToolBar = CreateSelectAndMoves(this, wxID_ANY, wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_OVERFLOW);
351351
mSelectAndMoveToolBar->SetFont(ResizeFont(mSelectAndMoveToolBar->GetFont(), GetToolBarFontSize()));
352352
mMarcherToolBar = CreateDotModifiers(this, wxID_ANY, wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_OVERFLOW);
353353
mMarcherToolBar->SetFont(ResizeFont(mMarcherToolBar->GetFont(), GetToolBarFontSize()));
@@ -829,8 +829,7 @@ void CalChartFrame::OnCmd_swap(wxCommandEvent&)
829829

830830
void CalChartFrame::OnCmd_curve(wxCommandEvent&)
831831
{
832-
mSelectAndMoveToolBar->ToggleTool(CALCHART__curve, true);
833-
mCanvas->SetDrawingCurve(true);
832+
mCanvas->SetDrawingCurve(mSelectAndMoveToolBar->GetToolToggled(CALCHART__curve));
834833
}
835834

836835
void CalChartFrame::OnCmd_move(wxCommandEvent&)
@@ -1233,12 +1232,6 @@ void CalChartFrame::ToolBarSetCurrentMove(CalChart::MoveMode type)
12331232
mSelectAndMoveToolBar->ToggleTool(CALCHART__move + toUType(type), true);
12341233
}
12351234

1236-
// call by the canvas to inform that the curve draw is done. Don't call back to canvas
1237-
void CalChartFrame::ToolBarUnsetDrawingCurve()
1238-
{
1239-
mSelectAndMoveToolBar->ToggleTool(CALCHART__curve, false);
1240-
}
1241-
12421235
void CalChartFrame::SetMode()
12431236
{
12441237
if (GetShow()) {

src/CalChartFrame.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ class CalChartFrame : public wxDocChildFrame {
153153
void SetCurrentSelect(CalChart::Select type);
154154
void SetCurrentMove(CalChart::MoveMode type);
155155
void ToolBarSetCurrentMove(CalChart::MoveMode type);
156-
void ToolBarUnsetDrawingCurve();
157156
float ToolBarSetZoom(float zoom); // set to an amount, returns what it was set to.
158157
void zoom_callback(wxCommandEvent&);
159158
void zoom_callback_textenter(wxCommandEvent&);

src/CalChartToolBar.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,18 +94,18 @@ std::vector<ToolBarEntry> GetSymbolsToolBar()
9494
return tb;
9595
}
9696

97-
std::vector<ToolBarEntry> GetHalfOfMainToolBar(bool withFeatureCurves)
97+
std::vector<ToolBarEntry> GetHalfOfMainToolBar()
9898
{
99-
static auto const tb = [withFeatureCurves] {
99+
static auto const tb = [] {
100100
auto result = std::vector<ToolBarEntry>{
101101
{ wxITEM_NORMAL, wxT(""), ScaleButtonBitmap(wxBitmap(BITMAP_NAME(tb_left))), wxT("Previous stuntsheet"), CALCHART__prev_ss, {} },
102102
{ wxITEM_NORMAL, wxT(""), ScaleButtonBitmap(wxBitmap(BITMAP_NAME(tb_right))), wxT("Next stuntsheet"), CALCHART__next_ss, true },
103103
{ wxITEM_RADIO, wxT(""), ScaleButtonBitmap(wxBitmap(BITMAP_NAME(tb_box))), wxT("Select points with box"), CALCHART__box, {} },
104104
{ wxITEM_RADIO, wxT(""), ScaleButtonBitmap(wxBitmap(BITMAP_NAME(tb_poly))), wxT("Select points with polygon"), CALCHART__poly, {} },
105105
{ wxITEM_RADIO, wxT(""), ScaleButtonBitmap(wxBitmap(BITMAP_NAME(tb_lasso))), wxT("Select points with lasso"), CALCHART__lasso, {} },
106106
{ wxITEM_RADIO, wxT(""), ScaleButtonBitmap(wxBitmap(BITMAP_NAME(tb_swap))), wxT("Swap points"), CALCHART__swap, true },
107+
{ wxITEM_CHECK, wxT(""), ScaleButtonBitmap(wxBitmap(BITMAP_NAME(tb_curve))), wxT("Draw and Edit Curves"), CALCHART__curve, true },
107108
{ wxITEM_RADIO, wxT(""), ScaleButtonBitmap(wxBitmap(BITMAP_NAME(tb_mv))), wxT("Translate points"), CALCHART__move, {} },
108-
109109
{ wxITEM_RADIO, wxT(""), ScaleButtonBitmap(wxBitmap(BITMAP_NAME(tb_shape_line))), wxT("Shape points in a line"), CALCHART__shape_line, {} },
110110
{ wxITEM_RADIO, wxT(""), ScaleButtonBitmap(wxBitmap(BITMAP_NAME(tb_shape_x))), wxT("Shape points in an x"), CALCHART__shape_x, {} },
111111
{ wxITEM_RADIO, wxT(""), ScaleButtonBitmap(wxBitmap(BITMAP_NAME(tb_shape_cross))), wxT("Shape points in a cross"), CALCHART__shape_cross, {} },
@@ -119,10 +119,6 @@ std::vector<ToolBarEntry> GetHalfOfMainToolBar(bool withFeatureCurves)
119119
{ wxITEM_RADIO, wxT(""), ScaleButtonBitmap(wxBitmap(BITMAP_NAME(tb_siz))), wxT("Resize block"), CALCHART__size, {} },
120120
{ wxITEM_RADIO, wxT(""), ScaleButtonBitmap(wxBitmap(BITMAP_NAME(tb_gen))), wxT("Genius move"), CALCHART__genius, true },
121121
};
122-
if (withFeatureCurves) {
123-
result.push_back(
124-
ToolBarEntry{ wxITEM_RADIO, "", ScaleButtonBitmap(wxBitmap(BITMAP_NAME(tb_curve))), wxT("Draw curve"), CALCHART__curve, true });
125-
}
126122
return result;
127123
}();
128124
return tb;
@@ -171,10 +167,10 @@ auto CreateAuiToolBar(wxAuiToolBar* tb, T toolbarBits)
171167
return tb;
172168
}
173169

174-
wxAuiToolBar* CreateSelectAndMoves(wxWindow* parent, bool withFeatureCurves, wxWindowID id, long style)
170+
wxAuiToolBar* CreateSelectAndMoves(wxWindow* parent, wxWindowID id, long style)
175171
{
176172

177-
return CreateAuiToolBar(new wxAuiToolBar(parent, id, wxDefaultPosition, wxDefaultSize, style), GetHalfOfMainToolBar(withFeatureCurves));
173+
return CreateAuiToolBar(new wxAuiToolBar(parent, id, wxDefaultPosition, wxDefaultSize, style), GetHalfOfMainToolBar());
178174
}
179175

180176
wxAuiToolBar* CreateDotModifiers(wxWindow* parent, wxWindowID id, long style)

src/CalChartToolBar.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ struct ToolBarEntry;
3131

3232
std::vector<wxBitmap> GetSymbolsBitmap();
3333

34-
wxAuiToolBar* CreateSelectAndMoves(wxWindow* parent, bool withFeatureCurves, wxWindowID id = wxID_ANY, long style = 0);
34+
wxAuiToolBar* CreateSelectAndMoves(wxWindow* parent, wxWindowID id = wxID_ANY, long style = 0);
3535
wxAuiToolBar* CreateDotModifiers(wxWindow* parent, wxWindowID id = wxID_ANY, long style = 0);

src/CalChartView.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ class CalChartView : public wxView {
124124
[[nodiscard]] auto GetCurrentMove() const { return mShow->GetCurrentMove(); }
125125
void SetCurrentMove(CalChart::MoveMode move) { mShow->SetCurrentMove(move); }
126126
[[nodiscard]] auto IsDrawingCurve() const { return mShow->IsDrawingCurve(); }
127-
void SetDrawingCurve(bool drawingCurve) const { return mShow->SetDrawingCurve(drawingCurve); }
127+
void SetDrawingCurve(bool drawingCurve) const { mShow->SetDrawingCurve(drawingCurve); }
128128

129129
[[nodiscard]] auto GetCurrentCurve(size_t index) const { return mShow->GetCurrentCurve(index); }
130130
[[nodiscard]] auto GetCurrentNumberCurves() const { return mShow->GetCurrentNumberCurves(); }

0 commit comments

Comments
 (0)