mirror of https://github.com/OpenTTD/OpenTTD
(svn r16465) -Codechange: Eliminated GetGloballyFocusedWidget(), it was used only once.
parent
2a2a9a27ba
commit
bfb8df3fb9
|
@ -111,15 +111,6 @@ void SetFocusedWindow(Window *w)
|
||||||
if (_focused_window != NULL) _focused_window->OnFocus();
|
if (_focused_window != NULL) _focused_window->OnFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 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
|
* 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.
|
* has a edit box as focused widget, or if a console is focused.
|
||||||
|
@ -127,7 +118,7 @@ const Widget *GetGloballyFocusedWidget()
|
||||||
*/
|
*/
|
||||||
bool EditBoxInGlobalFocus()
|
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. */
|
/* The console does not have an edit box so a special case is needed. */
|
||||||
return (wi != NULL && wi->type == WWT_EDITBOX) ||
|
return (wi != NULL && wi->type == WWT_EDITBOX) ||
|
||||||
|
|
|
@ -657,7 +657,6 @@ enum SpecialMouseMode {
|
||||||
Window *GetCallbackWnd();
|
Window *GetCallbackWnd();
|
||||||
|
|
||||||
void SetFocusedWindow(Window *w);
|
void SetFocusedWindow(Window *w);
|
||||||
const Widget *GetGloballyFocusedWidget();
|
|
||||||
bool EditBoxInGlobalFocus();
|
bool EditBoxInGlobalFocus();
|
||||||
|
|
||||||
void ScrollbarClickHandler(Window *w, const Widget *wi, int x, int y);
|
void ScrollbarClickHandler(Window *w, const Widget *wi, int x, int y);
|
||||||
|
|
Loading…
Reference in New Issue