[Gcblue-commits] gcb_wx/include/graphics tc3DWindow.h,1.6,1.7 tcHookInfo.h,1.2,1.3 tcPanel.h,1.1,1.2
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2004-10-29 02:51:25
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17989/include/graphics Modified Files: tc3DWindow.h tcHookInfo.h tcPanel.h tcPopupControl.h Log Message: A few more changes related to GDI+ replacement Index: tcPopupControl.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcPopupControl.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcPopupControl.h 5 Sep 2004 01:02:00 -0000 1.1 --- tcPopupControl.h 29 Oct 2004 02:50:43 -0000 1.2 *************** *** 29,40 **** #include "wx/wx.h" ! #ifdef WIN32 ! #include "wx/msw/private.h" // for MS Windows specific definitions ! #endif #include <string> #include <vector> #include "tcMenu.h" #include "tcPanel.h" ! #include "tcWindow.h" #include "commandlist.h" --- 29,38 ---- #include "wx/wx.h" ! #include <string> #include <vector> #include "tcMenu.h" #include "tcPanel.h" ! #include "tc3DWindow.h" #include "commandlist.h" *************** *** 57,61 **** }; ! class tcPopupControl : public tcWindow { public: --- 55,59 ---- }; ! class tcPopupControl : public tc3DWindow { public: *************** *** 71,77 **** void OnLButtonDown(wxMouseEvent& event); void OnMouseMove(wxMouseEvent& event); ! int Draw(); void UpdateRegions(); void InitMenu(); tcPopupControl(wxWindow *parent, const wxPoint& pos, const wxSize& size, --- 69,76 ---- void OnLButtonDown(wxMouseEvent& event); void OnMouseMove(wxMouseEvent& event); ! void Draw(); void UpdateRegions(); void InitMenu(); + tcPopupControl(wxWindow *parent, const wxPoint& pos, const wxSize& size, *************** *** 92,99 **** wxRect mrectMenuExtent; - Gdiplus::Pen *mpPen; - Gdiplus::SolidBrush *mpBrush; - Gdiplus::Font *mpFont; - WCHAR mzwchar[255]; // wide char array for string buffer bool mbShowDebug; --- 91,94 ---- Index: tcPanel.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcPanel.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcPanel.h 5 Sep 2004 01:02:00 -0000 1.1 --- tcPanel.h 29 Oct 2004 02:50:43 -0000 1.2 *************** *** 1,6 **** ! /* ! ** tcPanel.h ! ** ! ** Copyright (C) 2003 Dewitt Colclough (de...@tw...) ** All rights reserved. --- 1,6 ---- ! /** ! ** @file tcPanel.h ! */ ! /* Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 28,35 **** #include "wx/wx.h" ! #include "wx/msw/private.h" // for MS Windows specific definitions #include <string> #include <vector> ! #include "gdiplus.h" struct tsItemData --- 28,37 ---- #include "wx/wx.h" ! ! #include "simmath.h" ! #include "tc3DWindow.h" #include <string> #include <vector> ! struct tsItemData *************** *** 41,45 **** bool isSelected; bool isBold; ! Gdiplus::RectF rect; void Clear() --- 43,47 ---- bool isSelected; bool isBold; ! tcRect rect; void Clear() *************** *** 50,55 **** }; ! // note: this class mixes view/display with data, may have to be separated later ! class tcPanel { public: void AddItem(std::string caption, std::string command, --- 52,62 ---- }; ! /** ! * note: this class mixes view/display with data, may have to be separated later ! * Needs refactoring to update to coherent system just like tcMenu ! * @see tcMenu ! */ ! class tcPanel ! { public: void AddItem(std::string caption, std::string command, *************** *** 59,94 **** float x, float y, float width, float height, int param = -1); void BoldLastItem(); ! void Clear(void); ! void ClearSelected(void); ! int Draw(Gdiplus::Graphics *apGraphics); ! virtual void DrawItem(tsItemData *item, Gdiplus::Graphics *apGraphics); ! static void InitGdi(void); void InitWithDefaults(); ! tsItemData* ItemContainingPoint(Gdiplus::PointF point); ! bool UpdateSelection(Gdiplus::PointF point); ! static void ReleaseGdi(void); ! void SetAnchor(Gdiplus::PointF p) {anchor = p;} void SetTitle(std::string new_title) {title = new_title;} ! void UpdateBox(void); ! tcPanel(void); tcPanel(tcPanel* apParent); ! virtual ~tcPanel(void); private: std::string title; std::vector<tsItemData> panelItems; ! Gdiplus::PointF anchor; ///< reference point (upper left) for drawing menu float mfItemWidth, mfItemHeight; ! Gdiplus::RectF boundingBox; ///< rectangle encompassing entire control ! Gdiplus::RectF titleBox; ///< rectangle for title bool mbUpdateRegions; float border_width; ! static unsigned mnReferenceCount; ! static Gdiplus::Pen *mpPen; ///< GDI+ objects ! static Gdiplus::SolidBrush *mpBrush; ! static Gdiplus::Font *mpFont; ! static Gdiplus::Font *mpBoldFont; ! static Gdiplus::StringFormat stringformatleftalign; ! static WCHAR mzwchar[255]; ///< wide char array for string buffer }; --- 66,98 ---- float x, float y, float width, float height, int param = -1); void BoldLastItem(); ! void Clear(); ! void ClearSelected(); ! void Draw(); ! virtual void DrawItem(tsItemData *item); void InitWithDefaults(); ! tsItemData* ItemContainingPoint(const wxRealPoint& point); ! bool UpdateSelection(const wxRealPoint& point); ! static void ReleaseGdi(); ! void SetAnchor(const wxRealPoint& p) {anchor = p;} void SetTitle(std::string new_title) {title = new_title;} ! void UpdateBox(); ! static void SetParentWindow(tc3DWindow* win) {parentWindow = win;} ! ! static tc3DWindow* parentWindow; ///< workaround to make this work with 3D window system ! ! tcPanel(); tcPanel(tcPanel* apParent); ! virtual ~tcPanel(); private: std::string title; std::vector<tsItemData> panelItems; ! wxRealPoint anchor; ///< reference point (upper left) for drawing menu float mfItemWidth, mfItemHeight; ! tcRect boundingBox; ///< rectangle encompassing entire control ! tcRect titleBox; ///< rectangle for title bool mbUpdateRegions; float border_width; ! const float fontSize; }; Index: tcHookInfo.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcHookInfo.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcHookInfo.h 7 Oct 2004 22:01:12 -0000 1.2 --- tcHookInfo.h 29 Oct 2004 02:50:43 -0000 1.3 *************** *** 79,82 **** --- 79,83 ---- tnPoolIndex mnHookID; + //Gdiplus::Pen *mpPen; // GDI+ objects //Gdiplus::SolidBrush *mpBrush; Index: tc3DWindow.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DWindow.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tc3DWindow.h 21 Oct 2004 04:10:58 -0000 1.6 --- tc3DWindow.h 29 Oct 2004 02:50:42 -0000 1.7 *************** *** 167,171 **** void MoveWindow(int ax, int ay); wxRealPoint RelativeToScreen(float x, float y); - void SetBackground(UINT32 anColor); bool GetBlend(); --- 167,170 ---- *************** *** 178,181 **** --- 177,181 ---- virtual void SetActive(bool abActive); + void SetBackground(unsigned int color) {} void SetBackgroundDraw(bool state); void SetResizeable2D(bool abState) {resizeable2DSurface = abState;} ///< @see tc3DWindow::OnSize *************** *** 210,213 **** --- 210,218 ---- bool resizeable2DSurface; + float fontSize; ///< default normal font size + float fontSizeLarge; ///< default large font size + float fontSizeSmall; ///< default small font size + + osg::ref_ptr<osgText::Font> defaultFont; *************** *** 248,256 **** void SkipMouseEvent(wxMouseEvent& event); ///< adjusts position to parent frame long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); private: osg::ref_ptr<osg::Geode> root; ///< root node for drawables osg::ref_ptr<osg::Group> groupRoot; ///< root node for transforms ! osg::ref_ptr<osg::Switch> switchNode; ///< node to enable/disable window ! osg::ref_ptr<osg::MatrixTransform> transform; ///< transform node for 3D draw objects osg::ref_ptr<osgText::Text> referenceText; ///< text to make size measurements with --- 253,267 ---- void SkipMouseEvent(wxMouseEvent& event); ///< adjusts position to parent frame long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); + virtual void UpdatePositionAndSize(const wxPoint& pos, const wxSize& size); + private: + osg::ref_ptr<osg::MatrixTransform> transform; ///< transform node for 3D draw objects + osg::ref_ptr<osg::Switch> switchNode; ///< node to enable/disable window osg::ref_ptr<osg::Geode> root; ///< root node for drawables osg::ref_ptr<osg::Group> groupRoot; ///< root node for transforms ! osg::ref_ptr<osg::Geode> textRoot; ///< root node for text graphics ! osg::ref_ptr<osg::Geode> backgroundRoot; ///< root node for background graphics ! ! osg::ref_ptr<osgText::Text> referenceText; ///< text to make size measurements with |