nux-1.16.0
Vector4Property.h
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 VECTOR4PROPERTY_H
00024 #define VECTOR4PROPERTY_H
00025 
00026 namespace nux
00027 {
00028 
00029   class EditTextLinePropertyItem;
00030 
00031   class Vector4PropertyItem: public SectionProperty
00032   {
00033     NODE_XML_CLASS_MEMBER (Vector4PropertyItem);
00034     NODE_SKIP_CHILD (true);
00035     NODE_SIG_RECEIVER (RecvPropertyChange, EditTextBox *);
00036   public:
00037     Vector4PropertyItem (const TCHAR *name,
00038                          double X = 0.0,
00039                          double Y = 0.0,
00040                          double Z = 0.0,
00041                          double W = 0.0,
00042                          const TCHAR *XName = TEXT ("X"),
00043                          const TCHAR *YName = TEXT ("Y"),
00044                          const TCHAR *ZName = TEXT ("Z"),
00045                          const TCHAR *WName = TEXT ("W") );
00046     virtual ~Vector4PropertyItem();
00047 
00048     virtual long ProcessPropertyEvent (IEvent &ievent, long TraverseInfo, long ProcessEventInfo);
00049     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) );
00050     virtual void ComputePropertyLayout (int x, int y, RowHeader *row, const std::vector<ColumnHeader>& column_vector);
00051 
00052     double GetX() const;
00053     double GetY() const;
00054     double GetZ() const;
00055     double GetW() const;
00056     void SetX (double x)
00057     {
00058       m_X->SetText (NString::Printf (TEXT ("%f"), x) );
00059     };
00060     void SetY (double y)
00061     {
00062       m_Y->SetText (NString::Printf (TEXT ("%f"), y) );
00063     };
00064     void SetZ (double z)
00065     {
00066       m_Z->SetText (NString::Printf (TEXT ("%f"), z) );
00067     };
00068     void SetW (double w)
00069     {
00070       m_W->SetText (NString::Printf (TEXT ("%f"), w) );
00071     };
00072 
00073     const TCHAR *GetXLabel() const
00074     {
00075       return m_X->GetName();
00076     }
00077     const TCHAR *GetYLabel() const
00078     {
00079       return m_Y->GetName();
00080     }
00081     const TCHAR *GetZLabel() const
00082     {
00083       return m_Z->GetName();
00084     }
00085     const TCHAR *GetWLabel() const
00086     {
00087       return m_W->GetName();
00088     }
00089   private:
00090     EditTextLinePropertyItem *m_X;
00091     EditTextLinePropertyItem *m_Y;
00092     EditTextLinePropertyItem *m_Z;
00093     EditTextLinePropertyItem *m_W;
00094   };
00095 
00096 }
00097 
00098 #endif // VECTOR4PROPERTY_H
00099 
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends