Browse Source

Fixed a couple of bugs in TableListBox and FileListComponent.

tags/2021-05-28
Julian Storer 15 years ago
parent
commit
5d5aa37475
6 changed files with 28 additions and 40 deletions
  1. +13
    -19
      juce_amalgamated.cpp
  2. +1
    -1
      juce_amalgamated.h
  3. +1
    -1
      src/core/juce_StandardHeader.h
  4. +1
    -1
      src/gui/components/controls/juce_TableListBox.cpp
  5. +0
    -1
      src/gui/components/filebrowser/juce_FileListComponent.cpp
  6. +12
    -17
      src/gui/components/special/juce_ColourSelector.cpp

+ 13
- 19
juce_amalgamated.cpp View File

@@ -51028,7 +51028,7 @@ TableListBox::TableListBox (const String& name, TableListBoxModel* const model_)


TableListBox::~TableListBox() TableListBox::~TableListBox()
{ {
deleteAllChildren();
header = 0;
} }


void TableListBox::setModel (TableListBoxModel* const newModel) void TableListBox::setModel (TableListBoxModel* const newModel)
@@ -57924,7 +57924,6 @@ FileListComponent::FileListComponent (DirectoryContentsList& listToShow)
FileListComponent::~FileListComponent() FileListComponent::~FileListComponent()
{ {
fileList.removeChangeListener (this); fileList.removeChangeListener (this);
deleteAllChildren();
} }


int FileListComponent::getNumSelectedFiles() const int FileListComponent::getNumSelectedFiles() const
@@ -73267,13 +73266,12 @@ public:
lastHue (0.0f), lastHue (0.0f),
edge (edgeSize) edge (edgeSize)
{ {
addAndMakeVisible (marker = new ColourSpaceMarker());
addAndMakeVisible (&marker);
setMouseCursor (MouseCursor::CrosshairCursor); setMouseCursor (MouseCursor::CrosshairCursor);
} }


~ColourSpaceView() ~ColourSpaceView()
{ {
deleteAllChildren();
} }


void paint (Graphics& g) void paint (Graphics& g)
@@ -73341,15 +73339,15 @@ private:
float& s; float& s;
float& v; float& v;
float lastHue; float lastHue;
ColourSpaceMarker* marker;
ColourSpaceMarker marker;
const int edge; const int edge;
Image colours; Image colours;


void updateMarker() const
void updateMarker()
{ {
marker->setBounds (roundToInt ((getWidth() - edge * 2) * s),
roundToInt ((getHeight() - edge * 2) * (1.0f - v)),
edge * 2, edge * 2);
marker.setBounds (roundToInt ((getWidth() - edge * 2) * s),
roundToInt ((getHeight() - edge * 2) * (1.0f - v)),
edge * 2, edge * 2);
} }


ColourSpaceView (const ColourSpaceView&); ColourSpaceView (const ColourSpaceView&);
@@ -73402,12 +73400,11 @@ public:
lastHue (0.0f), lastHue (0.0f),
edge (edgeSize) edge (edgeSize)
{ {
addAndMakeVisible (marker = new HueSelectorMarker());
addAndMakeVisible (&marker);
} }


~HueSelectorComp() ~HueSelectorComp()
{ {
deleteAllChildren();
} }


void paint (Graphics& g) void paint (Graphics& g)
@@ -73425,8 +73422,8 @@ public:


void resized() void resized()
{ {
marker->setBounds (0, roundToInt ((getHeight() - edge * 2) * h),
getWidth(), edge * 2);
marker.setBounds (0, roundToInt ((getHeight() - edge * 2) * h),
getWidth(), edge * 2);
} }


void mouseDown (const MouseEvent& e) void mouseDown (const MouseEvent& e)
@@ -73452,7 +73449,7 @@ private:
float& s; float& s;
float& v; float& v;
float lastHue; float lastHue;
HueSelectorMarker* marker;
HueSelectorMarker marker;
const int edge; const int edge;


HueSelectorComp (const HueSelectorComp&); HueSelectorComp (const HueSelectorComp&);
@@ -73517,6 +73514,8 @@ ColourSelector::ColourSelector (const int flags_,
const int edgeGap_, const int edgeGap_,
const int gapAroundColourSpaceComponent) const int gapAroundColourSpaceComponent)
: colour (Colours::white), : colour (Colours::white),
colourSpace (0),
hueSelector (0),
flags (flags_), flags (flags_),
topSpace (0), topSpace (0),
edgeGap (edgeGap_) edgeGap (edgeGap_)
@@ -73548,11 +73547,6 @@ ColourSelector::ColourSelector (const int flags_,
addAndMakeVisible (colourSpace = new ColourSpaceView (this, h, s, v, gapAroundColourSpaceComponent)); addAndMakeVisible (colourSpace = new ColourSpaceView (this, h, s, v, gapAroundColourSpaceComponent));
addAndMakeVisible (hueSelector = new HueSelectorComp (this, h, s, v, gapAroundColourSpaceComponent)); addAndMakeVisible (hueSelector = new HueSelectorComp (this, h, s, v, gapAroundColourSpaceComponent));
} }
else
{
colourSpace = 0;
hueSelector = 0;
}


update(); update();
} }


+ 1
- 1
juce_amalgamated.h View File

