progressbar with stop()
This commit is contained in:
parent
11d65763ce
commit
3157f5f056
@ -30,6 +30,8 @@ namespace nana
|
||||
unsigned Max(unsigned);
|
||||
void unknown(bool);
|
||||
bool unknown() const;
|
||||
bool stop(bool s = true);
|
||||
bool stoped() const;
|
||||
private:
|
||||
void attached(widget_reference, graph_reference) override;
|
||||
void refresh(graph_reference) override;
|
||||
@ -45,6 +47,7 @@ namespace nana
|
||||
nana::paint::graphics* graph_{nullptr};
|
||||
unsigned draw_width_{static_cast<unsigned>(-1)};
|
||||
bool unknown_{false};
|
||||
bool stop_{false};
|
||||
unsigned max_{100};
|
||||
unsigned value_{0};
|
||||
}; //end class drawer
|
||||
@ -67,6 +70,8 @@ namespace nana
|
||||
unsigned amount(unsigned value);
|
||||
void unknown(bool);
|
||||
bool unknown() const;
|
||||
bool stop(bool s=true); ///< request stop or cancel and return previus stop status
|
||||
bool stoped() const;
|
||||
};
|
||||
}//end namespace nana
|
||||
#endif
|
||||
|
@ -89,6 +89,15 @@ namespace nana
|
||||
{
|
||||
return unknown_;
|
||||
}
|
||||
bool trigger::stoped() const
|
||||
{
|
||||
return stop_;
|
||||
}
|
||||
bool trigger::stop(bool s)
|
||||
{
|
||||
std::swap(s,stop_);
|
||||
return s;
|
||||
}
|
||||
|
||||
void trigger::refresh(graph_reference)
|
||||
{
|
||||
@ -197,5 +206,13 @@ namespace nana
|
||||
{
|
||||
return get_drawer_trigger().unknown();
|
||||
}
|
||||
bool progress::stop(bool s)
|
||||
{
|
||||
return get_drawer_trigger().stop(s);
|
||||
}
|
||||
bool progress::stoped() const
|
||||
{
|
||||
return get_drawer_trigger().stoped();
|
||||
}
|
||||
//end class progress
|
||||
}//end namespace nana
|
||||
|
Loading…
x
Reference in New Issue
Block a user