SPH
src
gui
windows
Widgets.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
objects/wrappers/Function.h
"
4
#include "
objects/wrappers/Interval.h
"
5
#include <wx/combobox.h>
6
#include <wx/textctrl.h>
7
8
NAMESPACE_SPH_BEGIN
9
10
class
FloatTextCtrl
:
public
wxTextCtrl {
11
private
:
12
double
value;
13
double
lastValidValue;
14
Interval
range;
15
16
public
:
17
Function
<bool(
double
)>
onValueChanged
;
18
19
FloatTextCtrl
(wxWindow* parent,
const
double
value,
const
Interval
range =
Interval::unbounded
());
20
21
double
getValue
()
const
{
22
return
value;
23
}
24
25
private
:
26
void
validate();
27
};
28
29
class
ComboBox
:
public
wxComboBox {
30
public
:
31
ComboBox
(wxWindow* parent,
const
wxString& title,
const
wxSize& size = { -1, -1 })
32
: wxComboBox(parent, wxID_ANY, title, wxDefaultPosition, size, {}, wxCB_READONLY) {}
33
};
34
35
NAMESPACE_SPH_END
NAMESPACE_SPH_BEGIN
NAMESPACE_SPH_BEGIN
Definition:
BarnesHut.cpp:13
Function.h
Generic wrappers of lambdas, functors and other callables.
Interval.h
Object representing interval of real values.
NAMESPACE_SPH_END
#define NAMESPACE_SPH_END
Definition:
Object.h:12
ComboBox
Definition:
Widgets.h:29
ComboBox::ComboBox
ComboBox(wxWindow *parent, const wxString &title, const wxSize &size={ -1, -1 })
Definition:
Widgets.h:31
FloatTextCtrl
Definition:
Widgets.h:10
FloatTextCtrl::getValue
double getValue() const
Definition:
Widgets.h:21
FloatTextCtrl::FloatTextCtrl
FloatTextCtrl(wxWindow *parent, const double value, const Interval range=Interval::unbounded())
Definition:
Widgets.cpp:7
FloatTextCtrl::onValueChanged
Function< bool(double)> onValueChanged
Definition:
Widgets.h:17
Function
Definition:
ForwardDecl.h:14
Interval
Object representing a 1D interval of real numbers.
Definition:
Interval.h:17
Interval::unbounded
static Interval unbounded()
Returns an unbounded (infinite) interval.
Definition:
Interval.h:109
Generated by
1.9.1