mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r16463) -Cleanup: Code style fixes.
This commit is contained in:
parent
1448160e1e
commit
5eecf3e5cb
|
@ -1072,11 +1072,11 @@ bool HandleCaret(Textbuf *tb)
|
|||
|
||||
bool QueryString::HasEditBoxFocus(const Window *w, int wid) const
|
||||
{
|
||||
return ((w->window_class == WC_OSK &&
|
||||
return (w->window_class == WC_OSK &&
|
||||
_focused_window == w->parent &&
|
||||
w->parent->focused_widget &&
|
||||
w->parent->focused_widget != NULL &&
|
||||
w->parent->focused_widget->type == WWT_EDITBOX) ||
|
||||
w->IsWidgetGloballyFocused(wid));
|
||||
w->IsWidgetGloballyFocused(wid);
|
||||
}
|
||||
|
||||
HandleEditBoxResult QueryString::HandleEditBoxKey(Window *w, int wid, uint16 key, uint16 keycode, Window::EventState &state)
|
||||
|
|
|
@ -289,7 +289,7 @@ static void DispatchLeftClickEvent(Window *w, int x, int y, bool double_click)
|
|||
* So unless the clicked widget is the caption bar, change focus to this widget */
|
||||
if (wi->type != WWT_CAPTION) {
|
||||
/* Close the OSK window if a edit box loses focus */
|
||||
if (w->focused_widget && w->focused_widget->type == WWT_EDITBOX && // An edit box was previously selected
|
||||
if (w->focused_widget != NULL && w->focused_widget->type == WWT_EDITBOX && // An edit box was previously selected
|
||||
w->focused_widget != wi && // and focus is going to change
|
||||
w->window_class != WC_OSK) { // and it is not the OSK window
|
||||
DeleteWindowById(WC_OSK, 0);
|
||||
|
@ -297,7 +297,7 @@ static void DispatchLeftClickEvent(Window *w, int x, int y, bool double_click)
|
|||
|
||||
if (w->focused_widget != wi) {
|
||||
/* Repaint the widget that loss focus. A focused edit box may else leave the caret left on the screen */
|
||||
if (w->focused_widget) w->InvalidateWidget(w->focused_widget - w->widget);
|
||||
if (w->focused_widget != NULL) w->InvalidateWidget(w->focused_widget - w->widget);
|
||||
focused_widget_changed = true;
|
||||
w->focused_widget = wi;
|
||||
}
|
||||
|
@ -812,7 +812,7 @@ void Window::Initialize(int x, int y, int min_width, int min_height,
|
|||
this->width = min_width;
|
||||
this->height = min_height;
|
||||
AssignWidgetToWindow(this, widget);
|
||||
this->focused_widget = 0;
|
||||
this->focused_widget = NULL;
|
||||
this->resize.width = min_width;
|
||||
this->resize.height = min_height;
|
||||
this->resize.step_width = 1;
|
||||
|
|
|
@ -272,7 +272,7 @@ public:
|
|||
{
|
||||
if (widget_index < this->widget_count) {
|
||||
/* Repaint the widget that loss focus. A focused edit box may else leave the caret left on the screen */
|
||||
if (this->focused_widget && this->focused_widget - this->widget != widget_index) {
|
||||
if (this->focused_widget != NULL && this->focused_widget - this->widget != widget_index) {
|
||||
this->InvalidateWidget(this->focused_widget - this->widget);
|
||||
}
|
||||
this->focused_widget = &this->widget[widget_index];
|
||||
|
|
Loading…
Reference in New Issue