Input preferences: fix build

One file was accidentally missing from this commit and was added to the
next one (which isn't ready for merging yet). Add it back here instead.
This commit is contained in:
Adrien Destugues 2019-07-24 21:19:42 +02:00
parent fc8ec82116
commit a79976efc2
5 changed files with 129 additions and 7 deletions

View File

@ -0,0 +1,71 @@
/*
* Copyright 2019, Haiku, Inc.
* Distributed under the terms of the MIT License.
*
* Author:
* Preetpal Kaur <preetpalok123@gmail.com>
*/
#include "InputDeviceView.h"
#include <Catalog.h>
#include <DateFormat.h>
#include <LayoutBuilder.h>
#include <ListView.h>
#include <Locale.h>
#include <ScrollView.h>
#include <String.h>
#include <StringItem.h>
#undef B_TRANSLATION_CONTEXT
#define B_TRANSLATION_CONTEXT "DeviceList"
DeviceName::DeviceName(const char* item, int d)
:
BStringItem(item)
{
this->fDevice = d;
}
DeviceName::~DeviceName()
{
}
DeviceListView::DeviceListView(const char* name)
:
BView(name, B_WILL_DRAW)
{
fDeviceList = new BListView("Device Names");
fScrollView = new BScrollView("ScrollView",fDeviceList,
0 , false, B_FANCY_BORDER);
SetExplicitMinSize(BSize(160, B_SIZE_UNSET));
SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNSET));
fDeviceList->AddItem(new DeviceName("Mouse", 101));
fDeviceList->AddItem(new DeviceName("Touchpad", 102));
BLayoutBuilder::Group<>(this, B_VERTICAL)
.SetInsets(B_USE_DEFAULT_SPACING)
.Add(fScrollView)
.End();
fDeviceList->SetSelectionMessage(new BMessage(ITEM_SELECTED));
}
DeviceListView::~DeviceListView()
{
}
void
DeviceListView::AttachedToWindow()
{
fDeviceList->SetTarget(this);
fDeviceList->Select(0);
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
}

View File

@ -0,0 +1,52 @@
/*
* Copyright 2019, Haiku, Inc.
* Distributed under the terms of the MIT License.
*
* Author:
* Preetpal Kaur <preetpalok123@gmail.com>
*/
#ifndef _INPUT_DEVICE_VIEW_H
#define _INPUT_DEVICE_VIEW_H
#include <ListView.h>
#include <ListItem.h>
#include <StringItem.h>
#include <ScrollBar.h>
#include <String.h>
#include <ScrollView.h>
#include <View.h>
#include <Message.h>
#include "InputTouchpadPref.h"
#include "MouseSettings.h"
#define ITEM_SELECTED 'I1s'
class TouchpadPref;
class MouseSettings;
class DeviceName : public BStringItem {
public:
DeviceName(const char* item, int d);
virtual ~DeviceName();
int WhichDevice() { return fDevice; };
private:
int fDevice;
};
class DeviceListView: public BView {
public:
DeviceListView(const char *name);
virtual ~DeviceListView();
virtual void AttachedToWindow();
private:
BScrollView* fScrollView;
BListView* fDeviceList;
TouchpadPref fTouchpadPref;
MouseSettings fMouseSettings;
};
#endif // _INPUT_DEVICE_VIEW_H */

View File

@ -24,7 +24,6 @@
#include "InputWindow.h"
#include "InputDeviceView.h"
#include "MouseSettings.h"
#include "InputMouse.h"
#include "InputConstants.h"

View File

@ -21,9 +21,10 @@
#include <CardView.h>
#include <Message.h>
#include "MouseSettings.h"
#include "InputDeviceView.h"
#include "InputMouse.h"
#include "InputTouchpadPrefView.h"
#include "MouseSettings.h"
#include "touchpad_settings.h"
@ -31,7 +32,6 @@ class BSplitView;
class BCardView;
class BCardLayout;
class DeviceListView;
class SettingsView;
class DeviceName;
class TouchpadPrefView;

View File

@ -4,11 +4,11 @@ UsePrivateHeaders input ;
Preference Input :
Input.cpp
InputWindow.cpp
InputDeviceView.cpp
InputMouse.cpp
InputTouchpadPref.cpp
InputTouchpadPrefView.cpp
InputMouse.cpp
InputWindow.cpp
MouseView.cpp
MouseSettings.cpp
SettingsView.cpp
@ -18,11 +18,11 @@ DoCatalogs Input :
x-vnd.Haiku-Input
:
Input.cpp
InputWindow.cpp
InputDeviceView.cpp
InputMouse.cpp
InputTouchpadPref.cpp
InputTouchpadPrefView.cpp
InputMouse.cpp
InputWindow.cpp
MouseView.cpp
MouseSettings.cpp
SettingsView.cpp