@@ -64,7 +64,7 @@
*/ */
#define JUCE_MAJOR_VERSION 1 #define JUCE_MAJOR_VERSION 1
#define JUCE_MINOR_VERSION 52 #define JUCE_MINOR_VERSION 52
#define JUCE_BUILDNUMBER 27
#define JUCE_BUILDNUMBER 28


/** Current Juce version number. /** Current Juce version number.




+ 1
- 1
src/core/juce_StandardHeader.h View File

@@ -33,7 +33,7 @@
*/ */
#define JUCE_MAJOR_VERSION 1 #define JUCE_MAJOR_VERSION 1
#define JUCE_MINOR_VERSION 52 #define JUCE_MINOR_VERSION 52
#define JUCE_BUILDNUMBER 27
#define JUCE_BUILDNUMBER 28
/** Current Juce version number. /** Current Juce version number.


+ 1
- 1
src/gui/components/controls/juce_TableListBox.cpp View File

@@ -330,7 +330,7 @@ TableListBox::TableListBox (const String& name, TableListBoxModel* const model_)
TableListBox::~TableListBox() TableListBox::~TableListBox()
{ {
deleteAllChildren();
header = 0;
} }
void TableListBox::setModel (TableListBoxModel* const newModel) void TableListBox::setModel (TableListBoxModel* const newModel)


+ 0
- 1
src/gui/components/filebrowser/juce_FileListComponent.cpp View File

@@ -47,7 +47,6 @@ FileListComponent::FileListComponent (DirectoryContentsList& listToShow)
FileListComponent::~FileListComponent() FileListComponent::~FileListComponent()
{ {
fileList.removeChangeListener (this); fileList.removeChangeListener (this);
deleteAllChildren();
} }
int FileListComponent::getNumSelectedFiles() const int FileListComponent::getNumSelectedFiles() const


+ 12
- 17
src/gui/components/special/juce_ColourSelector.cpp View File

@@ -101,13 +101,12 @@ public:
lastHue (0.0f), lastHue (0.0f),
edge (edgeSize) edge (edgeSize)
{ {
addAndMakeVisible (marker = new ColourSpaceMarker());
addAndMakeVisible (&marker);
setMouseCursor (MouseCursor::CrosshairCursor); setMouseCursor (MouseCursor::CrosshairCursor);
} }
~ColourSpaceView() ~ColourSpaceView()
{ {
deleteAllChildren();
} }
void paint (Graphics& g) void paint (Graphics& g)
@@ -175,15 +174,15 @@ private:
float& s; float& s;
float& v; float& v;
float lastHue; float lastHue;
ColourSpaceMarker* marker;
ColourSpaceMarker marker;
const int edge; const int edge;
Image colours; Image colours;
void updateMarker() const
void updateMarker()
{ {
marker->setBounds (roundToInt ((getWidth() - edge * 2) * s),
roundToInt ((getHeight() - edge * 2) * (1.0f - v)),
edge * 2, edge * 2);
marker.setBounds (roundToInt ((getWidth() - edge * 2) * s),
roundToInt ((getHeight() - edge * 2) * (1.0f - v)),
edge * 2, edge * 2);
} }
ColourSpaceView (const ColourSpaceView&); ColourSpaceView (const ColourSpaceView&);
@@ -238,12 +237,11 @@ public:
lastHue (0.0f), lastHue (0.0f),
edge (edgeSize) edge (edgeSize)
{ {
addAndMakeVisible (marker = new HueSelectorMarker());
addAndMakeVisible (&marker);
} }
~HueSelectorComp() ~HueSelectorComp()
{ {
deleteAllChildren();
} }
void paint (Graphics& g) void paint (Graphics& g)
@@ -261,8 +259,8 @@ public:
void resized() void resized()
{ {
marker->setBounds (0, roundToInt ((getHeight() - edge * 2) * h),
getWidth(), edge * 2);
marker.setBounds (0, roundToInt ((getHeight() - edge * 2) * h),
getWidth(), edge * 2);
} }
void mouseDown (const MouseEvent& e) void mouseDown (const MouseEvent& e)
@@ -288,7 +286,7 @@ private:
float& s; float& s;
float& v; float& v;
float lastHue; float lastHue;
HueSelectorMarker* marker;
HueSelectorMarker marker;
const int edge; const int edge;
HueSelectorComp (const HueSelectorComp&); HueSelectorComp (const HueSelectorComp&);
@@ -355,6 +353,8 @@ ColourSelector::ColourSelector (const int flags_,
const int edgeGap_, const int edgeGap_,
const int gapAroundColourSpaceComponent) const int gapAroundColourSpaceComponent)
: colour (Colours::white), : colour (Colours::white),
colourSpace (0),
hueSelector (0),
flags (flags_), flags (flags_),
topSpace (0), topSpace (0),
edgeGap (edgeGap_) edgeGap (edgeGap_)
@@ -386,11 +386,6 @@ ColourSelector::ColourSelector (const int flags_,
addAndMakeVisible (colourSpace = new ColourSpaceView (this, h, s, v, gapAroundColourSpaceComponent)); addAndMakeVisible (colourSpace = new ColourSpaceView (this, h, s, v, gapAroundColourSpaceComponent));
addAndMakeVisible (hueSelector = new HueSelectorComp (this, h, s, v, gapAroundColourSpaceComponent)); addAndMakeVisible (hueSelector = new HueSelectorComp (this, h, s, v, gapAroundColourSpaceComponent));
} }
else
{
colourSpace = 0;
hueSelector = 0;
}
update(); update();
} }


Loading…
Cancel
Save