int LComponent::setMouseCursor ( lua_State *L ) { if (child) { if(lua_isnumber(L,2)) child->setMouseCursor( MouseCursor((MouseCursor::StandardCursorType)(LUA::getNumber<int>(2))) ); else if(LUCE::luce_isofclass(LImage,2)) { Image img(*LUA::from_luce<LImage>(2)); int hotSpotX = LUA::getNumber<int>(2); int hotSpotY = LUA::getNumber<int>(2); float scaleFactor = LUA::checkAndGetNumber<float>(2, 1.0f); child->setMouseCursor( MouseCursor(img, hotSpotX, hotSpotY, scaleFactor) ); } // TODO: static methods for show/hideWaitCursor else if(lua_isstring(L,2)) { String wait = LUA::getString(2); if(wait=="wait") MouseCursor::showWaitCursor(); else MouseCursor::hideWaitCursor(); } } return 0; }
//============================================================================== void PianoGridNote::mouseMove (const MouseEvent& e) { if (e.x >= getWidth() - 2) { setMouseCursor (MouseCursor (MouseCursor::LeftRightResizeCursor)); } else { setMouseCursor (MouseCursor (MouseCursor::NormalCursor)); } }
const MouseCursor LfpDisplayCanvas::getMouseCursor() { const MouseCursor c = MouseCursor(cursorType); return c; }
void PianoGridNote::endVelocity (const MouseEvent& e) { isEditingVelocity = false; setMouseCursor (MouseCursor (MouseCursor::NormalCursor)); repaint (); }
//============================================================================== void PianoGridNote::startVelocity (const MouseEvent& e) { isEditingVelocity = true; setMouseCursor (MouseCursor (MouseCursor::UpDownResizeCursor)); toFront (true); repaint (); }
StretchableLayoutResizerBar::StretchableLayoutResizerBar (StretchableLayoutManager* layout_, const int itemIndex_, const bool isVertical_) : layout (layout_), itemIndex (itemIndex_), isVertical (isVertical_) { setRepaintsOnMouseActivity (true); setMouseCursor (MouseCursor (isVertical_ ? MouseCursor::LeftRightResizeCursor : MouseCursor::UpDownResizeCursor)); }
ResizableEdgeComponent::ResizableEdgeComponent (Component* const componentToResize, ComponentBoundsConstrainer* const constrainer_, Edge edge_) : component (componentToResize), constrainer (constrainer_), edge (edge_) { setRepaintsOnMouseActivity (true); setMouseCursor (MouseCursor (isVertical() ? MouseCursor::LeftRightResizeCursor : MouseCursor::UpDownResizeCursor)); }
//============================================================================== CodeEditorComponent::CodeEditorComponent (CodeDocument& document_, CodeTokeniser* const codeTokeniser_) : document (document_), firstLineOnScreen (0), gutter (5), spacesPerTab (4), lineHeight (0), linesOnScreen (0), columnsOnScreen (0), scrollbarThickness (16), columnToTryToMaintain (-1), useSpacesForTabs (false), xOffset (0), verticalScrollBar (true), horizontalScrollBar (false), codeTokeniser (codeTokeniser_) { caretPos = CodeDocument::Position (&document_, 0, 0); caretPos.setPositionMaintained (true); selectionStart = CodeDocument::Position (&document_, 0, 0); selectionStart.setPositionMaintained (true); selectionEnd = CodeDocument::Position (&document_, 0, 0); selectionEnd.setPositionMaintained (true); setOpaque (true); setMouseCursor (MouseCursor (MouseCursor::IBeamCursor)); setWantsKeyboardFocus (true); addAndMakeVisible (&verticalScrollBar); verticalScrollBar.setSingleStepSize (1.0); addAndMakeVisible (&horizontalScrollBar); horizontalScrollBar.setSingleStepSize (1.0); addAndMakeVisible (caret = getLookAndFeel().createCaretComponent (this)); Font f (12.0f); f.setTypefaceName (Font::getDefaultMonospacedFontName()); setFont (f); resetToDefaultColours(); verticalScrollBar.addListener (this); horizontalScrollBar.addListener (this); document.addListener (this); }
BEGIN_JUCE_NAMESPACE #include "juce_ResizableEdgeComponent.h" #include "../lookandfeel/juce_LookAndFeel.h" //============================================================================== ResizableEdgeComponent::ResizableEdgeComponent (Component* const componentToResize, ComponentBoundsConstrainer* const constrainer_, Edge edge_) : component (componentToResize), constrainer (constrainer_), edge (edge_) { setRepaintsOnMouseActivity (true); setMouseCursor (MouseCursor (isVertical() ? MouseCursor::LeftRightResizeCursor : MouseCursor::UpDownResizeCursor)); }
BEGIN_JUCE_NAMESPACE #include "juce_StretchableLayoutResizerBar.h" #include "../lookandfeel/juce_LookAndFeel.h" //============================================================================== StretchableLayoutResizerBar::StretchableLayoutResizerBar (StretchableLayoutManager* layout_, const int itemIndex_, const bool isVertical_) : layout (layout_), itemIndex (itemIndex_), isVertical (isVertical_) { setRepaintsOnMouseActivity (true); setMouseCursor (MouseCursor (isVertical_ ? MouseCursor::LeftRightResizeCursor : MouseCursor::UpDownResizeCursor)); }
void DiagramToolbar::mouseDown(const MouseEvent& e) { _dragger.startDraggingComponent(this, 0); setMouseCursor(MouseCursor(MouseCursor::DraggingHandCursor)); }