source: git/src/unitsprefs.cc @ b0d1f80

RELEASE/1.1RELEASE/1.2debug-cidebug-ci-sanitisersfaster-cavernlogstereowalls-datawalls-data-hanging-as-warning
Last change on this file since b0d1f80 was d0867c3, checked in by Mark Shinwell <mark>, 22 years ago

more preferences work

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

  • Property mode set to 100644
File size: 2.9 KB
Line 
1//
2//  unitsprefs.cc
3//
4//  Preferences page for measurement unit options.
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 "unitsprefs.h"
24#include "message.h"
25
26#include <wx/statline.h>
27
28static const wxWindowID ID_UNITS_PREFS = 5005;
29static const wxWindowID ID_UNITS_METRIC = 2000;
30static const wxWindowID ID_UNITS_IMPERIAL = 2001;
31static const wxWindowID ID_UNITS_DEGREES = 2002;
32static const wxWindowID ID_UNITS_GRADS = 2003;
33static const wxWindowID ID_UNITS_LINE1 = 2004;
34static const wxWindowID ID_UNITS_LABEL1 = 2005;
35static const wxWindowID ID_UNITS_LABEL2 = 2006;
36
37UnitsPrefs::UnitsPrefs(wxWindow* parent) : PanelDlgPage(parent, ID_UNITS_PREFS)
38{
39    wxRadioButton* metric = new wxRadioButton(this, ID_UNITS_METRIC, msg(/*metric units*/362),
40                                              wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
41    wxRadioButton* imperial = new wxRadioButton(this, ID_UNITS_IMPERIAL, msg(/*imperial units*/363));
42    wxRadioButton* degrees = new wxRadioButton(this, ID_UNITS_DEGREES, msg(/*degrees*/364),
43                                               wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
44    wxRadioButton* grads = new wxRadioButton(this, ID_UNITS_GRADS, msg(/*grads*/365));
45
46    wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);
47
48    sizer->Add(new wxStaticText(this, ID_UNITS_LABEL1, msg(/*Display measurements in*/366)),
49               0 /* not vertically stretchable */, wxALIGN_TOP | wxBOTTOM, 4);
50    sizer->Add(metric, 0, wxALIGN_TOP | wxLEFT, 32);
51    sizer->Add(10, 4);
52    sizer->Add(imperial, 0, wxALIGN_TOP | wxLEFT, 32);
53    sizer->Add(10, 8);
54    sizer->Add(new wxStaticLine(this, ID_UNITS_LINE1), 0, wxEXPAND | wxRIGHT, 16);
55    sizer->Add(10, 8);
56    sizer->Add(new wxStaticText(this, ID_UNITS_LABEL2, msg(/*Display angles in*/367)),
57               0 /* not vertically stretchable */, wxALIGN_TOP | wxBOTTOM, 4);
58    sizer->Add(degrees, 0, wxALIGN_TOP | wxLEFT, 32);
59    sizer->Add(10, 4);
60    sizer->Add(grads, 0, wxALIGN_TOP | wxLEFT, 32);
61
62    SetAutoLayout(true);
63    SetSizer(sizer);
64}
65
66UnitsPrefs::~UnitsPrefs()
67{
68
69}
70
71const wxString UnitsPrefs::GetName()
72{
73    return "Units";
74}
75
76const wxBitmap UnitsPrefs::GetIcon()
77{
78    return wxGetApp().LoadPreferencesIcon("units");
79}
80
Note: See TracBrowser for help on using the repository browser.