From: John L. <jr...@us...> - 2005-12-22 18:42:45
|
Update of /cvsroot/wxlua/wxLua/apps/wxluaedit/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19516/wxLua/apps/wxluaedit/src Modified Files: wxledit.cpp wxledit.h wxluaedit.cpp Log Message: Removed the wxLuaInterpreter - all functions transferred to the wxLuaState wxLuaInterpreter is typedefed to wxLuaState temporarily Index: wxledit.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluaedit/src/wxledit.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** wxledit.h 30 Nov 2005 23:52:30 -0000 1.2 --- wxledit.h 22 Dec 2005 18:42:34 -0000 1.3 *************** *** 16,19 **** --- 16,21 ---- #endif + #include "wxlua/include/wxldefs.h" + class WXDLLEXPORT wxMenu; class WXDLLEXPORT wxKeyEvent; *************** *** 21,26 **** class WXDLLEXPORT wxSplitterWindow; class WXDLLEXPORT wxToolBar; ! class WXDLLEXPORT wxLuaInterpreter; ! class WXDLLEXPORT wxLuaEvent; #include "wx/stedit/stedit.h" --- 23,28 ---- class WXDLLEXPORT wxSplitterWindow; class WXDLLEXPORT wxToolBar; ! class WXDLLIMPEXP_WXLUA wxLuaState; ! class WXDLLIMPEXP_WXLUA wxLuaEvent; #include "wx/stedit/stedit.h" *************** *** 79,97 **** // Get the interpreter this shell uses ! wxLuaInterpreter *GetLuaInterpreter() const { return m_luaInterpreter; } // Set this shell to use another interpreter, will delete it if !is_static // note shell has built in function ! virtual void SetLuaInterpreter(wxLuaInterpreter *interp, bool is_static); // Used to create/recreate local interpreter ! // Can be subclassed to use your own interpreter derived from a wxLuaInterpreter // or a new interpreter can be set in by catching the wxEVT_LUASHELL_wxLUA_CREATION // wxLuaEvent that's sent with this control's id and *this as the GetEventObject // the preferred window ID is in event.GetExtraLong() ! // if you call event.SetLuaInterpreter(new wxLuaInterpreter(...)) // and event.SetInt(1 for static interpreter or 0 for not static) // then SetLuaIntpreter(event.GetLuaInterpreter(), event.GetInt() == 1) // is called. You'll probably want to set the lua interpreter's eventhandler // to this as well as it's win id ! virtual bool RecreateLuaInterpreter(wxEvtHandler *evtHandler, int win_id); // Run a string, append the string if append_text --- 81,99 ---- // Get the interpreter this shell uses ! wxLuaState GetwxLuaState() const { return m_wxlState; } // Set this shell to use another interpreter, will delete it if !is_static // note shell has built in function ! virtual void SetwxLuaState(const wxLuaState& wxlState, bool is_static); // Used to create/recreate local interpreter ! // Can be subclassed to use your own interpreter derived from a wxLuaState // or a new interpreter can be set in by catching the wxEVT_LUASHELL_wxLUA_CREATION // wxLuaEvent that's sent with this control's id and *this as the GetEventObject // the preferred window ID is in event.GetExtraLong() ! // if you call event.SetwxLuaState(wxLuaState(...)) // and event.SetInt(1 for static interpreter or 0 for not static) // then SetLuaIntpreter(event.GetLuaInterpreter(), event.GetInt() == 1) // is called. You'll probably want to set the lua interpreter's eventhandler // to this as well as it's win id ! virtual bool RecreatewxLuaState(wxEvtHandler *evtHandler, int win_id); // Run a string, append the string if append_text *************** *** 103,108 **** protected: ! wxLuaInterpreter *m_luaInterpreter; ! bool m_luaInterpreter_static; private: --- 105,110 ---- protected: ! wxLuaState m_wxlState; ! bool m_wxlstate_static; private: *************** *** 189,207 **** // Get the interpreter this shell uses ! wxLuaInterpreter *GetLuaInterpreter() const { return m_luaInterpreter; } // Set this shell to use another interpreter, will delete it if !is_static // note shell has built in function ! virtual void SetLuaInterpreter(wxLuaInterpreter *interp, bool is_static); // Used to create/recreate local interpreter ! // Can be subclassed to use your own interpreter derived from a wxLuaInterpreter // or a new interpreter can be set in by catching the wxEVT_LUASHELL_wxLUA_CREATION // wxLuaEvent that's sent with this control's id and *this as the GetEventObject // the preferred window ID is in event.GetExtraLong() ! // if you call event.SetLuaInterpreter(new wxLuaInterpreter(...)) // and event.SetInt(1 for static interpreter or 0 for not static) // then SetLuaIntpreter(event.GetLuaInterpreter(), event.GetInt() == 1) // is called. You'll probably want to set the lua interpreter's eventhandler // to this as well as it's win id ! virtual bool RecreateLuaInterpreter(wxEvtHandler *evtHandler, int win_id); virtual void OutputLuaEvent(wxLuaEvent &event, wxLuaShell *outputWin); --- 191,209 ---- // Get the interpreter this shell uses ! wxLuaState GetwxLuaState() const { return m_wxlState; } // Set this shell to use another interpreter, will delete it if !is_static // note shell has built in function ! void SetwxLuaState(const wxLuaState& wxlState, bool is_static); // Used to create/recreate local interpreter ! // Can be subclassed to use your own interpreter derived from a wxLuaState // or a new interpreter can be set in by catching the wxEVT_LUASHELL_wxLUA_CREATION // wxLuaEvent that's sent with this control's id and *this as the GetEventObject // the preferred window ID is in event.GetExtraLong() ! // if you call event.SetLuaInterpreter(wxLuaState(...)) // and event.SetInt(1 for static interpreter or 0 for not static) // then SetLuaIntpreter(event.GetLuaInterpreter(), event.GetInt() == 1) // is called. You'll probably want to set the lua interpreter's eventhandler // to this as well as it's win id ! virtual bool RecreatewxLuaState(wxEvtHandler *evtHandler, int win_id); virtual void OutputLuaEvent(wxLuaEvent &event, wxLuaShell *outputWin); *************** *** 234,239 **** int sizeFlags = wxSIZE_AUTO); ! wxLuaInterpreter *m_luaInterpreter; ! bool m_luaInterpreter_static; wxSplitterWindow *m_splitter; --- 236,241 ---- int sizeFlags = wxSIZE_AUTO); ! wxLuaState m_wxlState; ! bool m_wxlstate_static; wxSplitterWindow *m_splitter; Index: wxluaedit.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluaedit/src/wxluaedit.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** wxluaedit.cpp 24 Nov 2005 06:38:17 -0000 1.1 --- wxluaedit.cpp 22 Dec 2005 18:42:34 -0000 1.2 *************** *** 1,5 **** ///////////////////////////////////////////////////////////////////////////// // Name: wxluaedit.cpp ! // Purpose: wxLuaEditor app // Author: John Labenski // Modified by: --- 1,5 ---- ///////////////////////////////////////////////////////////////////////////// // Name: wxluaedit.cpp ! // Purpose: wxLuaEditor app // Author: John Labenski // Modified by: *************** *** 62,66 **** virtual bool HandleMenuEvent( wxCommandEvent &event ); void OnAbout(wxCommandEvent& event); ! wxLuaConsole *m_luaConsole; --- 62,66 ---- virtual bool HandleMenuEvent( wxCommandEvent &event ); void OnAbout(wxCommandEvent& event); ! wxLuaConsole *m_luaConsole; *************** *** 99,104 **** frame->m_luaConsole->PopulateToolBar(frame->GetToolBar(), LUACON_TB_LUA); frame->m_luaConsole->SetToolBar(frame->GetToolBar()); ! frame->m_luaConsole->SetMenuBar(frame->GetMenuBar()); ! // The size of the frame isn't set when the splitter is created, resize it wxSplitterWindow *splitWin = frame->m_luaConsole->GetSplitterWin(); --- 99,104 ---- frame->m_luaConsole->PopulateToolBar(frame->GetToolBar(), LUACON_TB_LUA); frame->m_luaConsole->SetToolBar(frame->GetToolBar()); ! frame->m_luaConsole->SetMenuBar(frame->GetMenuBar()); ! // The size of the frame isn't set when the splitter is created, resize it wxSplitterWindow *splitWin = frame->m_luaConsole->GetSplitterWin(); *************** *** 120,124 **** bool wxLuaEditorFrame::Create(const wxString& title, const wxPoint& pos, const wxSize& size, long frame_style) ! { m_luaConsole = NULL; --- 120,124 ---- bool wxLuaEditorFrame::Create(const wxString& title, const wxPoint& pos, const wxSize& size, long frame_style) ! { m_luaConsole = NULL; *************** *** 129,133 **** m_sideSplitter->SetMinimumPaneSize(10); m_sideNotebook = new wxNotebook(m_sideSplitter, wxID_ANY); ! m_fileListBox = new wxListBox(m_sideNotebook, ID_STF_FILELISTBOX, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_SINGLE ); m_sideNotebook->AddPage(m_fileListBox, wxT("Files")); --- 129,133 ---- m_sideSplitter->SetMinimumPaneSize(10); m_sideNotebook = new wxNotebook(m_sideSplitter, wxID_ANY); ! m_fileListBox = new wxListBox(m_sideNotebook, ID_STF_FILELISTBOX, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_SINGLE ); m_sideNotebook->AddPage(m_fileListBox, wxT("Files")); *************** *** 137,141 **** m_editorNotebook = m_luaConsole->GetEditorNotebook(); m_sideSplitterWin2 = m_luaConsole; ! return true; } --- 137,141 ---- m_editorNotebook = m_luaConsole->GetEditorNotebook(); m_sideSplitterWin2 = m_luaConsole; ! return true; } *************** *** 147,153 **** switch (event.GetId()) { ! case wxID_ABOUT : { ! OnAbout(event); return true; } --- 147,153 ---- switch (event.GetId()) { ! case wxID_ABOUT : { ! OnAbout(event); return true; } *************** *** 160,164 **** if (focusWin == m_luaConsole->GetLuaOutputWin()) return m_luaConsole->GetLuaOutputWin()->HandleMenuEvent(event); ! if (focusWin == m_luaConsole->GetLuaShellWin()) return m_luaConsole->GetLuaShellWin()->HandleMenuEvent(event); --- 160,164 ---- if (focusWin == m_luaConsole->GetLuaOutputWin()) return m_luaConsole->GetLuaOutputWin()->HandleMenuEvent(event); ! if (focusWin == m_luaConsole->GetLuaShellWin()) return m_luaConsole->GetLuaShellWin()->HandleMenuEvent(event); *************** *** 171,175 **** if (!wxSTEditorFrame::HandleMenuEvent(event)) m_luaConsole->OnMenu(event); ! return true; } --- 171,175 ---- if (!wxSTEditorFrame::HandleMenuEvent(event)) m_luaConsole->OnMenu(event); ! return true; } *************** *** 178,182 **** { // since the dialog is modal, it's ok that the interpreter is created on the stack ! wxLuaInterpreter interpreter(NULL, -1); // Create a script to run --- 178,182 ---- { // since the dialog is modal, it's ok that the interpreter is created on the stack ! wxLuaState wxlState(NULL, -1); // Create a script to run *************** *** 190,194 **** script += wxT("wx.wxMessageBox(msg, \"About wxLua Embedded\", wx.wxOK + wx.wxICON_INFORMATION)"); ! interpreter.RunString(script); // Equivalent code --- 190,194 ---- script += wxT("wx.wxMessageBox(msg, \"About wxLua Embedded\", wx.wxOK + wx.wxICON_INFORMATION)"); ! wxlState.RunString(script); // Equivalent code Index: wxledit.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluaedit/src/wxledit.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** wxledit.cpp 5 Dec 2005 06:11:14 -0000 1.4 --- wxledit.cpp 22 Dec 2005 18:42:34 -0000 1.5 *************** *** 57,62 **** void wxLuaShell::Init() { ! m_luaInterpreter = NULL; ! m_luaInterpreter_static = false; } --- 57,61 ---- void wxLuaShell::Init() { ! m_wxlstate_static = false; } *************** *** 75,99 **** wxLuaShell::~wxLuaShell() { ! if (m_luaInterpreter && !m_luaInterpreter_static) ! delete m_luaInterpreter; } ! void wxLuaShell::SetLuaInterpreter(wxLuaInterpreter *interp, bool is_static) { ! if (m_luaInterpreter && !m_luaInterpreter_static) { ! if (m_luaInterpreter->Ok() && m_luaInterpreter->IsRunning()) ! m_luaInterpreter->Break(); ! delete m_luaInterpreter; } ! m_luaInterpreter = interp; ! m_luaInterpreter_static = is_static; } ! bool wxLuaShell::RecreateLuaInterpreter(wxEvtHandler *evtHandler, int win_id) { ! wxLuaEvent event(wxEVT_LUASHELL_wxLUA_CREATION, GetId(), NULL); event.SetEventObject(this); event.SetInt(0); --- 74,98 ---- wxLuaShell::~wxLuaShell() { ! if (m_wxlState.Ok() && !m_wxlstate_static) ! m_wxlState.Destroy(); } ! void wxLuaShell::SetwxLuaState(const wxLuaState& wxlState, bool is_static) { ! if (m_wxlState.Ok() && !m_wxlstate_static) { ! if (m_wxlState.IsRunning()) ! m_wxlState.DebugHookBreak(); ! m_wxlState.Destroy(); } ! m_wxlState = wxlState; ! m_wxlstate_static = is_static; } ! bool wxLuaShell::RecreatewxLuaState(wxEvtHandler *evtHandler, int win_id) { ! wxLuaEvent event(wxEVT_LUASHELL_wxLUA_CREATION, GetId(), wxNullLuaState); event.SetEventObject(this); event.SetInt(0); *************** *** 101,113 **** GetEventHandler()->ProcessEvent( event ); ! if (event.GetLuaInterpreter() != NULL) { ! SetLuaInterpreter(event.GetLuaInterpreter(), event.GetInt() == 1); return true; } ! wxLuaInterpreter *interp = new wxLuaInterpreter(evtHandler, win_id); ! interp->SetLuaDebugHook( 1000, 50, false, LUA_MASKCOUNT ); ! SetLuaInterpreter(interp, false); return true; --- 100,112 ---- GetEventHandler()->ProcessEvent( event ); ! if (event.GetwxLuaState().Ok()) { ! SetwxLuaState(event.GetwxLuaState(), event.GetInt() == 1); return true; } ! wxLuaState wxlState = wxLuaState(evtHandler, win_id); ! wxlState.SetLuaDebugHook( 1000, 50, false, LUA_MASKCOUNT ); ! SetwxLuaState(wxlState, false); return true; *************** *** 134,138 **** if (string == wxT("reset")) { ! if (m_luaInterpreter_static) { AppendText(wxT("Unable to reset lua, interpreter locked by another process.\n")); --- 133,137 ---- if (string == wxT("reset")) { ! if (m_wxlstate_static) { AppendText(wxT("Unable to reset lua, interpreter locked by another process.\n")); *************** *** 140,144 **** else { ! if (RecreateLuaInterpreter(GetEventHandler(), GetId())) { AppendText(wxT("Sucessfully reset interpreter.\n")); --- 139,143 ---- else { ! if (RecreatewxLuaState(GetEventHandler(), GetId())) { AppendText(wxT("Sucessfully reset interpreter.\n")); *************** *** 149,154 **** } } ! else if (m_luaInterpreter) ! ret = m_luaInterpreter->RunString(string) == 0; else AppendText(wxT("The lua interpreter is not available - try running 'reset'.\n")); --- 148,153 ---- } } ! else if (m_wxlState.Ok()) ! ret = m_wxlState.RunString(string) == 0; else AppendText(wxT("The lua interpreter is not available - try running 'reset'.\n")); *************** *** 298,303 **** void wxLuaConsole::Init() { ! m_luaInterpreter = NULL; ! m_luaInterpreter_static = false; m_splitter = NULL; --- 297,301 ---- void wxLuaConsole::Init() { ! m_wxlstate_static = false; m_splitter = NULL; *************** *** 366,370 **** m_luaShell->CreateOptions(m_shellOptions); m_luaShell->SetWrapMode(wxSTC_WRAP_WORD); ! m_luaShell->RecreateLuaInterpreter(m_luaShell->GetEventHandler(), m_luaShell->GetId()); m_luaShell->CheckPrompt(true); splitter->Initialize(m_luaShell); --- 364,368 ---- m_luaShell->CreateOptions(m_shellOptions); m_luaShell->SetWrapMode(wxSTC_WRAP_WORD); ! m_luaShell->RecreatewxLuaState(m_luaShell->GetEventHandler(), m_luaShell->GetId()); m_luaShell->CheckPrompt(true); splitter->Initialize(m_luaShell); *************** *** 379,383 **** splitter->Initialize(m_luaOutput); m_luaOutput->MarkerDeleteAll(wxLuaShell::markerPrompt); ! m_luaOutput->SetLuaInterpreter(m_luaInterpreter, true); m_luaOutput->SetWrapMode(wxSTC_WRAP_NONE); m_luaOutput->SetFileName(wxT("Output")); --- 377,381 ---- splitter->Initialize(m_luaOutput); m_luaOutput->MarkerDeleteAll(wxLuaShell::markerPrompt); ! m_luaOutput->SetwxLuaState(m_wxlState, true); m_luaOutput->SetWrapMode(wxSTC_WRAP_NONE); m_luaOutput->SetFileName(wxT("Output")); *************** *** 395,399 **** wxLuaConsole::~wxLuaConsole() { ! delete m_luaInterpreter; } --- 393,397 ---- wxLuaConsole::~wxLuaConsole() { ! m_wxlState.Destroy(); } *************** *** 411,415 **** m_toolBar = toolBar; ! if (!m_luaInterpreter || !m_luaInterpreter->IsRunning()) EnableTool(ID_LUACON_BREAK_LUA, false); } --- 409,413 ---- m_toolBar = toolBar; ! if (!m_wxlState.Ok() || !m_wxlState.IsRunning()) EnableTool(ID_LUACON_BREAK_LUA, false); } *************** *** 442,462 **** } ! void wxLuaConsole::SetLuaInterpreter(wxLuaInterpreter *interp, bool is_static) { ! if (m_luaInterpreter && !m_luaInterpreter_static) { ! if (m_luaInterpreter->Ok() && m_luaInterpreter->IsRunning()) ! m_luaInterpreter->Break(); ! delete m_luaInterpreter; } ! m_luaInterpreter = interp; ! m_luaInterpreter_static = is_static; } ! bool wxLuaConsole::RecreateLuaInterpreter(wxEvtHandler *evtHandler, int win_id) { ! wxLuaEvent event(wxEVT_LUACONSOLE_wxLUA_CREATION, GetId(), NULL); event.SetEventObject(this); event.SetInt(0); --- 440,460 ---- } ! void wxLuaConsole::SetwxLuaState(const wxLuaState& wxlState, bool is_static) { ! if (m_wxlState.Ok() && !m_wxlstate_static) { ! if (m_wxlState.IsRunning()) ! m_wxlState.DebugHookBreak(); ! m_wxlState.Destroy(); } ! m_wxlState = wxlState; ! m_wxlstate_static = is_static; } ! bool wxLuaConsole::RecreatewxLuaState(wxEvtHandler *evtHandler, int win_id) { ! wxLuaEvent event(wxEVT_LUACONSOLE_wxLUA_CREATION, GetId(), wxNullLuaState); event.SetEventObject(this); event.SetInt(0); *************** *** 464,476 **** GetEventHandler()->ProcessEvent( event ); ! if (event.GetLuaInterpreter() != NULL) { ! SetLuaInterpreter(event.GetLuaInterpreter(), event.GetInt() == 1); return true; } ! wxLuaInterpreter *interp = new wxLuaInterpreter(evtHandler, win_id); ! interp->SetLuaDebugHook( 1000, 50, false, LUA_MASKCOUNT ); ! SetLuaInterpreter(interp, false); return true; } --- 462,474 ---- GetEventHandler()->ProcessEvent( event ); ! if (event.GetwxLuaState().Ok()) { ! SetwxLuaState(event.GetwxLuaState(), event.GetInt() == 1); return true; } ! wxLuaState wxlState = wxLuaState(evtHandler, win_id); ! wxlState.SetLuaDebugHook( 1000, 50, false, LUA_MASKCOUNT ); ! SetwxLuaState(wxlState, false); return true; } *************** *** 550,560 **** if (program.IsEmpty()) break; ! if (m_luaInterpreter) { ! wxCHECK_RET(m_luaInterpreter->Destroy(false), wxT("Can't destroy lua interpreter")); } // Fresh start! ! wxCHECK_RET(RecreateLuaInterpreter(GetEventHandler(), editor->GetId()), wxT("Can't recreate lua interpreter")); EnableTool(ID_LUACON_RUN_LUA, false); --- 548,559 ---- if (program.IsEmpty()) break; ! if (m_wxlState.Ok()) { ! m_wxlState.Destroy(); // FIXME ! //wxCHECK_RET(m_wxlState.Destroy(), wxT("Can't destroy lua interpreter")); } // Fresh start! ! wxCHECK_RET(RecreatewxLuaState(GetEventHandler(), editor->GetId()), wxT("Can't recreate lua interpreter")); EnableTool(ID_LUACON_RUN_LUA, false); *************** *** 573,586 **** wxSafeYield(); // allow tools to adjust (sometimes necessary?) ! m_luaOutput->SetLuaInterpreter(m_luaInterpreter, true); if (editor->HasBreakpoint(-1)) ! m_luaInterpreter->SetLuaDebugHook(1, 50, true, LUA_MASKLINE); else ! m_luaInterpreter->SetLuaDebugHook(100, 50, false); m_luaOutput->SetReadOnly(true); editor->SetReadOnly(true); ! m_luaInterpreter->RunString(program); editor->SetReadOnly(false); m_luaOutput->SetReadOnly(false); --- 572,585 ---- wxSafeYield(); // allow tools to adjust (sometimes necessary?) ! m_luaOutput->SetwxLuaState(m_wxlState, true); if (editor->HasBreakpoint(-1)) ! m_wxlState.SetLuaDebugHook(1, 50, true, LUA_MASKLINE); else ! m_wxlState.SetLuaDebugHook(100, 50, false); m_luaOutput->SetReadOnly(true); editor->SetReadOnly(true); ! m_wxlState.RunString(program); editor->SetReadOnly(false); m_luaOutput->SetReadOnly(false); *************** *** 595,612 **** EnableTool(ID_LUACON_SHOW_STACK, true); - // don't delete it since it may "exist" as a frame or something - // also allows for showing stack frame - //if (m_luaInterpreter) { delete m_luaInterpreter; m_luaInterpreter = NULL; } break; } case ID_LUACON_BREAK_LUA : { ! if (m_luaInterpreter && m_luaInterpreter->IsRunning()) { ! m_luaInterpreter->Break(wxT("Interpreter stopped")); } ! else if (m_luaShell->GetLuaInterpreter() && m_luaShell->GetLuaInterpreter()->IsRunning()) { ! m_luaShell->GetLuaInterpreter()->Break(wxT("Interpreter stopped")); } --- 594,608 ---- EnableTool(ID_LUACON_SHOW_STACK, true); break; } case ID_LUACON_BREAK_LUA : { ! if (m_wxlState.Ok() && m_wxlState.IsRunning()) { ! m_wxlState.Break(wxT("Interpreter stopped")); } ! else if (m_luaShell->GetwxLuaState().Ok() && m_luaShell->GetwxLuaState().IsRunning()) { ! m_luaShell->GetwxLuaState().Break(wxT("Interpreter stopped")); } *************** *** 619,646 **** bool err = true; ! wxLuaInterpreter *luaInterp = NULL; ! wxLuaShell *luaShell = NULL; if (m_msgNotebook->GetSelection() == 0) { ! luaInterp = m_luaShell ? m_luaShell->GetLuaInterpreter() : NULL; luaShell = m_luaShell; } else { ! luaInterp = m_luaInterpreter; ! luaShell = m_luaOutput; } ! if (luaShell && luaInterp) { ! int hook_count = luaInterp->GetLuaDebugHookCount(); ! int hook_yield = luaInterp->GetLuaDebugHookYield(); ! bool hook_send = luaInterp->GetLuaDebugHookSendEvt(); ! int hook_mask = luaInterp->GetLuaDebugHook(); ! luaInterp->SetLuaDebugHook(1, -1, true); ! luaInterp->RunString(wxT("print(\"Showing stack\")")); ! luaInterp->SetLuaDebugHook(hook_count, hook_yield, hook_send, hook_mask); luaShell->CheckPrompt(true); err = false; --- 615,642 ---- bool err = true; ! wxLuaState wxlState; ! wxLuaShell *luaShell = NULL; if (m_msgNotebook->GetSelection() == 0) { ! wxlState = m_luaShell ? m_luaShell->GetwxLuaState() : wxNullLuaState; luaShell = m_luaShell; } else { ! wxlState = m_wxlState; ! luaShell = m_luaOutput; } ! if (luaShell && wxlState.Ok()) { ! int hook_count = wxlState.GetLuaDebugHookCount(); ! int hook_yield = wxlState.GetLuaDebugHookYield(); ! bool hook_send = wxlState.GetLuaDebugHookSendEvt(); ! int hook_mask = wxlState.GetLuaDebugHook(); ! wxlState.SetLuaDebugHook(1, -1, true); ! wxlState.RunString(wxT("print(\"Showing stack\")")); ! wxlState.SetLuaDebugHook(hook_count, hook_yield, hook_send, hook_mask); luaShell->CheckPrompt(true); err = false; *************** *** 661,667 **** wxLuaShell *outEditor = NULL; ! if (event.GetLuaInterpreter() == m_luaInterpreter) outEditor = m_luaOutput; ! else if (event.GetLuaInterpreter() == m_luaShell->GetLuaInterpreter()) outEditor = m_luaShell; --- 657,663 ---- wxLuaShell *outEditor = NULL; ! if (event.GetwxLuaState() == m_wxlState) outEditor = m_luaOutput; ! else if (event.GetwxLuaState() == m_luaShell->GetwxLuaState()) outEditor = m_luaShell; *************** *** 688,692 **** m_show_stack = false; } ! else if (event.GetEventObject() == m_luaInterpreter) { wxLuaEditor *editor = wxDynamicCast(m_editorNotebook->FindWindow(event.GetId()), wxLuaEditor); --- 684,688 ---- m_show_stack = false; } ! else if (event.GetwxLuaState() == m_wxlState) { wxLuaEditor *editor = wxDynamicCast(m_editorNotebook->FindWindow(event.GetId()), wxLuaEditor); *************** *** 696,700 **** int line = event.GetLineNum(); if (editor->HasBreakpoint(line-1)) ! m_luaInterpreter->Break(wxString::Format(wxT("Stopped at breakpoint, line: %d"), line)); } } --- 692,696 ---- int line = event.GetLineNum(); if (editor->HasBreakpoint(line-1)) ! m_wxlState.Break(wxString::Format(wxT("Stopped at breakpoint, line: %d"), line)); } } *************** *** 715,719 **** // Put a marker where the error occurred ! if ((line >= 0) && (event.GetEventObject() == m_luaInterpreter)) { wxLuaEditor *editor = wxDynamicCast(m_editorNotebook->FindWindow(event.GetId()), wxLuaEditor); --- 711,715 ---- // Put a marker where the error occurred ! if ((line >= 0) && (event.GetwxLuaState() == m_wxlState)) { wxLuaEditor *editor = wxDynamicCast(m_editorNotebook->FindWindow(event.GetId()), wxLuaEditor); |