Added Calculator to the build, and fixed build for Dano.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17685 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2006-06-01 09:27:37 +00:00
parent f883a05a74
commit 9427e13a87
2 changed files with 50 additions and 52 deletions

View File

@ -2,6 +2,7 @@ SubDir HAIKU_TOP src apps ;
SubInclude HAIKU_TOP src apps abouthaiku ;
SubInclude HAIKU_TOP src apps bemail ;
SubInclude HAIKU_TOP src apps calculator ;
SubInclude HAIKU_TOP src apps cdplayer ;
SubInclude HAIKU_TOP src apps clock ;
SubInclude HAIKU_TOP src apps codycam ;

View File

@ -5,71 +5,68 @@
* Authors:
* Peter Wagner <pwagner@stanfordalumni.org>
*/
#ifndef __CALC_VIEW__
#define __CALC_VIEW__
#ifndef CALC_VIEW_H
#define CALC_VIEW_H
#include <View.h>
#include <Message.h>
#include "FrameView.h"
#include "CalcEngine.h"
class _EXPORT CalcView : public BView
{
public:
static void About(void);
class BStringView;
static float TheWidth() { return 272; }
static float TheHeight() { return 284; }
static BRect TheRect() { return TheRect(0,0); }
static BRect TheRect(const BPoint &pt) { return TheRect(pt.x,pt.y); }
static BRect TheRect(float x, float y) { return BRect(x,y,x+TheWidth(),y+TheHeight()); }
static float ExtraHeight() { return 43; }
class _EXPORT CalcView : public BView {
public:
CalcView(BRect frame);
CalcView(BMessage *msg);
virtual ~CalcView();
virtual status_t Archive(BMessage *msg, bool deep) const;
static BArchivable* Instantiate(BMessage *msg);
virtual void AttachedToWindow();
virtual void AllAttached();
virtual void Draw(BRect updateRect);
virtual void KeyDown(const char *bytes, int32 numBytes);
virtual void MouseDown(BPoint where);
virtual void WindowActivated(bool state);
virtual void MakeFocus(bool focusState = true);
virtual void MessageReceived(BMessage *message);
void SendKeystroke(ulong key);
virtual bool TextWidthOK(const char *str);
BView *AddExtra();
CalcView(BRect frame);
virtual ~CalcView();
static void About();
static float TheWidth() { return 272; }
static float TheHeight() { return 284; }
static BRect TheRect() { return TheRect(0,0); }
static BRect TheRect(const BPoint &pt) { return TheRect(pt.x,pt.y); }
static BRect TheRect(float x, float y) { return BRect(x,y,x+TheWidth(),y+TheHeight()); }
static float ExtraHeight() { return 43; }
private:
void Init();
// replicant
CalcView(BMessage *msg);
virtual status_t Archive(BMessage *msg, bool deep) const;
static BArchivable* Instantiate(BMessage *msg);
CalcEngine calc;
bool is_replicant;
virtual void AttachedToWindow();
virtual void AllAttached();
virtual void Draw(BRect updateRect);
virtual void KeyDown(const char *bytes, int32 numBytes);
virtual void MouseDown(BPoint where);
virtual void WindowActivated(bool state);
virtual void MakeFocus(bool focusState = true);
virtual void MessageReceived(BMessage *message);
void SendKeystroke(ulong key);
virtual bool TextWidthOK(const char *str);
BView *AddExtra();
private:
void Init(void);
CalcEngine calc;
bool is_replicant;
int current_highlight;
enum { state_unknown=0, state_active, state_inactive };
void ChangeHighlight();
FrameView *lcd_frame;
BStringView *lcd;
BStringView *binary_sign_view;
BStringView *binary_exponent_view;
BStringView *binary_number_view;
int current_highlight;
enum { state_unknown=0, state_active, state_inactive };
void ChangeHighlight();
FrameView *lcd_frame;
BStringView *lcd;
BStringView *binary_sign_view;
BStringView *binary_exponent_view;
BStringView *binary_number_view;
};
#endif
#endif // CALC_VIEW_H