34 image.duplicateIfShared();
35 image.multiplyAllAlphas (0.8f);
72 if (onlyCountVisibleColumns)
98 if (ci->name != newName)
119 ci->name = columnName;
122 ci->lastDeliberateWidth =
width;
123 ci->minimumWidth = minimumWidth;
124 ci->maximumWidth = maximumWidth >= 0 ? maximumWidth : std::numeric_limits<int>::max();
125 jassert (ci->maximumWidth >= ci->minimumWidth);
126 ci->propertyFlags = propertyFlags;
128 columns.insert (insertIndex, ci);
158 if (
columns[currentIndex] !=
nullptr && currentIndex != newIndex)
160 columns.move (currentIndex, newIndex);
177 const auto newWidthToUse =
jlimit (ci->minimumWidth, ci->maximumWidth, newWidth);
179 if (ci->width != newWidthToUse)
183 ci->lastDeliberateWidth = ci->width = newWidthToUse;
214 if ((! onlyCountVisibleColumns) ||
c->isVisible())
216 if (
c->id == columnId)
228 if (onlyCountVisibleColumns)
231 if (
auto* ci =
columns [index])
317 targetTotalWidth =
jmax (targetTotalWidth, 0);
320 for (
int i = firstColumnIndex;
i <
columns.size(); ++
i)
325 sor.
addItem (ci->lastDeliberateWidth, ci->minimumWidth, ci->maximumWidth);
331 for (
int i = firstColumnIndex;
i <
columns.size(); ++
i)
337 auto newWidth =
jlimit (ci->minimumWidth, ci->maximumWidth,
340 if (newWidth != ci->width)
342 ci->width = newWidth;
355 if (shouldBeVisible != ci->isVisible())
371 return ci->isVisible();
429 e->setAttribute (
"id", ci->id);
430 e->setAttribute (
"visible", ci->isVisible());
431 e->setAttribute (
"width", ci->width);
443 for (
auto* col : storedXML->getChildIterator())
445 auto tabId = col->getIntAttribute (
"id");
450 ci->width = col->getIntAttribute (
"width");
461 storedXML->getBoolAttribute (
"sortForwards",
true));
468 listeners.addIfNotAlreadyThere (newListener);
473 listeners.removeFirstMatchingValue (listenerToRemove);
488 menu.
addItem (ci->id, ci->name,
503 lf.drawTableHeaderBackground (
g, *
this);
505 auto clip =
g.getClipBounds();
513 if (
x + ci->width > clip.getX()
521 g.reduceClipRegion (0, 0, ci->width,
getHeight());
523 lf.drawTableHeaderColumn (
g, *
this, ci->name, ci->id, ci->width,
getHeight(),
531 if (
x >= clip.getRight())
551 if (
e.mods.isPopupMenu())
563 &&
e.mouseWasDraggedSinceMouseDown()
564 && !
e.mods.isPopupMenu())
587 auto w =
jlimit (ci->minimumWidth, ci->maximumWidth,
593 int minWidthOnRight = 0;
596 if (
columns.getUnchecked (
i)->isVisible())
597 minWidthOnRight +=
columns.getUnchecked (
i)->minimumWidth;
623 int newIndex = currentIndex;
629 auto* previous =
columns.getUnchecked (newIndex - 1);
631 if ((previous->propertyFlags &
draggable) != 0)
644 if (newIndex <
columns.size() - 1)
648 auto* nextCol =
columns.getUnchecked (newIndex + 1);
650 if ((nextCol->propertyFlags &
draggable) != 0)
663 if (newIndex != currentIndex)
685 if (ci ==
nullptr || (ci->propertyFlags &
draggable) == 0)
723 listeners.getUnchecked(
i)->tableColumnDraggingChanged (
this, 0);
735 c->lastDeliberateWidth =
c->width;
779 if (
columns.getUnchecked(
i)->isVisible())
781 if (
n == visibleIndex)
814 listeners.getUnchecked(
i)->tableSortOrderChanged (
this);
823 listeners.getUnchecked(
i)->tableColumnsChanged (
this);
832 listeners.getUnchecked(
i)->tableColumnsResized (
this);
842 const int draggableDistance = 3;
849 if (std::abs (mouseX - (
x + ci->width)) <= draggableDistance
887 if (
m.getNumItems() > 0)
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 triggerAsyncUpdate()
Definition juce_AsyncUpdater.cpp:62
bool isMouseButtonDown(bool includeChildren=false) const
Definition juce_Component.cpp:3177
virtual MouseCursor getMouseCursor()
Definition juce_Component.cpp:1870
Image createComponentSnapshot(Rectangle< int > areaToGrab, bool clipImageToComponentBounds=true, float scaleFactor=1.0f)
Definition juce_Component.cpp:2135
bool reallyContains(Point< int > localPoint, bool returnTrueIfWithinAChild)
Definition juce_Component.cpp:1454
int getHeight() const noexcept
Definition juce_Component.h:274
int getX() const noexcept
Definition juce_Component.h:259
void addAndMakeVisible(Component *child, int zOrder=-1)
Definition juce_Component.cpp:1554
void setAlwaysOnTop(bool shouldStayOnTop)
Definition juce_Component.cpp:1074
void repaint()
Definition juce_Component.cpp:1917
Component() noexcept
Definition juce_Component.cpp:517
Point< int > getMouseXYRelative() const
Definition juce_Component.cpp:3210
virtual void resized()
Definition juce_Component.cpp:2318
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
Definition juce_GraphicsContext.h:660
Definition juce_GraphicsContext.h:45
Definition juce_Image.h:58
static ModalComponentManager::Callback * forComponent(void(*functionToCall)(int, ComponentType *), ComponentType *component)
Definition juce_ModalComponentManager.h:276
Definition juce_ModifierKeys.h:41
bool isPopupMenu() const noexcept
Definition juce_ModifierKeys.h:78
Definition juce_MouseCursor.h:39
@ LeftRightResizeCursor
Definition juce_MouseCursor.h:59
Definition juce_MouseEvent.h:39
Definition juce_Rectangle.h:67
Definition juce_StretchableObjectResizer.h:47
void addItem(double currentSize, double minSize, double maxSize, int order=0)
Definition juce_StretchableObjectResizer.cpp:32
double getItemSize(int index) const noexcept
Definition juce_StretchableObjectResizer.cpp:48
void resizeToFit(double targetSize)
Definition juce_StretchableObjectResizer.cpp:54
Definition juce_String.h:53
Definition juce_XmlElement.h:83
String toString(const TextFormat &format={}) const
Definition juce_XmlElement.cpp:352
XmlElement * createNewChildElement(StringRef tagName)
Definition juce_XmlElement.cpp:733
void setAttribute(const Identifier &attributeName, const String &newValue)
Definition juce_XmlElement.cpp:615
* e
Definition inflate.c:1404
UINT_D64 w
Definition inflate.c:942
unsigned * m
Definition inflate.c:1559
int g
Definition inflate.c:1573
register unsigned i
Definition inflate.c:1575
unsigned s
Definition inflate.c:1555
unsigned x[BMAX+1]
Definition inflate.c:1586
static int width
Definition pugl.h:1593
Definition carla_juce.cpp:31
constexpr Type jmin(Type a, Type b)
Definition juce_MathsFunctions.h:106
std::unique_ptr< XmlElement > parseXMLIfTagMatches(const String &textToParse, StringRef requiredTag)
Definition juce_XmlDocument.cpp:51
constexpr Type jmax(Type a, Type b)
Definition juce_MathsFunctions.h:94
Type jlimit(Type lowerLimit, Type upperLimit, Type valueToConstrain) noexcept
Definition juce_MathsFunctions.h:262
static void tableHeaderMenuCallback(int result, TableHeaderComponent *tableHeader, int columnIdClicked)
Definition juce_TableHeaderComponent.cpp:876
bool isPositiveAndBelow(Type1 valueToTest, Type2 upperLimit) noexcept
Definition juce_MathsFunctions.h:279
@ tableHeader
Definition juce_AccessibilityRole.h:51
Definition juce_TableHeaderComponent.h:425
int propertyFlags
Definition juce_TableHeaderComponent.h:427
bool isVisible() const
Definition juce_TableHeaderComponent.cpp:759
Definition juce_XmlElement.h:136
int n
Definition crypt.c:458
return c
Definition crypt.c:175
int result
Definition process.c:1455
ss
Definition zipinfo.c:2292