wxMaxima
Loading...
Searching...
No Matches
Gen1Wiz.h
1// -*- mode: c++; c-file-style: "linux"; c-basic-offset: 2; indent-tabs-mode: nil -*-
2//
3// Copyright (C) 2004-2015 Andrej Vodopivec <andrej.vodopivec@gmail.com>
4// Copyright (C) 2017-2018 Gunter Königsmann <wxMaxima@physikbuch.de>
5//
6// This program is free software; you can redistribute it and/or modify
7// it under the terms of the GNU General Public License as published by
8// the Free Software Foundation; either version 2 of the License, or
9// (at your option) any later version.
10//
11// This program is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14// GNU General Public License for more details.
15//
16//
17// You should have received a copy of the GNU General Public License
18// along with this program; if not, write to the Free Software
19// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20//
21// SPDX-License-Identifier: GPL-2.0+
22
23#ifndef GEN1WIZ_H
24#define GEN1WIZ_H
25
26#include "precomp.h"
27#include <wx/wx.h>
28#include <wx/statline.h>
29#include <functional>
30
31#include "BTextCtrl.h"
32
33// cppcheck-suppress ctuOneDefinitionRuleViolation
34class Gen1Wiz : public wxDialog
35{
36public:
39 ~Gen1Wiz() override { SendDestroyEvent(); }
40 Gen1Wiz(wxWindow *parent, int id,
41 Configuration *cfg,
42 const wxString &title,
43 const wxString &label,
44 const wxString &val = wxEmptyString,
45 const wxString &warning = wxEmptyString,
46 const wxString &warningToolTip = wxEmptyString,
47 const wxPoint &pos = wxDefaultPosition,
48 const wxSize &size = wxDefaultSize, long style = wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxRESIZE_BORDER | wxCAPTION | wxCLOSE_BOX | wxCLIP_CHILDREN);
49
50 wxString GetValue()
51 {
52 return text_ctrl_1->GetValue();
53 }
54
55 void SetValue(const wxString &v)
56 {
57 text_ctrl_1->SetValue(v);
58 text_ctrl_1->SetSelection(-1, -1);
59 }
60
61 void SetLabel1ToolTip(wxString toolTip){label_2->SetToolTip(toolTip);}
62private:
63
64 void set_properties();
65
66 void do_layout();
67
68 wxStaticText *label_2;
69 BTextCtrl *text_ctrl_1;
70 wxStaticLine *static_line_1;
71 wxButton *button_1;
72 wxButton *button_2;
73 wxStaticText *m_warning;
74 wxString m_warningText;
75};
76
77void GetTextFromUser(const wxString &label, const wxString &title, Configuration *cfg, wxString value,
78 wxWindow *parent, std::function<void (wxString)> callback);
79
80#endif // GEN1WIZ_H
A wxTextCtrl with parenthesis matching.
Definition: BTextCtrl.h:34
The configuration storage for the current worksheet.
Definition: Configuration.h:101
Definition: Gen1Wiz.h:35
~Gen1Wiz() override
Saves the geometry while this is still a whole dialog, see FindReplaceDialog::~FindReplaceDialog()
Definition: Gen1Wiz.h:39