From 257e8792f940f9ec1ae76af0b847a9ca3ba47445 Mon Sep 17 00:00:00 2001 From: twanvl Date: Fri, 21 Sep 2007 18:01:31 +0000 Subject: [PATCH] No longer incorrectly showing caret git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@735 0fc631ac-6414-0410-93d0-97cfa31319b6 --- src/gui/value/text.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/gui/value/text.cpp b/src/gui/value/text.cpp index fb072e3a..821567be 100644 --- a/src/gui/value/text.cpp +++ b/src/gui/value/text.cpp @@ -584,11 +584,11 @@ void TextValueEditor::draw(RotatedDC& dc) { } void TextValueEditor::redrawSelection(size_t old_selection_start_i, size_t old_selection_end_i, bool old_drop_down_shown) { -//% if (!isCurrent()) return; -//% if (old_drop_down_shown && dropDownShown()) return; // Hide caret - wxCaret* caret = editor().GetCaret(); - if (caret->IsVisible()) caret->Hide(); + if (isCurrent()) { + wxCaret* caret = editor().GetCaret(); + if (caret->IsVisible()) caret->Hide(); + } // Destroy the clientDC before reshowing the caret, prevent flicker on MSW { // Move selection @@ -619,7 +619,9 @@ void TextValueEditor::redrawSelection(size_t old_selection_start_i, size_t old_s drawWordListIndicators(dc, true); } } - showCaret(); + if (isCurrent()) { + showCaret(); + } } // ----------------------------------------------------------------------------- : Other overrides @@ -1279,6 +1281,7 @@ void TextValueEditor::findWordLists() { } void TextValueEditor::clearWordListIndicators(RotatedDC& dc) { + if (word_lists.empty()) return; Rotater rot(dc, style().getRotation()); bool current = isCurrent(); FOR_EACH(wl, word_lists) { @@ -1301,6 +1304,7 @@ void TextValueEditor::redrawWordListIndicators(bool toggling_dropdown) { } void TextValueEditor::drawWordListIndicators(RotatedDC& dc, bool redrawing) { + if (word_lists.empty()) return; Rotater rot(dc, style().getRotation()); bool current = isCurrent(); // Draw lines around fields