summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2009-05-30 11:30:25 +0000
committeralberth <alberth@openttd.org>2009-05-30 11:30:25 +0000
commitbfb8df3fb9e21fffce0560a4fb44bb615663a7a2 (patch)
tree1f1264264661e84cf5fb179fee6f6f109fcb3b11
parent2a2a9a27ba0cf2550116fd5f84e0a5c95c208c80 (diff)
downloadopenttd-bfb8df3fb9e21fffce0560a4fb44bb615663a7a2.tar.xz
(svn r16465) -Codechange: Eliminated GetGloballyFocusedWidget(), it was used only once.
-rw-r--r--src/window.cpp11
-rw-r--r--src/window_gui.h1
2 files changed, 1 insertions, 11 deletions
diff --git a/src/window.cpp b/src/window.cpp
index 2009f15dd..10165ef87 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -112,22 +112,13 @@ void SetFocusedWindow(Window *w)
}
/**
- * Gets the globally focused widget. Which is the focused widget of the focused window.
- * @return A pointer to the globally focused Widget, or NULL if there is no globally focused widget.
- */
-const Widget *GetGloballyFocusedWidget()
-{
- return _focused_window != NULL ? _focused_window->focused_widget : NULL;
-}
-
-/**
* Check if an edit box is in global focus. That is if focused window
* has a edit box as focused widget, or if a console is focused.
* @return returns true if an edit box is in global focus or if the focused window is a console, else false
*/
bool EditBoxInGlobalFocus()
{
- const Widget *wi = GetGloballyFocusedWidget();
+ const Widget *wi = (_focused_window != NULL) ? _focused_window->focused_widget : NULL;
/* The console does not have an edit box so a special case is needed. */
return (wi != NULL && wi->type == WWT_EDITBOX) ||
diff --git a/src/window_gui.h b/src/window_gui.h
index 4de82d9db..975cdee1b 100644
--- a/src/window_gui.h
+++ b/src/window_gui.h
@@ -657,7 +657,6 @@ enum SpecialMouseMode {
Window *GetCallbackWnd();
void SetFocusedWindow(Window *w);
-const Widget *GetGloballyFocusedWidget();
bool EditBoxInGlobalFocus();
void ScrollbarClickHandler(Window *w, const Widget *wi, int x, int y);