diff --git a/src/prefs/devices/DevicesViews.cpp b/src/prefs/devices/DevicesViews.cpp index 068926fe4b..0ee9867ade 100644 --- a/src/prefs/devices/DevicesViews.cpp +++ b/src/prefs/devices/DevicesViews.cpp @@ -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)); +} +// ---------------------------------------------------------------------------------------------------------- // diff --git a/src/prefs/devices/DevicesViews.h b/src/prefs/devices/DevicesViews.h index 8dafefd1ce..c2a9db855e 100644 --- a/src/prefs/devices/DevicesViews.h +++ b/src/prefs/devices/DevicesViews.h @@ -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 diff --git a/src/prefs/devices/DevicesWindows.h b/src/prefs/devices/DevicesWindows.h index 10764af6fa..b3dd7ee3fd 100644 --- a/src/prefs/devices/DevicesWindows.h +++ b/src/prefs/devices/DevicesWindows.h @@ -24,6 +24,9 @@ class ResourceUsageWindow : public BWindow private: void InitWindow(void); ResourceUsageView* ptrResourceUsageView; + + BTabView *tabView; + BTab *tab; }; diff --git a/src/prefs/devices/ResourceUsageWindow.cpp b/src/prefs/devices/ResourceUsageWindow.cpp index 1520d31d7a..81c4ac453e 100644 --- a/src/prefs/devices/ResourceUsageWindow.cpp +++ b/src/prefs/devices/ResourceUsageWindow.cpp @@ -9,17 +9,13 @@ Author: Sikosis */ // Includes ------------------------------------------------------------------------------------------ // -#include #include -#include -#include -#include #include #include #include #include #include -#include +#include #include #include @@ -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); } // -------------------------------------------------------------------------------------------------- //