Browse Source

fixed a bug with popup menus in browser plugins in IE8; added an option to change the time delay of a TooltipWindow; added a missing function to MagnifierComponent

tags/2021-05-28
jules 16 years ago
parent
commit
f8e2eaccc3
6 changed files with 69 additions and 8 deletions
  1. +18
    -3
      build/win32/platform_specific_code/juce_win32_Windowing.cpp
  2. +28
    -3
      juce_amalgamated.cpp
  3. +6
    -1
      juce_amalgamated.h
  4. +5
    -0
      src/juce_appframework/gui/components/special/juce_MagnifierComponent.cpp
  5. +5
    -0
      src/juce_appframework/gui/components/windows/juce_TooltipWindow.cpp
  6. +7
    -1
      src/juce_appframework/gui/components/windows/juce_TooltipWindow.h

+ 18
- 3
build/win32/platform_specific_code/juce_win32_Windowing.cpp View File

@@ -872,6 +872,11 @@ public:
}
}
bool isInside (HWND h) const
{
return GetAncestor (hwnd, GA_ROOT) == h;
}
//==============================================================================
juce_UseDebuggingNewOperator
@@ -2296,10 +2301,20 @@ bool Process::isForegroundProcess() throw()
if (fg == 0)
return true;
DWORD processId = 0;
GetWindowThreadProcessId (fg, &processId);
// when running as a plugin in IE8, the browser UI runs in a different process to the plugin, so
// process ID isn't a reliable way to check if the foreground window belongs to us - instead, we
// have to see if any of our windows are children of the foreground window
fg = GetAncestor (fg, GA_ROOT);
for (int i = ComponentPeer::getNumPeers(); --i >= 0;)
{
Win32ComponentPeer* const wp = dynamic_cast <Win32ComponentPeer*> (ComponentPeer::getPeer (i));
if (wp != 0 && wp->isInside (fg))
return true;
}
return processId == GetCurrentProcessId();
return false;
}
//==============================================================================


+ 28
- 3
juce_amalgamated.cpp View File

@@ -70898,6 +70898,11 @@ void MagnifierComponent::setScaleFactor (double newScaleFactor)
}
}

void MagnifierComponent::setResamplingQuality (Graphics::ResamplingQuality newQuality)
{
quality = newQuality;
}

void MagnifierComponent::paint (Graphics& g)
{
const int w = holderComp->getWidth();
@@ -74812,6 +74817,11 @@ TooltipWindow::~TooltipWindow()
hide();
}

void TooltipWindow::setMillisecondsBeforeTipAppears (const int newTimeMs) throw()
{
millisecondsBeforeTipAppears = newTimeMs;
}

void TooltipWindow::paint (Graphics& g)
{
getLookAndFeel().drawTooltip (g, tipShowing, getWidth(), getHeight());
@@ -244507,6 +244517,11 @@ public:
}
}

bool isInside (HWND h) const
{
return GetAncestor (hwnd, GA_ROOT) == h;
}

juce_UseDebuggingNewOperator

bool dontRepaint;
@@ -245908,10 +245923,20 @@ bool Process::isForegroundProcess() throw()
if (fg == 0)
return true;

DWORD processId = 0;
GetWindowThreadProcessId (fg, &processId);
// when running as a plugin in IE8, the browser UI runs in a different process to the plugin, so
// process ID isn't a reliable way to check if the foreground window belongs to us - instead, we
// have to see if any of our windows are children of the foreground window
fg = GetAncestor (fg, GA_ROOT);

for (int i = ComponentPeer::getNumPeers(); --i >= 0;)
{
Win32ComponentPeer* const wp = dynamic_cast <Win32ComponentPeer*> (ComponentPeer::getPeer (i));

if (wp != 0 && wp->isInside (fg))
return true;
}

return processId == GetCurrentProcessId();
return false;
}

bool AlertWindow::showNativeDialogBox (const String& title,


+ 6
- 1
juce_amalgamated.h View File

@@ -30241,6 +30241,11 @@ public:
/** Destructor. */
~TooltipWindow();

/** Changes the time before the tip appears.
This lets you change the value that was set in the constructor.
*/
void setMillisecondsBeforeTipAppears (const int newTimeMs = 700) throw();

/** A set of colour IDs to use to change the colour of various aspects of the tooltip.

These constants can be used either via the Component::setColour(), or LookAndFeel::setColour()
@@ -30259,7 +30264,7 @@ public:

private:

const int millisecondsBeforeTipAppears;
int millisecondsBeforeTipAppears;
int mouseX, mouseY, mouseClicks;
unsigned int lastCompChangeTime, lastHideTime;
Component* lastComponentUnderMouse;


+ 5
- 0
src/juce_appframework/gui/components/special/juce_MagnifierComponent.cpp View File

@@ -245,6 +245,11 @@ void MagnifierComponent::setScaleFactor (double newScaleFactor)
}
}
void MagnifierComponent::setResamplingQuality (Graphics::ResamplingQuality newQuality)
{
quality = newQuality;
}
void MagnifierComponent::paint (Graphics& g)
{
const int w = holderComp->getWidth();


+ 5
- 0
src/juce_appframework/gui/components/windows/juce_TooltipWindow.cpp View File

@@ -66,6 +66,11 @@ TooltipWindow::~TooltipWindow()
hide();
}
void TooltipWindow::setMillisecondsBeforeTipAppears (const int newTimeMs) throw()
{
millisecondsBeforeTipAppears = newTimeMs;
}
void TooltipWindow::paint (Graphics& g)
{
getLookAndFeel().drawTooltip (g, tipShowing, getWidth(), getHeight());


+ 7
- 1
src/juce_appframework/gui/components/windows/juce_TooltipWindow.h View File

@@ -79,6 +79,12 @@ public:
/** Destructor. */
~TooltipWindow();
//==============================================================================
/** Changes the time before the tip appears.
This lets you change the value that was set in the constructor.
*/
void setMillisecondsBeforeTipAppears (const int newTimeMs = 700) throw();
//==============================================================================
/** A set of colour IDs to use to change the colour of various aspects of the tooltip.
@@ -99,7 +105,7 @@ public:
private:
//==============================================================================
const int millisecondsBeforeTipAppears;
int millisecondsBeforeTipAppears;
int mouseX, mouseY, mouseClicks;
unsigned int lastCompChangeTime, lastHideTime;
Component* lastComponentUnderMouse;


Loading…
Cancel
Save