Added TabView to Resource Usage Window and added blank Views for the necessary tabs. Just need help understanding where the current R5 Devices application is "getting" this information from.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4027 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
b87ce267f2
commit
75d162977d
@ -41,3 +41,33 @@ ResourceUsageView::ResourceUsageView (BRect frame) : BView (frame, "ResourceUsag
|
||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||
}
|
||||
// ---------------------------------------------------------------------------------------------------------- //
|
||||
|
||||
|
||||
// IRQView - used in Resource Usage Window
|
||||
IRQView::IRQView (BRect frame) : BView (frame, "IRQView", B_FOLLOW_ALL_SIDES, B_WILL_DRAW )
|
||||
{
|
||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||
}
|
||||
// ---------------------------------------------------------------------------------------------------------- //
|
||||
|
||||
|
||||
// DMAView - used in Resource Usage Window
|
||||
DMAView::DMAView (BRect frame) : BView (frame, "DMAView", B_FOLLOW_ALL_SIDES, B_WILL_DRAW )
|
||||
{
|
||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||
}
|
||||
// ---------------------------------------------------------------------------------------------------------- //
|
||||
|
||||
// IORangeView - used in Resource Usage Window
|
||||
IORangeView::IORangeView (BRect frame) : BView (frame, "IORangeView", B_FOLLOW_ALL_SIDES, B_WILL_DRAW )
|
||||
{
|
||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||
}
|
||||
// ---------------------------------------------------------------------------------------------------------- //
|
||||
|
||||
// MemoryRangeView - used in Resource Usage Window
|
||||
MemoryRangeView::MemoryRangeView (BRect frame) : BView (frame, "MemoryRangeView", B_FOLLOW_ALL_SIDES, B_WILL_DRAW )
|
||||
{
|
||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||
}
|
||||
// ---------------------------------------------------------------------------------------------------------- //
|
||||
|
@ -26,5 +26,33 @@ class ResourceUsageView : public BView
|
||||
ResourceUsageView(BRect frame);
|
||||
};
|
||||
|
||||
|
||||
class IRQView : public BView
|
||||
{
|
||||
public:
|
||||
IRQView(BRect frame);
|
||||
};
|
||||
|
||||
|
||||
class DMAView : public BView
|
||||
{
|
||||
public:
|
||||
DMAView(BRect frame);
|
||||
};
|
||||
|
||||
|
||||
class IORangeView : public BView
|
||||
{
|
||||
public:
|
||||
IORangeView(BRect frame);
|
||||
};
|
||||
|
||||
|
||||
class MemoryRangeView : public BView
|
||||
{
|
||||
public:
|
||||
MemoryRangeView(BRect frame);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -24,6 +24,9 @@ class ResourceUsageWindow : public BWindow
|
||||
private:
|
||||
void InitWindow(void);
|
||||
ResourceUsageView* ptrResourceUsageView;
|
||||
|
||||
BTabView *tabView;
|
||||
BTab *tab;
|
||||
};
|
||||
|
||||
|
||||
|
@ -9,17 +9,13 @@ Author: Sikosis
|
||||
*/
|
||||
|
||||
// Includes ------------------------------------------------------------------------------------------ //
|
||||
#include <Alert.h>
|
||||
#include <Application.h>
|
||||
#include <Button.h>
|
||||
#include <ListItem.h>
|
||||
#include <ListView.h>
|
||||
#include <Path.h>
|
||||
#include <Screen.h>
|
||||
#include <ScrollView.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <TextControl.h>
|
||||
#include <TabView.h>
|
||||
#include <Window.h>
|
||||
#include <View.h>
|
||||
|
||||
@ -31,7 +27,8 @@ Author: Sikosis
|
||||
// CenterWindowOnScreen -- Centers the BWindow to the Current Screen
|
||||
static void CenterWindowOnScreen(BWindow* w)
|
||||
{
|
||||
BRect screenFrame = (BScreen(B_MAIN_SCREEN_ID).Frame()); BPoint pt;
|
||||
BRect screenFrame = (BScreen(B_MAIN_SCREEN_ID).Frame());
|
||||
BPoint pt;
|
||||
pt.x = screenFrame.Width()/2 - w->Bounds().Width()/2;
|
||||
pt.y = screenFrame.Height()/2 - w->Bounds().Height()/2;
|
||||
|
||||
@ -40,6 +37,7 @@ static void CenterWindowOnScreen(BWindow* w)
|
||||
}
|
||||
// -------------------------------------------------------------------------------------------------- //
|
||||
|
||||
|
||||
// ResourceUsageWindow - Constructor
|
||||
ResourceUsageWindow::ResourceUsageWindow(BRect frame) : BWindow (frame, "Resource Usage", B_TITLED_WINDOW, B_MODAL_SUBSET_WINDOW_FEEL , 0)
|
||||
{
|
||||
@ -49,36 +47,44 @@ ResourceUsageWindow::ResourceUsageWindow(BRect frame) : BWindow (frame, "Resourc
|
||||
}
|
||||
// -------------------------------------------------------------------------------------------------- //
|
||||
|
||||
|
||||
// ResourceUsageWindow - Destructor
|
||||
ResourceUsageWindow::~ResourceUsageWindow()
|
||||
{
|
||||
exit(0);
|
||||
//exit(0);
|
||||
}
|
||||
// -------------------------------------------------------------------------------------------------- //
|
||||
|
||||
|
||||
// ResourceUsageWindow::InitWindow -- Initialization Commands here
|
||||
void ResourceUsageWindow::InitWindow(void)
|
||||
{
|
||||
BRect r;
|
||||
BRect rtab;
|
||||
r = Bounds(); // the whole view
|
||||
|
||||
/*lsvProjectFiles = new BListView(BRect(5,5,200,80), "ltvProjectFiles",
|
||||
B_SINGLE_SELECTION_LIST, B_FOLLOW_LEFT | B_FOLLOW_TOP,
|
||||
B_WILL_DRAW | B_NAVIGABLE | B_FRAME_EVENTS);
|
||||
|
||||
//BListView *list = new BListView(r, "City", B_MULTIPLE_SELECTION_LIST);
|
||||
lsvProjectFiles->AddItem(new BStringItem("Brisbane"));
|
||||
lsvProjectFiles->AddItem(new BStringItem("Sydney"));
|
||||
lsvProjectFiles->AddItem(new BStringItem("Melbourne"));
|
||||
lsvProjectFiles->AddItem(new BStringItem("Adelaide"));
|
||||
|
||||
// lsiItem = new BListItem();
|
||||
|
||||
// lsvProjectFiles.AddItem(lsiItem);*/
|
||||
rtab = Bounds();
|
||||
|
||||
rtab.InsetBy(0,10);
|
||||
tabView = new BTabView(rtab,"resource_usage_tabview");
|
||||
tabView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||
rtab = tabView->Bounds();
|
||||
rtab.InsetBy(5,5);
|
||||
tab = new BTab();
|
||||
tabView->AddTab(new IRQView(r), tab);
|
||||
tab->SetLabel("IRQ");
|
||||
tab = new BTab();
|
||||
tabView->AddTab(new DMAView(r), tab);
|
||||
tab->SetLabel("DMA");
|
||||
tab = new BTab();
|
||||
tabView->AddTab(new IORangeView(r), tab);
|
||||
tab->SetLabel("IO Range");
|
||||
tab = new BTab();
|
||||
tabView->AddTab(new MemoryRangeView(r), tab);
|
||||
tab->SetLabel("Memory Range");
|
||||
|
||||
// Create the Views
|
||||
AddChild(ptrResourceUsageView = new ResourceUsageView(r));
|
||||
//ptrResourceUsageView->AddChild(...);
|
||||
ptrResourceUsageView->AddChild(tabView);
|
||||
}
|
||||
// -------------------------------------------------------------------------------------------------- //
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user