[Gcblue-commits] gcb_wx/include/common simmath.h,1.20,1.21 tcOptions.h,1.7,1.8 tcOptionsView.h,1.9,1
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2004-10-02 22:42:13
|
Update of /cvsroot/gcblue/gcb_wx/include/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13659/include/common Modified Files: simmath.h tcOptions.h tcOptionsView.h Log Message: Changes related to GDI+ replacement Index: tcOptions.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/tcOptions.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcOptions.h 9 May 2004 20:40:20 -0000 1.7 --- tcOptions.h 2 Oct 2004 22:41:32 -0000 1.8 *************** *** 27,48 **** #include <string> - #define N_OPTIONS 32 // max number of options - #define N_OPTION_VALUES 4 // max number of states for each option class TiXmlDocument; class TiXmlNode; ! struct tsOptionInfo ! { ! int mnValue; ! enum teType ! { ! OT_BOOLEAN, ! OT_RADIOBUTTON ! } meType; ! int mnStateCount; ! wxString mzCaption[N_OPTION_VALUES]; ! int *mpAssociated; ///< variable to change to match mnValue ! }; /** --- 27,35 ---- #include <string> class TiXmlDocument; class TiXmlNode; ! /** *************** *** 57,60 **** --- 44,65 ---- { public: + + enum + { + N_OPTIONS = 32, // max number of options + N_OPTION_VALUES = 4 // max number of states for each option + }; + struct tsOptionInfo + { + int mnValue; + enum teType + { + OT_BOOLEAN, + OT_RADIOBUTTON + } meType; + int mnStateCount; + wxString mzCaption[tcOptions::N_OPTION_VALUES]; + int *mpAssociated; ///< variable to change to match mnValue + }; int mnCommandMode; int mnViewMode; ///< "Omniscient view" "Omniscient, no sensor tags" "Legal view" Index: simmath.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/simmath.h,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** simmath.h 16 Aug 2004 01:43:29 -0000 1.20 --- simmath.h 2 Oct 2004 22:41:32 -0000 1.21 *************** *** 59,66 **** public: float left,right,top,bottom; ! virtual float Width() {return right-left;} ! virtual float Height() {return top-bottom;} ! virtual float XCenter() {return 0.5f*(right+left);} ! virtual float YCenter() {return 0.5f*(top+bottom);} virtual void Offset(float dx, float dy) {left+=dx;right+=dx;bottom+=dy;top+=dy;} virtual void Set(float x1,float x2,float y1,float y2) {left=x1;right=x2;bottom=y1;top=y2;} --- 59,66 ---- public: float left,right,top,bottom; ! virtual float Width() const {return right-left;} ! virtual float Height() const {return top-bottom;} ! virtual float XCenter() const {return 0.5f*(right+left);} ! virtual float YCenter() const {return 0.5f*(top+bottom);} virtual void Offset(float dx, float dy) {left+=dx;right+=dx;bottom+=dy;top+=dy;} virtual void Set(float x1,float x2,float y1,float y2) {left=x1;right=x2;bottom=y1;top=y2;} Index: tcOptionsView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/tcOptionsView.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcOptionsView.h 5 Sep 2004 01:02:00 -0000 1.9 --- tcOptionsView.h 2 Oct 2004 22:41:32 -0000 1.10 *************** *** 1,4 **** ! /* ! ** Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. --- 1,6 ---- ! /** ! ** @file tcOptionsView.h ! */ ! /* Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 27,37 **** #include "wx/wx.h" ! #ifdef WIN32 ! #include "wx/msw/private.h" // for MS Windows specific definitions ! #endif #include "tcOptions.h" #include "tcXmlWindow.h" - #include "tcSound.h" // View and GUI for user options data --- 29,44 ---- #include "wx/wx.h" ! #include <osg/ref_ptr> ! #include "tcOptions.h" #include "tcXmlWindow.h" + namespace osg + { + class Texture2D; + } + + class tcOptions; + class tcSound; // View and GUI for user options data *************** *** 48,59 **** public: ! void AttachOptions(tcOptions *apOptions) {mpOptions=apOptions;} ! bool Init(void); ! int Draw(void); ! void DrawButton(Gdiplus::Graphics *apGraphics, int x, int y, int abOn); void OnLButtonDown(wxMouseEvent& event); bool ButtonContainingPoint(wxPoint point, int& rnOption, int& rnValue); ! tcOptionsView(wxWindow *parent, tcWindow *surfaceHost, const wxPoint& pos, const wxSize& size, const wxString& name = "OptionsView"); --- 55,65 ---- public: ! void Init(); ! void Draw(); ! void DrawButton(int x, int y, int abOn); void OnLButtonDown(wxMouseEvent& event); bool ButtonContainingPoint(wxPoint point, int& rnOption, int& rnValue); ! tcOptionsView(wxWindow *parent, const wxPoint& pos, const wxSize& size, const wxString& name = "OptionsView"); *************** *** 61,74 **** private: tcOptions *mpOptions; ! Gdiplus::Image *mpiBackground; ! Gdiplus::Image *mpiButtonOn; ! Gdiplus::Image *mpiButtonOff; ! Gdiplus::SolidBrush *mpBrush; ! Gdiplus::Font *mpFont; ! Gdiplus::Pen *mpPen; ! int mnBackgroundWidth,mnBackgroundHeight; ! int mnButtonWidth,mnButtonHeight; ! tsButtonInfo maButtonPosition[N_OPTIONS][N_OPTION_VALUES]; ! int mnXStart,mnYStart; }; --- 67,80 ---- private: tcOptions *mpOptions; ! ! osg::ref_ptr<osg::Texture2D> mpiButtonOn; ! osg::ref_ptr<osg::Texture2D> mpiButtonOff; ! ! float fontSize; ///< font size of options choice text ! int mnButtonWidth; ! int mnButtonHeight; ! tsButtonInfo maButtonPosition[tcOptions::N_OPTIONS][tcOptions::N_OPTION_VALUES]; ! int mnXStart; ! int mnYStart; }; |