Browse Source

Fixes for disappearing win32 drag images, and TextEditor custom cursors.

tags/2021-05-28
Julian Storer 14 years ago
parent
commit
ca8ce6d354
7 changed files with 55 additions and 21 deletions
  1. +21
    -3
      juce_amalgamated.cpp
  2. +7
    -8
      juce_amalgamated.h
  3. +1
    -1
      src/core/juce_StandardHeader.h
  4. +9
    -0
      src/gui/components/controls/juce_TextEditor.cpp
  5. +6
    -7
      src/gui/components/controls/juce_TextEditor.h
  6. +8
    -0
      src/gui/components/mouse/juce_DragAndDropContainer.cpp
  7. +3
    -2
      src/native/windows/juce_win32_Windowing.cpp

+ 21
- 3
juce_amalgamated.cpp View File

@@ -53159,6 +53159,15 @@ void TextEditor::colourChanged()
repaint();
}

void TextEditor::lookAndFeelChanged()
{
if (isCaretVisible())
{
setCaretVisible (false);
setCaretVisible (true);
}
}

void TextEditor::setCaretVisible (const bool shouldCaretBeVisible)
{
if (shouldCaretBeVisible && ! isReadOnly())
@@ -53439,7 +53448,7 @@ void TextEditor::updateTextHolderSize()
const int h = topIndent + roundToInt (jmax (i.lineY + i.lineHeight,
currentFont.getHeight()));

textHolder->setSize (w + 2, h + 1);
textHolder->setSize (w + 2, h + 1); // (the +2 allows a bit of space for the cursor to be at the right-hand-edge)
}
}

@@ -71132,6 +71141,14 @@ void DragAndDropContainer::startDragging (const String& sourceDescription,

static_cast <DragImageComponent*> (static_cast <Component*> (dragImageComponent))->updateLocation (false, lastMouseDown);
dragImageComponent->setVisible (true);

#if JUCE_WIN32
// Under heavy load, the layered window's paint callback can often be lost by the OS,
// so forcing a repaint at least once makes sure that the window becomes visible..
ComponentPeer* const peer = dragImageComponent->getPeer();
if (peer != 0)
peer->performAnyPendingRepaintsNow();
#endif
}
}

@@ -246560,8 +246577,9 @@ public:
void performAnyPendingRepaintsNow()
{
MSG m;
if (component->isVisible() && PeekMessage (&m, hwnd, WM_PAINT, WM_PAINT, PM_REMOVE))
DispatchMessage (&m);
if (component->isVisible()
&& (PeekMessage (&m, hwnd, WM_PAINT, WM_PAINT, PM_REMOVE) || isUsingUpdateLayeredWindow()))
handlePaintMessage();
}

static Win32ComponentPeer* getOwnerOfWindow (HWND h) throw()


+ 7
- 8
juce_amalgamated.h View File

@@ -73,7 +73,7 @@ namespace JuceDummyNamespace {}
*/
#define JUCE_MAJOR_VERSION 1
#define JUCE_MINOR_VERSION 53
#define JUCE_BUILDNUMBER 56
#define JUCE_BUILDNUMBER 57

/** Current Juce version number.

@@ -42206,20 +42206,18 @@ public:
/** Deletes all the text from the editor. */
void clear();

/** Deletes the currently selected region, and puts it on the clipboard.
/** Deletes the currently selected region.
This doesn't copy the deleted section to the clipboard - if you need to do that, call copy() first.
@see copy, paste, SystemClipboard
*/
void cut();

/** Copies any currently selected region to the clipboard.

/** Copies the currently selected region to the clipboard.
@see cut, paste, SystemClipboard
*/
void copy();

/** Pastes the contents of the clipboard into the editor at the cursor position.

@see cut, copy, SystemClipboard
*/
void paste();
@@ -42349,6 +42347,8 @@ public:
/** @internal */
void colourChanged();
/** @internal */
void lookAndFeelChanged();
/** @internal */
bool isTextInputActive() const;

/** This adds the items to the popup menu.
@@ -42402,8 +42402,7 @@ protected:
/** Used internally to dispatch a text-change message. */
void textChanged();

/** Begins a new transaction in the UndoManager.
*/
/** Begins a new transaction in the UndoManager. */
void newTransaction();

/** Used internally to trigger an undo or redo. */


+ 1
- 1
src/core/juce_StandardHeader.h View File

@@ -33,7 +33,7 @@
*/
#define JUCE_MAJOR_VERSION 1
#define JUCE_MINOR_VERSION 53
#define JUCE_BUILDNUMBER 56
#define JUCE_BUILDNUMBER 57
/** Current Juce version number.


+ 9
- 0
src/gui/components/controls/juce_TextEditor.cpp View File

@@ -1138,6 +1138,15 @@ void TextEditor::colourChanged()
repaint();
}
void TextEditor::lookAndFeelChanged()
{
if (isCaretVisible())
{
setCaretVisible (false);
setCaretVisible (true);
}
}
void TextEditor::setCaretVisible (const bool shouldCaretBeVisible)
{
if (shouldCaretBeVisible && ! isReadOnly())


+ 6
- 7
src/gui/components/controls/juce_TextEditor.h View File

@@ -385,20 +385,18 @@ public:
/** Deletes all the text from the editor. */
void clear();
/** Deletes the currently selected region, and puts it on the clipboard.
/** Deletes the currently selected region.
This doesn't copy the deleted section to the clipboard - if you need to do that, call copy() first.
@see copy, paste, SystemClipboard
*/
void cut();
/** Copies any currently selected region to the clipboard.
/** Copies the currently selected region to the clipboard.
@see cut, paste, SystemClipboard
*/
void copy();
/** Pastes the contents of the clipboard into the editor at the cursor position.
@see cut, copy, SystemClipboard
*/
void paste();
@@ -530,6 +528,8 @@ public:
/** @internal */
void colourChanged();
/** @internal */
void lookAndFeelChanged();
/** @internal */
bool isTextInputActive() const;
//==============================================================================
@@ -585,8 +585,7 @@ protected:
/** Used internally to dispatch a text-change message. */
void textChanged();
/** Begins a new transaction in the UndoManager.
*/
/** Begins a new transaction in the UndoManager. */
void newTransaction();
/** Used internally to trigger an undo or redo. */


+ 8
- 0
src/gui/components/mouse/juce_DragAndDropContainer.cpp View File

@@ -396,6 +396,14 @@ void DragAndDropContainer::startDragging (const String& sourceDescription,
static_cast <DragImageComponent*> (static_cast <Component*> (dragImageComponent))->updateLocation (false, lastMouseDown);
dragImageComponent->setVisible (true);
#if JUCE_WIN32
// Under heavy load, the layered window's paint callback can often be lost by the OS,
// so forcing a repaint at least once makes sure that the window becomes visible..
ComponentPeer* const peer = dragImageComponent->getPeer();
if (peer != 0)
peer->performAnyPendingRepaintsNow();
#endif
}
}


+ 3
- 2
src/native/windows/juce_win32_Windowing.cpp View File

@@ -814,8 +814,9 @@ public:
void performAnyPendingRepaintsNow()
{
MSG m;
if (component->isVisible() && PeekMessage (&m, hwnd, WM_PAINT, WM_PAINT, PM_REMOVE))
DispatchMessage (&m);
if (component->isVisible()
&& (PeekMessage (&m, hwnd, WM_PAINT, WM_PAINT, PM_REMOVE) || isUsingUpdateLayeredWindow()))
handlePaintMessage();
}
//==============================================================================


Loading…
Cancel
Save