Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F126296
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
3 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/util/gui/popup-box.h b/util/gui/popup-box.h
index c4e382b4..75cd9d10 100644
--- a/util/gui/popup-box.h
+++ b/util/gui/popup-box.h
@@ -1,65 +1,71 @@
#ifndef _paintown_gui_popup_box_h
#define _paintown_gui_popup_box_h
#include <string>
#include <vector>
#include "widget.h"
#include "box.h"
#include "../gradient.h"
namespace Gui{
class PopupBox : public Widget {
public:
PopupBox();
PopupBox(const PopupBox &);
virtual ~PopupBox();
//! copy
PopupBox &operator=(const PopupBox &);
//! Logic
virtual void act(const Font &);
//! Render
using Widget::render;
virtual void render(const Graphics::Bitmap &);
//! Open box
virtual void open();
//! Close box
virtual void close();
+
//! Is active?
virtual inline bool isActive(){
return (this->fadeState != Closed);
}
+
+ virtual inline bool isOpen(){
+ return this->fadeState == Open;
+ }
+
//!set fadespeed
virtual inline void setFadeSpeed(int speed){
this->fadeSpeed = speed;
}
//! Get current box coordinates
virtual inline const Coordinate & getArea(){
return this->board.location;
}
private:
void doFade();
enum FadeState{
Closed,
FadeIn,
Open,
FadeOut,
};
//! Current fade state
FadeState fadeState;
//! Fade speed
int fadeSpeed;
//! Board
Box board;
};
}
#endif
diff --git a/util/gui/widget.h b/util/gui/widget.h
index eaef544f..4aad408c 100644
--- a/util/gui/widget.h
+++ b/util/gui/widget.h
@@ -1,67 +1,68 @@
#ifndef _paintown_gui_widget_h
#define _paintown_gui_widget_h
#include "rectarea.h"
#include "coordinate.h"
namespace Graphics{
class Bitmap;
}
class Token;
class Font;
namespace Gui{
struct ColorInfo{
ColorInfo():
body(0),
- bodyAlpha(0),
+ /* alpha 0 is invisible, 255 is opaque. set something in the middle as default */
+ bodyAlpha(128),
border(0),
- borderAlpha(0){
+ borderAlpha(128){
}
int body;
int bodyAlpha;
int border;
int borderAlpha;
};
class Widget{
public:
Widget();
Widget( const Widget & w );
virtual ~Widget();
// copy
Widget &operator=( const Widget &);
void setCoordinates(const Token * token);
void setColors(const Token * token);
//! New position data
Coordinate location;
//! Colors
ColorInfo colors;
// Logic
virtual void act(const Font &)=0;
// Render
virtual void render(const Graphics::Bitmap &) = 0;
/* default behavior is just to call render() */
virtual void render(const Graphics::Bitmap &, const Font &);
protected:
void arc( const Graphics::Bitmap &, int x, int y, double startAngle, int radius, int color );
void roundRect( const Graphics::Bitmap &, int radius, int x1, int y1, int x2, int y2, int color );
void roundRectFill( const Graphics::Bitmap &, int radius, int x1, int y1, int x2, int y2, int color );
void checkWorkArea();
Graphics::Bitmap *workArea;
};
}
#endif
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Thu, Jun 11, 11:12 AM (3 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
68666
Default Alt Text
(3 KB)
Attached To
Mode
R75 R-Tech1
Attached
Detach File
Event Timeline