nux-0.9.48
|
00001 /* 00002 * Copyright 2010 Inalogic® Inc. 00003 * 00004 * This program is free software: you can redistribute it and/or modify it 00005 * under the terms of the GNU Lesser General Public License, as 00006 * published by the Free Software Foundation; either version 2.1 or 3.0 00007 * of the License. 00008 * 00009 * This program is distributed in the hope that it will be useful, but 00010 * WITHOUT ANY WARRANTY; without even the implied warranties of 00011 * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR 00012 * PURPOSE. See the applicable version of the GNU Lesser General Public 00013 * License for more details. 00014 * 00015 * You should have received a copy of both the GNU Lesser General Public 00016 * License along with this program. If not, see <http://www.gnu.org/licenses/> 00017 * 00018 * Authored by: Jay Taoko <jaytaoko@inalogic.com> 00019 * 00020 */ 00021 00022 00023 #ifndef VECTOR3PROPERTY_H 00024 #define VECTOR3PROPERTY_H 00025 00026 namespace nux 00027 { 00028 00029 class EditTextLinePropertyItem; 00030 00031 class Vector3PropertyItem: public SectionProperty 00032 { 00033 NODE_XML_CLASS_MEMBER (Vector3PropertyItem); 00034 NODE_SKIP_CHILD (true); 00035 NODE_SIG_RECEIVER2 (RecvPropertyChange, EditTextBox *); 00036 public: 00037 Vector3PropertyItem (const TCHAR *name, 00038 double X = 0.0, 00039 double Y = 0.0, 00040 double Z = 0.0, 00041 const TCHAR *XName = TEXT ("X"), 00042 const TCHAR *YName = TEXT ("Y"), 00043 const TCHAR *ZName = TEXT ("Z") ); 00044 virtual ~Vector3PropertyItem(); 00045 00046 virtual long ProcessPropertyEvent (IEvent &ievent, long TraverseInfo, long ProcessEventInfo); 00047 virtual void DrawProperty (GraphicsEngine &GfxContext, TableCtrl *table, bool force_draw, Geometry geo, const BasePainter &Painter, RowHeader *row, const std::vector<ColumnHeader>& column_vector, Color ItemBackgroundColor = Color (0x0) ); 00048 virtual void ComputePropertyLayout (int x, int y, RowHeader *row, const std::vector<ColumnHeader>& column_vector); 00049 00050 double GetX() const; 00051 double GetY() const; 00052 double GetZ() const; 00053 void SetX (double x) 00054 { 00055 m_X->SetText (NString::Printf (TEXT ("%f"), x) ); 00056 }; 00057 void SetY (double y) 00058 { 00059 m_Y->SetText (NString::Printf (TEXT ("%f"), y) ); 00060 }; 00061 void SetZ (double z) 00062 { 00063 m_Z->SetText (NString::Printf (TEXT ("%f"), z) ); 00064 }; 00065 00066 const TCHAR *GetXLabel() const 00067 { 00068 return m_X->GetName(); 00069 } 00070 const TCHAR *GetYLabel() const 00071 { 00072 return m_Y->GetName(); 00073 } 00074 const TCHAR *GetZLabel() const 00075 { 00076 return m_Z->GetName(); 00077 } 00078 private: 00079 EditTextLinePropertyItem *m_X; 00080 EditTextLinePropertyItem *m_Y; 00081 EditTextLinePropertyItem *m_Z; 00082 }; 00083 00084 } 00085 00086 #endif // VECTOR3PROPERTY_H