3
* $Id: wnota.h 3535 2011-03-18 17:57:05Z carlos $
6
* Copyright 2008-10 MetaEmotion S.L. All rights reserved.
7
* http://ginkgo-cadx.com
9
* This file is licensed under LGPL v3 license.
10
* See License.txt for details
16
#include <api/iwidgets.h>
17
#include <api/widgetserializable.h>
18
#include <widgets/openglhelper.h>
20
//----------------------------------------------------------------------------------------------------
21
//region Forward Declarations
46
//====================================================================================================
48
//====================================================================================================
49
class WNotaBuilder : public GNC::GCS::Widgets::IWidgetBuilder {
51
typedef GNC::GCS::Vector TVector;
52
WNotaBuilder(GNC::GCS::IWidgetsManager* pManager);
56
virtual void OnMouseEvents(GNC::GCS::Eventos::EventoRaton&);
58
virtual void OnKeyEvents(GNC::GCS::Eventos::EventoTeclado&);
60
virtual void Render(GNC::GCS::Contexto3D* c);
62
virtual GNC::GCS::Widgets::TipoCursor GetCursor();
66
GNC::GCS::Widgets::IWidgetBuilder::Estado m_Estado;
69
WCajaTexto* m_pTempWidget;
73
//====================================================================================================
75
//====================================================================================================
76
class WCajaTexto : public GNC::GCS::Widgets::IWidget, public GNC::GCS::Widgets::IWidgetSerializable {
79
typedef GNC::GCS::Vector TVector;
80
typedef GNC::GCS::Matriz TMatriz;
82
WCajaTexto(IWidgetsManager* pManager, long vid, TVector posicion, const char* nombre = "", std::string texto = "");
86
//----------------------------------------------------------------------------------------------------
87
//region "Serializado y desserializado"
89
WCajaTexto(IWidgetsManager* pManager, long vid, wxXmlNode* nodo);
91
wxXmlNode* Serializar(const std::string& nombreMedico);
99
GNC::GCS::Vector m_TamTexto;
106
typedef struct TexturaNota {
108
TexturaCairo* m_textura;
109
bool correcta; //indica si esta correctamente cargada
112
m_textura = new GNC::GCS::TexturaCairo();
113
m_textura->ActivarInterpolacion();
119
m_textura->Descargar();
123
typedef std::map<void*,TexturaNota*> TMapaRecursos;
124
TMapaRecursos m_mapaRecursos;
125
TexturaNota* GetTextura(void* renderer);
128
GNC::GCS::Widgets::Dialogos::SeleccionTexto* m_pWidgetSeleccion;
137
//----------------------------------------------------------------------------------------------------
141
virtual void SetColor(Color color);
142
virtual const std::string& GetTexto() const;
143
virtual void SetTexto(const std::string& texto);
144
virtual void PropagarModificacion();
145
virtual const Color& GetColor() const;
148
//----------------------------------------------------------------------------------------------------
149
//region "Interfaz especifica"
152
virtual bool SoportaAutoBorrado() const {
156
virtual void OnMouseEvents(GNC::GCS::Eventos::EventoRaton&);
158
virtual void OnKeyEvents(GNC::GCS::Eventos::EventoTeclado&);
160
virtual bool HitTest(float x, float y, float umbralCuadrado);
162
virtual bool HitTest(GNC::GCS::Vector* vertices, int numVertices);
164
virtual void Render(GNC::GCS::Contexto3D* c);
166
virtual void OffscreenRender(Contexto3D* c);
168
virtual void Seleccionar(bool seleccionado);
170
virtual void Iluminar(bool iluminado);
172
virtual void Ocultar(bool oculto);
174
virtual void LiberarRecursos(GNC::GCS::IWidgetsRenderer* pKey);
176
//----------------------------------------------------------------------------------------------------
179
virtual void Recalcular(void* renderer);
182
//----------------------------------------------------------------------------------------------------
183
//region "Menu contextual"
185
virtual bool GetMenuContextual(wxMenu* , wxWindow* pParent) ;
189
virtual void InsertarPropiedades(TListaMapasPropiedades &listaMapaPropiedades);