diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-02-25 21:39:35 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-02-25 21:39:35 +0000 |
| commit | e13fde5e5525c5feb69cae6618f484158378d116 (patch) | |
| tree | 7fece5db91839c722fd28080e41fdc64d961f386 /src | |
| parent | b84f9f2682205881c208035fea7a7eb43811d565 (diff) | |
Fix dumb-assery. Initial axes.
Diffstat (limited to 'src')
| -rw-r--r-- | src/wx/audio_plot.cc | 11 | ||||
| -rw-r--r-- | src/wx/film_viewer.cc | 5 |
2 files changed, 13 insertions, 3 deletions
diff --git a/src/wx/audio_plot.cc b/src/wx/audio_plot.cc index 8e7b3f9f5..0fe9fb45e 100644 --- a/src/wx/audio_plot.cc +++ b/src/wx/audio_plot.cc @@ -40,9 +40,6 @@ AudioPlot::AudioPlot (wxWindow* parent) , _gain (0) { SetDoubleBuffered (true); -#if wxMAJOR_VERSION == 2 && wxMINOR_VERSION >= 9 - SetBackgroundStyle (wxBG_STYLE_PAINT); -#endif for (int i = 0; i < MAX_AUDIO_CHANNELS; ++i) { _channel_visible[i] = false; @@ -115,6 +112,7 @@ AudioPlot::paint (wxPaintEvent &) float const xs = width / float (_analysis->points (0)); int const height = GetSize().GetHeight (); float const ys = height / -_minimum; + int const border = 8; wxGraphicsPath grid = gc->CreatePath (); gc->SetFont (gc->CreateFont (*wxSMALL_FONT)); @@ -127,6 +125,13 @@ AudioPlot::paint (wxPaintEvent &) gc->SetPen (*wxLIGHT_GREY_PEN); gc->StrokePath (grid); + wxGraphicsPath axes = gc->CreatePath (); + axes.MoveToPoint (border, border); + axes.AddLineToPoint (border, height - border); + axes.AddLineToPoint (width - border, height - border); + gc->SetPen (*wxBLACK_PEN); + gc->StrokePath (axes); + for (int c = 0; c < MAX_AUDIO_CHANNELS; ++c) { if (!_channel_visible[c] || c >= _analysis->channels()) { continue; diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index 2314a7f24..96656ce09 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -56,6 +56,11 @@ FilmViewer::FilmViewer (shared_ptr<Film> f, wxWindow* p) , _got_frame (false) , _clear_required (false) { + _panel->SetDoubleBuffered (true); +#if wxMAJOR_VERSION == 2 && wxMINOR_VERSION >= 9 + _panel->SetBackgroundStyle (wxBG_STYLE_PAINT); +#endif + _v_sizer = new wxBoxSizer (wxVERTICAL); SetSizer (_v_sizer); |
