Skip to content

Commit

Permalink
-Added UpdateNameForActiveWindow() method.
Browse files Browse the repository at this point in the history
-GetActiveWindow() no longer asserts if no window exists.  Instead it returns a NULL TabWindow so that calling code can properly compensate for no active window.
  • Loading branch information
readgs committed Sep 9, 2003
1 parent abd8495 commit cdf97bc
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions TabBrowser.cpp
Expand Up @@ -66,10 +66,28 @@ TabWindow *TabBrowser::GetActiveWindow()

Page = Notebook->GetSelection();
// There must be a valid page selected
assert(Page != -1);
if(Page == -1)
CurrentPage = NULL;
else
{
// Return the window to the caller
CurrentPage = (TabWindow *)Notebook->GetPage(Page);
assert(CurrentPage);
}
return CurrentPage;
}

void TabBrowser::UpdateNameForActiveWindow()
{
TabWindow *CurrentPage;
int Page;

Page = Notebook->GetSelection();
// There must be a valid page selected
assert(Page != -1);
// Return the window to the caller
CurrentPage = (TabWindow *)Notebook->GetPage(Page);
// Page object must be valid
assert(CurrentPage);
return CurrentPage;
}
Notebook->SetPageText(Page, CurrentPage->GetName());
}

0 comments on commit cdf97bc

Please sign in to comment.