From: Francesco M. <fr...@us...> - 2006-12-17 10:47:11
|
Update of /cvsroot/wxlua/wxLua/apps/wxluacan/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv2227 Modified Files: cansim.cpp cansim.h Log Message: removed tabs in favour of spaces; use wxID_EXIT instead of ID_QUIT to get automatic stock icon on GTK2, minor cleaning Index: cansim.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluacan/src/cansim.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** cansim.cpp 12 Jun 2006 22:27:14 -0000 1.10 --- cansim.cpp 17 Dec 2006 10:47:07 -0000 1.11 *************** *** 43,56 **** wxlLuaCanCmd* GetCmdhMain() { return mainCan->GetCmdh(); } - // WDR: event table for MyFrame - BEGIN_EVENT_TABLE(MyFrame,wxFrame) - EVT_MENU(ID_QUIT, MyFrame::OnQuit) EVT_CLOSE(MyFrame::OnCloseWindow) ! EVT_TIMER(-1, MyFrame::OnTimer) EVT_MENU_RANGE(MenuOption_First, MenuOption_Last, MyFrame::OnOption) EVT_MENU( lua_script, MyFrame::OnRunScript) EVT_MENU( wxID_UNDO, MyFrame::OnUndo) EVT_MENU( wxID_REDO, MyFrame::OnRedo) END_EVENT_TABLE() --- 43,55 ---- wxlLuaCanCmd* GetCmdhMain() { return mainCan->GetCmdh(); } BEGIN_EVENT_TABLE(MyFrame,wxFrame) EVT_CLOSE(MyFrame::OnCloseWindow) ! EVT_TIMER(wxID_ANY, MyFrame::OnTimer) ! EVT_MENU_RANGE(MenuOption_First, MenuOption_Last, MyFrame::OnOption) EVT_MENU( lua_script, MyFrame::OnRunScript) EVT_MENU( wxID_UNDO, MyFrame::OnUndo) EVT_MENU( wxID_REDO, MyFrame::OnRedo) + EVT_MENU( wxID_EXIT, MyFrame::OnQuit) END_EVENT_TABLE() *************** *** 72,76 **** SetIcon(wxICON(wxLuaSmall)); ! m_interp = wxLuaState(NULL, wxID_ANY); m_interp.SetEventHandler( &wxGetApp() ); --- 71,75 ---- SetIcon(wxICON(wxLuaSmall)); ! m_interp = wxLuaState(NULL, wxID_ANY); m_interp.SetEventHandler( &wxGetApp() ); *************** *** 84,108 **** m_canvas->SetVirtualSize( 1000, 1000 ); m_canvas->SetScrollRate( 50, 50 ); ! m_canvas->SetBackgroundColour( wxColour( 223,234,251)); ! m_canvas->SetBackgroundBrush( wxBrush( wxColour( 30,174,171), wxCROSS_HATCH ) ); ! m_canvas->SetYaxis( false ); //true ); //defines the minimum x and y to show and the number of world units per pixel in x and y m_canvas->SetMappingUpp( m_xOrigin, m_yOrigin, m_xScale, m_yScale ); ! wxlCanObjRect* rect = new wxlCanObjRect( 170, 170,200, -120 ); ! rect->SetPen(*wxGREEN_PEN); ! rect->SetBrush( wxBrush( wxColour( 70, 124,71) ) ); ! m_canvas->AddObject( rect ); ! wxlCanObjCircle* circs = new wxlCanObjCircle( 0, 0, 20 ); ! circs->SetPen(*wxBLACK_PEN); ! circs->SetBrush( wxBrush( wxColour( 30,174,71) ) ); ! rect->AddObject( circs ); ! wxlCanObjCircle* circ = new wxlCanObjCircle( 140, 160,100 ); ! circ->SetPen(*wxRED_PEN); ! circ->SetBrush( wxBrush( wxColour( 30,74,71), wxFDIAGONAL_HATCH ) ); ! m_canvas->AddObject( circ ); m_timer = new wxTimer( this ); --- 83,107 ---- m_canvas->SetVirtualSize( 1000, 1000 ); m_canvas->SetScrollRate( 50, 50 ); ! m_canvas->SetBackgroundColour( wxColour( 223,234,251)); ! m_canvas->SetBackgroundBrush( wxBrush( wxColour( 30,174,171), wxCROSS_HATCH ) ); ! m_canvas->SetYaxis( false ); //true ); //defines the minimum x and y to show and the number of world units per pixel in x and y m_canvas->SetMappingUpp( m_xOrigin, m_yOrigin, m_xScale, m_yScale ); ! wxlCanObjRect* rect = new wxlCanObjRect( 170, 170,200, -120 ); ! rect->SetPen(*wxGREEN_PEN); ! rect->SetBrush( wxBrush( wxColour( 70, 124,71) ) ); ! m_canvas->AddObject( rect ); ! wxlCanObjCircle* circs = new wxlCanObjCircle( 0, 0, 20 ); ! circs->SetPen(*wxBLACK_PEN); ! circs->SetBrush( wxBrush( wxColour( 30,174,71) ) ); ! rect->AddObject( circs ); ! wxlCanObjCircle* circ = new wxlCanObjCircle( 140, 160,100 ); ! circ->SetPen(*wxRED_PEN); ! circ->SetBrush( wxBrush( wxColour( 30,74,71), wxFDIAGONAL_HATCH ) ); ! m_canvas->AddObject( circ ); m_timer = new wxTimer( this ); *************** *** 118,122 **** { wxMenu *file_menu = new wxMenu; ! file_menu->Append( ID_QUIT, _T("Quit..."), _T("Quit program") ); wxMenu *menuMap = new wxMenu; --- 117,121 ---- { wxMenu *file_menu = new wxMenu; ! file_menu->Append( wxID_EXIT, _T("Quit..."), _T("Quit program") ); wxMenu *menuMap = new wxMenu; *************** *** 170,174 **** void MyFrame::OnQuit( wxCommandEvent & ) { ! Close( true ); } --- 169,173 ---- void MyFrame::OnQuit( wxCommandEvent & ) { ! Close( true ); } *************** *** 221,225 **** case Axis_Vertic: m_yAxisReversed = !m_yAxisReversed; ! m_canvas->SetYaxis(m_yAxisReversed); break; --- 220,224 ---- case Axis_Vertic: m_yAxisReversed = !m_yAxisReversed; ! m_canvas->SetYaxis(m_yAxisReversed); break; *************** *** 236,243 **** case Object_AddCircle: { ! wxlCanObjCircle* circ = new wxlCanObjCircle( 140, 160,50 ); ! circ->SetPen(*wxGREEN_PEN); ! circ->SetBrush( wxBrush( wxColour(130,74,71), wxCROSSDIAG_HATCH ) ); ! m_canvas->AddObject( circ ); m_canvas->GetCmdh()->MoveObject( -1, 100,100 ); --- 235,242 ---- case Object_AddCircle: { ! wxlCanObjCircle* circ = new wxlCanObjCircle( 140, 160,50 ); ! circ->SetPen(*wxGREEN_PEN); ! circ->SetBrush( wxBrush( wxColour(130,74,71), wxCROSSDIAG_HATCH ) ); ! m_canvas->AddObject( circ ); m_canvas->GetCmdh()->MoveObject( -1, 100,100 ); *************** *** 260,276 **** _(""), _(""), ! _("lua"), ! _("*.lua") , 0, this ! ); ! if ( !fullPath.IsEmpty() && ::wxFileExists( fullPath ) ) ! { ! if ( 0 != m_interp.RunFile( fullPath ) ) ! { ! wxLogWarning( _("Error in Lua Script") ); ! } ! } } --- 259,275 ---- _(""), _(""), ! _("lua"), ! _("*.lua") , 0, this ! ); ! if ( !fullPath.IsEmpty() && ::wxFileExists( fullPath ) ) ! { ! if ( 0 != m_interp.RunFile( fullPath ) ) ! { ! wxLogWarning( _("Error in Lua Script") ); ! } ! } } *************** *** 307,311 **** } - void MyApp::OnLua( wxLuaEvent &event ) { --- 306,309 ---- Index: cansim.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluacan/src/cansim.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** cansim.h 5 Sep 2006 21:48:11 -0000 1.4 --- cansim.h 17 Dec 2006 10:47:07 -0000 1.5 *************** *** 27,32 **** //---------------------------------------------------------------------------- - #define ID_QUIT 101 - // IDs the menu commands enum --- 27,30 ---- *************** *** 78,82 **** wxTimer *m_timer; ! wxLuaState m_interp; private: --- 76,80 ---- wxTimer *m_timer; ! wxLuaState m_interp; private: *************** *** 93,97 **** void OnOption(wxCommandEvent& event); ! void OnRunScript(wxCommandEvent& event); double m_xScale; --- 91,95 ---- void OnOption(wxCommandEvent& event); ! void OnRunScript(wxCommandEvent& event); double m_xScale; *************** *** 108,111 **** --- 106,111 ---- extern wxlCan* GetCan(); extern wxlLuaCanCmd* GetCmdhMain(); + + //---------------------------------------------------------------------------- // MyApp |