Thread: [Gcblue-commits] gcb_wx/include/graphics tcButton.h,NONE,1.1 tcButtonConsole.h,NONE,1.1 tcwindow.h,1
Status: Alpha
Brought to you by:
ddcforge
From: <ddc...@us...> - 2004-01-03 00:45:17
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1:/tmp/cvs-serv548/include/graphics Modified Files: tcwindow.h Added Files: tcButton.h tcButtonConsole.h Log Message: briefing camera features --- NEW FILE: tcButton.h --- /* ** tcButton.h ** ** Copyright (C) 2003 Dewitt "Cole" Colclough (de...@tw...) ** 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 */ /** @file tcButton.h */ #ifndef _TCBUTTON_H_ #define _TCBUTTON_H_ #pragma once #include "tcWindow.h" #include <string> class tcSound; /** * Push button class derived from tcWindow. * This class uses the parent window's tc2DSurface so * CreateSurfaces() and DeleteSurfaces() should not be called. * tcButton must be constructed AFTER the parent's surfaces have * been created. */ class tcButton : public tcWindow { public: void AttachSound(tcSound *soundInterface) {sound = soundInterface;} virtual int Draw(); std::string GetCaption() const {return caption;} void SetCaption(std::string s) {caption = s;} void SetCommand(long cmd) {command = cmd;} void SetSoundEffect(int effect) {soundEffect = effect;} tcButton(tcWindow *parent, const wxPoint& pos, const wxSize& size, const wxString& name = "PushButton"); virtual ~tcButton(); protected: std::string caption; long command; bool isMouseOver; tcSound *sound; int soundEffect; float fontSize; Gdiplus::Pen *pen; Gdiplus::SolidBrush *brush; Gdiplus::Font *font; virtual void OnEnterWindow(wxMouseEvent& event); virtual void OnLButtonDown(wxMouseEvent& event); virtual void OnLButtonUp(wxMouseEvent& event); virtual void OnLeaveWindow(wxMouseEvent& event); }; #endif --- NEW FILE: tcButtonConsole.h --- /* ** tcButtonConsole.h ** ** Copyright (C) 2003 Dewitt "Cole" Colclough (de...@tw...) ** 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 _BUTTONCONSOLE_H_ #define _BUTTONCONSOLE_H_ #pragma once #include "wx/wx.h" #include "wx/msw/private.h" // for MS Windows specific definitions #include "tcSoundConsole.h" #include <vector> class tcButton; /** * Adds push buttons to tcSoundConsole */ class tcButtonConsole : public tcSoundConsole { public: virtual void AddButton(wxRect bounds, long command, std::string caption); void ButtonRequestedRedraw(wxCommandEvent& event); virtual int Draw(); virtual void SetActive(bool abActive); tcButtonConsole(wxWindow *parent, const wxPoint& pos, const wxSize& size, const wxString& name = "ButtonConsole"); virtual ~tcButtonConsole(); private: std::vector<tcButton*> buttons; DECLARE_EVENT_TABLE() }; #endif Index: tcwindow.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcwindow.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tcwindow.h 22 Dec 2003 02:32:37 -0000 1.12 --- tcwindow.h 3 Jan 2004 00:45:12 -0000 1.13 *************** *** 61,65 **** void Erase(void); void EraseOpaque(void); ! void Freeze(); wxBitmap* GetBitmap(); bool IsSurfaceModified(); --- 61,65 ---- void Erase(void); void EraseOpaque(void); ! virtual void Freeze(); wxBitmap* GetBitmap(); bool IsSurfaceModified(); *************** *** 75,78 **** --- 75,79 ---- void GetWindow(RECT& r) {r = mrectWindow;} void SetDisplayRegion(Gdiplus::RectF r); + tc2DGraphicsSurface* GetSurface() const {return mp2DSurface;} void MoveWindow(int ax, int ay); bool GetDrawDC(HDC& hdc); *************** *** 81,90 **** bool GetLowQualityGraphics(Gdiplus::Graphics*& rpGraphics); // GDI+ bool ReleaseGraphics(Gdiplus::Graphics* apGraphics); // GDI+ ! void SetActive(bool abActive); void SetRenderTexture(bool abState); void SetResizeable2D(bool abState) {resizeable2DSurface = abState;} ///< @see tcWindow::OnSize void SetSkipCount(unsigned skipCount); virtual void SetYMirror(int y) {yMirror = y;} ! void Thaw(); Gdiplus::RectF mrectDisplay; tcWindow(wxWindow *parent, --- 82,91 ---- bool GetLowQualityGraphics(Gdiplus::Graphics*& rpGraphics); // GDI+ bool ReleaseGraphics(Gdiplus::Graphics* apGraphics); // GDI+ ! virtual void SetActive(bool abActive); void SetRenderTexture(bool abState); void SetResizeable2D(bool abState) {resizeable2DSurface = abState;} ///< @see tcWindow::OnSize void SetSkipCount(unsigned skipCount); virtual void SetYMirror(int y) {yMirror = y;} ! virtual void Thaw(); Gdiplus::RectF mrectDisplay; tcWindow(wxWindow *parent, |