00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __CONTROL_GUI__
00023 #define __CONTROL_GUI__
00024
00025 #include "jed_defs.h"
00026 #include "entidad.h"
00027 #include "lista.h"
00028 #include "toolkits/util/parsero.h"
00029
00030 class JED_INTERFACE;
00031
00032 #ifdef WXWINDOWS_ENABLED
00033 #ifdef _STRING_H
00034 #undef _STRING_H
00035 #include <wx/wx.h>
00036 #define _STRING_H
00037 #endif
00038 #ifndef _STRING_H
00039 #include <wx/wx.h>
00040 #endif
00041 #include <wx/spinbutt.h>
00042 #endif
00043
00044 #ifdef MOTIF_ENABLED
00045 #include <Xm/Xm.h>
00046 #endif
00047
00048 class CONTROL_GUI : public CONTROLADOR_DE_ENTIDAD {
00049 protected:
00050 char *_nombre_etiqueta;
00051 JED_INTERFACE **_Padre;
00052 public:
00053 CONTROL_GUI(JED_INTERFACE **p);
00054 virtual ~CONTROL_GUI();
00055 virtual BOOLEAN leer(TOKENIZADOR *Sabiondo) = 0;
00056 virtual void actualizar(ENTIDAD *Entidad) = 0;
00057 #ifdef MOTIF_ENABLED
00058 virtual Widget crear_motif(REPOSITORIO_DE_ENTIDADES *Repositorio,
00059 Widget padre) = 0;
00060 #endif
00061 #ifdef WXWINDOWS_ENABLED
00062 virtual void crear_wxwindows(REPOSITORIO_DE_ENTIDADES *Repositorio,
00063 wxPanel *padre) = 0;
00064 #endif
00065 };
00066
00067 class CONTROL_GUI_GRUPO : public CONTROL_GUI {
00068 private:
00069 LISTA <CONTROL_GUI *> lista_hijos;
00070 BOOLEAN orientacion_vertical;
00071 BOOLEAN con_marco;
00072 int estilo_borde;
00073 public:
00074 CONTROL_GUI_GRUPO(JED_INTERFACE **p);
00075 virtual ~CONTROL_GUI_GRUPO();
00076 BOOLEAN leer(TOKENIZADOR *Sabiondo);
00077 void actualizar(ENTIDAD *Entidad);
00078 #ifdef MOTIF_ENABLED
00079 Widget crear_motif(REPOSITORIO_DE_ENTIDADES *Repositorio,
00080 Widget padre);
00081 #endif
00082 #ifdef WXWINDOWS_ENABLED
00083 void crear_wxwindows(REPOSITORIO_DE_ENTIDADES *Repositorio,
00084 wxPanel *padre);
00085 #endif
00086 };
00087
00088 #ifdef WXWINDOWS_ENABLED
00089
00090 class CONTROL_GUI_FLOAT;
00091 class _WXWINDOWS_EVTMNGR_SPIN;
00092
00093 class _WXWINDOWS_TEXTBOX : public wxTextCtrl {
00094 private:
00095 DECLARE_EVENT_TABLE();
00096 CONTROL_GUI_FLOAT *_Control;
00097
00098 public:
00099 _WXWINDOWS_TEXTBOX(wxWindow *parent, wxWindowID id, const wxString &value,
00100 const wxPoint &pos, const wxSize &size, int style = 0);
00101 void OnChar(wxKeyEvent& event);
00102 void set_control(CONTROL_GUI_FLOAT *c);
00103
00104 friend class _WXWINDOWS_EVTMNGR_SPIN;
00105 };
00106
00107 class _WXWINDOWS_EVTMNGR_SPIN : public wxEvtHandler {
00108 private:
00109 DECLARE_EVENT_TABLE();
00110
00111 _WXWINDOWS_TEXTBOX *_Textbox;
00112 wxSpinButton *_Spin;
00113
00114 public:
00115 _WXWINDOWS_EVTMNGR_SPIN();
00116 void set_data(_WXWINDOWS_TEXTBOX *textbox, wxSpinButton *spin);
00117 void OnSpinBtnUp(wxCommandEvent& event);
00118 void OnSpinBtnDown(wxCommandEvent& event);
00119 };
00120
00121 #endif // WXWINDOWS
00122
00123 class CONTROL_GUI_FLOAT : public CONTROL_GUI {
00124 private:
00125 char *_nombre_variable;
00126 char *_nombre_subvariable;
00127 int estilo;
00128 double _valor;
00129 ENTIDAD *Entidad_controlada;
00130
00131 #ifdef MOTIF_ENABLED
00132 Widget widget_datos;
00133 #endif
00134 #ifdef WXWINDOWS_ENABLED
00135 wxSlider *slider;
00136 _WXWINDOWS_TEXTBOX *textbox;
00137 wxSpinButton *spin;
00138 #endif
00139 public:
00140 CONTROL_GUI_FLOAT(JED_INTERFACE **p);
00141 virtual ~CONTROL_GUI_FLOAT();
00142
00143 BOOLEAN leer(TOKENIZADOR *Sabiondo);
00144 void actualizar(ENTIDAD *Entidad);
00145 #ifdef MOTIF_ENABLED
00146 Widget crear_motif(REPOSITORIO_DE_ENTIDADES *Repositorio,
00147 Widget padre);
00148 #endif
00149 #ifdef WXWINDOWS_ENABLED
00150 void crear_wxwindows(REPOSITORIO_DE_ENTIDADES *Repositorio,
00151 wxPanel *padre);
00152 #endif
00153 void set_valor(double val);
00154 };
00155
00156 #include "framework/gui/jed_gui.h"
00157
00158 #endif
00159
00160
00161
00162
00163