[Gcblue-commits] gcb_wx/src/common tcOptionsView.cpp,1.10,1.11 tcSoundConsole.cpp,1.7,1.8
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2004-10-07 22:01:59
|
Update of /cvsroot/gcblue/gcb_wx/src/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12439/src/common Modified Files: tcOptionsView.cpp tcSoundConsole.cpp Log Message: Changes related to GDI+ replacement Index: tcSoundConsole.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/tcSoundConsole.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcSoundConsole.cpp 8 Aug 2004 00:31:33 -0000 1.7 --- tcSoundConsole.cpp 7 Oct 2004 22:01:45 -0000 1.8 *************** *** 23,33 **** #ifndef WX_PRECOMP #include "wx/wx.h" - #ifdef WIN32 - #include "wx/msw/private.h" // for MS Windows specific definitions - #endif #endif #include "tcSoundConsole.h" #include "tcSound.h" #ifdef _DEBUG --- 23,32 ---- #ifndef WX_PRECOMP #include "wx/wx.h" #endif #include "tcSoundConsole.h" + #include "tcConsoleBox.h" #include "tcSound.h" + #include "common/tinyxml.h" #ifdef _DEBUG *************** *** 35,66 **** #endif ! int tcSoundConsole::Draw() { ! if (Redraw()) { tcSound::Get()->PlayEffect(mnSoundEffect); } ! return tcConsole::Draw(); } ! /********************************************************************/ ! int tcSoundConsole::Print(const char* line) { tcSound::Get()->PlayEffect(mnSoundEffect); ! return tcConsole::Print(line); } ! /********************************************************************/ tcSoundConsole::tcSoundConsole(wxWindow *parent, const wxPoint& pos, const wxSize& size, const wxString& name) : ! tcConsole(parent, pos, size, name) { mnSoundEffect = SEFFECT_CONSOLE; } ! /********************************************************************/ ! tcSoundConsole::~tcSoundConsole() { } --- 34,129 ---- #endif ! void tcSoundConsole::Draw() { ! if (textBox->Redraw()) { tcSound::Get()->PlayEffect(mnSoundEffect); } ! DrawChildren(); ! ! DrawBorder(); ! ! HideUnusedObjects(); } ! tcConsoleBox* tcSoundConsole::GetConsoleBox() ! { ! wxASSERT(textBox); ! ! return textBox; ! } ! ! void tcSoundConsole::Print(const char* line) { tcSound::Get()->PlayEffect(mnSoundEffect); ! textBox->Print(line); } ! void tcSoundConsole::SetDelayedTextEffect(bool effectOn) ! { ! wxASSERT(textBox); ! ! textBox->SetDelayedTextEffect(effectOn); ! } ! ! void tcSoundConsole::SetLineSpacing(int anSpacing) ! { ! wxASSERT(textBox); ! ! textBox->SetLineSpacing(anSpacing); ! } ! ! void tcSoundConsole::SetWrap(int n) ! { ! wxASSERT(textBox); ! ! textBox->SetWrap(n); ! ! } ! ! tcSoundConsole::tcSoundConsole(wxWindow *parent, const wxPoint& pos, const wxSize& size, + const wxString& configFile, const wxString& name) : ! tcXmlWindow(parent, pos, size, configFile, name) { mnSoundEffect = SEFFECT_CONSOLE; + + if (!config) + { + fprintf(stderr, "tcSoundConsole::tcSoundConsole - Missing xml config\n"); + return; + } + + TiXmlNode* root = config->FirstChild("Window"); + if (!root) + { + fprintf(stderr, "tcSoundConsole::tcSoundConsole - Missing top level <Window> tag\n"); + return; + } + + TiXmlNode* current = root->FirstChild("TextBox"); + + int topMargin = 0; + int bottomMargin = 0; + if (current) + { + TiXmlElement* elt = current->ToElement(); + elt->Attribute("TopMargin", &topMargin); + elt->Attribute("BottomMargin", &bottomMargin); + } + + textBox = new tcConsoleBox(this, current); + textBox->SetActive(true); + textBox->SetSize(0, topMargin, + size.GetWidth(), size.GetHeight() - (topMargin + bottomMargin)); + } ! ! tcSoundConsole::~tcSoundConsole() ! { } Index: tcOptionsView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/tcOptionsView.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcOptionsView.cpp 2 Oct 2004 22:41:33 -0000 1.10 --- tcOptionsView.cpp 7 Oct 2004 22:01:45 -0000 1.11 *************** *** 91,95 **** maButtonPosition[i][j].mnTextX = xpos; maButtonPosition[i][j].mnTextY = ypos-mnButtonHeight+2; ! xpos += (int)(rstring.GetWidth()) + 1; maButtonPosition[i][j].mnButtonX = xpos; maButtonPosition[i][j].mnButtonY = ypos-mnButtonHeight-mnButtonHeight/6; --- 91,95 ---- maButtonPosition[i][j].mnTextX = xpos; maButtonPosition[i][j].mnTextY = ypos-mnButtonHeight+2; ! xpos += (int)(rstring.GetWidth()) + 5; maButtonPosition[i][j].mnButtonX = xpos; maButtonPosition[i][j].mnButtonY = ypos-mnButtonHeight-mnButtonHeight/6; |