Thread: [Gcblue-commits] gcb_wx/include/graphics tcDatabaseViewer.h,NONE,1.1 tc3DWindow.h,1.24,1.25 tcButton
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2006-03-27 01:08:36
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18413/include/graphics Modified Files: tc3DWindow.h tcButton.h tcDatabaseInfoWindow.h tcXmlWindow.h Added Files: tcDatabaseViewer.h Log Message: Index: tcXmlWindow.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcXmlWindow.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcXmlWindow.h 22 Mar 2006 01:23:29 -0000 1.7 --- tcXmlWindow.h 27 Mar 2006 01:08:30 -0000 1.8 *************** *** 1,5 **** ! /** @file tcXmlWindow.h */ ! /* ! ** Copyright (C) 2003 Dewitt Colclough (de...@gc...) ** All rights reserved. --- 1,6 ---- ! /** ! ** @file tcXmlWindow.h ! */ ! /* Copyright (C) 2003 Dewitt Colclough (de...@gc...) ** All rights reserved. *************** *** 41,44 **** --- 42,48 ---- { public: + /// find first button with matching command and set force disable state + void SetButtonDisable(long command, bool state); + /// find first button with matching command and change caption void SetButtonCaption(long command, const std::string& caption); Index: tc3DWindow.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DWindow.h,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** tc3DWindow.h 22 Mar 2006 01:23:28 -0000 1.24 --- tc3DWindow.h 27 Mar 2006 01:08:30 -0000 1.25 *************** *** 2,6 **** ** @file tc3DWindow.h */ ! /* Copyright (C) 2004 Dewitt Colclough (de...@gc...) ** All rights reserved. --- 2,6 ---- ** @file tc3DWindow.h */ ! /* Copyright (C) 2004-2006 Dewitt Colclough (de...@gc...) ** All rights reserved. *************** *** 54,62 **** } - //namespace osgText - //{ - // class Font; - // class Text; - //} class tcGraphicsEngine; --- 54,57 ---- *************** *** 197,201 **** virtual void SetActive(bool abActive); ! void SetBackground(unsigned int color) {} void SetBackgroundDraw(bool state); void SetResizeable2D(bool abState) {resizeable2DSurface = abState;} ///< @see tc3DWindow::OnSize --- 192,196 ---- virtual void SetActive(bool abActive); ! void SetBackgroundColor(const osg::Vec4& color); void SetBackgroundDraw(bool state); void SetResizeable2D(bool abState) {resizeable2DSurface = abState;} ///< @see tc3DWindow::OnSize *************** *** 222,225 **** --- 217,221 ---- const int geometryRenderBin; + osg::Vec4 backgroundColor; Index: tcDatabaseInfoWindow.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcDatabaseInfoWindow.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcDatabaseInfoWindow.h 23 Mar 2006 01:12:12 -0000 1.1 --- tcDatabaseInfoWindow.h 27 Mar 2006 01:08:30 -0000 1.2 *************** *** 55,65 **** void SetDatabaseObject(long id); ! static void SetParent(tc3DWindow* win); ! tcDatabaseInfoWindow(const wxPoint& pos, const wxString& configFile = "xml/database_info.xml", ! const wxString& name = "DatabaseInfo"); virtual ~tcDatabaseInfoWindow(); --- 55,68 ---- void SetDatabaseObject(long id); ! void SetDragable(bool state); static void SetParent(tc3DWindow* win); ! ! ! tcDatabaseInfoWindow(const wxPoint& pos, const wxString& configFile = "xml/database_info.xml", ! const wxString& name = "DatabaseInfo", ! tc3DWindow* hostParent = parent); virtual ~tcDatabaseInfoWindow(); *************** *** 72,75 **** --- 75,79 ---- bool windowDragOn; wxPoint windowDragPoint; + bool isDragable; ///< true if window can be dragged (moved) void DrawDatabaseInfo(); *************** *** 79,88 **** private: bool destroy; ///< workaround to delay destruction of window to safe time ! long objId; ///< id of obj or track to display info for std::string databaseClassName; ///< class name of database object, empty if not looked up yet static tc3DWindow* parent; database::tcDatabaseObject* GetDatabaseObject(); DECLARE_EVENT_TABLE() --- 83,97 ---- private: bool destroy; ///< workaround to delay destruction of window to safe time ! ! long objId; ///< id of obj or track to display info for std::string databaseClassName; ///< class name of database object, empty if not looked up yet + std::vector<osg::ref_ptr<osg::Texture2D> > imageList; ///< images for this db object, loaded as textures + size_t currentImageIdx; ///< index of current image displayed (to cycle through available images) + unsigned int imageTime; ///< time at which current image was first displayed static tc3DWindow* parent; database::tcDatabaseObject* GetDatabaseObject(); + void LoadImageList(); DECLARE_EVENT_TABLE() --- NEW FILE: tcDatabaseViewer.h --- /** ** @file tcDatabaseViewer.h */ /* Copyright (C) 2006 Dewitt Colclough (de...@gc...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _DATABASEVIEWER_H_ #define _DATABASEVIEWER_H_ #if _MSC_VER > 1000 #pragma once #endif #include "wx/wx.h" #include "wx/dir.h" #include <osg/ref_ptr> #include <osg/Vec4> #include "tcXmlWindow.h" #include "tcSound.h" class tcDatabaseInfoWindow; namespace osg { class Texture2D; } /** * Class to browse and view database info on various platforms */ class tcDatabaseViewer : public tcXmlWindow { struct BrowseItem { std::string className; ///< dir name or filename without the .py extension struct { float x; float y; float width; float height; } drawBox; ///< location to draw to screen osg::Vec4 color; enum {OFF = 0, OVER = 1, ON = 2} drawState; }; public: void Draw(); void OnLButtonDown(wxMouseEvent& event); void OnMouseMove(wxMouseEvent& event); void SetClassificationMask(unsigned int mask); tcDatabaseViewer(wxWindow *parent, const wxPoint& pos, const wxSize& size, const wxString& name = "DatabaseViewer"); virtual ~tcDatabaseViewer(); private: unsigned int classificationMask; ///< mask for current platform type on browse list long displayId; ///< id of current platform displayed std::string displayName; ///< class name of current platform displayed std::vector<BrowseItem> browseInfo; tcDatabaseInfoWindow* databaseInfoWindow; const wxRealPoint basePosition; wxPoint mousePosition; void BrowseSurface(wxCommandEvent& event); void BrowseSub(wxCommandEvent& event); void BrowseAir(wxCommandEvent& event); void BrowseHelo(wxCommandEvent& event); void BrowseLand(wxCommandEvent& event); void BrowseMissile(wxCommandEvent& event); void BrowseTorpedo(wxCommandEvent& event); void BrowseBallistic(wxCommandEvent& event); void BuildBrowseInfo(); void InitializeButtons(); void InitializeDatabaseInfoWindow(); bool ProcessMouseClick(std::vector<BrowseItem>& info, wxPoint pos); void UpdateDrawInfo(std::vector<BrowseItem>& info); DECLARE_EVENT_TABLE() }; #endif Index: tcButton.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcButton.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** tcButton.h 22 Mar 2006 01:23:28 -0000 1.14 --- tcButton.h 27 Mar 2006 01:08:30 -0000 1.15 *************** *** 52,55 **** --- 52,56 ---- const std::string& overOffImageName, const std::string& overOnImageName); + virtual void SetActive(bool abActive); void SetBackgroundAlpha(float val); void SetCaption(const std::string& s) {caption = s;} *************** *** 58,61 **** --- 59,63 ---- const osg::Vec4& on_color); void SetFontSize(float val); + void SetForceDisable(bool state); void SetOn(bool state) {isButtonOn = state;} void SetSendRedraw(bool state) {sendRedraw = state;} *************** *** 76,80 **** bool sendRedraw; ///< true to send redraw message to parent on button state change float backgroundAlpha; ///< transparency value for solid color background ! osg::Vec4 offColor; osg::Vec4 overColor; --- 78,83 ---- bool sendRedraw; ///< true to send redraw message to parent on button state change float backgroundAlpha; ///< transparency value for solid color background ! bool forceDisable; ///< if true then do not enable button ! osg::Vec4 offColor; osg::Vec4 overColor; |