Style cleanups
Fixed the header to mention the authors on this app on each file Made the prefs app font sensitive git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18379 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -4,7 +4,7 @@ SetSubDirSupportedPlatformsBeOSCompatible ;
|
|||||||
|
|
||||||
if $(TARGET_PLATFORM) != haiku {
|
if $(TARGET_PLATFORM) != haiku {
|
||||||
SubDirC++Flags -DCOMPILE_FOR_R5 ;
|
SubDirC++Flags -DCOMPILE_FOR_R5 ;
|
||||||
SubDirC++Flags -fmultiple-symbol-spaces ;
|
# SubDirC++Flags -fmultiple-symbol-spaces ;
|
||||||
}
|
}
|
||||||
|
|
||||||
UsePrivateHeaders input ;
|
UsePrivateHeaders input ;
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
/*
|
/*
|
||||||
** Copyright 2004, the Haiku project. All rights reserved.
|
* Copyright 2004-2006, the Haiku project. All rights reserved.
|
||||||
** Distributed under the terms of the Haiku License.
|
* Distributed under the terms of the Haiku License.
|
||||||
**
|
*
|
||||||
** Author : mccall@digitalparadise.co.uk, Jérôme Duval
|
* Authors in chronological order:
|
||||||
|
* [email protected]
|
||||||
|
* Jérôme Duval
|
||||||
|
* Marcus Overhagen
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <Alert.h>
|
#include <Alert.h>
|
||||||
|
|
||||||
#include "Keyboard.h"
|
#include "Keyboard.h"
|
||||||
@@ -24,7 +26,6 @@ int main(int, char**)
|
|||||||
KeyboardApplication::KeyboardApplication()
|
KeyboardApplication::KeyboardApplication()
|
||||||
: BApplication("application/x-vnd.Haiku-KeyboardPrefs")
|
: BApplication("application/x-vnd.Haiku-KeyboardPrefs")
|
||||||
{
|
{
|
||||||
|
|
||||||
new KeyboardWindow();
|
new KeyboardWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -32,13 +33,17 @@ void
|
|||||||
KeyboardApplication::MessageReceived(BMessage *message)
|
KeyboardApplication::MessageReceived(BMessage *message)
|
||||||
{
|
{
|
||||||
switch(message->what) {
|
switch(message->what) {
|
||||||
case ERROR_DETECTED:
|
case ERROR_DETECTED: {
|
||||||
{
|
BAlert *errorAlert = new BAlert("Error",
|
||||||
BAlert *errorAlert = new BAlert("Error", "Something has gone wrong!","OK",NULL,NULL,B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_WARNING_ALERT);
|
"Something has gone wrong!",
|
||||||
|
"OK",NULL,NULL,
|
||||||
|
B_WIDTH_AS_USUAL,
|
||||||
|
B_OFFSET_SPACING,
|
||||||
|
B_WARNING_ALERT);
|
||||||
errorAlert->Go();
|
errorAlert->Go();
|
||||||
be_app->PostMessage(B_QUIT_REQUESTED);
|
be_app->PostMessage(B_QUIT_REQUESTED);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
BApplication::MessageReceived(message);
|
BApplication::MessageReceived(message);
|
||||||
break;
|
break;
|
||||||
@@ -49,5 +54,5 @@ KeyboardApplication::MessageReceived(BMessage *message)
|
|||||||
void
|
void
|
||||||
KeyboardApplication::AboutRequested(void)
|
KeyboardApplication::AboutRequested(void)
|
||||||
{
|
{
|
||||||
(new BAlert("about", "...by Andrew Edward McCall", "Dig Deal"))->Go();
|
(new BAlert("about", "Written by Andrew Edward McCall", "OK"))->Go();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
/*
|
/*
|
||||||
** Copyright 2004, the Haiku project. All rights reserved.
|
* Copyright 2004-2006, the Haiku project. All rights reserved.
|
||||||
** Distributed under the terms of the Haiku License.
|
* Distributed under the terms of the Haiku License.
|
||||||
**
|
*
|
||||||
** Author : mccall@digitalparadise.co.uk, Jérôme Duval
|
* Authors in chronological order:
|
||||||
|
* [email protected]
|
||||||
|
* Jérôme Duval
|
||||||
|
* Marcus Overhagen
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef KEYBOARD_H
|
#ifndef KEYBOARD_H
|
||||||
#define KEYBOARD_H
|
#define KEYBOARD_H
|
||||||
|
|
||||||
@@ -13,11 +15,10 @@
|
|||||||
class KeyboardApplication : public BApplication
|
class KeyboardApplication : public BApplication
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
KeyboardApplication();
|
KeyboardApplication();
|
||||||
|
|
||||||
void MessageReceived(BMessage *message);
|
void MessageReceived(BMessage *message);
|
||||||
|
void AboutRequested(void);
|
||||||
void AboutRequested(void);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
/*
|
/*
|
||||||
|
* Copyright 2004-2006, the Haiku project. All rights reserved.
|
||||||
KeyboardMessages.h
|
* Distributed under the terms of the Haiku License.
|
||||||
|
*
|
||||||
|
* Authors in chronological order:
|
||||||
|
* [email protected]
|
||||||
|
* Jérôme Duval
|
||||||
|
* Marcus Overhagen
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef KEYBOARD_MESSAGES_H
|
#ifndef KEYBOARD_MESSAGES_H
|
||||||
#define KEYBOARD_MESSAGES_H
|
#define KEYBOARD_MESSAGES_H
|
||||||
|
|
||||||
@@ -14,4 +17,4 @@ const uint32 SLIDER_DELAY_RATE = 'SLdr';
|
|||||||
|
|
||||||
const uint32 ERROR_DETECTED = 'ERor';
|
const uint32 ERROR_DETECTED = 'ERor';
|
||||||
|
|
||||||
#endif //KEYBOARD_MESSAGES_H
|
#endif
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
/*
|
/*
|
||||||
** Copyright 2004-2006, the Haiku project. All rights reserved.
|
* Copyright 2004-2006, the Haiku project. All rights reserved.
|
||||||
** Distributed under the terms of the Haiku License.
|
* Distributed under the terms of the Haiku License.
|
||||||
**
|
*
|
||||||
** Authors in chronological order:
|
* Authors in chronological order:
|
||||||
** [email protected]
|
* [email protected]
|
||||||
** Jérôme Duval
|
* Jérôme Duval
|
||||||
** Marcus Overhagen
|
* Marcus Overhagen
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <FindDirectory.h>
|
#include <FindDirectory.h>
|
||||||
#include <File.h>
|
#include <File.h>
|
||||||
#include <Path.h>
|
#include <Path.h>
|
||||||
@@ -33,19 +32,22 @@ KeyboardSettings::KeyboardSettings()
|
|||||||
BPath path;
|
BPath path;
|
||||||
BFile file;
|
BFile file;
|
||||||
|
|
||||||
if (find_directory(B_USER_SETTINGS_DIRECTORY, &path) < B_OK)
|
|
||||||
goto err;
|
|
||||||
if (path.Append(kb_settings_file) < B_OK)
|
|
||||||
goto err;
|
|
||||||
if (file.SetTo(path.Path(), B_READ_ONLY) < B_OK)
|
|
||||||
goto err;
|
|
||||||
if (file.ReadAt(sizeof(kb_settings), &fCorner, sizeof(fCorner)) != sizeof(fCorner))
|
|
||||||
goto err;
|
|
||||||
|
|
||||||
return;
|
|
||||||
err:
|
|
||||||
fCorner.x = 150;
|
fCorner.x = 150;
|
||||||
fCorner.y = 100;
|
fCorner.y = 100;
|
||||||
|
|
||||||
|
status_t status = find_directory(B_USER_SETTINGS_DIRECTORY, &path);
|
||||||
|
if(status == B_OK) {
|
||||||
|
status = path.Append(kb_settings_file);
|
||||||
|
if(status == B_OK) {
|
||||||
|
status = file.SetTo(path.Path(), B_READ_ONLY);
|
||||||
|
if (status == B_OK) {
|
||||||
|
if(file.ReadAt(sizeof(kb_settings), &fCorner, sizeof(fCorner)) != sizeof(fCorner)) {
|
||||||
|
fCorner.x = 150;
|
||||||
|
fCorner.y = 100;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -56,8 +58,10 @@ KeyboardSettings::~KeyboardSettings()
|
|||||||
|
|
||||||
if (find_directory(B_USER_SETTINGS_DIRECTORY, &path) < B_OK)
|
if (find_directory(B_USER_SETTINGS_DIRECTORY, &path) < B_OK)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (path.Append(kb_settings_file) < B_OK)
|
if (path.Append(kb_settings_file) < B_OK)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// be careful: don't create the file if it doesn't already exist
|
// be careful: don't create the file if it doesn't already exist
|
||||||
if (file.SetTo(path.Path(), B_WRITE_ONLY) < B_OK)
|
if (file.SetTo(path.Path(), B_WRITE_ONLY) < B_OK)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
/*
|
/*
|
||||||
** Copyright 2004, the Haiku project. All rights reserved.
|
* Copyright 2004-2006, the Haiku project. All rights reserved.
|
||||||
** Distributed under the terms of the Haiku License.
|
* Distributed under the terms of the Haiku License.
|
||||||
**
|
*
|
||||||
** Author : mccall@digitalparadise.co.uk, Jérôme Duval
|
* Authors in chronological order:
|
||||||
|
* [email protected]
|
||||||
|
* Jérôme Duval
|
||||||
|
* Marcus Overhagen
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef KEYBOARD_SETTINGS_H_
|
#ifndef KEYBOARD_SETTINGS_H_
|
||||||
#define KEYBOARD_SETTINGS_H_
|
#define KEYBOARD_SETTINGS_H_
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
/*
|
/*
|
||||||
|
* Copyright 2004-2006, the Haiku project. All rights reserved.
|
||||||
KeyboardView.cpp
|
* Distributed under the terms of the Haiku License.
|
||||||
|
*
|
||||||
|
* Authors in chronological order:
|
||||||
|
* [email protected]
|
||||||
|
* Jérôme Duval
|
||||||
|
* Marcus Overhagen
|
||||||
*/
|
*/
|
||||||
#include <InterfaceDefs.h>
|
#include <InterfaceDefs.h>
|
||||||
#include <TranslationUtils.h>
|
#include <TranslationUtils.h>
|
||||||
@@ -9,78 +13,120 @@
|
|||||||
#include <Button.h>
|
#include <Button.h>
|
||||||
#include <Slider.h>
|
#include <Slider.h>
|
||||||
#include <TextControl.h>
|
#include <TextControl.h>
|
||||||
|
#include <Window.h>
|
||||||
|
#include <Font.h>
|
||||||
|
|
||||||
#include "KeyboardView.h"
|
#include "KeyboardView.h"
|
||||||
#include "KeyboardMessages.h"
|
#include "KeyboardMessages.h"
|
||||||
|
|
||||||
|
|
||||||
KeyboardView::KeyboardView(BRect rect)
|
KeyboardView::KeyboardView(BRect rect)
|
||||||
: BBox(rect, "keyboard_view",
|
: BView(rect, "keyboard_view", B_FOLLOW_LEFT | B_FOLLOW_TOP,
|
||||||
B_FOLLOW_ALL, B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE_JUMP,
|
B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE_JUMP)
|
||||||
B_PLAIN_BORDER)
|
|
||||||
{
|
{
|
||||||
BRect frame;
|
BRect frame;
|
||||||
BButton *button;
|
|
||||||
BSlider *slider;
|
|
||||||
BTextControl *textcontrol;
|
|
||||||
|
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||||
|
|
||||||
fIconBitmap = BTranslationUtils::GetBitmap("key_bmap");
|
fIconBitmap = BTranslationUtils::GetBitmap("key_bmap");
|
||||||
fClockBitmap = BTranslationUtils::GetBitmap("clock_bmap");
|
fClockBitmap = BTranslationUtils::GetBitmap("clock_bmap");
|
||||||
|
|
||||||
|
float labelwidth = StringWidth("Delay until key repeat")+20;
|
||||||
|
|
||||||
|
font_height fontHeight;
|
||||||
|
be_plain_font->GetHeight(&fontHeight);
|
||||||
|
|
||||||
|
float labelheight = fontHeight.ascent + fontHeight.descent +
|
||||||
|
fontHeight.leading;
|
||||||
|
|
||||||
|
// Create the "Key repeat rate" slider...
|
||||||
|
frame.Set(10,10,10 + labelwidth,10 + (labelheight*2) + 20);
|
||||||
|
fRepeatSlider = new BSlider(frame,"key_repeat_rate",
|
||||||
|
"Key repeat rate",
|
||||||
|
new BMessage(SLIDER_REPEAT_RATE),
|
||||||
|
20,300,B_BLOCK_THUMB,
|
||||||
|
B_FOLLOW_LEFT,B_WILL_DRAW);
|
||||||
|
fRepeatSlider->SetHashMarks(B_HASH_MARKS_BOTTOM);
|
||||||
|
fRepeatSlider->SetHashMarkCount(5);
|
||||||
|
fRepeatSlider->SetLimitLabels("Slow","Fast");
|
||||||
|
|
||||||
|
|
||||||
|
// Create the "Delay until key repeat" slider...
|
||||||
|
frame.OffsetBy(0,frame.Height() + 10);
|
||||||
|
fDelaySlider = new BSlider(frame,"delay_until_key_repeat",
|
||||||
|
"Delay until key repeat",
|
||||||
|
new BMessage(SLIDER_DELAY_RATE),250000,1000000,
|
||||||
|
B_BLOCK_THUMB,B_FOLLOW_LEFT,B_WILL_DRAW);
|
||||||
|
fDelaySlider->SetHashMarks(B_HASH_MARKS_BOTTOM);
|
||||||
|
fDelaySlider->SetHashMarkCount(4);
|
||||||
|
fDelaySlider->SetLimitLabels("Short","Long");
|
||||||
|
|
||||||
|
// Create the "Typing test area" text box...
|
||||||
|
frame.OffsetBy(0,frame.Height() + 15);
|
||||||
|
frame.right = fDelaySlider->Frame().right + fIconBitmap->Bounds().Width() +
|
||||||
|
10;
|
||||||
|
BTextControl *textcontrol = new BTextControl(frame,"typing_test_area",NULL,
|
||||||
|
"Typing test area",
|
||||||
|
new BMessage('TTEA'),
|
||||||
|
B_FOLLOW_LEFT,B_WILL_DRAW);
|
||||||
|
textcontrol->SetAlignment(B_ALIGN_LEFT,B_ALIGN_CENTER);
|
||||||
|
|
||||||
|
float width, height;
|
||||||
|
textcontrol->GetPreferredSize(&width, &height);
|
||||||
|
textcontrol->ResizeTo(frame.Width(),height);
|
||||||
|
|
||||||
|
// Create the box for the sliders...
|
||||||
|
frame.left = frame.top = 10;
|
||||||
|
frame.right = frame.left + fDelaySlider->Frame().right +
|
||||||
|
fClockBitmap->Bounds().Width() + 20;
|
||||||
|
frame.bottom = textcontrol->Frame().bottom + 20;
|
||||||
|
fBox = new BBox(frame,"keyboard_box",B_FOLLOW_LEFT,B_WILL_DRAW,
|
||||||
|
B_FANCY_BORDER);
|
||||||
|
AddChild(fBox);
|
||||||
|
|
||||||
|
fBox->AddChild(fRepeatSlider);
|
||||||
|
fBox->AddChild(fDelaySlider);
|
||||||
|
fBox->AddChild(textcontrol);
|
||||||
|
|
||||||
//Add the "Default" button..
|
//Add the "Default" button..
|
||||||
frame.Set(10,187,85,207);
|
frame.left = 10;
|
||||||
button = new BButton(frame,"keyboard_defaults","Defaults", new BMessage(BUTTON_DEFAULTS));
|
frame.top = fBox->Frame().bottom + 10;
|
||||||
|
frame.right = frame.left + 1;
|
||||||
|
frame.bottom = frame.top + 1;
|
||||||
|
BButton *button = new BButton(frame,"keyboard_defaults","Defaults",
|
||||||
|
new BMessage(BUTTON_DEFAULTS));
|
||||||
|
button->ResizeToPreferred();
|
||||||
AddChild(button);
|
AddChild(button);
|
||||||
|
|
||||||
// Add the "Revert" button...
|
// Add the "Revert" button...
|
||||||
frame.Set(92,187,167,207);
|
frame = button->Frame();
|
||||||
button = new BButton(frame,"keyboard_revert","Revert", new BMessage(BUTTON_REVERT));
|
frame.OffsetBy(frame.Width() + 10, 0);
|
||||||
|
button = new BButton(frame,"keyboard_revert","Revert",
|
||||||
|
new BMessage(BUTTON_REVERT));
|
||||||
button->SetEnabled(false);
|
button->SetEnabled(false);
|
||||||
AddChild(button);
|
AddChild(button);
|
||||||
|
|
||||||
// Create the box for the sliders...
|
|
||||||
frame=Bounds();
|
|
||||||
frame.left=frame.left+11;
|
|
||||||
frame.top=frame.top+12;
|
|
||||||
frame.right=frame.right-11;
|
|
||||||
frame.bottom=frame.bottom-44;
|
|
||||||
fBox = new BBox(frame,"keyboard_box",B_FOLLOW_LEFT,B_WILL_DRAW,B_FANCY_BORDER);
|
|
||||||
|
|
||||||
// Create the "Key repeat rate" slider...
|
ResizeTo(fBox->Frame().right + 10, button->Frame().bottom + 10);
|
||||||
frame.Set(10,10,172,50);
|
|
||||||
slider = new BSlider(frame,"key_repeat_rate","Key repeat rate", new BMessage(SLIDER_REPEAT_RATE),20,300,B_BLOCK_THUMB,B_FOLLOW_LEFT,B_WILL_DRAW);
|
|
||||||
slider->SetHashMarks(B_HASH_MARKS_BOTTOM);
|
|
||||||
slider->SetHashMarkCount(5);
|
|
||||||
slider->SetLimitLabels("Slow","Fast");
|
|
||||||
fBox->AddChild(slider);
|
|
||||||
|
|
||||||
// Create the "Delay until key repeat" slider...
|
|
||||||
frame.Set(10,65,172,115);
|
|
||||||
slider = new BSlider(frame,"delay_until_key_repeat","Delay until key repeat", new BMessage(SLIDER_DELAY_RATE),250000,1000000,B_BLOCK_THUMB,B_FOLLOW_LEFT,B_WILL_DRAW);
|
|
||||||
slider->SetHashMarks(B_HASH_MARKS_BOTTOM);
|
|
||||||
slider->SetHashMarkCount(4);
|
|
||||||
slider->SetLimitLabels("Short","Long");
|
|
||||||
fBox->AddChild(slider);
|
|
||||||
|
|
||||||
// Create the "Typing test area" text box...
|
|
||||||
frame=Bounds();
|
|
||||||
frame.left=frame.left+10;
|
|
||||||
frame.top=135;
|
|
||||||
frame.right=frame.right-34;
|
|
||||||
frame.bottom=frame.bottom-11;
|
|
||||||
textcontrol = new BTextControl(frame,"typing_test_area",NULL,"Typing test area", new BMessage('TTEA'),B_FOLLOW_LEFT,B_WILL_DRAW);
|
|
||||||
textcontrol->SetAlignment(B_ALIGN_LEFT,B_ALIGN_CENTER);
|
|
||||||
fBox->AddChild(textcontrol);
|
|
||||||
|
|
||||||
AddChild(fBox);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void KeyboardView::Draw(BRect updateFrame)
|
void
|
||||||
|
KeyboardView::Draw(BRect updateFrame)
|
||||||
{
|
{
|
||||||
inherited::Draw(updateFrame);
|
BPoint pt;
|
||||||
fBox->DrawBitmap(fIconBitmap,BPoint(178,26));
|
pt.x = fRepeatSlider->Frame().right + 10;
|
||||||
fBox->DrawBitmap(fClockBitmap,BPoint(178,83));
|
pt.y = fRepeatSlider->Frame().bottom - 35 -
|
||||||
|
(fIconBitmap->Bounds().Height()/3);
|
||||||
|
|
||||||
|
fBox->DrawBitmap(fIconBitmap,pt);
|
||||||
|
|
||||||
|
pt.y = fDelaySlider->Frame().bottom - 35 -
|
||||||
|
(fIconBitmap->Bounds().Height()/3);
|
||||||
|
fBox->DrawBitmap(fClockBitmap,pt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
KeyboardView::AttachedToWindow(void)
|
||||||
|
{
|
||||||
|
Window()->ResizeTo(Bounds().Width(), Bounds().Height());
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
/*
|
/*
|
||||||
|
* Copyright 2004-2006, the Haiku project. All rights reserved.
|
||||||
KeyboardView.h
|
* Distributed under the terms of the Haiku License.
|
||||||
|
*
|
||||||
|
* Authors in chronological order:
|
||||||
|
* [email protected]
|
||||||
|
* Jérôme Duval
|
||||||
|
* Marcus Overhagen
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef KEYBOARD_VIEW_H
|
#ifndef KEYBOARD_VIEW_H
|
||||||
#define KEYBOARD_VIEW_H
|
#define KEYBOARD_VIEW_H
|
||||||
|
|
||||||
@@ -14,19 +17,19 @@
|
|||||||
#include <InterfaceDefs.h>
|
#include <InterfaceDefs.h>
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
|
|
||||||
class KeyboardView : public BBox
|
class KeyboardView : public BView
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef BBox inherited;
|
KeyboardView(BRect frame);
|
||||||
|
void Draw(BRect frame);
|
||||||
KeyboardView(BRect frame);
|
void AttachedToWindow(void);
|
||||||
virtual void Draw(BRect frame);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BBitmap *fIconBitmap;
|
BBitmap *fIconBitmap;
|
||||||
BBitmap *fClockBitmap;
|
BBitmap *fClockBitmap;
|
||||||
BBox *fBox;
|
BBox *fBox;
|
||||||
|
BSlider *fDelaySlider;
|
||||||
|
BSlider *fRepeatSlider;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
/*
|
/*
|
||||||
** Copyright 2004, the Haiku project. All rights reserved.
|
* Copyright 2004-2006, the Haiku project. All rights reserved.
|
||||||
** Distributed under the terms of the Haiku License.
|
* Distributed under the terms of the Haiku License.
|
||||||
**
|
*
|
||||||
** Author : mccall@digitalparadise.co.uk, Jérôme Duval
|
* Authors in chronological order:
|
||||||
|
* [email protected]
|
||||||
|
* Jérôme Duval
|
||||||
|
* Marcus Overhagen
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <Button.h>
|
#include <Button.h>
|
||||||
#include <Message.h>
|
#include <Message.h>
|
||||||
#include <Screen.h>
|
#include <Screen.h>
|
||||||
@@ -15,12 +17,9 @@
|
|||||||
#include "KeyboardWindow.h"
|
#include "KeyboardWindow.h"
|
||||||
#include "KeyboardView.h"
|
#include "KeyboardView.h"
|
||||||
|
|
||||||
#define KEYBOARD_WINDOW_RIGHT 229
|
|
||||||
#define KEYBOARD_WINDOW_BOTTTOM 221
|
|
||||||
|
|
||||||
KeyboardWindow::KeyboardWindow()
|
KeyboardWindow::KeyboardWindow()
|
||||||
: BWindow(BRect(0,0,KEYBOARD_WINDOW_RIGHT,KEYBOARD_WINDOW_BOTTTOM), "Keyboard",
|
: BWindow(BRect(0,0,200,200), "Keyboard", B_TITLED_WINDOW,
|
||||||
B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE )
|
B_NOT_RESIZABLE | B_NOT_ZOOMABLE)
|
||||||
{
|
{
|
||||||
MoveTo(fSettings.WindowCorner());
|
MoveTo(fSettings.WindowCorner());
|
||||||
|
|
||||||
@@ -45,7 +44,6 @@ KeyboardWindow::KeyboardWindow()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
Show();
|
Show();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -144,5 +142,4 @@ KeyboardWindow::MessageReceived(BMessage *message)
|
|||||||
BWindow::MessageReceived(message);
|
BWindow::MessageReceived(message);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
/*
|
/*
|
||||||
** Copyright 2004, the Haiku project. All rights reserved.
|
* Copyright 2004-2006, the Haiku project. All rights reserved.
|
||||||
** Distributed under the terms of the Haiku License.
|
* Distributed under the terms of the Haiku License.
|
||||||
**
|
*
|
||||||
** Author : mccall@digitalparadise.co.uk, Jérôme Duval
|
* Authors in chronological order:
|
||||||
|
* [email protected]
|
||||||
|
* Jérôme Duval
|
||||||
|
* Marcus Overhagen
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef KEYBOARD_WINDOW_H
|
#ifndef KEYBOARD_WINDOW_H
|
||||||
#define KEYBOARD_WINDOW_H
|
#define KEYBOARD_WINDOW_H
|
||||||
|
|
||||||
@@ -16,14 +18,13 @@
|
|||||||
class KeyboardWindow : public BWindow
|
class KeyboardWindow : public BWindow
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
KeyboardWindow();
|
KeyboardWindow();
|
||||||
|
|
||||||
bool QuitRequested();
|
bool QuitRequested();
|
||||||
void MessageReceived(BMessage *message);
|
void MessageReceived(BMessage *message);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
KeyboardView *fView;
|
KeyboardView *fView;
|
||||||
|
|
||||||
KeyboardSettings fSettings;
|
KeyboardSettings fSettings;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user