ResizableCornerComponent::ResizableCornerComponent (Component* const componentToResize,
                                                    ComponentBoundsConstrainer* const constrainer_)
   : component (componentToResize),
     constrainer (constrainer_)
{
    setRepaintsOnMouseActivity (true);
    setMouseCursor (MouseCursor::BottomRightCornerResizeCursor);
}
ResizableEdgeComponent::ResizableEdgeComponent (Component* const componentToResize,
                                                ComponentBoundsConstrainer* const constrainer_,
                                                Edge edge_)
   : component (componentToResize),
     constrainer (constrainer_),
     edge (edge_)
{
    setRepaintsOnMouseActivity (true);
    setMouseCursor (isVertical() ? MouseCursor::LeftRightResizeCursor
                                 : MouseCursor::UpDownResizeCursor);
}
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));
}
Exemplo n.º 4
0
//==============================================================================
ComboBox::ComboBox (const String& name)
    : Component (name),
      lastCurrentId (0),
      isButtonDown (false),
      separatorPending (false),
      menuActive (false),
      noChoicesMessage (TRANS("(no choices)"))
{
    setRepaintsOnMouseActivity (true);
    ComboBox::lookAndFeelChanged();
    currentId.addListener (this);
}
MenuBarComponent::MenuBarComponent (MenuBarModel* model_)
    : model (nullptr),
      itemUnderMouse (-1),
      currentPopupIndex (-1),
      topLevelIndexClicked (0)
{
    setRepaintsOnMouseActivity (true);
    setWantsKeyboardFocus (false);
    setMouseClickGrabsKeyboardFocus (false);

    setModel (model_);
}
Exemplo n.º 6
0
MLEnvelope::MLEnvelope (MLWidget* pC) :
	MLWidget(pC)
{
	MLWidget::setComponent(this);
	MLLookAndFeel* myLookAndFeel = (&(getRootViewResources(this).mLookAndFeel));
	setOpaque(myLookAndFeel->getDefaultOpacity());
	setBufferedToImage(myLookAndFeel->getDefaultBufferMode());
	setPaintingIsUnclipped(myLookAndFeel->getDefaultUnclippedMode());

	mDARMode = false;
 	setColour (foregroundColor, findColour(MLLookAndFeel::labelColor));
    setRepaintsOnMouseActivity (false);
}
Exemplo n.º 7
0
 ArrowCanvas::ArrowCanvas()
 : Component()
 , _strokeWidth(1.0f)
 , _lines()
 , _drawGrid(true)
 , _lassoComponent(new LassoComponent<Figure*>)
 , _lassoSource(NULL)
 {
     addAndMakeVisible(_lassoComponent, -1);
     setBroughtToFrontOnMouseClick(false);
     setBufferedToImage(true);
     setRepaintsOnMouseActivity(true);
     setOpaque(false);
 }
Exemplo n.º 8
0
//==============================================================================
ComboBox::ComboBox (const String& name)
    : Component (name),
      lastCurrentId (0),
      isButtonDown (false),
      separatorPending (false),
      menuActive (false),
      scrollWheelEnabled (false),
      mouseWheelAccumulator (0),
      noChoicesMessage (TRANS("(no choices)")),
      labelEditableState (editableUnknown)
{
    setRepaintsOnMouseActivity (true);
    lookAndFeelChanged();
    currentId.addListener (this);
}
Exemplo n.º 9
0
//==============================================================================
PathPointComponent::PathPointComponent (PaintElementPath* const path_,
                                        const int index_,
                                        const int pointNumber_)
    : ElementSiblingComponent (path_),
      path (path_),
      routine (path_->getOwner()),
      index (index_),
      pointNumber (pointNumber_),
      selected (false)
{
    setSize (11, 11);
    setRepaintsOnMouseActivity (true);

    selected = routine->getSelectedPoints().isSelected (path_->points [index]);
    routine->getSelectedPoints().addChangeListener (this);
}
Exemplo n.º 10
0
ChildAlias::ChildAlias (Component* targetChild, String type, int ind)
:   target (targetChild), index(ind), type(type)
{   
   resizeContainer = new ComponentBoundsConstrainer();
   resizeContainer->setMinimumSize(target.getComponent()->getWidth()/2, target.getComponent()->getHeight()/2); //set minimum size so objects cant be resized too small
   resizer = new ResizableBorderComponent (this,resizeContainer);
   addAndMakeVisible (resizer);
   resizer->addMouseListener (this,false);
   constrainer = new ComponentBoundsConstrainer();
   
   interest = false;
   userAdjusting = false;
   updateFromTarget ();
   setRepaintsOnMouseActivity (true);

}
BEGIN_JUCE_NAMESPACE

#include "juce_ResizableCornerComponent.h"
#include "../juce_Desktop.h"
#include "../lookandfeel/juce_LookAndFeel.h"
#include "../../graphics/geometry/juce_Line.h"


//==============================================================================
ResizableCornerComponent::ResizableCornerComponent (Component* const componentToResize,
                                                    ComponentBoundsConstrainer* const constrainer_)
   : component (componentToResize),
     constrainer (constrainer_)
{
    setRepaintsOnMouseActivity (true);
    setMouseCursor (MouseCursor::BottomRightCornerResizeCursor);
}
Exemplo n.º 12
0
ComponentOverlay::ComponentOverlay (Component* targetChild, ComponentLayoutEditor* owner)
    :   target (targetChild), layoutEditor (owner), lookAndFeel()
{
    resizeContainer = new ComponentBoundsConstrainer();
    resizeContainer->setMinimumSize (10, 10); //set minimum size so objects cant be resized too small
    resizer = new ResizableBorderComponent (this, resizeContainer);
    addAndMakeVisible (resizer);
    resizer->addMouseListener (this, false);
    constrainer = new ComponentBoundsConstrainer();
    interest = "none";
    userAdjusting = false;
    updateFromTarget ();
    setLookAndFeel (&lookAndFeel);
    setRepaintsOnMouseActivity (true);
    addKeyListener (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));
}
BEGIN_JUCE_NAMESPACE

