Public Member Functions | |
gMemuItemConsole (uMenu *M, tString &c, uAutoCompleter *completer) | |
Constructor. | |
virtual | ~gMemuItemConsole () |
bool | Event (SDL_Event &e) |
Handles an event. |
Definition at line 599 of file gMenus.cpp.
gMemuItemConsole::gMemuItemConsole | ( | uMenu * | M, | |
tString & | c, | |||
uAutoCompleter * | completer | |||
) |
Constructor.
M | passed on to uMenuItemStringWithHistory | |
c | passed on to uMenuItemStringWithHistory | |
completer | the completer to be used |
Definition at line 609 of file gMenus.cpp.
00609 : 00610 uMenuItemStringWithHistory(M,"Con:","", c, 1024, sg_consoleHistory(), sg_consoleHistoryMaxSize, completer) 00611 {}
virtual gMemuItemConsole::~gMemuItemConsole | ( | ) | [inline, virtual] |
bool gMemuItemConsole::Event | ( | SDL_Event & | e | ) | [virtual] |
Handles an event.
e | the event to process |
Reimplemented from uMenuItemStringWithHistory.
Definition at line 614 of file gMenus.cpp.
References tColoredString::ColorString(), con, uMenuItemString::content, uMenuItemStringWithHistory::Event(), uMenu::Exit(), uActionGlobal::IsBreakingGlobalBind(), tRecorderBase::IsPlayingBack(), tConfItemBase::LoadAll(), tConfItemBase::LoadPlayback(), uMenuItemString::MyMenu(), and su_HandleEvent().
00614 { 00615 if (e.type==SDL_KEYDOWN && 00616 (e.key.keysym.sym==SDLK_KP_ENTER || e.key.keysym.sym==SDLK_RETURN)){ 00617 00618 con << tColoredString::ColorString(.5,.5,1) << " > " << *content << '\n'; 00619 00620 if ( tRecorder::IsPlayingBack() ) 00621 { 00622 // the command was also recorded; better play it back, 00623 // or the playback gets out of sync 00624 tConfItemBase::LoadPlayback( false ); 00625 } 00626 else 00627 { 00628 // pass the console command to the configuration system 00629 std::stringstream s(&((*content)[0])); 00630 tConfItemBase::LoadAll(s); 00631 } 00632 00633 MyMenu()->Exit(); 00634 return true; 00635 } 00636 else if (e.type==SDL_KEYDOWN && 00637 uActionGlobal::IsBreakingGlobalBind(e.key.keysym.sym)) 00638 return su_HandleEvent(e, true); 00639 else 00640 return uMenuItemStringWithHistory::Event(e); 00641 }