void MapOverview::OnMotion(wxMouseEvent& event) { wxSleep(0.01); if ( event.LeftIsDown()==1 ) { int x=event.GetX(); int y=event.GetY(); if ( XYOverFeed(x,y)==1 ) { // Meta ta X,Y tha periexoun nees plirofories if ( set_point_flag == 1 ) { wxString tmp; tmp.clear() , tmp<<x , TextCurPosX->SetValue(tmp); tmp.clear() , tmp<<y , TextCurPosY->SetValue(tmp); //StatusBar1->SetStatusText(wxT("Set Start point")); SetAgentLocation(GetWorldHandler(),OURROBOT,x,y); wxCommandEvent nullevent; OnButtonExecuteClick(nullevent); } else if ( set_point_flag == 2 ) { wxString tmp; tmp.clear() , tmp<<x , TextTargetPosX->SetValue(tmp); tmp.clear() , tmp<<y , TextTargetPosY->SetValue(tmp); //StatusBar1->SetStatusText(wxT("Set End point")); SetAgentTargetLocation(GetWorldHandler(),OURROBOT,x,y); wxCommandEvent nullevent; OnButtonExecuteClick(nullevent); } else { SetObstacle(GetWorldHandler(),x,y,OBSTACLE_UNCERTAINTY) ; Refresh(); } set_point_flag=0; } } else if ( event.RightIsDown()==1 ) { int x=event.GetX(); int y=event.GetY(); if ( XYOverFeed(x,y)==1 ) { RemoveObstacle(GetWorldHandler(),x,y,OBSTACLE_UNCERTAINTY); Refresh(); } } return; }
void CheckMousePosition() { mouse = wxGetMouseState(); int x=mouse.GetX(); int y=mouse.GetY(); if ( XYOverFeed(x,y,live_feeds[2]) ) {} else if ( XYOverFeed(x,y,live_feeds[3]) ) {} }