source: git/src/stnprefs.cc @ b0d1f80

RELEASE/1.1RELEASE/1.2debug-cidebug-ci-sanitisersfaster-cavernlogstereowalls-datawalls-data-hanging-as-warning
Last change on this file since b0d1f80 was 203d2a7, checked in by Olly Betts <olly@…>, 21 years ago

Checked in Mark's avengl changes.

git-svn-id: file:///home/survex-svn/survex/branches/survex-1_1@2332 4b37db11-9a0c-4f06-9ece-9ab7cdaee568

  • Property mode set to 100644
File size: 5.1 KB
Line 
1//
2//  stnprefs.cc
3//
4//  Preferences page for stations.
5//
6//  Copyright (C) 2002 Mark R. Shinwell
7//
8//  This program is free software; you can redistribute it and/or modify
9//  it under the terms of the GNU General Public License as published by
10//  the Free Software Foundation; either version 2 of the License, or
11//  (at your option) any later version.
12//
13//  This program is distributed in the hope that it will be useful,
14//  but WITHOUT ANY WARRANTY; without even the implied warranty of
15//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16//  GNU General Public License for more details.
17//
18//  You should have received a copy of the GNU General Public License
19//  along with this program; if not, write to the Free Software
20//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21//
22
23#include "stnprefs.h"
24#include "message.h"
25#include "gfxcore.h"
26
27#include <wx/statline.h>
28
29static const wxWindowID ID_STN_PREFS = 1001;
30static const wxWindowID ID_STN_CROSSES = 2000;
31static const wxWindowID ID_STN_HI_ENTS = 2001;
32static const wxWindowID ID_STN_HI_FIXED = 2002;
33static const wxWindowID ID_STN_HI_XPTS = 2003;
34static const wxWindowID ID_STN_NAMES = 2004;
35static const wxWindowID ID_STN_OVERLAPPING = 2005;
36static const wxWindowID ID_STN_LINE1 = 2006;
37static const wxWindowID ID_STN_LINE2 = 2006;
38
39BEGIN_EVENT_TABLE(StnPrefs, PanelDlgPage)
40    EVT_CHECKBOX(ID_STN_CROSSES, StnPrefs::OnShowCrosses)
41    EVT_CHECKBOX(ID_STN_HI_ENTS, StnPrefs::OnHighlightEntrances)
42    EVT_CHECKBOX(ID_STN_HI_FIXED, StnPrefs::OnHighlightFixedPts)
43    EVT_CHECKBOX(ID_STN_HI_XPTS, StnPrefs::OnHighlightExportedPts)
44    EVT_CHECKBOX(ID_STN_NAMES, StnPrefs::OnNames)
45    EVT_CHECKBOX(ID_STN_OVERLAPPING, StnPrefs::OnOverlappingNames)
46
47    EVT_UPDATE_UI(ID_STN_CROSSES, StnPrefs::OnShowCrossesUpdate)
48    EVT_UPDATE_UI(ID_STN_HI_ENTS, StnPrefs::OnHighlightEntrancesUpdate)
49    EVT_UPDATE_UI(ID_STN_HI_FIXED, StnPrefs::OnHighlightFixedPtsUpdate)
50    EVT_UPDATE_UI(ID_STN_HI_XPTS, StnPrefs::OnHighlightExportedPtsUpdate)
51    EVT_UPDATE_UI(ID_STN_NAMES, StnPrefs::OnNamesUpdate)
52    EVT_UPDATE_UI(ID_STN_OVERLAPPING, StnPrefs::OnOverlappingNamesUpdate)
53END_EVENT_TABLE()
54
55StnPrefs::StnPrefs(GfxCore* parent, wxWindow* parent_win) : PanelDlgPage(parent_win, ID_STN_PREFS), m_Parent(parent)
56{
57    wxCheckBox* show_crosses = new wxCheckBox(this, ID_STN_CROSSES, msg(/*Mark survey stations with crosses*/350));
58    wxCheckBox* hi_ents = new wxCheckBox(this, ID_STN_HI_ENTS, msg(/*Highlight stations marked as entrances*/351));
59    wxCheckBox* hi_fixed = new wxCheckBox(this, ID_STN_HI_FIXED,
60                                          msg(/*Highlight stations marked as fixed points*/352));
61    wxCheckBox* hi_xpts = new wxCheckBox(this, ID_STN_HI_XPTS, msg(/*Highlight stations which are exported*/353));
62    wxCheckBox* names = new wxCheckBox(this, ID_STN_NAMES, msg(/*Mark survey stations with their names*/354));
63    wxCheckBox* overlapping = new wxCheckBox(this, ID_STN_OVERLAPPING,
64                                             msg(/*Allow names to overlap on the display (faster)*/355));
65
66    wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);
67
68    sizer->Add(show_crosses, 0 /* not vertically stretchable */, wxALIGN_TOP | wxBOTTOM, 0);
69    sizer->Add(10, 8);
70    sizer->Add(new wxStaticLine(this, ID_STN_LINE1), 0, wxEXPAND | wxRIGHT, 16);
71    sizer->Add(10, 8);
72    sizer->Add(hi_ents, 0, wxALIGN_TOP | wxBOTTOM, 4);
73    sizer->Add(hi_fixed, 0, wxALIGN_TOP | wxBOTTOM, 4);
74    sizer->Add(hi_xpts, 0, wxALIGN_TOP | wxBOTTOM, 0);
75    sizer->Add(10, 8);
76    sizer->Add(new wxStaticLine(this, ID_STN_LINE2), 0, wxEXPAND | wxRIGHT, 16);
77    sizer->Add(10, 8);
78    sizer->Add(names, 0, wxALIGN_TOP | wxBOTTOM, 4);
79    sizer->Add(overlapping, 0, wxALIGN_TOP | wxLEFT, 32);
80
81    SetAutoLayout(true);
82    SetSizer(sizer);
83}
84
85StnPrefs::~StnPrefs()
86{
87
88}
89
90void StnPrefs::OnShowCrosses(wxCommandEvent&)
91{
92    m_Parent->ToggleCrosses();
93}
94
95void StnPrefs::OnHighlightEntrances(wxCommandEvent&)
96{
97    m_Parent->ToggleEntrances();
98}
99
100void StnPrefs::OnHighlightFixedPts(wxCommandEvent&)
101{
102    m_Parent->ToggleFixedPts();
103}
104
105void StnPrefs::OnHighlightExportedPts(wxCommandEvent&)
106{
107    m_Parent->ToggleExportedPts();
108}
109
110void StnPrefs::OnNames(wxCommandEvent&)
111{
112    m_Parent->ToggleStationNames();
113}
114
115void StnPrefs::OnOverlappingNames(wxCommandEvent&)
116{
117    m_Parent->ToggleOverlappingNames();
118}
119
120void StnPrefs::OnShowCrossesUpdate(wxUpdateUIEvent& ui)
121{
122    ui.Check(m_Parent->ShowingCrosses());
123}
124
125void StnPrefs::OnHighlightEntrancesUpdate(wxUpdateUIEvent& ui)
126{
127    ui.Check(m_Parent->ShowingEntrances());
128}
129
130void StnPrefs::OnHighlightFixedPtsUpdate(wxUpdateUIEvent& ui)
131{
132    ui.Check(m_Parent->ShowingFixedPts());
133}
134
135void StnPrefs::OnHighlightExportedPtsUpdate(wxUpdateUIEvent& ui)
136{
137    ui.Check(m_Parent->ShowingExportedPts());
138}
139
140void StnPrefs::OnNamesUpdate(wxUpdateUIEvent& ui)
141{
142    ui.Check(m_Parent->ShowingStationNames());
143}
144
145void StnPrefs::OnOverlappingNamesUpdate(wxUpdateUIEvent& ui)
146{
147    ui.Check(m_Parent->ShowingOverlappingNames());
148}
149
150const wxString StnPrefs::GetName()
151{
152    return "Stations";
153}
154
155const wxBitmap StnPrefs::GetIcon()
156{
157    return wxGetApp().LoadPreferencesIcon("stations");
158}
159
Note: See TracBrowser for help on using the repository browser.