No longer incorrectly showing caret

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@735 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-09-21 18:01:31 +00:00
parent 69d59eb9e7
commit 257e8792f9
+9 -5
View File
@@ -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) { 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 // Hide caret
wxCaret* caret = editor().GetCaret(); if (isCurrent()) {
if (caret->IsVisible()) caret->Hide(); wxCaret* caret = editor().GetCaret();
if (caret->IsVisible()) caret->Hide();
}
// Destroy the clientDC before reshowing the caret, prevent flicker on MSW // Destroy the clientDC before reshowing the caret, prevent flicker on MSW
{ {
// Move selection // Move selection
@@ -619,7 +619,9 @@ void TextValueEditor::redrawSelection(size_t old_selection_start_i, size_t old_s
drawWordListIndicators(dc, true); drawWordListIndicators(dc, true);
} }
} }
showCaret(); if (isCurrent()) {
showCaret();
}
} }
// ----------------------------------------------------------------------------- : Other overrides // ----------------------------------------------------------------------------- : Other overrides
@@ -1279,6 +1281,7 @@ void TextValueEditor::findWordLists() {
} }
void TextValueEditor::clearWordListIndicators(RotatedDC& dc) { void TextValueEditor::clearWordListIndicators(RotatedDC& dc) {
if (word_lists.empty()) return;
Rotater rot(dc, style().getRotation()); Rotater rot(dc, style().getRotation());
bool current = isCurrent(); bool current = isCurrent();
FOR_EACH(wl, word_lists) { FOR_EACH(wl, word_lists) {
@@ -1301,6 +1304,7 @@ void TextValueEditor::redrawWordListIndicators(bool toggling_dropdown) {
} }
void TextValueEditor::drawWordListIndicators(RotatedDC& dc, bool redrawing) { void TextValueEditor::drawWordListIndicators(RotatedDC& dc, bool redrawing) {
if (word_lists.empty()) return;
Rotater rot(dc, style().getRotation()); Rotater rot(dc, style().getRotation());
bool current = isCurrent(); bool current = isCurrent();
// Draw lines around fields // Draw lines around fields