1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-24 01:54:22 +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:
Julian Storer 2010-02-25 22:33:44 +00:00
parent bc5a7a6b7e
commit 5fecb8a353
49 changed files with 1251 additions and 1152 deletions

View file

@ -69,10 +69,10 @@ BEGIN_JUCE_NAMESPACE
#include "../gui/components/special/juce_WebBrowserComponent.h"
#include "../gui/components/keyboard/juce_KeyPress.h"
#include "../utilities/juce_SystemClipboard.h"
#include "../gui/components/windows/juce_ComponentPeer.h"
#include "../gui/components/windows/juce_AlertWindow.h"
#include "../gui/components/special/juce_OpenGLComponent.h"
#include "../gui/components/juce_Desktop.h"
#include "../gui/components/juce_ComponentDeletionWatcher.h"
#include "../gui/graphics/geometry/juce_RectangleList.h"
#include "../gui/graphics/imaging/juce_ImageFileFormat.h"
#include "../gui/graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.h"

View file

@ -54,6 +54,7 @@ BEGIN_JUCE_NAMESPACE
#include "../gui/graphics/imaging/juce_ImageFileFormat.h"
#include "../gui/graphics/imaging/juce_CameraDevice.h"
#include "../gui/components/windows/juce_AlertWindow.h"
#include "../gui/components/windows/juce_ComponentPeer.h"
#include "../gui/components/juce_Desktop.h"
#include "../gui/components/menus/juce_MenuBarModel.h"
#include "../gui/components/special/juce_OpenGLComponent.h"

View file

@ -57,6 +57,7 @@ BEGIN_JUCE_NAMESPACE
#include "../gui/graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.h"
#include "../gui/graphics/imaging/juce_ImageFileFormat.h"
#include "../gui/graphics/imaging/juce_CameraDevice.h"
#include "../gui/components/windows/juce_ComponentPeer.h"
#include "../gui/components/windows/juce_AlertWindow.h"
#include "../gui/components/juce_Desktop.h"
#include "../gui/components/menus/juce_MenuBarModel.h"

View file

@ -535,7 +535,7 @@ public:
if (windowH != 0)
{
const ComponentDeletionWatcher deletionChecker (component);
Component::SafePointer<Component> deletionChecker (component);
wx = x;
wy = y;
@ -566,7 +566,7 @@ public:
wx - windowBorder.getLeft(),
wy - windowBorder.getTop(), ww, wh);
if (! deletionChecker.hasBeenDeleted())
if (deletionChecker != 0)
{
updateBorderSize();
handleMovedOrResized();

View file

@ -563,7 +563,7 @@ public:
if (fullScreen != shouldBeFullScreen)
{
fullScreen = shouldBeFullScreen;
const ComponentDeletionWatcher deletionChecker (component);
const Component::SafePointer deletionChecker (component);
if (! fullScreen)
{
@ -589,7 +589,7 @@ public:
SendMessageW (hwnd, WM_SETTINGCHANGE, 0, 0);
}
if (! deletionChecker.hasBeenDeleted())
if (deletionChecker != 0)
handleMovedOrResized();
}
}