ALBA
albaGUILutSlider.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaGUILutSlider
5 Authors: Silvano Imboden
6
7 Copyright (c) BIC
8 All rights reserved. See Copyright.txt or
9
10
11 This software is distributed WITHOUT ANY WARRANTY; without even
12 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13 PURPOSE. See the above copyright notice for more information.
14
15=========================================================================*/
16
17#ifndef __albaGUILutSlider_H__
18#define __albaGUILutSlider_H__
19
20//----------------------------------------------------------------------------
21// Include:
22//----------------------------------------------------------------------------
23#include "albaObserver.h"
24
25//----------------------------------------------------------------------------
26// forward reference :
27//----------------------------------------------------------------------------
28class albaGUILutButt;
29class albaEvent;
30class albaObserver;
31
32//----------------------------------------------------------------------------
33// albaGUILutSlider :
38//----------------------------------------------------------------------------
39class ALBA_EXPORT albaGUILutSlider : public wxPanel
40{
41public:
43 wxWindow *parent,
44 wxWindowID id,
45 const wxPoint& pos = wxDefaultPosition,
46 const wxSize& size = wxDefaultSize,
47 long style = wxBORDER_SIMPLE | wxCLIP_CHILDREN,
48 const char* middleButtonTitle = "windowing"
49 );
51
53 {
54 ID_MOUSE_RELEASE = 0,
57 };
58
60 {
61 MIN_BUTTON = 1,
64 };
65
66 void SetListener(albaObserver *listener) {m_Listener=listener;};
67
69 void SetRange(double rmin, double rmax);
70
72 void SetRange(double *range) { SetRange(range[0], range[1]); };
73
75 void GetRange(double *rmin, double *rmax) { *rmin = m_MinValue; *rmax = m_MaxValue; };
76
78 void GetRange(double *range) { range[0] = m_MinValue; range[1] = m_MaxValue; };
79
81 void SetSubRange(double low, double hi );
82
84 void SetSubRange(const double *range) { SetSubRange(range[0], range[1]); };
85
87 void GetSubRange(double *low, double *hi) { *low = m_LowValue; *hi = m_HighValue; };
88
90 void GetSubRange(double *range) { range[0] = m_LowValue; range[1] = m_HighValue; };
91
93 void MoveButton(int id, int pos);
94
97
99 void ShowRangeEntry(int id);
100
102 void ShowSubRangeEntry(int id);
103
105 void SetText(long i, wxString text);
106
108 void SetColour(long i, wxColour colour);
109
111 void SetFloatingPointTextOn(){m_FloatingPointText = true;};
112 void SetFloatingPointTextOff(){m_FloatingPointText = false;};
113
115 void SetFixedTextOn(){m_FixedText = true;};
116
118 void SetFixedTextOff(){m_FixedText = false;};
119
121 void SetFixedTextMinButton(const char* label);
122
124 void SetFixedTextMaxButton(const char* label);
125
127 void EnableMiddleButton(bool enable);
128
130 void EnableMaxButton(bool enable);
131
133 void EnableMinButton(bool enable);
134
135protected:
137 void OnSize(wxSizeEvent &event);
138
141
142 albaGUILutButt* m_MinButton;
143 albaGUILutButt* m_MiddleButton;
144 albaGUILutButt* m_MaxButton;
145 wxTextCtrl *m_MinEntry;
146 wxTextCtrl *m_MaxEntry;
147
148 wxStaticText *m_MinLabel;
149 wxStaticText *m_MaxLabel;
150
155
158
160DECLARE_EVENT_TABLE()
161};
162#endif // __albaGUILutSlider_H__
albaEvent - Class implementing ALBA application events.
Definition: albaEvent.h:55
albaGUILutSlider is a Label that notify user-click using the normal wxEvents.
void SetText(long i, wxString text)
Set the label text.
albaGUILutButt * m_MinButton
void EnableMinButton(bool enable)
Enable/Disable min button.
wxTextCtrl * m_MinEntry
void SetFixedTextMaxButton(const char *label)
Set the fixed text for max button.
void SetFloatingPointTextOn()
Set the label background colour.
void EnableMiddleButton(bool enable)
Enable/Disable middle button.
bool m_FixedText
flag used for visualization of fixed text, default: false
void UpdateButtons()
Update slider's cursors position.
void SetFloatingPointTextOff()
void EnableMaxButton(bool enable)
Enable/Disable max button.
void SetFixedTextMinButton(const char *label)
Set the fixed text for min button.
void GetRange(double *rmin, double *rmax)
Get the range of the double slider.
void SetRange(double rmin, double rmax)
Set the range of the double slider.
albaGUILutSlider(wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxBORDER_SIMPLE|wxCLIP_CHILDREN, const char *middleButtonTitle="windowing")
void ReleaseButton()
Set the position of the slider's cursors and send the event foe range modified.
void SetSubRange(double low, double hi)
Set the values of the slider's cursors.
void MoveButton(int id, int pos)
Set the position of the slider's cursors and send the event foe range modified.
void GetSubRange(double *low, double *hi)
Get the values of the slider's cursors.
void SetRange(double *range)
Set the range of the double slider.
wxStaticText * m_MinLabel
wxTextCtrl * m_MaxEntry
void SetFixedTextOff()
Turn Off the fixed text for labels.
void SetColour(long i, wxColour colour)
Set the label background colour.
albaObserver * m_Listener
wxStaticText * m_MaxLabel
void GetSubRange(double *range)
Get the values of the slider's cursors.
void OnSize(wxSizeEvent &event)
Update slider's cursors.
albaGUILutButt * m_MaxButton
void SetFixedTextOn()
Turn On the fixed text for labels.
bool m_FloatingPointText
flag used for visualization of decimal in the title of button, default : false
void ShowSubRangeEntry(int id)
Show an entry to insert a Sub Range numerical values from keyboard.
void SetListener(albaObserver *listener)
void SetSubRange(const double *range)
Set the values of the slider's cursors.
void GetRange(double *range)
Get the range of the double slider.
void ShowRangeEntry(int id)
Show an entry to insert a Range numerical values from keyboard.
albaGUILutButt * m_MiddleButton
Interface implementing the Observer of the Subject/Observer design pattern.
Definition: albaObserver.h:36