File: plotpane.h

package info (click to toggle)
fityk 1.3.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,772 kB
  • sloc: cpp: 34,595; ansic: 4,676; python: 963; makefile: 384; sh: 119; xml: 91; java: 31; ruby: 27; perl: 25
file content (53 lines) | stat: -rw-r--r-- 1,601 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// This file is part of fityk program. Copyright 2001-2013 Marcin Wojdyr
// Licence: GNU General Public License ver. 2+

#ifndef FITYK_WX_PLOTPANE_H_
#define FITYK_WX_PLOTPANE_H_

#include "cmn.h"  //for MouseModeEnum, ProportionalSplitter

class MainPlot;
class AuxPlot;
class FPlot;

class ZoomHistory
{
public:
    ZoomHistory(const std::string& s) : items_(1, s), pos_(0) {}
    void push(const std::string& s);
    void move(int n) { set_pos(n >= -(int)pos_ ? pos_ + n : 0); }
    void set_pos(size_t p);
    size_t pos() const { return pos_; }
    const std::vector<std::string>& items() const { return items_; }

private:
    std::vector<std::string> items_;
    size_t pos_;
};

/// A pane containing main and auxiliary plots and a proxy for some
/// of the methods of plots.
class PlotPane : public ProportionalSplitter
{
    friend class FPrintout;
public:
    PlotPane(wxWindow *parent, wxWindowID id=-1);
    void save_settings(wxConfigBase *cf) const;
    void read_settings(wxConfigBase *cf);
    void refresh_plots(bool now, WhichPlot which_plot);
    const MainPlot* get_plot() const { return plot_; }
    MainPlot* get_plot() { return plot_; }
    AuxPlot* get_aux_plot(int n) const
                     { assert(n>=0 && n<2); return aux_plot_[n]; }
    void show_aux(int n, bool show);
    bool aux_visible(int n) const;
    void draw_vertical_lines(int X1, int X2, FPlot* skip);
    wxBitmap prepare_bitmap_for_export(int W, int H, bool include_aux);

private:
    MainPlot *plot_;
    ProportionalSplitter *aux_split_;
    AuxPlot *aux_plot_[2];
};

#endif // FITYK_WX_PLOTPANE_H_