HoverRace  2.0
FillBox.h
Go to the documentation of this file.
1 
2 // FillBox.h
3 //
4 // Copyright (c) 2013-2016 Michael Imamura.
5 //
6 // Licensed under GrokkSoft HoverRace SourceCode License v1.0(the "License");
7 // you may not use this file except in compliance with the License.
8 //
9 // A copy of the license should have been attached to the package from which
10 // you have taken this file. If you can not find the license you can not use
11 // this file.
12 //
13 //
14 // The author makes no representations about the suitability of
15 // this software for any purpose. It is provided "as is" "AS IS",
16 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
17 // implied.
18 //
19 // See the License for the specific language governing permissions
20 // and limitations under the License.
21 
22 #pragma once
23 
24 #include "Color.h"
25 
26 #include "Box.h"
27 
28 #if defined(_WIN32) && defined(HR_ENGINE_SHARED)
29 # ifdef MR_ENGINE
30 # define MR_DllDeclare __declspec( dllexport )
31 # else
32 # define MR_DllDeclare __declspec( dllimport )
33 # endif
34 #else
35 # define MR_DllDeclare
36 #endif
37 
38 namespace HoverRace {
39  namespace Display {
40  class Display;
41  }
42 }
43 
44 namespace HoverRace {
45 namespace Display {
46 
51 class MR_DllDeclare FillBox : public Box
52 {
53  using SUPER = Box;
54 
55 public:
56  struct Props
57  {
58  enum {
59  COLOR = SUPER::Props::NEXT_,
63  };
64  };
65 
66 public:
67  FillBox(const Vec2 &size, const Color color,
68  uiLayoutFlags_t layoutFlags = 0);
69  FillBox(double w, double h, const Color color,
70  uiLayoutFlags_t layoutFlags = 0);
71  FillBox(const Vec2 &size, const Color color, double border,
72  const Color borderColor, uiLayoutFlags_t layoutFlags = 0);
73  FillBox(double w, double h, const Color color, double border,
74  const Color borderColor, uiLayoutFlags_t layoutFlags = 0);
75  virtual ~FillBox() { }
76 
77 public:
78  virtual void AttachView(Display &disp) { AttachViewDynamic(disp, this); }
79 
80 public:
81  const Color GetColor() const { return color; }
82  void SetColor(const Color color);
83 
84  double GetBorder() const { return border; }
85  void SetBorder(double border);
86 
87  const Color GetBorderColor() const { return borderColor; }
88  void SetBorderColor(const Color color);
89 
90 private:
92  double border;
94 };
95 
96 } // namespace Display
97 } // namespace HoverRace
98 
99 #undef MR_DllDeclare
Definition: Color.h:40
Color borderColor
Definition: FillBox.h:93
double GetBorder() const
Definition: FillBox.h:84
Base class for UI (2D) components.
Definition: UiViewModel.h:56
virtual ~FillBox()
Definition: FillBox.h:75
Color color
Definition: FillBox.h:91
Base class for low-level bounded widgets.
Definition: Box.h:51
Definition: Vec.h:38
MR_UInt32 uiLayoutFlags_t
Definition: UiLayoutFlags.h:53
Base class for display managers.
Definition: Display.h:73
const Color GetColor() const
Definition: FillBox.h:81
virtual void AttachView(Display &disp)
Definition: FillBox.h:78
const Color GetBorderColor() const
Definition: FillBox.h:87
A colored rectangle, that's all.
Definition: FillBox.h:51
Definition: FillBox.h:56
Definition: Announcement.h:24
double border
Definition: FillBox.h:92
First index for subclasses.
Definition: FillBox.h:62
#define MR_DllDeclare
Definition: FillBox.h:35