source: git/src/stnprefs.cc @ 7c18431

RELEASE/1.1RELEASE/1.2debug-cidebug-ci-sanitisersstereowalls-datawalls-data-hanging-as-warning
Last change on this file since 7c18431 was cbfa50d, checked in by Olly Betts <olly@…>, 21 years ago

Sorted out config.h inclusion, GL header inclusion, and removed some
needless inclusion of wx headers.

git-svn-id: file:///home/survex-svn/survex/branches/survex-1_1@2342 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#ifdef HAVE_CONFIG_H
24#include <config.h>
25#endif
26
27#include "stnprefs.h"
28#include "message.h"
29#include "gfxcore.h"
30
31#include <wx/statline.h>
32
33static const wxWindowID ID_STN_PREFS = 1001;
34static const wxWindowID ID_STN_CROSSES = 2000;
35static const wxWindowID ID_STN_HI_ENTS = 2001;
36static const wxWindowID ID_STN_HI_FIXED = 2002;
37static const wxWindowID ID_STN_HI_XPTS = 2003;
38static const wxWindowID ID_STN_NAMES = 2004;
39static const wxWindowID ID_STN_OVERLAPPING = 2005;
40static const wxWindowID ID_STN_LINE1 = 2006;
41static const wxWindowID ID_STN_LINE2 = 2006;
42
43BEGIN_EVENT_TABLE(StnPrefs, PanelDlgPage)
44    EVT_CHECKBOX(ID_STN_CROSSES, StnPrefs::OnShowCrosses)
45    EVT_CHECKBOX(ID_STN_HI_ENTS, StnPrefs::OnHighlightEntrances)
46    EVT_CHECKBOX(ID_STN_HI_FIXED, StnPrefs::OnHighlightFixedPts)
47    EVT_CHECKBOX(ID_STN_HI_XPTS, StnPrefs::OnHighlightExportedPts)
48    EVT_CHECKBOX(ID_STN_NAMES, StnPrefs::OnNames)
49    EVT_CHECKBOX(ID_STN_OVERLAPPING, StnPrefs::OnOverlappingNames)
50
51    EVT_UPDATE_UI(ID_STN_CROSSES, StnPrefs::OnShowCrossesUpdate)
52    EVT_UPDATE_UI(ID_STN_HI_ENTS, StnPrefs::OnHighlightEntrancesUpdate)
53    EVT_UPDATE_UI(ID_STN_HI_FIXED, StnPrefs::OnHighlightFixedPtsUpdate)
54    EVT_UPDATE_UI(ID_STN_HI_XPTS, StnPrefs::OnHighlightExportedPtsUpdate)
55    EVT_UPDATE_UI(ID_STN_NAMES, StnPrefs::OnNamesUpdate)
56    EVT_UPDATE_UI(ID_STN_OVERLAPPING, StnPrefs::OnOverlappingNamesUpdate)
57END_EVENT_TABLE()
58
59StnPrefs::StnPrefs(GfxCore* parent, wxWindow* parent_win) : PanelDlgPage(parent_win, ID_STN_PREFS), m_Parent(parent)
60{
61    wxCheckBox* show_crosses = new wxCheckBox(this, ID_STN_CROSSES, msg(/*Mark survey stations with crosses*/350));
62    wxCheckBox* hi_ents = new wxCheckBox(this, ID_STN_HI_ENTS, msg(/*Highlight stations marked as entrances*/351));
63    wxCheckBox* hi_fixed = new wxCheckBox(this, ID_STN_HI_FIXED,
64                                          msg(/*Highlight stations marked as fixed points*/352));
65    wxCheckBox* hi_xpts = new wxCheckBox(this, ID_STN_HI_XPTS, msg(/*Highlight stations which are exported*/353));
66    wxCheckBox* names = new wxCheckBox(this, ID_STN_NAMES, msg(/*Mark survey stations with their names*/354));
67    wxCheckBox* overlapping = new wxCheckBox(this, ID_STN_OVERLAPPING,
68                                             msg(/*Allow names to overlap on the display (faster)*/355));
69
70    wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);
71
72    sizer->Add(show_crosses, 0 /* not vertically stretchable */, wxALIGN_TOP | wxBOTTOM, 0);
73    sizer->Add(10, 8);
74    sizer->Add(new wxStaticLine(this, ID_STN_LINE1), 0, wxEXPAND | wxRIGHT, 16);
75    sizer->Add(10, 8);
76    sizer->Add(hi_ents, 0, wxALIGN_TOP | wxBOTTOM, 4);
77    sizer->Add(hi_fixed, 0, wxALIGN_TOP | wxBOTTOM, 4);
78    sizer->Add(hi_xpts, 0, wxALIGN_TOP | wxBOTTOM, 0);
79    sizer->Add(10, 8);
80    sizer->Add(new wxStaticLine(this, ID_STN_LINE2), 0, wxEXPAND | wxRIGHT, 16);
81    sizer->Add(10, 8);
82    sizer->Add(names, 0, wxALIGN_TOP | wxBOTTOM, 4);
83    sizer->Add(overlapping, 0, wxALIGN_TOP | wxLEFT, 32);
84
85    SetAutoLayout(true);
86    SetSizer(sizer);
87}
88
89StnPrefs::~StnPrefs()
90{
91
92}
93
94void StnPrefs::OnShowCrosses(wxCommandEvent&)
95{
96    m_Parent->ToggleCrosses();
97}
98
99void StnPrefs::OnHighlightEntrances(wxCommandEvent&)
100{
101    m_Parent->ToggleEntrances();
102}
103
104void StnPrefs::OnHighlightFixedPts(wxCommandEvent&)
105{
106    m_Parent->ToggleFixedPts();
107}
108
109void StnPrefs::OnHighlightExportedPts(wxCommandEvent&)
110{
111    m_Parent->ToggleExportedPts();
112}
113
114void StnPrefs::OnNames(wxCommandEvent&)
115{
116    m_Parent->ToggleStationNames();
117}
118
119void StnPrefs::OnOverlappingNames(wxCommandEvent&)
120{
121    m_Parent->ToggleOverlappingNames();
122}
123
124void StnPrefs::OnShowCrossesUpdate(wxUpdateUIEvent& ui)
125{
126    ui.Check(m_Parent->ShowingCrosses());
127}
128
129void StnPrefs::OnHighlightEntrancesUpdate(wxUpdateUIEvent& ui)
130{
131    ui.Check(m_Parent->ShowingEntrances());
132}
133
134void StnPrefs::OnHighlightFixedPtsUpdate(wxUpdateUIEvent& ui)
135{
136    ui.Check(m_Parent->ShowingFixedPts());
137}
138
139void StnPrefs::OnHighlightExportedPtsUpdate(wxUpdateUIEvent& ui)
140{
141    ui.Check(m_Parent->ShowingExportedPts());
142}
143
144void StnPrefs::OnNamesUpdate(wxUpdateUIEvent& ui)
145{
146    ui.Check(m_Parent->ShowingStationNames());
147}
148
149void StnPrefs::OnOverlappingNamesUpdate(wxUpdateUIEvent& ui)
150{
151    ui.Check(m_Parent->ShowingOverlappingNames());
152}
153
154const wxString StnPrefs::GetName()
155{
156    return "Stations";
157}
158
159const wxBitmap StnPrefs::GetIcon()
160{
161    return wxGetApp().LoadPreferencesIcon("stations");
162}
163
Note: See TracBrowser for help on using the repository browser.