mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-11-29 22:01:01 -07:00
NEW: management camera video stream in device panel
Change-Id: I39634af900071cc5c01a88100457880a513e416f
This commit is contained in:
parent
1068baf10e
commit
4d4fcc1780
24 changed files with 334 additions and 56 deletions
|
|
@ -127,6 +127,14 @@ bool Button::Enable(bool enable)
|
|||
|
||||
void Button::SetCanFocus(bool canFocus) { this->canFocus = canFocus; }
|
||||
|
||||
void Button::SetValue(bool state)
|
||||
{
|
||||
if (GetValue() == state) return;
|
||||
state_handler.set_state(state ? StateHandler::Checked : 0, StateHandler::Checked);
|
||||
}
|
||||
|
||||
bool Button::GetValue() const { return state_handler.states() & StateHandler::Checked; }
|
||||
|
||||
void Button::Rescale()
|
||||
{
|
||||
if (this->active_icon.bmp().IsOk())
|
||||
|
|
|
|||
|
|
@ -48,6 +48,10 @@ public:
|
|||
|
||||
void SetCanFocus(bool canFocus) override;
|
||||
|
||||
void SetValue(bool state);
|
||||
|
||||
bool GetValue() const;
|
||||
|
||||
void Rescale();
|
||||
|
||||
protected:
|
||||
|
|
|
|||
|
|
@ -69,6 +69,19 @@ void StateHandler::update_binds()
|
|||
for (auto &c : children_) c->update_binds();
|
||||
}
|
||||
|
||||
void StateHandler::set_state(int state, int mask)
|
||||
{
|
||||
if (states_ & mask == state & mask) return;
|
||||
int old = states_;
|
||||
states_ = states_ & ~mask | state & mask;
|
||||
if (old != states_ && (old | states2_) != (states_ | states2_)) {
|
||||
if (parent_)
|
||||
parent_->changed(states_ | states2_);
|
||||
else
|
||||
owner_->Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
StateHandler::StateHandler(StateHandler *parent, wxWindow *owner)
|
||||
: StateHandler(owner)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -41,6 +41,8 @@ public:
|
|||
|
||||
int states() const { return states_ | states2_; }
|
||||
|
||||
void set_state(int state, int mask);
|
||||
|
||||
private:
|
||||
StateHandler(StateHandler * parent, wxWindow *owner);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue