mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-16 00:34:19 +00:00
Created a new class Component::SafePointer that keeps a pointer to a component and automatically nulls it if the component is deleted - this makes it a much more elegant replacement for the old ComponentDeletionWatcher class. Removed Component::getComponentUnderMouse(), which doesn't fit with multi-touch interfaces - for similar functionality, use the Desktop::getMouseInputSource() methods to find out what MouseInputSources are available, and ask them about the component they are over or dragging.
This commit is contained in:
parent
bc5a7a6b7e
commit
5fecb8a353
49 changed files with 1251 additions and 1152 deletions
|
|
@ -28,6 +28,7 @@
|
|||
BEGIN_JUCE_NAMESPACE
|
||||
|
||||
#include "juce_TextEditor.h"
|
||||
#include "../windows/juce_ComponentPeer.h"
|
||||
#include "../../graphics/fonts/juce_GlyphArrangement.h"
|
||||
#include "../../../utilities/juce_SystemClipboard.h"
|
||||
#include "../../../core/juce_Time.h"
|
||||
|
|
@ -2165,7 +2166,7 @@ void TextEditor::resized()
|
|||
|
||||
void TextEditor::handleCommandMessage (const int commandId)
|
||||
{
|
||||
const ComponentDeletionWatcher deletionChecker (this);
|
||||
Component::SafePointer<Component> deletionChecker (this);
|
||||
|
||||
for (int i = listeners.size(); --i >= 0;)
|
||||
{
|
||||
|
|
@ -2196,7 +2197,7 @@ void TextEditor::handleCommandMessage (const int commandId)
|
|||
break;
|
||||
}
|
||||
|
||||
if (i > 0 && deletionChecker.hasBeenDeleted())
|
||||
if (deletionChecker == 0)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue