bool ctrlScrollBar::Msg_LeftUp(const MouseCoords& mc) { move = false; // ButtonMessages weiterleiten return RelayMouseMessage(&Window::Msg_LeftUp, mc); }
bool ctrlScrollBar::Msg_LeftDown(const MouseCoords& mc) { if (Coll(mc.x, mc.y, GetX(), GetY() + button_height + scrollbar_pos, width_, scrollbar_height)) { // Maus auf dem Scrollbutton move = true; return true; } else if (Coll(mc.x, mc.y, GetX(), GetY(), width_, button_height) || Coll(mc.x, mc.y, GetX(), GetY() + height_ - button_height, width_, button_height)) { // Maus auf einer Schaltflaeche return RelayMouseMessage(&Window::Msg_LeftDown, mc); } else { // Maus auf der Leiste unsigned short diff = scrollbar_height / 2; if (Coll(mc.x, mc.y, GetX(), GetY() + button_height, width_, scrollbar_pos)) { if (scrollbar_pos < diff) scrollbar_pos = 0; else scrollbar_pos -= diff; CalculatePosition(); parent_->Msg_ScrollChange(id_, scroll_pos); return true; } else { unsigned short sbb = button_height + scrollbar_pos + scrollbar_height; if (Coll(mc.x, mc.y, GetX(), GetY() + sbb, width_, height_ - (sbb + button_height))) { scrollbar_pos += diff; if (scrollbar_pos > (scroll_height - scrollbar_height)) scrollbar_pos = scroll_height - scrollbar_height; CalculatePosition(); parent_->Msg_ScrollChange(id_, scroll_pos); return true; } } } return false; }
/** * * * @author OLiver */ bool ctrlTable::Msg_RightDown(const MouseCoords& mc) { if(Coll(mc.x, mc.y, GetX(), GetY()+header_height, width-20, height)) { SetSelection((mc.y - header_height - GetY()) / font->getHeight() + GetCtrl<ctrlScrollBar>(0)->GetPos(), false); if(parent) parent->Msg_TableRightButton(this->id,row_r_selection); return true; } else return RelayMouseMessage(&Window::Msg_RightDown, mc); }
/** * * * @author OLiver */ bool ctrlTable::Msg_LeftDown(const MouseCoords& mc) { if(Coll(mc.x, mc.y, GetX(), GetY() + header_height, width - 20, height - header_height)) { SetSelection((mc.y - header_height - GetY()) / font->getHeight() + GetCtrl<ctrlScrollBar>(0)->GetPos()); if(parent) parent->Msg_TableLeftButton(this->id, row_l_selection); // Doppelklick? Dann noch einen extra Eventhandler aufrufen if(mc.dbl_click && parent) parent->Msg_TableChooseItem(this->id,row_l_selection); return true; } else return RelayMouseMessage(&Window::Msg_LeftDown, mc); }
/** * * * @author OLiver */ bool ctrlProgress::Msg_MouseMove(const MouseCoords& mc) { // an Buttons weiterleiten RelayMouseMessage(&Window::Msg_MouseMove, mc); if(Coll(mc.x, mc.y, GetX() + height_ + x_padding, GetY(), width_ - height_ * 2 - x_padding * 2, height_)) { WINDOWMANAGER.SetToolTip(this, tooltip_); return true; } else { WINDOWMANAGER.SetToolTip(this, ""); return false; } }
bool ctrlScrollBar::Msg_MouseMove(const MouseCoords& mc) { if(isMouseScrolling) { const int moveDist = mc.y - last_y; sliderPos += moveDist; if(sliderPos + sliderHeight > scroll_height) sliderPos = moveDist < 0 ? 0 : (scroll_height - sliderHeight); UpdatePosFromSlider(); } last_y = mc.y; // ButtonMessages weiterleiten return RelayMouseMessage(&Window::Msg_MouseMove, mc); }
bool ctrlComboBox::Msg_RightDown(const MouseCoords& mc) { ctrlList* list = GetCtrl<ctrlList>(0); // Für Button und Liste weiterleiten (und danach erst schließen) bool ret = RelayMouseMessage(&Window::Msg_RightDown, mc); // Clicked on list -> close it if(!readonly && Coll(mc.x, mc.y, GetX(), GetY() + height_, width_, height_ + list->GetHeight())) { // Liste wieder ausblenden ShowList(false); } return ret; }
bool ctrlScrollBar::Msg_MouseMove(const MouseCoords& mc) { if(move) { scrollbar_pos += (mc.y - last_y); if(scrollbar_pos + scrollbar_height > scroll_height) scrollbar_pos = ((mc.y - last_y) < 0 ? 0 : (scroll_height - scrollbar_height)); CalculatePosition(); if(scroll_pos > scroll_range - pagesize) scroll_pos = scroll_range - pagesize; parent_->Msg_ScrollChange(id_, scroll_pos); } last_y = mc.y; // ButtonMessages weiterleiten return RelayMouseMessage(&Window::Msg_MouseMove, mc); }
bool ctrlComboBox::Msg_WheelDown(const MouseCoords& mc) { ctrlList* list = GetCtrl<ctrlList>(0); if(!readonly && Coll(mc.x, mc.y, GetX(), GetY() + height_, width_, height_ + list->GetHeight()) && list->GetVisible()) { // Scrolled in opened list -> return RelayMouseMessage(&Window::Msg_WheelDown, mc); } if(!readonly && Coll(mc.x, mc.y, GetX(), GetY(), width_, height_)) { // Scrolled without list opened if (list->GetSelection() + 1 < list->GetLineCount()) Msg_ListSelectItem(GetID(), list->GetSelection() + 1); return true; } return false; }
/** * * * @author OLiver */ bool ctrlProgress::Msg_LeftDown(const MouseCoords& mc) { // Test if clicked on progress bar if(Coll(mc.x, mc.y, GetX() + height_ + 2 + x_padding, GetY() + 4 + y_padding, width_ - height_ * 2 - 4 - 2 * x_padding, height_ - 8 - 2 * y_padding)) { // The additional check for (position > maximum) is // mathematically redundant here; if there was more code than // it in SetPosition() we had to call it here instead of simply: position = ( mc.x - (GetX() + height_ + 2 + x_padding) + /*rounding:*/ (width_ - height_ * 2 - 4 - 2 * x_padding) / maximum / 2) * maximum / (width_ - height_ * 2 - 4 - 2 * x_padding); if(parent_) parent_->Msg_ProgressChange(GetID(), position); return true; } else return RelayMouseMessage(&Window::Msg_LeftDown, mc); }
bool ctrlScrollBar::Msg_LeftDown(const MouseCoords& mc) { if (Coll(mc.x, mc.y, GetX(), GetY() + button_height + sliderPos, width_, sliderHeight)) { // Maus auf dem Scrollbutton isMouseScrolling = true; return true; } else if (Coll(mc.x, mc.y, GetX(), GetY() + button_height, width_, sliderPos)) { // Clicked above slider -> Move half a slider height up if (sliderPos < sliderHeight / 2) sliderPos = 0; else sliderPos -= sliderHeight / 2; UpdatePosFromSlider(); return true; } else { unsigned short bottomSliderPos = button_height + sliderPos + sliderHeight; if (Coll(mc.x, mc.y, GetX(), GetY() + bottomSliderPos, width_, height_ - (bottomSliderPos + button_height))) { // Clicked below slider -> Move half a slider height down sliderPos += sliderHeight / 2; if(sliderPos + sliderHeight > scroll_height) { RTTR_Assert(scroll_height > sliderHeight); // Otherwise the scrollbar should be hidden sliderPos = scroll_height - sliderHeight; } UpdatePosFromSlider(); return true; } } return RelayMouseMessage(&Window::Msg_LeftDown, mc); }
bool ctrlComboBox::Msg_LeftDown(const MouseCoords& mc) { ctrlList* list = GetCtrl<ctrlList>(0); // Irgendwo anders hingeklickt --> Liste ausblenden if(!readonly && !Coll(mc.x, mc.y, GetX(), GetY(), width_, height_ + list->GetHeight())) { // Liste wieder ausblenden ShowList(false); return false; } if(!readonly && Coll(mc.x, mc.y, GetX(), GetY(), width_, height_)) { // Liste wieder ein/ausblenden ShowList(!list->GetVisible()); return true; } // Für Button und Liste weiterleiten return RelayMouseMessage(&Window::Msg_LeftDown, mc); }
/** * * * @author OLiver */ bool ctrlTab::Msg_MouseMove(const MouseCoords& mc) { return RelayMouseMessage(&Window::Msg_MouseMove, mc); }
bool ctrlComboBox::Msg_MouseMove(const MouseCoords& mc) { // Für Button und Liste weiterleiten return RelayMouseMessage(&Window::Msg_MouseMove, mc); }
/** * * * @author OLiver */ bool ctrlOptionGroup::Msg_LeftUp(const MouseCoords& mc) { return RelayMouseMessage(&Window::Msg_LeftUp, mc); }
/** * * * @author Divan */ bool ctrlOptionGroup::Msg_WheelDown(const MouseCoords& mc) { return RelayMouseMessage(&Window::Msg_WheelDown, mc); }
/** * * * @author OLiver */ bool ctrlGroup::Msg_RightUp(const MouseCoords& mc) { return RelayMouseMessage(&Window::Msg_RightUp, mc); }
/** * * * @author OLiver */ bool ctrlTab::Msg_LeftDown(const MouseCoords& mc) { return RelayMouseMessage(&Window::Msg_LeftDown, mc); }
/** * * * @author OLiver */ bool ctrlProgress::Msg_LeftUp(const MouseCoords& mc) { return RelayMouseMessage(&Window::Msg_LeftUp, mc); }
bool ctrlMultiSelectGroup::Msg_MouseMove(const MouseCoords& mc) { return RelayMouseMessage(&Window::Msg_MouseMove, mc); }
bool ctrlMultiSelectGroup::Msg_WheelDown(const MouseCoords& mc) { return RelayMouseMessage(&Window::Msg_WheelDown, mc); }
/** * * * @author OLiver */ bool ctrlTable::Msg_MouseMove(const MouseCoords& mc) { // ButtonMessages weiterleiten return RelayMouseMessage(&Window::Msg_MouseMove, mc); }
/** * * * @author Divan */ bool ctrlTab::Msg_WheelUp(const MouseCoords& mc) { return RelayMouseMessage(&Window::Msg_WheelUp, mc); }
void WindowManager::Msg_RightUp(const MouseCoords& mc) { RelayMouseMessage(&Window::Msg_RightUp, mc); }