Update of /cvsroot/gcblue/gcb_wx/src/graphics
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9801/src/graphics
Modified Files:
tcContainerGui.cpp tcMapView.cpp
Log Message:
minor gui updates
Index: tcMapView.cpp
===================================================================
RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMapView.cpp,v
retrieving revision 1.40
retrieving revision 1.41
diff -C2 -d -r1.40 -r1.41
*** tcMapView.cpp 18 Dec 2005 18:48:17 -0000 1.40
--- tcMapView.cpp 24 Dec 2005 07:41:20 -0000 1.41
***************
*** 38,41 ****
--- 38,42 ----
#include "tcMapOverlay.h"
#include "tcDragStatus.h"
+ #include "tcTime.h"
#include <osg/Image>
***************
*** 646,654 ****
tcMapView::Thaw(); // unfreeze every Draw() call, works with Freeze() to stop resize flicker
! if ((mnScrollState >= SCROLL_DELAY) && (mnScrollState % 2 == 0))
! {
! ScrollMap(mfScrollDirection);
}
- else if (mnScrollState > 0) {mnScrollState++;}
// SetView called here to avoid artifacts from terrainview being out of sync with mapview
--- 647,657 ----
tcMapView::Thaw(); // unfreeze every Draw() call, works with Freeze() to stop resize flicker
! unsigned timeCount = tcTime::Get()->Get30HzCount();
!
! if (scrollActive && (timeCount - lastScrollTime > 1))
! {
! ScrollMap(scrollDirection);
! lastScrollTime = timeCount;
}
// SetView called here to avoid artifacts from terrainview being out of sync with mapview
***************
*** 2278,2282 ****
void tcTacticalMapView::OnLeaveWindow(wxMouseEvent& event)
{
! mnScrollState = 0;
isLButtonDown = false;
}
--- 2281,2285 ----
void tcTacticalMapView::OnLeaveWindow(wxMouseEvent& event)
{
! scrollActive = false;
isLButtonDown = false;
}
***************
*** 2521,2551 ****
if (mpointMouse.x <= nScrollBorder + 200)
{
! if (mnScrollState < SCROLL_DELAY) {mnScrollState++;} // allows for delay
! mfScrollDirection = 270.0f;
}
else if (mpointMouse.x >= mnWidth - nScrollBorder)
{
! if (mnScrollState < SCROLL_DELAY) {mnScrollState++;}
! mfScrollDirection = 90.0f;
}
else if (mpointMouse.y <= nScrollBorder)
{
! if (mnScrollState < SCROLL_DELAY) {mnScrollState++;}
! mfScrollDirection = 0.0f;
}
! else if (mpointMouse.y >= mnHeight - nScrollBorder)
{
! if (mnScrollState < SCROLL_DELAY) {mnScrollState++;}
! mfScrollDirection = 180.0f;
}
else
{
! mnScrollState = 0;
! }
! /*
! if (mbMapCmdActive) {
! mpointMouse = point;
}
! */
}
--- 2524,2556 ----
if (mpointMouse.x <= nScrollBorder + 200)
{
! scrollActive = true;
! scrollDirection = 270.0f;
}
else if (mpointMouse.x >= mnWidth - nScrollBorder)
{
! scrollActive = true;
! scrollDirection = 90.0f;
}
else if (mpointMouse.y <= nScrollBorder)
{
! scrollActive = true;
! scrollDirection = 0.0f;
}
! else if (mpointMouse.y >= mnHeight - nScrollBorder - 200) // -200 another similar hack
{
! scrollActive = true;
! scrollDirection = 180.0f;
}
else
{
! scrollActive = false;
! scrollDirection = 0.0f;
}
!
! if (scrollActive)
! {
! lastScrollTime = tcTime::Get()->Get30HzCount();
! }
!
}
***************
*** 2639,2643 ****
const wxPoint& pos, const wxSize& size,
const wxString& name) :
! tcMapView(parent, pos, size, name)
{
--- 2644,2651 ----
const wxPoint& pos, const wxSize& size,
const wxString& name) :
! tcMapView(parent, pos, size, name),
! scrollActive(false),
! lastScrollTime(0),
! scrollDirection(0.0)
{
***************
*** 2664,2668 ****
mpMapData = NULL;
mfFrameRate = 0;
! mnScrollState = 0;
maNavPointGeo.clear();
maNavPointScreen.clear();
--- 2672,2676 ----
mpMapData = NULL;
mfFrameRate = 0;
!
maNavPointGeo.clear();
maNavPointScreen.clear();
Index: tcContainerGui.cpp
===================================================================
RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcContainerGui.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** tcContainerGui.cpp 18 Dec 2005 18:48:17 -0000 1.4
--- tcContainerGui.cpp 24 Dec 2005 07:41:20 -0000 1.5
***************
*** 120,123 ****
--- 120,125 ----
tc3DWindow* tcContainerGui::parent = 0;
+ int tcContainerGui::windowLayer = 2;
+
void tcContainerGui::SetParent(tc3DWindow* win)
***************
*** 253,257 ****
isLButtonDown = true;
! if ((point.y <= 10) || (point.y >= mnHeight))
{
windowDragOn = true;
--- 255,259 ----
isLButtonDown = true;
! if ((point.y <= 15) || (point.y >= mnHeight))
{
windowDragOn = true;
***************
*** 416,420 ****
windowDragOn(false)
{
! SetBaseRenderBin(parent->GetBaseRenderBin() + 10);
TiXmlNode* root = config->FirstChild("Window");
--- 418,427 ----
windowDragOn(false)
{
!
! // put gui window on top
! SetBaseRenderBin(parent->GetBaseRenderBin() + windowLayer*10);
! wxWindow::Raise();
!
! windowLayer++;
TiXmlNode* root = config->FirstChild("Window");
***************
*** 485,488 ****
--- 492,497 ----
}
}
+
+ windowLayer--;
}
|