Fix for bug #1166231 (GUI: Caret not removed when switching tabs)

svn-id: r17379
This commit is contained in:
Max Horn 2005-04-04 17:57:40 +00:00
parent d2cdbefc5c
commit adf9bcf5d1

View file

@ -60,7 +60,7 @@ int TabWidget::addTab(const String &title) {
// Add a new tab page // Add a new tab page
Tab newTab; Tab newTab;
newTab.title = title; newTab.title = title;
newTab.firstWidget = NULL; newTab.firstWidget = 0;
_tabs.push_back(newTab); _tabs.push_back(newTab);
@ -84,8 +84,10 @@ void TabWidget::setActiveTab(int tabID) {
assert(0 <= tabID && tabID < (int)_tabs.size()); assert(0 <= tabID && tabID < (int)_tabs.size());
if (_activeTab != tabID) { if (_activeTab != tabID) {
// Exchange the widget lists, and switch to the new tab // Exchange the widget lists, and switch to the new tab
if (_activeTab != -1) if (_activeTab != -1) {
_tabs[_activeTab].firstWidget = _firstWidget; _tabs[_activeTab].firstWidget = _firstWidget;
releaseFocus();
}
_activeTab = tabID; _activeTab = tabID;
_firstWidget = _tabs[tabID].firstWidget; _firstWidget = _tabs[tabID].firstWidget;
_boss->draw(); _boss->draw();