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_LOCATE_SOURCE_IF_NEEDED = 'lsin',
MSG_SOURCE_ENTRY_QUERY_COMPLETE = 'seqc', MSG_SOURCE_ENTRY_QUERY_COMPLETE = 'seqc',
MSG_CLEAR_STACK_TRACE = 'clst', 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), fStepOutButton(NULL),
fMenuBar(NULL), fMenuBar(NULL),
fSourcePathView(NULL), fSourcePathView(NULL),
fStatusBarView(NULL),
fConsoleOutputView(NULL), fConsoleOutputView(NULL),
fFunctionSplitView(NULL), fFunctionSplitView(NULL),
fSourceSplitView(NULL), fSourceSplitView(NULL),
@ -525,6 +527,13 @@ TeamWindow::MessageReceived(BMessage* message)
_LoadSettings(settings); _LoadSettings(settings);
break; break;
} }
case MSG_UPDATE_STATUS_BAR:
{
const char* messageText;
if (message->FindString("message", &messageText) == B_OK)
fStatusBarView->SetText(messageText);
break;
}
case MSG_TEAM_RENAMED: case MSG_TEAM_RENAMED:
{ {
_UpdateTitle(); _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 void
TeamWindow::ThreadSelectionChanged(::Thread* thread) TeamWindow::ThreadSelectionChanged(::Thread* thread)
{ {
@ -995,7 +1013,11 @@ TeamWindow::_Init()
.SetInsets(0.0) .SetInsets(0.0)
.Add(fConsoleOutputView = ConsoleOutputView::Create()) .Add(fConsoleOutputView = ConsoleOutputView::Create())
.End() .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 // add source view
sourceScrollView->SetTarget(fSourceView = SourceView::Create(fTeam, this)); sourceScrollView->SetTarget(fSourceView = SourceView::Create(fTeam, this));

View File

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