From eb4f887ec342e504a3ff8fbc86560b7a652ea3c6 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 7 Jun 2009 22:19:48 +0000 Subject: Added Clear button for search box. Looks a bit off, but we do not yet have skinned buttons. svn-id: r41355 --- gui/launcher.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gui/launcher.cpp') diff --git a/gui/launcher.cpp b/gui/launcher.cpp index aebe3d4aa9..da49c1ccfd 100644 --- a/gui/launcher.cpp +++ b/gui/launcher.cpp @@ -66,6 +66,7 @@ enum { kQuitCmd = 'QUIT', kSearchCmd = 'SRCH', kListSearchCmd = 'LSSR', + kSearchClearCmd = 'SRCL', kCmdGlobalGraphicsOverride = 'OGFX', kCmdGlobalAudioOverride = 'OSFX', @@ -524,6 +525,7 @@ LauncherDialog::LauncherDialog() _searchDesc = new StaticTextWidget(this, "Launcher.SearchDesc", "Search:"); _searchWidget = new EditTextWidget(this, "Launcher.Search", _search, kSearchCmd); + _searchClearButton = new ButtonWidget(this, "Launcher.SearchClearButton", "C", kSearchClearCmd, 0); // Add list with game titles _list = new ListWidget(this, "Launcher.GameList", kListSearchCmd); @@ -936,6 +938,10 @@ void LauncherDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat case kSearchCmd: _list->setFilter(_searchWidget->getEditString()); break; + case kSearchClearCmd: + _searchWidget->setEditString(""); + _list->setFilter(""); + break; default: Dialog::handleCommand(sender, cmd, data); } -- cgit v1.2.3