Cruft removal

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5085 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
DarkWyrm
2003-10-18 23:17:34 +00:00
parent c94c672743
commit d1c8b508e5
4 changed files with 0 additions and 172 deletions
@@ -1,105 +0,0 @@
#include "ColorWell.h"
ColorWell::ColorWell(BRect frame, BMessage *msg, bool is_rectangle=false)
: BView(frame,"ColorWell", B_FOLLOW_ALL_SIDES, B_WILL_DRAW)
{
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
SetLowColor(0,0,0);
invoker=new BInvoker(msg,this);
disabledcol.red=128;
disabledcol.green=128;
disabledcol.blue=128;
disabledcol.alpha=255;
is_enabled=true;
is_rect=is_rectangle;
}
ColorWell::~ColorWell(void)
{
delete invoker;
}
void ColorWell::SetTarget(BHandler *tgt)
{
invoker->SetTarget(tgt);
}
void ColorWell::SetColor(rgb_color col)
{
SetHighColor(col);
currentcol=col;
Draw(Bounds());
// Invalidate();
invoker->Invoke();
}
void ColorWell::SetColor(uint8 r,uint8 g, uint8 b)
{
SetHighColor(r,g,b);
currentcol.red=r;
currentcol.green=g;
currentcol.blue=b;
Draw(Bounds());
//Invalidate();
invoker->Invoke();
}
void ColorWell::MessageReceived(BMessage *msg)
{
// If we received a dropped message, try to see if it has color data
// in it
if(msg->WasDropped())
{
rgb_color *col;
uint8 *ptr;
ssize_t size;
if(msg->FindData("RGBColor",(type_code)'RGBC',(const void**)&ptr,&size)==B_OK)
{
col=(rgb_color*)ptr;
SetHighColor(*col);
}
}
// The default
BView::MessageReceived(msg);
}
void ColorWell::SetEnabled(bool value)
{
if(is_enabled!=value)
{
is_enabled=value;
Invalidate();
}
}
void ColorWell::Draw(BRect update)
{
if(is_enabled)
SetHighColor(currentcol);
else
SetHighColor(disabledcol);
if(is_rect)
{
FillRect(Bounds());
if(is_enabled)
StrokeRect(Bounds(),B_SOLID_LOW);
}
else
{
FillEllipse(Bounds());
if(is_enabled)
StrokeEllipse(Bounds(),B_SOLID_LOW);
}
}
rgb_color ColorWell::Color(void) const
{
return currentcol;
}
void ColorWell::SetMode(bool is_rectangle)
{
is_rect=is_rectangle;
}
@@ -1,27 +0,0 @@
#ifndef COLORWELL_H_
#define COLORWELL_H_
#include <View.h>
#include <Message.h>
#include <Invoker.h>
class ColorWell : public BView
{
public:
ColorWell(BRect frame, BMessage *msg, bool is_rectangle=false);
~ColorWell(void);
void SetColor(rgb_color col);
rgb_color Color(void) const;
void SetColor(uint8 r,uint8 g, uint8 b);
virtual void MessageReceived(BMessage *msg);
virtual void Draw(BRect update);
virtual void SetTarget(BHandler *tgt);
virtual void SetEnabled(bool value);
void SetMode(bool is_rectangle);
protected:
BInvoker *invoker;
bool is_enabled, is_rect;
rgb_color disabledcol, currentcol;
};
#endif
-20
View File
@@ -1,20 +0,0 @@
#ifndef DEFS_H_
#define DEFS_H_
#define SETTINGS_DIR "/boot/home/config/settings/app_server/"
#define APPLY_SETTINGS 'aply'
#define REVERT_SETTINGS 'rvrt'
#define DEFAULT_SETTINGS 'dflt'
#define TRY_SETTINGS 'trys'
#define ATTRIBUTE_CHOSEN 'atch'
#define UPDATE_COLOR 'upcl'
#define DECORATOR_CHOSEN 'dcch'
#define UPDATE_DECORATOR 'updc'
#define SET_DECORATOR 'sdec'
#define GET_DECORATOR 'gdec'
#define SET_UI_COLORS 'suic'
#endif
@@ -1,20 +0,0 @@
#ifndef DEFS_H_
#define DEFS_H_
#define SETTINGS_DIR "/boot/home/config/settings/app_server/"
#define APPLY_SETTINGS 'aply'
#define REVERT_SETTINGS 'rvrt'
#define DEFAULT_SETTINGS 'dflt'
#define TRY_SETTINGS 'trys'
#define ATTRIBUTE_CHOSEN 'atch'
#define UPDATE_COLOR 'upcl'
#define DECORATOR_CHOSEN 'dcch'
#define UPDATE_DECORATOR 'updc'
#define SET_DECORATOR 'sdec'
#define GET_DECORATOR 'gdec'
#define SET_UI_COLORS 'suic'
#endif