Debugger: Add status bar to main team window.

TeamWindow:
- Add a status bar in the form of a string view to the bottom of the
  window, along with a helper function to request updating it.
This commit is contained in:
Rene Gollent 2015-08-14 20:40:55 -04:00
parent 667361d71f
commit 0324fc408c
2 changed files with 27 additions and 2 deletions

View File

@ -74,7 +74,8 @@ enum {
MSG_LOCATE_SOURCE_IF_NEEDED = 'lsin',
MSG_SOURCE_ENTRY_QUERY_COMPLETE = 'seqc',
MSG_CLEAR_STACK_TRACE = 'clst',
MSG_HANDLE_LOAD_SETTINGS = 'hlst'
MSG_HANDLE_LOAD_SETTINGS = 'hlst',
MSG_UPDATE_STATUS_BAR = 'upsb'
};
@ -133,6 +134,7 @@ TeamWindow::TeamWindow(::Team* team, UserInterfaceListener* listener)
fStepOutButton(NULL),
fMenuBar(NULL),
fSourcePathView(NULL),
fStatusBarView(NULL),
fConsoleOutputView(NULL),
fFunctionSplitView(NULL),
fSourceSplitView(NULL),
@ -525,6 +527,13 @@ TeamWindow::MessageReceived(BMessage* message)
_LoadSettings(settings);
break;
}
case MSG_UPDATE_STATUS_BAR:
{
const char* messageText;
if (message->FindString("message", &messageText) == B_OK)
fStatusBarView->SetText(messageText);
break;
}
case MSG_TEAM_RENAMED:
{
_UpdateTitle();
@ -725,6 +734,15 @@ TeamWindow::SaveSettings(GuiTeamUiSettings* settings)
}
void
TeamWindow::DisplayBackgroundStatus(const char* message)
{
BMessage updateMessage(MSG_UPDATE_STATUS_BAR);
updateMessage.AddString("message", message);
PostMessage(&updateMessage);
}
void
TeamWindow::ThreadSelectionChanged(::Thread* thread)
{
@ -995,7 +1013,11 @@ TeamWindow::_Init()
.SetInsets(0.0)
.Add(fConsoleOutputView = ConsoleOutputView::Create())
.End()
.End();
.End()
.Add(fStatusBarView = new BStringView("status", "Ready."));
fStatusBarView->SetExplicitMinSize(BSize(50.0, B_SIZE_UNSET));
fStatusBarView->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNSET));
// add source view
sourceScrollView->SetTarget(fSourceView = SourceView::Create(fTeam, this));

View File

@ -71,6 +71,8 @@ public:
status_t SaveSettings(
GuiTeamUiSettings* settings);
void DisplayBackgroundStatus(const char* message);
private:
enum ActiveSourceObject {
@ -228,6 +230,7 @@ private:
BButton* fStepOutButton;
BMenuBar* fMenuBar;
BStringView* fSourcePathView;
BStringView* fStatusBarView;
ConsoleOutputView* fConsoleOutputView;
BSplitView* fFunctionSplitView;
BSplitView* fSourceSplitView;