00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #if !defined(_XRB_PROGRESSBAR_HPP_)
00012 #define _XRB_PROGRESSBAR_HPP_
00013
00014 #include "xrb_widget.hpp"
00015
00016 #include "xrb_color.hpp"
00017
00018 using namespace Xrb;
00019
00020 namespace Xrb
00021 {
00022
00023 class ProgressBar : public Widget
00024 {
00025 public:
00026
00027 enum GrowOrientation
00028 {
00029 GO_LEFT = 0,
00030 GO_RIGHT,
00031 GO_UP,
00032 GO_DOWN,
00033
00034 GO_COUNT
00035 };
00036
00037 ProgressBar (
00038 GrowOrientation grow_orientation,
00039 ContainerWidget *parent,
00040 std::string const &name = "ProgressBar");
00041 virtual ~ProgressBar ();
00042
00043 inline Float Progress () const
00044 {
00045 return m_progress;
00046 }
00047 inline Color const &GetColor () const
00048 {
00049 return m_color;
00050 }
00051
00052 inline void SetProgress (Float const progress)
00053 {
00054 ASSERT1(progress >= 0.0f && progress <= 1.0f);
00055 m_progress = progress;
00056 }
00057 inline void SetColor (Color const &color)
00058 {
00059 m_color = color;
00060 }
00061
00062 inline SignalReceiver1<Float> const *ReceiverSetProgress () { return &m_receiver_set_progress; }
00063
00064 virtual void Draw (RenderContext const &render_context) const;
00065
00066 private:
00067
00068 GrowOrientation m_grow_orientation;
00069 Float m_progress;
00070 Color m_color;
00071
00072 SignalReceiver1<Float> m_receiver_set_progress;
00073 };
00074
00075 }
00076
00077 #endif // !defined(_XRB_PROGRESSBAR_HPP_)
00078