From 9427e13a870d98e1a195dde5f6f4c459c0998fee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 1 Jun 2006 09:27:37 +0000 Subject: [PATCH] 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 --- src/apps/Jamfile | 1 + src/apps/calculator/CalcView.h | 101 ++++++++++++++++----------------- 2 files changed, 50 insertions(+), 52 deletions(-) diff --git a/src/apps/Jamfile b/src/apps/Jamfile index c4f6e2b7c9..18ef266071 100644 --- a/src/apps/Jamfile +++ b/src/apps/Jamfile @@ -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 ; diff --git a/src/apps/calculator/CalcView.h b/src/apps/calculator/CalcView.h index 6c7e6542b2..58f864c15c 100644 --- a/src/apps/calculator/CalcView.h +++ b/src/apps/calculator/CalcView.h @@ -5,71 +5,68 @@ * Authors: * Peter Wagner */ -#ifndef __CALC_VIEW__ -#define __CALC_VIEW__ +#ifndef CALC_VIEW_H +#define CALC_VIEW_H + #include #include #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