43 getLookAndFeel().drawTabButton (*
this,
g, shouldDrawButtonAsHighlighted, shouldDrawButtonAsDown);
58 if (
owner.isVertical())
74 return p.contains ((
float) (mx - area.getX()),
75 (
float) (my - area.getY()));
89 auto overlap = lf.getTabButtonOverlap (depth);
93 if (
owner.isVertical())
94 textArea.
reduce (0, overlap);
96 textArea.
reduce (overlap, 0);
101 extraComp = lf.getTabButtonExtraComponentBounds (*
this, textArea, *
extraComponent);
103 auto orientation =
owner.getOrientation();
132 auto spaceAroundImage =
getLookAndFeel().getTabButtonSpaceAroundImage();
133 auto orientation =
owner.getOrientation();
245 Colour tabBackgroundColour,
253 insertIndex =
tabs.size();
258 newTab->name = tabName;
259 newTab->colour = tabBackgroundColour;
261 jassert (newTab->button !=
nullptr);
263 tabs.insert (insertIndex, newTab);
276 if (
auto* tab =
tabs[tabIndex])
278 if (tab->name != newName)
281 tab->button->setButtonText (newName);
294 oldSelectedIndex = -1;
295 else if (indexToRemove < oldSelectedIndex)
298 tabs.remove (indexToRemove);
308 tabs.move (currentIndex, newIndex);
345 for (
int i = 0;
i <
tabs.size(); ++
i)
350 if (shouldSendChangeMessage)
359 if (
auto* tab =
tabs[index])
367 for (
int i =
tabs.size(); --
i >= 0;)
381 return animator.isAnimating (
button) ? animator.getComponentDestination (
button)
410 std::swap (depth,
length);
412 auto overlap = lf.getTabButtonOverlap (depth) + lf.getTabButtonSpaceAroundImage() * 2;
414 auto totalLength =
jmax (0, overlap);
415 auto numVisibleButtons =
tabs.size();
417 for (
int i = 0;
i <
tabs.size(); ++
i)
419 auto* tb =
tabs.getUnchecked(
i)->button.get();
421 totalLength += tb->getBestTabLength (depth) - overlap;
422 tb->overlapPixels =
jmax (0, overlap / 2);
430 const bool isTooBig = (
int) (totalLength * scale) >
length;
431 int tabsButtonPos = 0;
449 tabsButtonPos =
getHeight() - buttonSize / 2 - 1;
454 tabsButtonPos =
getWidth() - buttonSize / 2 - 1;
460 for (
int i = 0;
i <
tabs.size(); ++
i)
462 auto* tb =
tabs.getUnchecked(
i)->button.get();
463 auto newLength = totalLength + tb->getBestTabLength (depth);
467 totalLength += overlap;
471 numVisibleButtons =
i + 1;
472 totalLength = newLength - overlap;
487 for (
int i = 0;
i <
tabs.size(); ++
i)
491 auto bestLength =
roundToInt (scale * tb->getBestTabLength (depth));
493 if (
i < numVisibleButtons)
500 animator.animateComponent (tb, newBounds, 1.0f, 200,
false, 3.0, 0.0);
504 animator.cancelAnimation (tb,
false);
505 tb->setBounds (newBounds);
517 tb->setVisible (
false);
520 pos += bestLength - overlap;
526 if (frontTab !=
nullptr)
536 if (
auto* tab =
tabs[tabIndex])
544 if (
auto* tab =
tabs [tabIndex])
546 if (tab->colour != newColour)
548 tab->colour = newColour;
558 for (
int i = 0;
i <
tabs.size(); ++
i)
560 auto* tab =
tabs.getUnchecked(
i);
562 if (! tab->button->isVisible())
565 .
setAction ([
this,
i] { setCurrentTabIndex (i); }));
569 .withDeletionCheck (*
this)
Type jmin(const Type a, const Type b)
Definition MathsFunctions.h:60
Type jmax(const Type a, const Type b)
Definition MathsFunctions.h:48
void sendChangeMessage()
Definition juce_ChangeBroadcaster.cpp:65
Definition juce_Colour.h:38
Definition juce_Component.h:36
int proportionOfWidth(float proportion) const noexcept
Definition juce_Component.cpp:1111
void setInterceptsMouseClicks(bool allowClicksOnThisComponent, bool allowClicksOnChildComponents) noexcept
Definition juce_Component.cpp:1420
int proportionOfHeight(float proportion) const noexcept
Definition juce_Component.cpp:1112
void setFocusContainerType(FocusContainerType containerType) noexcept
Definition juce_Component.cpp:2862
int getHeight() const noexcept
Definition juce_Component.h:274
void toFront(bool shouldAlsoGainKeyboardFocus)
Definition juce_Component.cpp:954
void addAndMakeVisible(Component *child, int zOrder=-1)
Definition juce_Component.cpp:1554
void repaint()
Definition juce_Component.cpp:1917
Component() noexcept
Definition juce_Component.cpp:517
@ keyboardFocusContainer
Definition juce_Component.h:1307
void setWantsKeyboardFocus(bool wantsFocus) noexcept
Definition juce_Component.cpp:2842
int getWidth() const noexcept
Definition juce_Component.h:271
LookAndFeel & getLookAndFeel() const noexcept
Definition juce_Component.cpp:2173
Rectangle< int > getLocalBounds() const noexcept
Definition juce_Component.cpp:2283
const Array< Component * > & getChildren() const noexcept
Definition juce_Component.h:685
virtual void setVisible(bool shouldBeVisible)
Definition juce_Component.cpp:575
static Desktop &JUCE_CALLTYPE getInstance()
Definition juce_Desktop.cpp:50
Definition juce_GraphicsContext.h:45
Definition juce_ModifierKeys.h:41
bool isPopupMenu() const noexcept
Definition juce_ModifierKeys.h:78
Definition juce_Path.h:65
Definition juce_Rectangle.h:67
ValueType getRight() const noexcept
Definition juce_Rectangle.h:139
void setLeft(ValueType newLeft) noexcept
Definition juce_Rectangle.h:261
ValueType getCentreX() const noexcept
Definition juce_Rectangle.h:145
ValueType getHeight() const noexcept
Definition juce_Rectangle.h:136
void setRight(ValueType newRight) noexcept
Definition juce_Rectangle.h:285
void setBottom(ValueType newBottom) noexcept
Definition juce_Rectangle.h:297
ValueType getCentreY() const noexcept
Definition juce_Rectangle.h:148
ValueType getBottom() const noexcept
Definition juce_Rectangle.h:142
void setTop(ValueType newTop) noexcept
Definition juce_Rectangle.h:273
ValueType getX() const noexcept
Definition juce_Rectangle.h:127
ValueType getWidth() const noexcept
Definition juce_Rectangle.h:133
bool isEmpty() const noexcept
Definition juce_Rectangle.h:121
ValueType getY() const noexcept
Definition juce_Rectangle.h:130
void reduce(ValueType deltaX, ValueType deltaY) noexcept
Definition juce_Rectangle.h:474
Definition juce_StringArray.h:35
void add(String stringToAdd)
Definition juce_StringArray.cpp:136
Definition juce_String.h:53
bool isNotEmpty() const noexcept
Definition juce_String.h:316
unsigned * m
Definition inflate.c:1559
struct huft * t
Definition inflate.c:943
int g
Definition inflate.c:1573
register unsigned i
Definition inflate.c:1575
static const char * name
Definition pugl.h:1582
static int JUCE_CDECL comp(const void *a, const void *b)
Definition lsp.c:298
const Colour transparentBlack
Definition juce_Colours.h:40
Definition carla_juce.cpp:31
constexpr Type jmin(Type a, Type b)
Definition juce_MathsFunctions.h:106
constexpr Type jmax(Type a, Type b)
Definition juce_MathsFunctions.h:94
@ dontSendNotification
Definition juce_NotificationType.h:33
bool isPositiveAndBelow(Type1 valueToTest, Type2 upperLimit) noexcept
Definition juce_MathsFunctions.h:279
int roundToInt(const FloatType value) noexcept
Definition juce_MathsFunctions.h:465
@ button
Definition juce_AccessibilityRole.h:38
@ group
Definition juce_AccessibilityRole.h:61
png_uint_32 length
Definition png.c:2247
uch * p
Definition crypt.c:594
return c
Definition crypt.c:175
int r
Definition crypt.c:458
typedef int(UZ_EXP MsgFn)()