[Gcblue-commits] gcb_wx/include/sim Game.h,1.48,1.49 tcMenu.h,1.6,1.7
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2004-10-29 02:51:26
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17989/include/sim Modified Files: Game.h tcMenu.h Log Message: A few more changes related to GDI+ replacement Index: Game.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/Game.h,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** Game.h 21 Oct 2004 04:10:59 -0000 1.48 --- Game.h 29 Oct 2004 02:50:43 -0000 1.49 *************** *** 217,220 **** --- 217,222 ---- bool enableGraphicsEngine; bool enableTacticalMap; + bool togglePopup; ///< true to toggle popup menu state + wxPoint rightButtonPoint; ///< position of mouse at last right button event void Activate(); *************** *** 272,275 **** --- 274,278 ---- void SynchTimeAcceleration(); void Toggle3DSize(); + void TogglePopup(); void UninitGame(); ///< uninitializes components initialized by InitGame() void Update3DSize(); Index: tcMenu.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcMenu.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcMenu.h 17 Aug 2004 02:22:56 -0000 1.6 --- tcMenu.h 29 Oct 2004 02:50:43 -0000 1.7 *************** *** 1,4 **** ! /* ! ** Copyright (C) 2003 Dewitt Colclough (de...@tw...) ** All rights reserved. --- 1,6 ---- ! /** ! ** @file tcMenu.h ! */ ! /* Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 27,34 **** #include "wx/wx.h" ! #include "wx/msw/private.h" //for MS Windows specific definitions #include <string> #include <vector> ! #include "gdiplus.h" class tcMenu; --- 29,38 ---- #include "wx/wx.h" ! #include "simmath.h" ! #include "tc3DWindow.h" ! #include <string> #include <vector> ! class tcMenu; *************** *** 43,47 **** bool mbTop; bool mbBottom; ! Gdiplus::RectF mrect; tcMenu *mpSubMenu; --- 47,51 ---- bool mbTop; bool mbBottom; ! tcRect mrect; tcMenu *mpSubMenu; *************** *** 54,58 **** /** ! * note: this class mixes view/display with data, may have to be separated later */ class tcMenu --- 58,64 ---- /** ! * Note: this class mixes view/display with data, may have to be separated later ! * This class should be converted to a tc3DWindow (or something more logical). ! * The current code is a hack to get this to work with new 3D window system. */ class tcMenu *************** *** 62,95 **** void AddItem(std::string caption, std::string command, int param = -1); void AddItemUI(std::string caption, std::string callback, std::string input, int param = -1); ! void BeginSubMenu(void); ! void Clear(void); ! void ClearSelected(void); ! int Draw(Gdiplus::Graphics *apGraphics); ! virtual void DrawItem(tsMenuData *apMD, Gdiplus::Graphics *apGraphics); ! void EndSubMenu(void); ! static void InitGdi(void); ! tsMenuData* ItemContainingPoint(Gdiplus::PointF point); ! bool UpdateSelection(Gdiplus::PointF point); ! static void ReleaseGdi(void); ! void SetAnchor(Gdiplus::PointF p) {anchor = p;} ! void UpdateRegions(Gdiplus::Graphics *apGraphics); ! tcMenu(void); tcMenu(tcMenu* apParent); ! virtual ~tcMenu(void); private: std::vector<tsMenuData> maMenuData; tcMenu *mpParent; tcMenu *mpCurrent; // current menu level to add items to ! Gdiplus::PointF anchor; // reference point (upper left) for drawing menu float mfItemWidth, mfItemHeight; ! Gdiplus::RectF menubox; // rectangle encompassing entire menu bool mbUpdateRegions; - - static unsigned mnReferenceCount; - static Gdiplus::Pen *mpPen; // GDI+ objects - static Gdiplus::SolidBrush *mpBrush; - static Gdiplus::Font *mpFont; - static WCHAR mzwchar[255]; // wide char array for string buffer }; --- 68,101 ---- void AddItem(std::string caption, std::string command, int param = -1); void AddItemUI(std::string caption, std::string callback, std::string input, int param = -1); ! void BeginSubMenu(); ! void Clear(); ! void ClearSelected(); ! void Draw(); ! virtual void DrawItem(tsMenuData* apMD); ! void EndSubMenu(); ! tsMenuData* ItemContainingPoint(const wxRealPoint& point); ! bool UpdateSelection(const wxRealPoint& point); ! ! void SetAnchor(const wxRealPoint& p) {anchor = p;} ! void UpdateRegions(); ! ! static void SetParentWindow(tc3DWindow* win) {parentWindow = win;} ! ! static tc3DWindow* parentWindow; ///< workaround to make this work with 3D window system ! ! tcMenu(); tcMenu(tcMenu* apParent); ! virtual ~tcMenu(); ! private: std::vector<tsMenuData> maMenuData; tcMenu *mpParent; tcMenu *mpCurrent; // current menu level to add items to ! wxRealPoint anchor; // reference point (upper left) for drawing menu float mfItemWidth, mfItemHeight; ! const float fontSize; ! tcRect menubox; // rectangle encompassing entire menu bool mbUpdateRegions; }; |