void ComboBox::mouseDrag (const MouseEvent& e) { beginDragAutoRepeat (50); if (isButtonDown && ! e.mouseWasClicked()) showPopupIfNotActive(); }
void ComboBox::mouseDrag (const MouseEvent& e) { beginDragAutoRepeat (50); if (isButtonDown && e.mouseWasDraggedSinceMouseDown()) showPopupIfNotActive(); }
//============================================================================== void ComboBox::mouseDown (const MouseEvent& e) { beginDragAutoRepeat (300); isButtonDown = isEnabled() && ! e.mods.isPopupMenu(); if (isButtonDown && (e.eventComponent == this || ! label->isEditable())) showPopupIfNotActive(); }
void ComboBox::mouseUp (const MouseEvent& e2) { if (isButtonDown) { isButtonDown = false; repaint(); const MouseEvent e (e2.getEventRelativeTo (this)); if (reallyContains (e.getPosition(), true) && (e2.eventComponent == this || ! label->isEditable())) { showPopupIfNotActive(); } } }
//============================================================================== bool ComboBox::keyPressed (const KeyPress& key) { if (key == KeyPress::upKey || key == KeyPress::leftKey) { nudgeSelectedItem (-1); return true; } if (key == KeyPress::downKey || key == KeyPress::rightKey) { nudgeSelectedItem (1); return true; } if (key == KeyPress::returnKey) { showPopupIfNotActive(); return true; } return false; }