1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-24 01:54:22 +00:00

Fix for MSVC compile problem.

This commit is contained in:
Julian Storer 2010-02-01 16:51:38 +00:00
parent 2a56cadd67
commit 0282a89908
5 changed files with 84 additions and 99 deletions

View file

@ -42301,6 +42301,21 @@ END_JUCE_NAMESPACE
BEGIN_JUCE_NAMESPACE
class Button::RepeatTimer : public Timer
{
public:
RepeatTimer (Button& owner_) : owner (owner_) {}
void timerCallback() { owner.repeatTimerCallback(); }
juce_UseDebuggingNewOperator
private:
Button& owner;
RepeatTimer (const RepeatTimer&);
RepeatTimer& operator= (const RepeatTimer&);
};
Button::Button (const String& name)
: Component (name),
keySource (0),
@ -42338,7 +42353,7 @@ Button::~Button()
clearShortcuts();
}
void Button::setButtonText (const String& newText) throw()
void Button::setButtonText (const String& newText)
{
if (text != newText)
{
@ -42379,7 +42394,7 @@ const String Button::getTooltip()
return SettableTooltipClient::getTooltip();
}
void Button::setConnectedEdges (const int connectedEdgeFlags_) throw()
void Button::setConnectedEdges (const int connectedEdgeFlags_)
{
if (connectedEdgeFlags != connectedEdgeFlags_)
{
@ -42474,7 +42489,7 @@ void Button::enablementChanged()
repaint();
}
Button::ButtonState Button::updateState (const MouseEvent* const e) throw()
Button::ButtonState Button::updateState (const MouseEvent* const e)
{
ButtonState state = buttonNormal;
@ -42572,7 +42587,7 @@ void Button::internalClickCallback (const ModifierKeys& modifiers)
sendClickMessage (modifiers);
}
void Button::flashButtonState() throw()
void Button::flashButtonState()
{
if (isEnabled())
{
@ -42598,7 +42613,7 @@ void Button::handleCommandMessage (int commandId)
}
}
void Button::addButtonListener (ButtonListener* const newListener) throw()
void Button::addButtonListener (ButtonListener* const newListener)
{
jassert (newListener != 0);
jassert (! buttonListeners.contains (newListener)); // trying to add a listener to the list twice!
@ -42607,7 +42622,7 @@ void Button::addButtonListener (ButtonListener* const newListener) throw()
buttonListeners.add (newListener);
}
void Button::removeButtonListener (ButtonListener* const listener) throw()
void Button::removeButtonListener (ButtonListener* const listener)
{
jassert (buttonListeners.contains (listener)); // trying to remove a listener that isn't on the list!
@ -42839,7 +42854,7 @@ void Button::clearShortcuts()
parentHierarchyChanged();
}
bool Button::isShortcutPressed() const throw()
bool Button::isShortcutPressed() const
{
if (! isCurrentlyBlockedByAnotherModalComponent())
{
@ -42851,7 +42866,7 @@ bool Button::isShortcutPressed() const throw()
return false;
}
bool Button::isRegisteredForShortcut (const KeyPress& key) const throw()
bool Button::isRegisteredForShortcut (const KeyPress& key) const
{
for (int i = shortcuts.size(); --i >= 0;)
if (key == shortcuts.getReference(i))
@ -42910,7 +42925,7 @@ void Button::setRepeatSpeed (const int initialDelayMillisecs,
autoRepeatMinimumDelay = jmin (autoRepeatSpeed, minimumDelayInMillisecs);
}
void Button::repeatTimerCallback() throw()
void Button::repeatTimerCallback()
{
if (needsRepainting)
{
@ -42955,34 +42970,10 @@ void Button::repeatTimerCallback() throw()
}
}
class InternalButtonRepeatTimer : public Timer
{
public:
InternalButtonRepeatTimer (Button& owner_) throw()
: owner (owner_)
{
}
~InternalButtonRepeatTimer()
{
}
void timerCallback()
{
owner.repeatTimerCallback();
}
private:
Button& owner;
InternalButtonRepeatTimer (const InternalButtonRepeatTimer&);
const InternalButtonRepeatTimer& operator= (const InternalButtonRepeatTimer&);
};
Timer& Button::getRepeatTimer() throw()
Button::RepeatTimer& Button::getRepeatTimer()
{
if (repeatTimer == 0)
repeatTimer = new InternalButtonRepeatTimer (*this);
repeatTimer = new RepeatTimer (*this);
return *repeatTimer;
}

View file

@ -15272,9 +15272,9 @@ protected:
public:
virtual ~Button();
void setButtonText (const String& newText) throw();
void setButtonText (const String& newText);
const String getButtonText() const throw() { return text; }
const String getButtonText() const { return text; }
bool isDown() const throw();
@ -15295,9 +15295,9 @@ public:
int getRadioGroupId() const throw() { return radioGroupId; }
void addButtonListener (ButtonListener* const newListener) throw();
void addButtonListener (ButtonListener* const newListener);
void removeButtonListener (ButtonListener* const listener) throw();
void removeButtonListener (ButtonListener* const listener);
virtual void triggerClick();
@ -15311,7 +15311,7 @@ public:
void clearShortcuts();
bool isRegisteredForShortcut (const KeyPress& key) const throw();
bool isRegisteredForShortcut (const KeyPress& key) const;
void setRepeatSpeed (const int initialDelayInMillisecs,
const int repeatDelayInMillisecs,
@ -15336,7 +15336,7 @@ public:
ConnectedOnBottom = 8
};
void setConnectedEdges (const int connectedEdgeFlags) throw();
void setConnectedEdges (const int connectedEdgeFlags);
int getConnectedEdgeFlags() const throw() { return connectedEdgeFlags; }
@ -15397,8 +15397,9 @@ private:
String text;
SortedSet <void*> buttonListeners;
friend class InternalButtonRepeatTimer;
ScopedPointer <Timer> repeatTimer;
class RepeatTimer;
friend class ScopedPointer <RepeatTimer>;
ScopedPointer <RepeatTimer> repeatTimer;
uint32 buttonPressTime, lastTimeCallbackTime;
ApplicationCommandManager* commandManagerToUse;
int autoRepeatDelay, autoRepeatSpeed, autoRepeatMinimumDelay;
@ -15414,14 +15415,14 @@ private:
bool triggerOnMouseDown : 1;
bool generateTooltip : 1;
void repeatTimerCallback() throw();
Timer& getRepeatTimer() throw();
void repeatTimerCallback();
RepeatTimer& getRepeatTimer();
ButtonState updateState (const MouseEvent* const e) throw();
bool isShortcutPressed() const throw();
ButtonState updateState (const MouseEvent* const e);
bool isShortcutPressed() const;
void turnOffOtherButtonsInGroup (const bool sendChangeNotification);
void flashButtonState() throw();
void flashButtonState();
void sendClickMessage (const ModifierKeys& modifiers);
void sendStateMessage();
@ -23530,7 +23531,7 @@ private:
MenuBarModel* menuBarModel;
class ButtonListenerProxy;
friend class ButtonListenerProxy;
friend class ScopedPointer <ButtonListenerProxy>;
ScopedPointer <ButtonListenerProxy> buttonListener;
void repaintTitleBar();

View file

@ -31,8 +31,25 @@ BEGIN_JUCE_NAMESPACE
#include "../juce_ComponentDeletionWatcher.h"
#include "../keyboard/juce_KeyPressMappingSet.h"
#include "../../../text/juce_LocalisedStrings.h"
#include "../../../events/juce_Timer.h"
//==============================================================================
class Button::RepeatTimer : public Timer
{
public:
RepeatTimer (Button& owner_) : owner (owner_) {}
void timerCallback() { owner.repeatTimerCallback(); }
juce_UseDebuggingNewOperator
private:
Button& owner;
RepeatTimer (const RepeatTimer&);
RepeatTimer& operator= (const RepeatTimer&);
};
//==============================================================================
Button::Button (const String& name)
: Component (name),
@ -72,7 +89,7 @@ Button::~Button()
}
//==============================================================================
void Button::setButtonText (const String& newText) throw()
void Button::setButtonText (const String& newText)
{
if (text != newText)
{
@ -113,7 +130,7 @@ const String Button::getTooltip()
return SettableTooltipClient::getTooltip();
}
void Button::setConnectedEdges (const int connectedEdgeFlags_) throw()
void Button::setConnectedEdges (const int connectedEdgeFlags_)
{
if (connectedEdgeFlags != connectedEdgeFlags_)
{
@ -210,7 +227,7 @@ void Button::enablementChanged()
repaint();
}
Button::ButtonState Button::updateState (const MouseEvent* const e) throw()
Button::ButtonState Button::updateState (const MouseEvent* const e)
{
ButtonState state = buttonNormal;
@ -309,7 +326,7 @@ void Button::internalClickCallback (const ModifierKeys& modifiers)
sendClickMessage (modifiers);
}
void Button::flashButtonState() throw()
void Button::flashButtonState()
{
if (isEnabled())
{
@ -336,7 +353,7 @@ void Button::handleCommandMessage (int commandId)
}
//==============================================================================
void Button::addButtonListener (ButtonListener* const newListener) throw()
void Button::addButtonListener (ButtonListener* const newListener)
{
jassert (newListener != 0);
jassert (! buttonListeners.contains (newListener)); // trying to add a listener to the list twice!
@ -345,7 +362,7 @@ void Button::addButtonListener (ButtonListener* const newListener) throw()
buttonListeners.add (newListener);
}
void Button::removeButtonListener (ButtonListener* const listener) throw()
void Button::removeButtonListener (ButtonListener* const listener)
{
jassert (buttonListeners.contains (listener)); // trying to remove a listener that isn't on the list!
@ -582,7 +599,7 @@ void Button::clearShortcuts()
parentHierarchyChanged();
}
bool Button::isShortcutPressed() const throw()
bool Button::isShortcutPressed() const
{
if (! isCurrentlyBlockedByAnotherModalComponent())
{
@ -594,7 +611,7 @@ bool Button::isShortcutPressed() const throw()
return false;
}
bool Button::isRegisteredForShortcut (const KeyPress& key) const throw()
bool Button::isRegisteredForShortcut (const KeyPress& key) const
{
for (int i = shortcuts.size(); --i >= 0;)
if (key == shortcuts.getReference(i))
@ -654,7 +671,7 @@ void Button::setRepeatSpeed (const int initialDelayMillisecs,
autoRepeatMinimumDelay = jmin (autoRepeatSpeed, minimumDelayInMillisecs);
}
void Button::repeatTimerCallback() throw()
void Button::repeatTimerCallback()
{
if (needsRepainting)
{
@ -699,34 +716,10 @@ void Button::repeatTimerCallback() throw()
}
}
class InternalButtonRepeatTimer : public Timer
{
public:
InternalButtonRepeatTimer (Button& owner_) throw()
: owner (owner_)
{
}
~InternalButtonRepeatTimer()
{
}
void timerCallback()
{
owner.repeatTimerCallback();
}
private:
Button& owner;
InternalButtonRepeatTimer (const InternalButtonRepeatTimer&);
const InternalButtonRepeatTimer& operator= (const InternalButtonRepeatTimer&);
};
Timer& Button::getRepeatTimer() throw()
Button::RepeatTimer& Button::getRepeatTimer()
{
if (repeatTimer == 0)
repeatTimer = new InternalButtonRepeatTimer (*this);
repeatTimer = new RepeatTimer (*this);
return *repeatTimer;
}

View file

@ -32,7 +32,6 @@
#include "../../../containers/juce_SortedSet.h"
#include "../../../containers/juce_Value.h"
#include "../windows/juce_TooltipWindow.h"
#include "../../../events/juce_Timer.h"
class Button;
@ -91,13 +90,13 @@ public:
@see getButtonText
*/
void setButtonText (const String& newText) throw();
void setButtonText (const String& newText);
/** Returns the text displayed in the button.
@see setButtonText
*/
const String getButtonText() const throw() { return text; }
const String getButtonText() const { return text; }
//==============================================================================
/** Returns true if the button is currently being held down by the mouse.
@ -198,13 +197,13 @@ public:
@see removeButtonListener
*/
void addButtonListener (ButtonListener* const newListener) throw();
void addButtonListener (ButtonListener* const newListener);
/** Removes a previously-registered button listener
@see addButtonListener
*/
void removeButtonListener (ButtonListener* const listener) throw();
void removeButtonListener (ButtonListener* const listener);
//==============================================================================
/** Causes the button to act as if it's been clicked.
@ -261,7 +260,7 @@ public:
@see addShortcut
*/
bool isRegisteredForShortcut (const KeyPress& key) const throw();
bool isRegisteredForShortcut (const KeyPress& key) const;
//==============================================================================
/** Sets an auto-repeat speed for the button when it is held down.
@ -334,7 +333,7 @@ public:
LookAndFeel can choose to ignore it if it's not relevent for this type of
button.
*/
void setConnectedEdges (const int connectedEdgeFlags) throw();
void setConnectedEdges (const int connectedEdgeFlags);
/** Returns the set of flags passed into setConnectedEdges(). */
int getConnectedEdgeFlags() const throw() { return connectedEdgeFlags; }
@ -474,8 +473,9 @@ private:
String text;
SortedSet <void*> buttonListeners;
friend class InternalButtonRepeatTimer;
ScopedPointer <Timer> repeatTimer;
class RepeatTimer;
friend class ScopedPointer <RepeatTimer>;
ScopedPointer <RepeatTimer> repeatTimer;
uint32 buttonPressTime, lastTimeCallbackTime;
ApplicationCommandManager* commandManagerToUse;
int autoRepeatDelay, autoRepeatSpeed, autoRepeatMinimumDelay;
@ -491,14 +491,14 @@ private:
bool triggerOnMouseDown : 1;
bool generateTooltip : 1;
void repeatTimerCallback() throw();
Timer& getRepeatTimer() throw();
void repeatTimerCallback();
RepeatTimer& getRepeatTimer();
ButtonState updateState (const MouseEvent* const e) throw();
bool isShortcutPressed() const throw();
ButtonState updateState (const MouseEvent* const e);
bool isShortcutPressed() const;
void turnOffOtherButtonsInGroup (const bool sendChangeNotification);
void flashButtonState() throw();
void flashButtonState();
void sendClickMessage (const ModifierKeys& modifiers);
void sendStateMessage();

View file

@ -254,7 +254,7 @@ private:
MenuBarModel* menuBarModel;
class ButtonListenerProxy;
friend class ButtonListenerProxy;
friend class ScopedPointer <ButtonListenerProxy>;
ScopedPointer <ButtonListenerProxy> buttonListener;
void repaintTitleBar();