[Gcblue-commits] gcb_wx/include/graphics tcNumberWidget.h,NONE,1.1
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2004-12-28 00:42:44
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11018/include/graphics Added Files: tcNumberWidget.h Log Message: --- NEW FILE: tcNumberWidget.h --- /** ** @file tcNumberWidget.h */ /* Copyright (C) 2004 Dewitt 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 _TCNUMBERWIDGET_H_ #define _TCNUMBERWIDGET_H_ #if _MSC_VER > 1000 #pragma once #endif #include "tc3DWindow.h" #include <string> namespace osg { class Texture2D; } class TiXmlNode; /** * GUI widget class derived from tc3DWindow. * Used to adjust and display float parameter graphically */ class tcNumberWidget : public tc3DWindow { public: virtual void Draw(); std::string GetCaption() const {return caption;} void SetBackgroundAlpha(float val); void SetCaption(std::string s) {caption = s;} void SetFontSize(float size); void SetSendRedraw(bool state); void SetSoundEffect(int effect) {soundEffect = effect;} tcNumberWidget(float& param, tc3DWindow *parent, const wxPoint& pos, const wxSize& size, const wxString& name = "NumberWidget"); virtual ~tcNumberWidget(); protected: float& val; ///< reference to parameter to adjust std::string caption; bool isMouseOver; int soundEffect; float fontSize; float backgroundAlpha; ///< transparency value for solid color background bool sendRedraw; bool autoChange; ///< true if mouse is down long enough, val will auto increment/decrement float changeIncrement; bool leftButtonDown; ///< true if left button is down unsigned int buttonDownTime; virtual void OnEnterWindow(wxMouseEvent& event); virtual void OnLButtonDown(wxMouseEvent& event); virtual void OnLButtonUp(wxMouseEvent& event); virtual void OnLeaveWindow(wxMouseEvent& event); virtual void OnRButtonDown(wxMouseEvent& event); void SendRedraw(); void UpdateAutoChange(); }; #endif |