//-----------------------------------------------------------------// void update_touch_slider(const vtx::spos& pos, uint16_t num) noexcept { if(num == 0) { focus_ = false; touch_ = false; touch_state_.position_.set(-1); touch_state_.positive_ = false; touch_state_.negative_ = touch_state_.level_; touch_state_.level_ = false; return; } auto loc = vtx::srect(get_final_position(), location_.size); loc.org -= touch_state_.expand_; loc.size += touch_state_.expand_; bool focus = loc.is_focus(pos); if(!focus_ && focus) { touch_ = true; } focus_ = focus; touch_state_.position_ = pos; auto level = touch_; touch_state_.positive_ = ( level && !touch_state_.level_); touch_state_.negative_ = (!level && touch_state_.level_); touch_state_.level_ = level; }
Patch::~Patch() { //XXX - Moved this up here... _textures.delete_all(); // Get out of the patch list if needed: if (_mesh) _mesh->unlist(this); _mesh = nullptr; // The patch owns its tri_strips, crease strips, and Gtexures, // but not its faces, edge strips, or vert strips. So it deletes // the former but not the latter. while (!_tri_strips.empty()) { delete _tri_strips.back(); _tri_strips.pop_back(); } delete _creases; delete _borders; //XXX - Moved this higher so that GTextures that do things // like unobserving meshes on destruction, still have // a valid _mesh pointer... //_textures.delete_all(); for (Bface_list::size_type i=0; i<_faces.size(); i++) { _faces[i]->set_patch(nullptr); _faces[i]->set_patch_index(-1); } if (is_focus(this)) set_focus(nullptr); }
//-----------------------------------------------------------------// void update_touch_def(const vtx::spos& pos, uint16_t num, bool exp = true) noexcept { auto loc = vtx::srect(get_final_position(), location_.size); if(exp) { loc.org -= touch_state_.expand_; loc.size += touch_state_.expand_; } focus_ = loc.is_focus(pos); if(focus_) { if(num > 0) { touch_ = true; touch_state_.position_ = pos; touch_state_.relative_ = pos - loc.org; } else { touch_ = false; touch_state_.position_.set(-1); } auto level = touch_; touch_state_.positive_ = ( level && !touch_state_.level_); touch_state_.negative_ = (!level && touch_state_.level_); touch_state_.level_ = level; } else { touch_state_.positive_ = false; touch_state_.negative_ = false; touch_state_.level_ = false; } }
void CheckBox::redraw () { choose_palette (is_focus () ? PALETTE_ID_CHECKBOX_FOCUS : PALETTE_ID_CHECKBOX); clear (); unsigned wid = get_size().x; Size pos = make_size (); if (wid >= 3) { pos = put (pos, L'['); } move_cursor (pos); // U+00D7 is Multipilcation sign pos = put (pos, status ? ( terminal_emulator_correct_wcwidth () ? L'\u00d7' : L'x' ) : L' '); if (wid >= 3) { put (pos, L']'); } }
void DropList::redraw () { choose_palette (is_focus () ? PALETTE_ID_DROPLIST_FOCUS : PALETTE_ID_DROPLIST); clear (); put (make_size (), items[select]); }