File: wx_dlg.h

package info (click to toggle)
fityk 0.4.4-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,472 kB
  • ctags: 2,617
  • sloc: cpp: 19,705; sh: 5,965; xml: 2,325; yacc: 356; makefile: 183; lex: 178
file content (194 lines) | stat: -rw-r--r-- 6,219 bytes parent folder | download
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
// This file is part of fityk program. Copyright (C) Marcin Wojdyr
// $Id: wx_dlg.h,v 1.4 2005/02/16 21:04:28 wojdyr Exp $

#ifndef WX_DLG__H__
#define WX_DLG__H__

#include <wx/treectrl.h>
#include <wx/notebook.h>
#include <wx/spinctrl.h>
#include <wx/listctrl.h> 
#include "pag.h"

class FuncTree;
struct z_names_type;
class wxGrid;

struct par_descr_type
{
    wxRadioButton *radio;
    std::string name;
    char option;
    std::string from_tree, new_value;
};

class FuncBrowserDlg : public wxDialog
{
public:
    FuncBrowserDlg (wxWindow* parent, wxWindowID id, int tab);
    void OnSelChanged           (wxTreeEvent& event);
    void OnAddWhatChoice (wxCommandEvent& WXUNUSED(event)) 
                                                    {set_list_of_fzg_types();}
    void OnAddTypeChoice (wxCommandEvent& WXUNUSED(event)) {type_was_chosen();}
    void OnParNumChosen (wxCommandEvent& WXUNUSED(event)) 
                                            { parameter_number_was_chosen(); }
    void OnAddTNCRadio       (wxCommandEvent& event); 
    void OnAddValText        (wxCommandEvent& event);
    void OnAddAddButton      (wxCommandEvent& event);
    void OnChangeButton      (wxCommandEvent& event);
    void OnArrowButton       (wxCommandEvent& event);
    void OnSetDomCheckBox    (wxCommandEvent& event);
    void OnSetDomCtrCheckBox (wxCommandEvent& event);
    void OnDeleteButton      (wxCommandEvent& event);
    void OnRRCheckBox        (wxCommandEvent& event);
    void OnFreezeButton      (wxCommandEvent& event);
    void OnFreezeAllButton   (wxCommandEvent& event);
    void OnValueButton       (wxCommandEvent& event);
    void show_expanded (int item, int subitem=-1);
protected:
    FuncTree *func_tree;
    wxTextCtrl *info_text, *frozen_tc, *value_at_tc, *value_output_tc;
    wxStaticText *ch_label, *del_label, *ch_dom_label[4], *value_label;
    wxButton *del_button, *freeze_button;
    wxPanel *p_change, *p_add;
    wxListCtrl *slc;
    wxCheckBox *dom_set_cb, *dom_ctr_set_cb;
    std::string sel_fun;
    wxChoice *fzg_choice, *type_choice;
    wxTextCtrl *add_preview_tc, *add_p_val_tc;
    wxTextCtrl *ch_edit, *ch_ctr, *ch_sigma, *ch_left_b, *ch_right_b, 
               *ch_def_dom_w;
    wxRadioButton *tpc_rb[3], *ch_dom_rb[2];
    wxStaticBox *add_box;
    wxButton *add_add_button;
    wxSizer *ah3_sizer;
    char add_what;
    std::vector<par_descr_type> par_descr;
    int current_add_p_number;
    std::vector<const z_names_type*> all_t;
    bool initialized;

    void set_list_of_fzg_types();
    void type_was_chosen();
    void parameter_number_was_chosen();
    void change_tpc_radio (int nradio);
    void update_add_preview();

    void update_frozen_tc();
    void update_freeze_button_label();
    void set_change_initials(int n);
    void change_domain_enable();
    DECLARE_EVENT_TABLE()
};

