ALBA
albaGUICrossIncremental.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaGUICrossIncremental
5 Authors: Daniele Giunchi
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 __albaGUICrossIncremental_H__
18#define __albaGUICrossIncremental_H__
19
20//----------------------------------------------------------------------------
21// Include:
22//----------------------------------------------------------------------------
23#include "albaGUIPanel.h"
24#include "albaObserver.h"
25#include "albaString.h"
26
27//----------------------------------------------------------------------------
28// Forward refs:
29//----------------------------------------------------------------------------
30class albaGUIButton;
31class albaGUIComboBox;
32
33//----------------------------------------------------------------------------
34// constant
35//----------------------------------------------------------------------------
36
37#define MININT -2147483647-1
38#define MAXINT 2147483647
39#define MINFLOAT -1.0e+38F
40#define MAXFLOAT 1.0e+38F
41#define MINDOUBLE -1.0e+299
42#define MAXDOUBLE 1.0e+299
43
44
45//----------------------------------------------------------------------------
46// albaGUICrossIncremental :
52//----------------------------------------------------------------------------
53class ALBA_EXPORT albaGUICrossIncremental: public albaGUIPanel , public albaObserver
54{
55public:
56 albaGUICrossIncremental(wxWindow* parent,
57 wxWindowID id,
58 const char * label,
59 double *stepVariable,
60 double *topBottomVariable,
61 double *leftRightVariable,
62 bool boldLabel = true,
63 int modality = ID_COMPLETE_LAYOUT,
64 const wxPoint& pos = wxDefaultPosition,
65 const wxSize& size = wxDefaultSize,
66 double min = MINFLOAT, double max = MAXFLOAT, int decimal_digit = -1,
67 long style = wxTAB_TRAVERSAL | wxCLIP_CHILDREN,
68 bool comboStep = false,
69 albaString *buttonUpDown_text = NULL,
70 albaString *buttonLeftRight_text = NULL);
71
73
74
76 {
77 ID_TOP_BOTTOM_LAYOUT = 0,
80 };
81
83 {
84 ID_DECREMENT = -1,
85 ID_CHANGE_STEP = 0,
86 ID_INCREMENT = 1
87 };
88
90 {
91 ID_BUTTON_TOP = MINID,
97 };
98
99
100 void EnableStep(bool value);
101
102 void SetListener(albaObserver *Listener) {m_Listener = Listener;};
103 void OnEvent(albaEventBase *alba_event);
104
105 int IsIncrement(){return m_Increment;};
106 double GetTopBottomVariation(){return m_TopBottomVariation;};
107 double GetLeftRightVariation(){return m_LeftRightVariation;};
108
109
110 void SetStepVariable(double step);
111 void SetComboBoxItems(wxArrayString &array, int selected = 0);
112
113 void LayoutStyle(const char *label);
114
115 void SetTextButtonTop(const char *text);
116 void SetTextButtonBottom(const char *text);
117 void SetTextButtonLeft(const char *text);
118 void SetTextButtonRight(const char *text);
119
120 albaGUIComboBox *GetComboBox(){return m_StepComboBox;}
121
122 void SetComboValue(int index);
123
124private:
125 void CreateWidgetTopBottom(albaString *button_text);
126 void CreateWidgetLeftRight(albaString *button_text);
127 void CreateWidgetTextEntry(double min, double max);
128 void CreateWidgetComboBox();
129 void ConvertStepComboIntoStepVariable();
130
131 albaGUIButton *m_ButtonTop;
132 albaGUIButton *m_ButtonBottom;
133 albaGUIButton *m_ButtonLeft;
134 albaGUIButton *m_ButtonRight;
135 wxTextCtrl *m_StepText;
136 albaGUIComboBox *m_StepComboBox;
137
138 wxBoxSizer *m_Sizer;
139
140 double *m_TopBottomVariable;
141 double *m_LeftRightVariable;
142
143 double m_TopBottomVariation;
144 double m_LeftRightVariation;
145
146 bool m_Bold;
147 int m_Increment;
148
149 double *m_StepVariable;
150 albaObserver* m_Listener;
151 int m_IdLayout;
152
153 bool m_IsComboStep;
154 int m_Digits;
155
156 DECLARE_EVENT_TABLE()
157};
158#endif
MINID
Definition: albaDecl.h:420
#define MINFLOAT
Definition: albaGUI.h:67
#define MAXFLOAT
Definition: albaGUI.h:68
Implementation of the message object for the Subject/Observer design pattern.
Definition: albaEventBase.h:49
albaGUIButton inherit from wxButton.
Definition: albaGUIButton.h:35
a ListBox that send albaEventNotification in the form albaEvent(this, widget_id, item_id,...
Class that represent a widget with 4 buttons and a text array disposed like a cross It can use two ac...
void EnableStep(bool value)
void SetTextButtonRight(const char *text)
virtual ~albaGUICrossIncremental()
void OnEvent(albaEventBase *alba_event)
process the events sent by subjects
void SetListener(albaObserver *Listener)
void SetTextButtonTop(const char *text)
void LayoutStyle(const char *label)
void SetStepVariable(double step)
albaGUICrossIncremental(wxWindow *parent, wxWindowID id, const char *label, double *stepVariable, double *topBottomVariable, double *leftRightVariable, bool boldLabel=true, int modality=ID_COMPLETE_LAYOUT, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, double min=MINFLOAT, double max=MAXFLOAT, int decimal_digit=-1, long style=wxTAB_TRAVERSAL|wxCLIP_CHILDREN, bool comboStep=false, albaString *buttonUpDown_text=NULL, albaString *buttonLeftRight_text=NULL)
void SetComboBoxItems(wxArrayString &array, int selected=0)
void SetTextButtonBottom(const char *text)
void SetTextButtonLeft(const char *text)
void SetComboValue(int index)
class name: albaGUIPanel Inherits directly from wxPanel and adds the pointer to the next panel
Definition: albaGUIPanel.h:27
Interface implementing the Observer of the Subject/Observer design pattern.
Definition: albaObserver.h:36
albaString - performs common string operations on c-strings.
Definition: albaString.h:43