[Gcblue-commits] gcb_wx/src/graphics tc3DWindow.cpp,1.20,1.21 tcEditBox.cpp,1.12,1.13 tcLauncherPopu
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2005-05-05 02:15:32
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv777/src/graphics Modified Files: tc3DWindow.cpp tcEditBox.cpp tcLauncherPopup.cpp tcStartView.cpp Log Message: Index: tcStartView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcStartView.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcStartView.cpp 29 Mar 2005 00:12:27 -0000 1.9 --- tcStartView.cpp 5 May 2005 02:14:52 -0000 1.10 *************** *** 98,102 **** wxString s = wxString::Format("%s Test Build", __DATE__); ! DrawTextR(s.c_str(), 85.0, 150.0, GetDefaultFont(), color, 24.0, LEFT_BASE_LINE); --- 98,102 ---- wxString s = wxString::Format("%s Test Build", __DATE__); ! DrawTextR(s.c_str(), 85.0, 180.0, GetDefaultFont(), color, 24.0, LEFT_BASE_LINE); Index: tcLauncherPopup.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcLauncherPopup.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcLauncherPopup.cpp 4 Mar 2005 00:46:17 -0000 1.5 --- tcLauncherPopup.cpp 5 May 2005 02:14:52 -0000 1.6 *************** *** 255,258 **** --- 255,259 ---- tcLauncher* launcher = GetLauncher(); wxASSERT(launcher); + if (launcher == 0) return; launcher->runToEnable_m = runToEnable; *************** *** 302,311 **** void tcLauncherPopup::OnDatumCommand(wxCommandEvent& event) { redraw = true; if (tcLauncher* launcher = GetLauncher()) { tcCommandQueue::Get()->GetUserInputForID("SetDatum", "Datum", ! std::vector<long>(platformId), launcherIdx); } } --- 303,316 ---- void tcLauncherPopup::OnDatumCommand(wxCommandEvent& event) { + static std::vector<long> idVect; + redraw = true; if (tcLauncher* launcher = GetLauncher()) { + idVect.clear(); + idVect.push_back(platformId); tcCommandQueue::Get()->GetUserInputForID("SetDatum", "Datum", ! idVect, launcherIdx); } } *************** *** 319,332 **** if (launcher->GetLauncherStatus() == tcLauncher::LAUNCHER_READY) { ! launcher->mnUncommitted -= 1; ! if (launcher->mnUncommitted < 0) ! { ! launcher->mnUncommitted = 0; // don't set new cmd here since this is an error case ! std::cerr << "Error - tcLauncherState::SetLaunch - negative uncommitted\n"; ! } ! //else ! //{ ! // commandObj.SetNewCommand(GetLauncherFlag(nLauncher)); ! //} } } --- 324,328 ---- if (launcher->GetLauncherStatus() == tcLauncher::LAUNCHER_READY) { ! launcher->SetLaunch(1); } } Index: tcEditBox.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcEditBox.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tcEditBox.cpp 29 Apr 2005 18:52:53 -0000 1.12 --- tcEditBox.cpp 5 May 2005 02:14:52 -0000 1.13 *************** *** 84,89 **** // draw cursor wxSize size; ! MeasureText(defaultFont.get(), fontSize, drawText, size); osg::Vec4 cursorColor(0, 0, 0, 1); --- 84,91 ---- // draw cursor + wxString textToCursor = wxString(drawText).Truncate(cursorPosition); wxSize size; ! //MeasureText(defaultFont.get(), fontSize, drawText, size); ! MeasureText(defaultFont.get(), fontSize, textToCursor.c_str(), size); osg::Vec4 cursorColor(0, 0, 0, 1); *************** *** 129,134 **** --- 131,138 ---- if (clearOnReturn) { + lastBuffer = mzBuffer; strcpy(mzBuffer, ""); strcpy(mzBufferHide, ""); + cursorPosition = 0; } } *************** *** 136,144 **** else if (keycode == WXK_BACK) { ! if (nLength == 0) return; ! mzBuffer[--nLength] = 0; mzBufferHide[nLength] = 0; textChanged = true; } else if (keycode == WXK_ESCAPE) { --- 140,167 ---- else if (keycode == WXK_BACK) { ! if (cursorPosition == 0) return; ! cursorPosition--; ! for (unsigned n=cursorPosition; n<(unsigned)nLength-1; n++) ! { ! mzBuffer[n] = mzBuffer[n+1]; ! mzBufferHide[n] = mzBufferHide[n+1]; ! } ! nLength--; ! mzBuffer[nLength] = 0; mzBufferHide[nLength] = 0; textChanged = true; } + else if (keycode == WXK_UP) + { + SetBuffer(lastBuffer.c_str()); + } + else if (keycode == WXK_LEFT) + { + if (cursorPosition > 0) cursorPosition--; + } + else if (keycode == WXK_RIGHT) + { + if (cursorPosition < (unsigned)nLength) cursorPosition++; + } else if (keycode == WXK_ESCAPE) { *************** *** 155,166 **** { long keycode = event.KeyCode(); ! int nLength = (int)strlen(mzBuffer); if (nLength >= MAX_EDITBOX_CHAR-1) {return;} ! mzBuffer[nLength] = (char)keycode; ! mzBufferHide[nLength] = '*'; ! mzBuffer[++nLength] = 0; mzBufferHide[nLength] = 0; textChanged = true; } --- 178,204 ---- { long keycode = event.KeyCode(); ! unsigned int nLength = strlen(mzBuffer); ! ! nLength++; ! if (nLength >= MAX_EDITBOX_CHAR-1) {return;} ! for (unsigned n=nLength-1; n>cursorPosition; n--) ! { ! mzBuffer[n] = mzBuffer[n-1]; ! mzBufferHide[n] = mzBuffer[n-1]; ! } ! ! mzBuffer[cursorPosition] = (char)keycode; ! mzBufferHide[cursorPosition] = '*'; ! ! ! mzBuffer[nLength] = 0; mzBufferHide[nLength] = 0; textChanged = true; + + cursorPosition++; + if (cursorPosition > (unsigned)nLength) cursorPosition = (unsigned)nLength; + } *************** *** 220,223 **** --- 258,263 ---- mzBufferHide[MAX_EDITBOX_CHAR-1] = 0; textChanged = true; + + cursorPosition = strlen(mzBuffer); } *************** *** 236,240 **** clearOnReturn(false), command(0), ! starText(false) { ref_count++; --- 276,281 ---- clearOnReturn(false), command(0), ! starText(false), ! cursorPosition(0) { ref_count++; Index: tc3DWindow.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DWindow.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** tc3DWindow.cpp 17 Apr 2005 22:35:31 -0000 1.20 --- tc3DWindow.cpp 5 May 2005 02:14:51 -0000 1.21 *************** *** 1592,1595 **** --- 1592,1596 ---- text->setLayout(osgText::Text::LEFT_TO_RIGHT); text->setFontResolution(32, 32); + //text->setFontResolution(64, 64); text->setText("UNINTIALIZED"); *************** *** 2018,2022 **** } ! defaultFont = osgText::readFontFile("fonts/times.ttf"); InitGraphicsObjects(); --- 2019,2024 ---- } ! //defaultFont = osgText::readFontFile("fonts/times.ttf"); ! defaultFont = osgText::readFontFile("fonts/arial.ttf"); InitGraphicsObjects(); |