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()
{
deleteAllChildren();
header = 0;
}

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

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

~ColourSpaceView()
{
deleteAllChildren();
}

void paint (Graphics& g)
@@ -73341,15 +73339,15 @@ private:
float& s;
float& v;
float lastHue;
ColourSpaceMarker* marker;
ColourSpaceMarker marker;
const int edge;
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&);
@@ -73402,12 +73400,11 @@ public:
lastHue (0.0f),
edge (edgeSize)
{
addAndMakeVisible (marker = new HueSelectorMarker());
addAndMakeVisible (&marker);
}

~HueSelectorComp()
{
deleteAllChildren();
}

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

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)
@@ -73452,7 +73449,7 @@ private:
float& s;
float& v;
float lastHue;
HueSelectorMarker* marker;
HueSelectorMarker marker;
const int edge;

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

update();
}


+ 1
- 1
juce_amalgamated.h View File

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

/** Current Juce version number.



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

@@ -33,7 +33,7 @@
*/
#define JUCE_MAJOR_VERSION 1
#define JUCE_MINOR_VERSION 52
#define JUCE_BUILDNUMBER 27
#define JUCE_BUILDNUMBER 28
/** 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()
{
deleteAllChildren();
header = 0;
}
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()
{
fileList.removeChangeListener (this);
deleteAllChildren();
}
int FileListComponent::getNumSelectedFiles() const


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

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


Loading…
Cancel
Save