Update of /cvsroot/gcblue/gcb_wx/src/graphics
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3870/src/graphics
Modified Files:
tc3DViewer.cpp tc3DWindow.cpp tcConsoleBox.cpp
Added Files:
tcBriefingView.cpp
Log Message:
Updates for wxWidgets 2.6.1 compatibility
Index: tcConsoleBox.cpp
===================================================================
RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcConsoleBox.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** tcConsoleBox.cpp 10 Sep 2005 21:47:38 -0000 1.15
--- tcConsoleBox.cpp 14 Sep 2005 01:33:24 -0000 1.16
***************
*** 33,36 ****
--- 33,39 ----
#endif
+ using std::min;
+ using std::max;
+
***************
*** 175,179 ****
if (lineOffset + MIN_LINES_DISPLAY > nLines)
{
! nLines = min(nLines, MIN_LINES_DISPLAY);
}
else
--- 178,182 ----
if (lineOffset + MIN_LINES_DISPLAY > nLines)
{
! nLines = min(nLines, (unsigned int)MIN_LINES_DISPLAY);
}
else
Index: tc3DViewer.cpp
===================================================================
RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DViewer.cpp,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** tc3DViewer.cpp 10 Sep 2005 21:47:38 -0000 1.26
--- tc3DViewer.cpp 14 Sep 2005 01:33:24 -0000 1.27
***************
*** 76,79 ****
--- 76,81 ----
#endif
+ using std::min;
+ using std::max;
BEGIN_EVENT_TABLE(tc3DViewer, wxWindow)
Index: tc3DWindow.cpp
===================================================================
RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DWindow.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** tc3DWindow.cpp 10 Sep 2005 21:47:38 -0000 1.25
--- tc3DWindow.cpp 14 Sep 2005 01:33:24 -0000 1.26
***************
*** 57,61 ****
BEGIN_EVENT_TABLE(tc3DWindow, wxWindow)
EVT_PAINT(tc3DWindow::OnPaint)
! EVT_NC_PAINT(tc3DWindow::OnPaint)
EVT_ERASE_BACKGROUND(tc3DWindow::OnEraseBackground)
EVT_MOVE(tc3DWindow::OnMove)
--- 57,61 ----
BEGIN_EVENT_TABLE(tc3DWindow, wxWindow)
EVT_PAINT(tc3DWindow::OnPaint)
! EVT_NC_PAINT(tc3DWindow::OnNcPaint)
EVT_ERASE_BACKGROUND(tc3DWindow::OnEraseBackground)
EVT_MOVE(tc3DWindow::OnMove)
***************
*** 123,126 ****
--- 123,131 ----
}
+ void tc3DWindow::OnNcPaint(wxNcPaintEvent& event)
+ {
+ wxPaintDC dc(this);
+ }
+
/**
* Do nothing for OnPaint event.
--- NEW FILE: tcBriefingView.cpp ---
/**
** @file tcBriefingView.cpp
*/
/* Copyright (C) 2005 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
*/
#include "stdwx.h"
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
#include "tcBriefingView.h"
#include "tcSimPythonInterface.h"
#include "tcScenarioInterface.h"
#include "common/tinyxml.h"
#include "tcUserInfo.h"
BEGIN_EVENT_TABLE(tcBriefingView, tcXmlWindow)
END_EVENT_TABLE()
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
using scriptinterface::tcSimPythonInterface;
using scriptinterface::tcScenarioInterface;
void tcBriefingView::Draw()
{
tcScenarioInterface* scenarioInterface = tcSimPythonInterface::Get()->GetScenarioInterface();
wxASSERT(scenarioInterface);
osg::Vec4 color(0.6f, 1, 0.6f, 1);
int userAlliance = tcUserInfo::Get()->GetOwnAlliance();
const std::string& briefingText = scenarioInterface->GetSimpleBriefing(userAlliance);
float x = 55.0f;
float y = 150.0f;
float fontSize;
if (mnWidth > 1200)
{
fontSize = 18.0f;
}
else if (mnWidth > 1000)
{
fontSize = 16.0f;
}
else
{
fontSize = 14.0f;
}
DrawTextR(briefingText.c_str(), x, y, defaultFont.get(), color, fontSize,
LEFT_BASE_LINE);
DrawChildren();
HideUnusedObjects();
}
/**
* @param surfaceHost tcWindow to share surface of
*/
tcBriefingView::tcBriefingView(wxWindow *parent,
const wxPoint& pos, const wxSize& size, const wxString& name)
: tcXmlWindow(parent, pos, size, "xml/briefing_view.xml", name)
{
if (config == 0)
{
fprintf(stderr, "tcBriefingView::tcBriefingView - NULL xml config node\n");
return;
}
/*
TiXmlNode* root = config->FirstChild("Window");
if (!root)
{
std::cerr << "tcBriefingView::tcBriefingView - Missing top level <Window> tag\n";
return;
}
*/
}
tcBriefingView::~tcBriefingView()
{
}
|