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:
@@ -41,3 +41,33 @@ ResourceUsageView::ResourceUsageView (BRect frame) : BView (frame, "ResourceUsag
|
|||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
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);
|
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
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,9 @@ class ResourceUsageWindow : public BWindow
|
|||||||
private:
|
private:
|
||||||
void InitWindow(void);
|
void InitWindow(void);
|
||||||
ResourceUsageView* ptrResourceUsageView;
|
ResourceUsageView* ptrResourceUsageView;
|
||||||
|
|
||||||
|
BTabView *tabView;
|
||||||
|
BTab *tab;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -9,17 +9,13 @@ Author: Sikosis
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Includes ------------------------------------------------------------------------------------------ //
|
// Includes ------------------------------------------------------------------------------------------ //
|
||||||
#include <Alert.h>
|
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
#include <Button.h>
|
|
||||||
#include <ListItem.h>
|
|
||||||
#include <ListView.h>
|
|
||||||
#include <Path.h>
|
#include <Path.h>
|
||||||
#include <Screen.h>
|
#include <Screen.h>
|
||||||
#include <ScrollView.h>
|
#include <ScrollView.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <TextControl.h>
|
#include <TabView.h>
|
||||||
#include <Window.h>
|
#include <Window.h>
|
||||||
#include <View.h>
|
#include <View.h>
|
||||||
|
|
||||||
@@ -31,7 +27,8 @@ Author: Sikosis
|
|||||||
// CenterWindowOnScreen -- Centers the BWindow to the Current Screen
|
// CenterWindowOnScreen -- Centers the BWindow to the Current Screen
|
||||||
static void CenterWindowOnScreen(BWindow* w)
|
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.x = screenFrame.Width()/2 - w->Bounds().Width()/2;
|
||||||
pt.y = screenFrame.Height()/2 - w->Bounds().Height()/2;
|
pt.y = screenFrame.Height()/2 - w->Bounds().Height()/2;
|
||||||
|
|
||||||
@@ -40,6 +37,7 @@ static void CenterWindowOnScreen(BWindow* w)
|
|||||||
}
|
}
|
||||||
// -------------------------------------------------------------------------------------------------- //
|
// -------------------------------------------------------------------------------------------------- //
|
||||||
|
|
||||||
|
|
||||||
// ResourceUsageWindow - Constructor
|
// ResourceUsageWindow - Constructor
|
||||||
ResourceUsageWindow::ResourceUsageWindow(BRect frame) : BWindow (frame, "Resource Usage", B_TITLED_WINDOW, B_MODAL_SUBSET_WINDOW_FEEL , 0)
|
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 - Destructor
|
||||||
ResourceUsageWindow::~ResourceUsageWindow()
|
ResourceUsageWindow::~ResourceUsageWindow()
|
||||||
{
|
{
|
||||||
exit(0);
|
//exit(0);
|
||||||
}
|
}
|
||||||
// -------------------------------------------------------------------------------------------------- //
|
// -------------------------------------------------------------------------------------------------- //
|
||||||
|
|
||||||
|
|
||||||
// ResourceUsageWindow::InitWindow -- Initialization Commands here
|
// ResourceUsageWindow::InitWindow -- Initialization Commands here
|
||||||
void ResourceUsageWindow::InitWindow(void)
|
void ResourceUsageWindow::InitWindow(void)
|
||||||
{
|
{
|
||||||
BRect r;
|
BRect r;
|
||||||
|
BRect rtab;
|
||||||
r = Bounds(); // the whole view
|
r = Bounds(); // the whole view
|
||||||
|
rtab = Bounds();
|
||||||
/*lsvProjectFiles = new BListView(BRect(5,5,200,80), "ltvProjectFiles",
|
|
||||||
B_SINGLE_SELECTION_LIST, B_FOLLOW_LEFT | B_FOLLOW_TOP,
|
rtab.InsetBy(0,10);
|
||||||
B_WILL_DRAW | B_NAVIGABLE | B_FRAME_EVENTS);
|
tabView = new BTabView(rtab,"resource_usage_tabview");
|
||||||
|
tabView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||||
//BListView *list = new BListView(r, "City", B_MULTIPLE_SELECTION_LIST);
|
rtab = tabView->Bounds();
|
||||||
lsvProjectFiles->AddItem(new BStringItem("Brisbane"));
|
rtab.InsetBy(5,5);
|
||||||
lsvProjectFiles->AddItem(new BStringItem("Sydney"));
|
tab = new BTab();
|
||||||
lsvProjectFiles->AddItem(new BStringItem("Melbourne"));
|
tabView->AddTab(new IRQView(r), tab);
|
||||||
lsvProjectFiles->AddItem(new BStringItem("Adelaide"));
|
tab->SetLabel("IRQ");
|
||||||
|
tab = new BTab();
|
||||||
// lsiItem = new BListItem();
|
tabView->AddTab(new DMAView(r), tab);
|
||||||
|
tab->SetLabel("DMA");
|
||||||
// lsvProjectFiles.AddItem(lsiItem);*/
|
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
|
// Create the Views
|
||||||
AddChild(ptrResourceUsageView = new ResourceUsageView(r));
|
AddChild(ptrResourceUsageView = new ResourceUsageView(r));
|
||||||
//ptrResourceUsageView->AddChild(...);
|
ptrResourceUsageView->AddChild(tabView);
|
||||||
}
|
}
|
||||||
// -------------------------------------------------------------------------------------------------- //
|
// -------------------------------------------------------------------------------------------------- //
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user