Fix dumb-assery. Initial axes.
authorCarl Hetherington <cth@carlh.net>
Mon, 25 Feb 2013 21:39:35 +0000 (21:39 +0000)
committerCarl Hetherington <cth@carlh.net>
Mon, 25 Feb 2013 21:39:35 +0000 (21:39 +0000)
src/wx/audio_plot.cc
src/wx/film_viewer.cc

index 8e7b3f9f5116da3b305f47bcaaf290839c6e739a..0fe9fb45e815e14e7cc4a640d8d2691282d24374 100644 (file)
@@ -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;
index 2314a7f24b32fc5755ea85aaab8ffde1b114dc96..96656ce097891ef8d8f6d54aaa59c518e52c9118 100644 (file)
@@ -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);