Removing Time* files from Keyboard folder, and changing Jamfile back for Keyboard.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@914 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
a51a3bf754
commit
18ed6f0441
@ -1,7 +1,7 @@
|
||||
SubDir OBOS_TOP src prefs time ;
|
||||
SubDir OBOS_TOP src prefs keyboard ;
|
||||
|
||||
AddResources Time : Time.rsrc ;
|
||||
AddResources Keyboard : Keyboard.rsrc ;
|
||||
|
||||
Preference Time : Time.cpp TimeSettings.cpp TimeView.cpp TimeWindow.cpp ;
|
||||
Preference Keyboard : Keyboard.cpp KeyboardSettings.cpp KeyboardView.cpp KeyboardWindow.cpp ;
|
||||
|
||||
LinkSharedOSLibs Time : translation be root ;
|
||||
LinkSharedOSLibs Keyboard : translation be root ;
|
||||
|
@ -1,70 +0,0 @@
|
||||
/*
|
||||
* Time.cpp
|
||||
* Time mccall@digitalparadise.co.uk
|
||||
*
|
||||
*/
|
||||
|
||||
#include <Alert.h>
|
||||
#include <Screen.h>
|
||||
|
||||
#include "Time.h"
|
||||
#include "TimeWindow.h"
|
||||
#include "TimeSettings.h"
|
||||
#include "TimeMessages.h"
|
||||
|
||||
const char TimeApplication::kTimeApplicationSig[] = "application/x-vnd.OpenBeOS-TIME";
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
TimeApplication myApplication;
|
||||
|
||||
myApplication.Run();
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
TimeApplication::TimeApplication()
|
||||
:BApplication(kTimeApplicationSig)
|
||||
{
|
||||
|
||||
TimeWindow *window;
|
||||
|
||||
fSettings = new TimeSettings();
|
||||
|
||||
window = new TimeWindow();
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
TimeApplication::MessageReceived(BMessage *message)
|
||||
{
|
||||
switch(message->what) {
|
||||
case ERROR_DETECTED:
|
||||
{
|
||||
BAlert *errorAlert = new BAlert("Error", "Something has gone wrong!","OK",NULL,NULL,B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_WARNING_ALERT);
|
||||
errorAlert->Go();
|
||||
be_app->PostMessage(B_QUIT_REQUESTED);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
BApplication::MessageReceived(message);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
TimeApplication::SetWindowCorner(BPoint corner)
|
||||
{
|
||||
fSettings->SetWindowCorner(corner);
|
||||
}
|
||||
|
||||
void
|
||||
TimeApplication::AboutRequested(void)
|
||||
{
|
||||
(new BAlert("about", "...by Andrew Edward McCall", "Dig Deal"))->Go();
|
||||
}
|
||||
|
||||
TimeApplication::~TimeApplication()
|
||||
{
|
||||
delete fSettings;
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
#ifndef TIME_H
|
||||
#define TIME_H
|
||||
|
||||
#include <Application.h>
|
||||
|
||||
#include "TimeWindow.h"
|
||||
#include "TimeSettings.h"
|
||||
|
||||
class TimeApplication : public BApplication
|
||||
{
|
||||
public:
|
||||
TimeApplication();
|
||||
virtual ~TimeApplication();
|
||||
|
||||
void MessageReceived(BMessage *message);
|
||||
BPoint WindowCorner() const {return fSettings->WindowCorner(); }
|
||||
void SetWindowCorner(BPoint corner);
|
||||
|
||||
void AboutRequested(void);
|
||||
|
||||
private:
|
||||
|
||||
static const char kTimeApplicationSig[];
|
||||
|
||||
TimeSettings *fSettings;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
Binary file not shown.
@ -1,17 +0,0 @@
|
||||
/*
|
||||
|
||||
TimeMessages.h
|
||||
|
||||
*/
|
||||
|
||||
#ifndef TIME_MESSAGES_H
|
||||
#define TIME_MESSAGES_H
|
||||
|
||||
const uint32 BUTTON_DEFAULTS = 'BTde';
|
||||
const uint32 BUTTON_REVERT = 'BTre';
|
||||
const uint32 SLIDER_REPEAT_RATE = 'SLrr';
|
||||
const uint32 SLIDER_DELAY_RATE = 'SLdr';
|
||||
|
||||
const uint32 ERROR_DETECTED = 'ERor';
|
||||
|
||||
#endif //TIME_MESSAGES_H
|
@ -1,63 +0,0 @@
|
||||
/*
|
||||
* TimeSettings.cpp
|
||||
* Time mccall@digitalparadise.co.uk
|
||||
*
|
||||
*/
|
||||
|
||||
#include <Application.h>
|
||||
#include <FindDirectory.h>
|
||||
#include <File.h>
|
||||
#include <Path.h>
|
||||
#include <String.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "TimeSettings.h"
|
||||
#include "TimeMessages.h"
|
||||
|
||||
const char TimeSettings::kTimeSettingsFile[] = "Time_settings";
|
||||
|
||||
TimeSettings::TimeSettings()
|
||||
{
|
||||
BPath path;
|
||||
|
||||
if (find_directory(B_USER_SETTINGS_DIRECTORY,&path) == B_OK) {
|
||||
path.Append(kTimeSettingsFile);
|
||||
BFile file(path.Path(), B_READ_ONLY);
|
||||
if (file.InitCheck() == B_OK) {
|
||||
// Now read in the data
|
||||
if (file.Read(&fCorner, sizeof(BPoint)) != sizeof(BPoint)) {
|
||||
fCorner.x=50;
|
||||
fCorner.y=50;
|
||||
};
|
||||
}
|
||||
else {
|
||||
fCorner.x=50;
|
||||
fCorner.y=50;
|
||||
}
|
||||
}
|
||||
else
|
||||
be_app->PostMessage(ERROR_DETECTED);
|
||||
}
|
||||
|
||||
TimeSettings::~TimeSettings()
|
||||
{
|
||||
BPath path;
|
||||
|
||||
if (find_directory(B_USER_SETTINGS_DIRECTORY,&path) < B_OK)
|
||||
return;
|
||||
|
||||
path.Append(kTimeSettingsFile);
|
||||
|
||||
BFile file(path.Path(), B_WRITE_ONLY | B_CREATE_FILE);
|
||||
if (file.InitCheck() == B_OK) {
|
||||
file.Write(&fCorner, sizeof(BPoint));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
TimeSettings::SetWindowCorner(BPoint corner)
|
||||
{
|
||||
fCorner=corner;
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
#ifndef TIME_SETTINGS_H_
|
||||
#define TIME_SETTINGS_H_
|
||||
|
||||
#include <SupportDefs.h>
|
||||
|
||||
class TimeSettings{
|
||||
public :
|
||||
TimeSettings();
|
||||
~TimeSettings();
|
||||
|
||||
BPoint WindowCorner() const { return fCorner; }
|
||||
void SetWindowCorner(BPoint corner);
|
||||
|
||||
private:
|
||||
static const char kTimeSettingsFile[];
|
||||
BPoint fCorner;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
@ -1,25 +0,0 @@
|
||||
/*
|
||||
|
||||
TimeView.cpp
|
||||
|
||||
*/
|
||||
#include <InterfaceDefs.h>
|
||||
|
||||
#include "TimeView.h"
|
||||
#include "TimeMessages.h"
|
||||
|
||||
TimeView::TimeView(BRect rect)
|
||||
: BBox(rect, "time_view",
|
||||
B_FOLLOW_ALL, B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE_JUMP,
|
||||
B_PLAIN_BORDER)
|
||||
{
|
||||
|
||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||
|
||||
}
|
||||
|
||||
void TimeView::Draw(BRect updateFrame)
|
||||
{
|
||||
inherited::Draw(updateFrame);
|
||||
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
/*
|
||||
|
||||
TimeView.h
|
||||
|
||||
*/
|
||||
|
||||
#ifndef TIME_VIEW_H
|
||||
#define TIME_VIEW_H
|
||||
|
||||
|
||||
#include <Box.h>
|
||||
|
||||
class TimeView : public BBox
|
||||
{
|
||||
public:
|
||||
typedef BBox inherited;
|
||||
|
||||
TimeView(BRect frame);
|
||||
virtual void Draw(BRect frame);
|
||||
|
||||
private:
|
||||
;
|
||||
};
|
||||
|
||||
#endif
|
@ -1,70 +0,0 @@
|
||||
/*
|
||||
* TimeWindow.cpp
|
||||
* Time mccall@digitalparadise.co.uk
|
||||
*
|
||||
*/
|
||||
|
||||
#include <Application.h>
|
||||
#include <Message.h>
|
||||
#include <Screen.h>
|
||||
|
||||
#include "TimeMessages.h"
|
||||
#include "TimeWindow.h"
|
||||
#include "TimeView.h"
|
||||
#include "Time.h"
|
||||
|
||||
#define TIME_WINDOW_RIGHT 332
|
||||
#define TIME_WINDOW_BOTTTOM 208
|
||||
|
||||
TimeWindow::TimeWindow()
|
||||
: BWindow(BRect(0,0,TIME_WINDOW_RIGHT,TIME_WINDOW_BOTTTOM), "Time & Date", B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE )
|
||||
{
|
||||
BScreen screen;
|
||||
BSlider *slider=NULL;
|
||||
|
||||
MoveTo(dynamic_cast<TimeApplication *>(be_app)->WindowCorner());
|
||||
|
||||
// Code to make sure that the window doesn't get drawn off screen...
|
||||
if (!(screen.Frame().right >= Frame().right && screen.Frame().bottom >= Frame().bottom))
|
||||
MoveTo((screen.Frame().right-Bounds().right)*.5,(screen.Frame().bottom-Bounds().bottom)*.5);
|
||||
|
||||
BuildView();
|
||||
AddChild(fView);
|
||||
|
||||
Show();
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
TimeWindow::BuildView()
|
||||
{
|
||||
fView = new TimeView(Bounds());
|
||||
}
|
||||
|
||||
bool
|
||||
TimeWindow::QuitRequested()
|
||||
{
|
||||
|
||||
dynamic_cast<TimeApplication *>(be_app)->SetWindowCorner(BPoint(Frame().left,Frame().top));
|
||||
|
||||
be_app->PostMessage(B_QUIT_REQUESTED);
|
||||
|
||||
return(true);
|
||||
}
|
||||
|
||||
void
|
||||
TimeWindow::MessageReceived(BMessage *message)
|
||||
{
|
||||
|
||||
switch(message->what) {
|
||||
default:
|
||||
BWindow::MessageReceived(message);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
TimeWindow::~TimeWindow()
|
||||
{
|
||||
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
#ifndef TIME_WINDOW_H
|
||||
#define TIME_WINDOW_H
|
||||
|
||||
#include <Window.h>
|
||||
|
||||
#include "TimeSettings.h"
|
||||
#include "TimeView.h"
|
||||
|
||||
class TimeWindow : public BWindow
|
||||
{
|
||||
public:
|
||||
TimeWindow();
|
||||
~TimeWindow();
|
||||
|
||||
bool QuitRequested();
|
||||
void MessageReceived(BMessage *message);
|
||||
void BuildView();
|
||||
|
||||
private:
|
||||
TimeView *fView;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user