Gin
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
ComponentGrid Class Reference

Inherits juce::Component, and juce::Timer.

Classes

struct  DragInfo
 

Public Types

enum  Orientation { vertical , horizontal }
 

Public Member Functions

 ComponentGrid (const juce::String &name={}, Orientation o=horizontal)
 
 ~ComponentGrid () override
 
void timerCallback () override
 
void mouseDown (const juce::MouseEvent &e) override
 
void mouseDrag (const juce::MouseEvent &e) override
 
void mouseUp (const juce::MouseEvent &e) override
 
void resized () override
 
bool isDragInProgress ()
 
void setGap (int)
 
void setOrientation (Orientation)
 

Static Public Member Functions

static bool isGridDrag (juce::var)
 
static int getDragIndex (juce::var)
 

Public Attributes

std::function< bool(const juce::MouseEvent &)> onDragStart
 
std::function< void(int, int)> onOrderChanged
 
std::function< void(int, int)> onDragFinished
 

Protected Member Functions

void layoutAnimated ()
 
int componentIndex (juce::Component &c)
 
juce::Array< juce::Rectangle< int > > getComponentRects ()
 

Protected Attributes

bool dragStarted = false
 
bool dragging = false
 
bool dragOut = false
 
Orientation orientation = horizontal
 
int gap = 1
 
juce::Array< juce::Component * > originalOrder
 
juce::ComponentAnimator animator
 

Member Enumeration Documentation

◆ Orientation

Enumerator
vertical 
horizontal 

Constructor & Destructor Documentation

◆ ComponentGrid()

ComponentGrid::ComponentGrid ( const juce::String &  name = {},
Orientation  o = horizontal 
)

◆ ~ComponentGrid()

ComponentGrid::~ComponentGrid ( )
override

Member Function Documentation

◆ timerCallback()

void ComponentGrid::timerCallback ( )
override

◆ mouseDown()

void ComponentGrid::mouseDown ( const juce::MouseEvent &  e)
override

◆ mouseDrag()

void ComponentGrid::mouseDrag ( const juce::MouseEvent &  e)
override

◆ mouseUp()

void ComponentGrid::mouseUp ( const juce::MouseEvent &  e)
override

◆ resized()

void ComponentGrid::resized ( )
override

◆ isDragInProgress()

bool ComponentGrid::isDragInProgress ( )

◆ setGap()

void ComponentGrid::setGap ( int  )

◆ setOrientation()

void ComponentGrid::setOrientation ( Orientation  )

◆ isGridDrag()

static bool ComponentGrid::isGridDrag ( juce::var  )
static

◆ getDragIndex()

static int ComponentGrid::getDragIndex ( juce::var  )
static

◆ layoutAnimated()

void ComponentGrid::layoutAnimated ( )
protected

◆ componentIndex()

int ComponentGrid::componentIndex ( juce::Component &  c)
protected

◆ getComponentRects()

juce::Array<juce::Rectangle<int> > ComponentGrid::getComponentRects ( )
protected

Member Data Documentation

◆ onDragStart

std::function<bool(const juce::MouseEvent&)> ComponentGrid::onDragStart

◆ onOrderChanged

std::function<void (int, int)> ComponentGrid::onOrderChanged

◆ onDragFinished

std::function<void (int, int)> ComponentGrid::onDragFinished

◆ dragStarted

bool ComponentGrid::dragStarted = false
protected

◆ dragging

bool ComponentGrid::dragging = false
protected

◆ dragOut

bool ComponentGrid::dragOut = false
protected

◆ orientation

Orientation ComponentGrid::orientation = horizontal
protected

◆ gap

int ComponentGrid::gap = 1
protected

◆ originalOrder

juce::Array<juce::Component*> ComponentGrid::originalOrder
protected

◆ animator

juce::ComponentAnimator ComponentGrid::animator
protected

The documentation for this class was generated from the following file: