Replace use of old layout-builder classes with new ones in devices app.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42303 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include <Alert.h>
|
||||
#include <Application.h>
|
||||
#include <Catalog.h>
|
||||
#include <LayoutBuilder.h>
|
||||
#include <TextView.h>
|
||||
|
||||
#include "DevicesView.h"
|
||||
@@ -44,20 +45,13 @@ DevicesApplication::DevicesApplication()
|
||||
DevicesWindow::DevicesWindow()
|
||||
:
|
||||
BWindow(BRect(50, 50, 750, 550), B_TRANSLATE_SYSTEM_NAME("Devices"),
|
||||
B_TITLED_WINDOW, B_ASYNCHRONOUS_CONTROLS
|
||||
| B_AUTO_UPDATE_SIZE_LIMITS
|
||||
| B_QUIT_ON_WINDOW_CLOSE)
|
||||
B_TITLED_WINDOW, B_ASYNCHRONOUS_CONTROLS | B_AUTO_UPDATE_SIZE_LIMITS
|
||||
| B_QUIT_ON_WINDOW_CLOSE)
|
||||
{
|
||||
float minWidth;
|
||||
float maxWidth;
|
||||
float minHeight;
|
||||
float maxHeight;
|
||||
GetSizeLimits(&minWidth, &maxWidth, &minHeight, &maxHeight);
|
||||
minWidth = 600;
|
||||
minHeight = 300;
|
||||
SetSizeLimits(minWidth, maxWidth, minHeight, maxHeight);
|
||||
fDevicesView = new DevicesView(Bounds());
|
||||
AddChild(fDevicesView);
|
||||
BLayoutBuilder::Group<>(this, B_VERTICAL)
|
||||
.SetInsets(0)
|
||||
.Add(fDevicesView = new DevicesView());
|
||||
GetLayout()->SetExplicitMinSize(BSize(600, 300));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -9,7 +9,10 @@
|
||||
|
||||
#include <Application.h>
|
||||
#include <Catalog.h>
|
||||
#include <LayoutBuilder.h>
|
||||
#include <MenuBar.h>
|
||||
#include <ScrollView.h>
|
||||
#include <String.h>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
@@ -18,8 +21,9 @@
|
||||
#undef B_TRANSLATE_CONTEXT
|
||||
#define B_TRANSLATE_CONTEXT "DevicesView"
|
||||
|
||||
DevicesView::DevicesView(const BRect& rect)
|
||||
: BView(rect, "DevicesView", B_FOLLOW_ALL, B_WILL_DRAW | B_FRAME_EVENTS)
|
||||
DevicesView::DevicesView()
|
||||
:
|
||||
BView("DevicesView", B_WILL_DRAW | B_FRAME_EVENTS)
|
||||
{
|
||||
CreateLayout();
|
||||
RescanDevices();
|
||||
@@ -30,8 +34,6 @@ DevicesView::DevicesView(const BRect& rect)
|
||||
void
|
||||
DevicesView::CreateLayout()
|
||||
{
|
||||
SetLayout(new BGroupLayout(B_VERTICAL));
|
||||
|
||||
BMenuBar* menuBar = new BMenuBar("menu");
|
||||
BMenu* menu = new BMenu(B_TRANSLATE("Devices"));
|
||||
BMenuItem* item;
|
||||
@@ -90,18 +92,15 @@ DevicesView::CreateLayout()
|
||||
fTabView->AddTab(fAttributesView, fDetailedTab);
|
||||
fDetailedTab->SetLabel(B_TRANSLATE("Detailed"));
|
||||
|
||||
AddChild(BGroupLayoutBuilder(B_VERTICAL, 0)
|
||||
.Add(menuBar)
|
||||
.Add(BSplitLayoutBuilder(B_HORIZONTAL, 5)
|
||||
.Add(BGroupLayoutBuilder(B_VERTICAL, 5)
|
||||
.Add(fOrderByMenu, 1)
|
||||
.Add(scrollView, 2)
|
||||
.TopView()
|
||||
)
|
||||
.Add(fTabView, 2)
|
||||
.SetInsets(5, 5, 5, 5)
|
||||
).TopView()
|
||||
);
|
||||
BLayoutBuilder::Group<>(this, B_VERTICAL, 0)
|
||||
.Add(menuBar)
|
||||
.AddSplit(B_HORIZONTAL)
|
||||
.SetInsets(B_USE_ITEM_INSETS)
|
||||
.AddGroup(B_VERTICAL)
|
||||
.Add(fOrderByMenu, 1)
|
||||
.Add(scrollView, 2)
|
||||
.End()
|
||||
.Add(fTabView, 2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -9,16 +9,10 @@
|
||||
#define DEVICESVIEW_H
|
||||
|
||||
|
||||
#include <GroupLayout.h>
|
||||
#include <GroupLayoutBuilder.h>
|
||||
#include <MenuField.h>
|
||||
#include <MenuItem.h>
|
||||
#include <OutlineListView.h>
|
||||
#include <PopUpMenu.h>
|
||||
#include <SplitLayoutBuilder.h>
|
||||
#include <ScrollView.h>
|
||||
#include <String.h>
|
||||
#include <StringView.h>
|
||||
#include <TabView.h>
|
||||
#include <View.h>
|
||||
|
||||
@@ -50,7 +44,7 @@ typedef std::vector<Device*> Devices;
|
||||
|
||||
class DevicesView : public BView {
|
||||
public:
|
||||
DevicesView(const BRect& r);
|
||||
DevicesView();
|
||||
~DevicesView();
|
||||
|
||||
virtual void CreateLayout();
|
||||
|
||||
Reference in New Issue
Block a user