class FuncTree : public wxTreeCtrl
{
public:
    FuncTree (wxWindow *parent, const wxWindowID id);
    void OnRightDown          (wxMouseEvent&   event);
    void OnPopupExpandAll     (wxCommandEvent& event);
    void OnPopupCollapseAll   (wxCommandEvent& event);
    void OnPopupToggleButton  (wxCommandEvent& event);
    void OnPopupReset         (wxCommandEvent& event);
    int update_labels (const std::string& beginning);
    void reset_funcs_in_root();
    void ExpandAll (const wxTreeItemId& item);
protected:
    std::vector<std::vector<wxTreeItemId> > a_ids, g_ids, f_ids, z_ids;
    void add_pags_to_tree (wxTreeItemId item_id, const std::vector<Pag>& pags);
    void add_fzg_to_tree (wxTreeItemId p_id, One_of_fzg fzg, int n);
    wxTreeItemId next_item (const wxTreeItemId& item);
    wxTreeItemId next_item_but_not_child (const wxTreeItemId& item);
    DECLARE_EVENT_TABLE()
};

class FDStdDevDlg : public wxDialog
{
public:
    std::string get_command();
    FDStdDevDlg (wxWindow* parent, wxWindowID id);
protected:
    wxTextCtrl *tc_val;
    wxString val;
    wxRadioButton *rb0, *rb1;
    DECLARE_EVENT_TABLE()
};

class FDRangeDlg : public wxDialog
{
public:
    wxTextCtrl *tc_from, *tc_to;
    wxStaticText *label_from, *label_to;
    wxString from, to;
    wxRadioBox *rb;
    FDRangeDlg (wxWindow* parent, wxWindowID id);
protected:
    void OnRadioBoxSelection (wxCommandEvent& event);
    void OnApplyButton (wxCommandEvent& event);
    DECLARE_EVENT_TABLE()
};

class FDXLoadDlg : public wxDialog
{
public:
    std::string filename;
    FDXLoadDlg (wxWindow* parent, wxWindowID id);
    std::string get_command();
    void OnChangeButton (wxCommandEvent& event);
    void set_filename (const std::string &path);

protected:
    wxTextCtrl *file_txt_ctrl;
    wxSpinCtrl *x_column, *y_column, *s_column, 
               *from_range, *to_range, *from_every, 
               *to_every, *of_every, *merge_number; 
    wxPanel *columns_panel, *other_types_panel;
    wxRadioBox *rb_filetype, *yrbox;
    wxCheckBox *merge_cb, *std_dev_cb;
    wxListBox *lb_filetypes;
    void OnFTypeRadioBoxSelection (wxCommandEvent& event);
    void OnSelRadioBoxSelection (wxCommandEvent& event);
    void OnMergeCheckBox (wxCommandEvent& event);
    void OnStdDevCheckBox (wxCommandEvent& event);
    DECLARE_EVENT_TABLE()
};


class SumHistoryDlg : public wxDialog
{
public:
    SumHistoryDlg (wxWindow* parent, wxWindowID id);
    void OnUpButton           (wxCommandEvent& event);
    void OnDownButton         (wxCommandEvent& event);
    void OnToggleSavedButton  (wxCommandEvent& event);
    void OnComputeWssrButton  (wxCommandEvent& event);
    void OnSelectedItem       (wxListEvent&    event);
    void OnActivatedItem      (wxListEvent&    event); 
    void OnViewSpinCtrlUpdate (wxSpinEvent&    event); 
protected:
    int view[3], view_max;
    wxListCtrl *lc;
    wxBitmapButton *up_arrow, *down_arrow;
    wxButton *compute_wssr_button;

    void initialize_lc();
    void update_selection();
    DECLARE_EVENT_TABLE()
};


class DataEditorDlg : public wxDialog
{
public:
    DataEditorDlg (wxWindow* parent, wxWindowID id, Data *data_);
    void OnRevert (wxCommandEvent& event);
    void update_data(Data *data_);
protected:
    wxGrid *grid;
    Data *data;
    wxStaticText *filename_label, *title_label;
    DECLARE_EVENT_TABLE()
};

#endif