#include "jucetice_ComponentLayoutEditor.h"


//==============================================================================
ChildAlias::ChildAlias (Component* targetChild)
    :   target (targetChild)
{
    resizer = new ResizableBorderComponent (this,0);
    addAndMakeVisible (resizer);
    resizer->addMouseListener (this,false);

    interest = false;
    userAdjusting = false;

    updateFromTarget ();
    setRepaintsOnMouseActivity (true);
}
Exemplo n.º 16
0
MLDrawing::MLDrawing(MLWidget* pContainer) :
	MLWidget(pContainer)
{
	MLWidget::setComponent(this);
	MLLookAndFeel* myLookAndFeel = (&(getRootViewResources(this).mLookAndFeel));
		
	setOpaque(myLookAndFeel->getDefaultOpacity());
	setBufferedToImage(myLookAndFeel->getDefaultBufferMode());
	setPaintingIsUnclipped(myLookAndFeel->getDefaultUnclippedMode());

	// setup component
	setRepaintsOnMouseActivity (false);
	setInterceptsMouseClicks(false, false);
	
	// set default drawing state
	mLineThickness = 1.0f;
	mDarkColor = mLineColor = myLookAndFeel->findColour(MLLookAndFeel::darkLabelColor);
	mLightColor = myLookAndFeel->findColour(MLLookAndFeel::lightLabelColor);

}
Exemplo n.º 17
0
//==============================================================================
ScrollBar::ScrollBar (const bool vertical_,
                      const bool buttonsAreVisible)
    : totalRange (0.0, 1.0),
      visibleRange (0.0, 0.1),
      singleStepSize (0.1),
      thumbAreaStart (0),
      thumbAreaSize (0),
      thumbStart (0),
      thumbSize (0),
      initialDelayInMillisecs (100),
      repeatDelayInMillisecs (50),
      minimumDelayInMillisecs (10),
      vertical (vertical_),
      isDraggingThumb (false),
      autohides (true)
{
    setButtonVisibility (buttonsAreVisible);

    setRepaintsOnMouseActivity (true);
    setFocusContainer (true);
}
Exemplo n.º 18
0
BEGIN_JUCE_NAMESPACE

#include "juce_MenuBarComponent.h"
#include "../juce_Desktop.h"
#include "../lookandfeel/juce_LookAndFeel.h"


//==============================================================================
MenuBarComponent::MenuBarComponent (MenuBarModel* model_)
    : model (nullptr),
      itemUnderMouse (-1),
      currentPopupIndex (-1),
      topLevelIndexClicked (0),
      lastMouseX (0),
      lastMouseY (0)
{
    setRepaintsOnMouseActivity (true);
    setWantsKeyboardFocus (false);
    setMouseClickGrabsKeyboardFocus (false);

    setModel (model_);
}
//==============================================================================
ComponentOverlayComponent::ComponentOverlayComponent (Component* const target_,
                                                      ComponentLayout& layout_)
    : target (target_),
      borderThickness (4),
      layout (layout_),
      selected (false),
      dragging (false),
      originalAspectRatio (1.0)
{
    setMinimumOnscreenAmounts (0, 0, 0, 0);
    setSizeLimits (borderThickness * 2 + 2, borderThickness * 2 + 2, 8192, 8192);

    addChildComponent (border = new ResizableBorderComponent (this, this));

    border->setBorderThickness (BorderSize<int> (borderThickness));

    target->addComponentListener (this);

    changeListenerCallback (nullptr);
    layout.getSelectedSet().addChangeListener (this);

    setRepaintsOnMouseActivity (true);
    border->setRepaintsOnMouseActivity (true);
}
Exemplo n.º 20
0
BEGIN_JUCE_NAMESPACE

#include "juce_ComboBox.h"
#include "../menus/juce_PopupMenu.h"
#include "../lookandfeel/juce_LookAndFeel.h"
#include "../../../text/juce_LocalisedStrings.h"


//==============================================================================
ComboBox::ComboBox (const String& name)
    : Component (name),
      lastCurrentId (0),
      isButtonDown (false),
      separatorPending (false),
      menuActive (false),
      label (0)
{
    noChoicesMessage = TRANS("(no choices)");
    setRepaintsOnMouseActivity (true);

    lookAndFeelChanged();

    currentId.addListener (this);
}
BEGIN_JUCE_NAMESPACE

#include "jucetice_GraphLinkComponent.h"
#include "jucetice_GraphNodeComponent.h"
#include "jucetice_GraphConnectorComponent.h"


//==============================================================================
GraphLinkComponent::GraphLinkComponent (const bool leftToRight_,
                                        const int lineThickness_,
                                        const float tension_)
    : from (0),
      to (0),
      startPointX (0),
      startPointY (0),
      endPointX (0),
      endPointY (0),
      leftToRight (leftToRight_),
      lineThickness (lineThickness_),
      tension (tension_)
{
    setInterceptsMouseClicks (true, false);
    setRepaintsOnMouseActivity (true);
}
Exemplo n.º 22
0
 CornerDragger()
 {
     setSize (30, 30);
     setRepaintsOnMouseActivity (true);
 }