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 ShowEntry(int id);
100
102 void SetText(long i, wxString text);
103
105 void SetColour(long i, wxColour colour);
106
108 void SetFloatingPointTextOn(){m_FloatingPointText = true;};
109 void SetFloatingPointTextOff(){m_FloatingPointText = false;};
110
112 void SetFixedTextOn(){m_FixedText = true;};
113
115 void SetFixedTextOff(){m_FixedText = false;};
116
118 void SetFixedTextMinButton(const char* label);
119
121 void SetFixedTextMaxButton(const char* label);
122
124 void EnableMiddleButton(bool enable);
125
127 void EnableMaxButton(bool enable);
128
130 void EnableMinButton(bool enable);
131
132protected:
134 void OnSize(wxSizeEvent &event);
135
138
139 albaGUILutButt* m_MinButton;
140 albaGUILutButt* m_MiddleButton;
141 albaGUILutButt* m_MaxButton;
142 wxTextCtrl *m_MinEntry;
143 wxTextCtrl *m_MaxEntry;
144
145 wxStaticText *m_MinLabel;
146 wxStaticText *m_MaxLabel;
147
152
155
157DECLARE_EVENT_TABLE()
158};
159#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.
void ShowEntry(int id)
Show an entry to insert a numerical values from keyboard.
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 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.
albaGUILutButt * m_MiddleButton
Interface implementing the Observer of the Subject/Observer design pattern.
Definition: albaObserver.h:36