mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-02-02 03:20:06 +00:00
DocumentWindow: Ensure button callbacks are called on Windows
This commit is contained in:
parent
1798b12d4b
commit
c02ec2e3d5
4 changed files with 63 additions and 3 deletions
|
|
@ -925,9 +925,32 @@ public:
|
|||
window's caption area to the edge of the screen), double-clicking a horizontal border to
|
||||
stretch a window vertically, and the window tiling flyout that appears when hovering the
|
||||
mouse over the maximise button.
|
||||
|
||||
This is called by the peer. Component subclasses may override this but should not call it directly.
|
||||
*/
|
||||
virtual WindowControlKind findControlAtPoint (Point<float>) const { return WindowControlKind::client; }
|
||||
|
||||
/** For components that are added to the desktop, this may be called to indicate that the mouse
|
||||
was clicked inside the area of the "close" control. This is currently only called on Windows.
|
||||
|
||||
This is called by the peer. Component subclasses may override this but should not call it directly.
|
||||
*/
|
||||
virtual void windowControlClickedClose() {}
|
||||
|
||||
/** For components that are added to the desktop, this may be called to indicate that the mouse
|
||||
was clicked inside the area of the "minimise" control. This is currently only called on Windows.
|
||||
|
||||
This is called by the peer. Component subclasses may override this but should not call it directly.
|
||||
*/
|
||||
virtual void windowControlClickedMinimise() {}
|
||||
|
||||
/** For components that are added to the desktop, this may be called to indicate that the mouse
|
||||
was clicked inside the area of the "maximise" control. This is currently only called on Windows.
|
||||
|
||||
This is called by the peer. Component subclasses may override this but should not call it directly.
|
||||
*/
|
||||
virtual void windowControlClickedMaximise() {}
|
||||
|
||||
/** Changes the default return value for the hitTest() method.
|
||||
|
||||
Setting this to false is an easy way to make a component pass all its mouse events
|
||||
|
|
|
|||
|
|
@ -4304,17 +4304,33 @@ private:
|
|||
switch (wParam)
|
||||
{
|
||||
case HTCLOSE:
|
||||
PostMessage (h, WM_CLOSE, 0, 0);
|
||||
if ((styleFlags & windowHasCloseButton) != 0 && ! sendInputAttemptWhenModalMessage())
|
||||
{
|
||||
if (hasTitleBar())
|
||||
PostMessage (h, WM_CLOSE, 0, 0);
|
||||
else
|
||||
component.windowControlClickedClose();
|
||||
}
|
||||
return 0;
|
||||
|
||||
case HTMAXBUTTON:
|
||||
if ((styleFlags & windowHasMaximiseButton) != 0 && ! sendInputAttemptWhenModalMessage())
|
||||
setFullScreen (! isFullScreen());
|
||||
{
|
||||
if (hasTitleBar())
|
||||
setFullScreen (! isFullScreen());
|
||||
else
|
||||
component.windowControlClickedMaximise();
|
||||
}
|
||||
return 0;
|
||||
|
||||
case HTMINBUTTON:
|
||||
if ((styleFlags & windowHasMinimiseButton) != 0 && ! sendInputAttemptWhenModalMessage())
|
||||
setMinimised (true);
|
||||
{
|
||||
if (hasTitleBar())
|
||||
setMinimised (true);
|
||||
else
|
||||
component.windowControlClickedMinimise();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -192,6 +192,21 @@ void DocumentWindow::maximiseButtonPressed()
|
|||
setFullScreen (! isFullScreen());
|
||||
}
|
||||
|
||||
void DocumentWindow::windowControlClickedClose()
|
||||
{
|
||||
closeButtonPressed();
|
||||
}
|
||||
|
||||
void DocumentWindow::windowControlClickedMinimise()
|
||||
{
|
||||
minimiseButtonPressed();
|
||||
}
|
||||
|
||||
void DocumentWindow::windowControlClickedMaximise()
|
||||
{
|
||||
maximiseButtonPressed();
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void DocumentWindow::paint (Graphics& g)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -294,6 +294,12 @@ public:
|
|||
Rectangle<int> getTitleBarArea() const;
|
||||
/** @internal */
|
||||
WindowControlKind findControlAtPoint (Point<float>) const override;
|
||||
/** @internal */
|
||||
void windowControlClickedClose() override;
|
||||
/** @internal */
|
||||
void windowControlClickedMinimise() override;
|
||||
/** @internal */
|
||||
void windowControlClickedMaximise() override;
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue