Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

valueEditor.h

Go to the documentation of this file.
00001 /* ***********************************************************************************
00002         Writer:         Sebastien Bloc
00003         Copyright:      2003-2004
00004         eMail:          sebastien.bloc@free.fr
00005         URL:            http://mignonsoft.free.fr
00006 
00007         This program is free software; you can redistribute it and/or
00008         modify it under the terms of the GNU General Public License
00009         as published by the Free Software Foundation; either version 2
00010         of the License, or (at your option) any later version.
00011 
00012         This program is distributed in the hope that it will be useful,
00013         but WITHOUT ANY WARRANTY; without even the implied warranty of
00014         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015         GNU General Public License for more details.
00016         http://www.gnu.org/copyleft/gpl.html
00017 *********************************************************************************** */
00018 
00023 #ifndef INCLUDE_VALUE_EDITOR
00024 #define INCLUDE_VALUE_EDITOR
00025 
00026 #pragma warning( disable : 4355 ) // pour les this codebase
00027 
00028 #include "3d.h"
00029 #include "face.h"
00030 #include "MyObject.h"
00031 #include "control.h"
00032 
00033 #define SPEED                   6         
00034 #define SPEED_PAD               45    
00035 #define SPEED_DELTA             1         
00036 #define SPEED_PAD_DELTA 10   
00037 #define DELTA_FOG       0.5
00038 
00042 class ParamValueEditor
00043 {
00044 public:
00045         Object *object; // valueEditor
00046         RECT rect;
00047         HWND hWndParent;
00048         BOOL independant;
00049 
00050         ParamValueEditor();
00051         void Zero();
00052         void operator=(ParamValueEditor &source);
00053         ParamValueEditor * GetCopy();
00054 };
00055 
00059 template <class T> 
00060 class ValueNamed
00061 {
00062 public:
00063         T value;
00064         MyString description;
00065 
00066 public:
00067         ValueNamed();
00068         void Zero();
00069         void operator=(ValueNamed &source);
00070         void Set (T _value,char *_desciption);
00071 };
00072 
00076 template <class T> 
00077 class ValueEditor
00078 {
00079 public:
00080         MyString valueText;
00081         MyString info;
00082         MyString variable;
00083         T minValue;
00084         T maxValue;
00085         T *value;
00086         HTREEITEM hItem;
00087 
00088         typedef ValueNamed<T> ValueNamedCour;
00089         MyList<ValueNamedCour> specials;
00090 
00091 public:
00092         ValueEditor();
00093         void Zero();
00094         void operator=(ValueEditor &source);
00095         ValueEditor<T> * GetCopy();
00096         void InterpretedText(MyString &interpretedText,char *_valueText=NULL,T *_value=NULL);
00097         void Set(char *_variable,char *_info,T _minValue,T _maxValue,HTREEITEM _hItem);
00098         void MAJ_TreeItem(HWND hWnd);
00099         void AddSpecial(T special,char *description);
00100         void MAJ_ValueMin(HWND hWnd);
00101         void MAJ_ValueMax(HWND hWnd);
00102         void MAJ_ValueMids(HWND hWnd);
00103         void MAJ_Value(HWND hWnd,T _value,BOOL refresh=TRUE);
00104         void MAJ_Value(HWND hWnd);
00105         void Get_Value(HWND hWnd);
00106         void MAJ_Slider(HWND hWnd);
00107         void MAJ_Specials(HWND hWnd,int num=-1);
00108         void MAJ(HWND hWnd);
00109 };
00110 
00111 typedef ValueEditor<GLint> ValueEditor_int;
00112 typedef ValueEditor<GLfloat> ValueEditor_float;
00113 typedef ValueEditor<GLdouble> ValueEditor_double;
00114 
00115 #define CBase_VE_int BaseObj<ValueEditor_int,CBASE_INDEX_INT>
00116 #define CBase_VE_float BaseObj<ValueEditor_float,CBASE_INDEX_FLOAT>
00117 #define CBase_VE_double BaseObj<ValueEditor_double,CBASE_INDEX_DOUBLE>
00118 
00122 class ValueEditors
00123 {
00124 public:
00125         MyList<Object> list;
00126         CBase_VE_double *VE_double;
00127         CBase_VE_int *VE_int;
00128         CBase_VE_float *VE_float;
00129 
00130 public:
00131         ValueEditors();
00132         ~ValueEditors();
00133         void Update(Object *object);
00134         void Zero();
00135         void MakeDebugStruct(HWND hWnd);
00136         void MakeDebugFaceStruct(HWND hWnd);
00137         void MakeDebugFaceStruct(HWND hWnd,HTREEITEM hParentItem,FaceNode *node);
00138         void MakeDebugControlStruct(HWND hWnd);
00139         void MakeDebugControlStruct(HWND hWnd,HTREEITEM hParentItem,FaceNode *node,int oldIdControl);
00140         void MakeRenderStruct(HWND hWnd);
00141         void MakeLightsStruct(HWND hWnd);
00142         void MakeTexturesStruct(HWND hWnd);
00143         void MakeFontsStruct(HWND hWnd);
00144         BOOL MakeElemFaceStruct(HWND hWnd,FaceNode *node);
00145         void MakeElemControlStruct(HWND hWnd,Control *control);
00146 
00147 };
00148 
00149 LRESULT WINAPI DebugStructProc(HWND hDlg,UINT message,WPARAM wParam,LPARAM lParam);
00150 LRESULT WINAPI ValueEditorProc(HWND hDlg,UINT message,WPARAM wParam,LPARAM lParam);
00151 
00152 #endif

Generated on Fri Aug 20 19:19:52 2004 for 3d Controls by doxygen 1.3.6