mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-13 02:52:37 +00:00
Codechange: Add EditBoxGainedFocus method to VideoDriver base class
This commit is contained in:
parent
46f7c6a641
commit
81f159434d
@ -374,6 +374,11 @@ struct IConsoleWindow : Window
|
|||||||
this->Scroll(-wheel);
|
this->Scroll(-wheel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OnFocus() override
|
||||||
|
{
|
||||||
|
VideoDriver::GetInstance()->EditBoxGainedFocus();
|
||||||
|
}
|
||||||
|
|
||||||
void OnFocusLost() override
|
void OnFocusLost() override
|
||||||
{
|
{
|
||||||
VideoDriver::GetInstance()->EditBoxLostFocus();
|
VideoDriver::GetInstance()->EditBoxLostFocus();
|
||||||
|
@ -93,6 +93,11 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual void EditBoxLostFocus() {}
|
virtual void EditBoxLostFocus() {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An edit box gained the input focus
|
||||||
|
*/
|
||||||
|
virtual void EditBoxGainedFocus() {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the currently active instance of the video driver.
|
* Get the currently active instance of the video driver.
|
||||||
*/
|
*/
|
||||||
|
@ -499,11 +499,20 @@ bool Window::SetFocusedWidget(int widget_index)
|
|||||||
if (this->nested_focus->type == WWT_EDITBOX) VideoDriver::GetInstance()->EditBoxLostFocus();
|
if (this->nested_focus->type == WWT_EDITBOX) VideoDriver::GetInstance()->EditBoxLostFocus();
|
||||||
}
|
}
|
||||||
this->nested_focus = this->GetWidget<NWidgetCore>(widget_index);
|
this->nested_focus = this->GetWidget<NWidgetCore>(widget_index);
|
||||||
|
if (this->nested_focus->type == WWT_EDITBOX) VideoDriver::GetInstance()->EditBoxGainedFocus();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when window looses focus
|
* Called when window gains focus
|
||||||
|
*/
|
||||||
|
void Window::OnFocus()
|
||||||
|
{
|
||||||
|
if (this->nested_focus != nullptr && this->nested_focus->type == WWT_EDITBOX) VideoDriver::GetInstance()->EditBoxGainedFocus();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when window loses focus
|
||||||
*/
|
*/
|
||||||
void Window::OnFocusLost()
|
void Window::OnFocusLost()
|
||||||
{
|
{
|
||||||
|
@ -592,10 +592,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual void SetStringParameters(int widget) const {}
|
virtual void SetStringParameters(int widget) const {}
|
||||||
|
|
||||||
/**
|
virtual void OnFocus();
|
||||||
* Called when window gains focus
|
|
||||||
*/
|
|
||||||
virtual void OnFocus() {}
|
|
||||||
|
|
||||||
virtual void OnFocusLost();
|
virtual void OnFocusLost();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user