Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
magicseteditor
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
magicseteditor
Commits
c51fcb0b
Commit
c51fcb0b
authored
Aug 28, 2007
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed redraw issue of text behind word list drop down arrows
parent
71fd64f9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
10 deletions
+30
-10
src/gui/value/text.cpp
src/gui/value/text.cpp
+27
-9
src/gui/value/text.hpp
src/gui/value/text.hpp
+3
-1
No files found.
src/gui/value/text.cpp
View file @
c51fcb0b
...
@@ -301,7 +301,7 @@ void DropDownWordList::select(size_t item) {
...
@@ -301,7 +301,7 @@ void DropDownWordList::select(size_t item) {
}
}
void
DropDownWordList
::
redrawArrowOnParent
()
{
void
DropDownWordList
::
redrawArrowOnParent
()
{
tve
.
redrawWordListIndicators
();
tve
.
redrawWordListIndicators
(
true
);
}
}
// ----------------------------------------------------------------------------- : TextValueEditor
// ----------------------------------------------------------------------------- : TextValueEditor
...
@@ -591,8 +591,8 @@ void TextValueEditor::draw(RotatedDC& dc) {
...
@@ -591,8 +591,8 @@ 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 (!isCurrent()) return;
if
(
old_drop_down_shown
&&
dropDownShown
())
return
;
//%
if (old_drop_down_shown && dropDownShown()) return;
// Hide caret
// Hide caret
wxCaret
*
caret
=
editor
().
GetCaret
();
wxCaret
*
caret
=
editor
().
GetCaret
();
if
(
caret
->
IsVisible
())
caret
->
Hide
();
if
(
caret
->
IsVisible
())
caret
->
Hide
();
...
@@ -616,6 +616,8 @@ void TextValueEditor::redrawSelection(size_t old_selection_start_i, size_t old_s
...
@@ -616,6 +616,8 @@ void TextValueEditor::redrawSelection(size_t old_selection_start_i, size_t old_s
updateScrollbar
();
updateScrollbar
();
redraw
();
redraw
();
}
else
{
}
else
{
// remove indicators
clearWordListIndicators
(
dc
);
// draw new selection
// draw new selection
if
(
!
dropDownShown
())
{
if
(
!
dropDownShown
())
{
v
.
drawSelection
(
dc
,
style
(),
selection_start_i
,
selection_end_i
);
v
.
drawSelection
(
dc
,
style
(),
selection_start_i
,
selection_end_i
);
...
@@ -1282,8 +1284,27 @@ void TextValueEditor::findWordLists() {
...
@@ -1282,8 +1284,27 @@ void TextValueEditor::findWordLists() {
}
}
}
}
void
TextValueEditor
::
redrawWordListIndicators
()
{
void
TextValueEditor
::
clearWordListIndicators
(
RotatedDC
&
dc
)
{
if
(
isCurrent
())
{
Rotater
rot
(
dc
,
style
().
getRotation
());
bool
current
=
isCurrent
();
FOR_EACH
(
wl
,
word_lists
)
{
if
(
current
&&
drop_down
&&
drop_down
->
IsShown
()
&&
drop_down
->
getPos
()
==
wl
)
{
continue
;
}
else
if
(
current
&&
selection_end_i
>=
wl
->
start
&&
selection_end_i
<=
wl
->
end
&&
!
dropDownShown
())
{
continue
;
}
else
if
(
wl
.
get
()
==
hovered_words
)
{
continue
;
}
// restore background
if
(
wl
->
behind
.
Ok
())
{
dc
.
DrawBitmap
(
wl
->
behind
,
wl
->
rect
.
topRight
()
+
RealSize
(
0
,
-
1
));
}
}
}
void
TextValueEditor
::
redrawWordListIndicators
(
bool
toggling_dropdown
)
{
redrawSelection
(
selection_start_i
,
selection_end_i
,
dropDownShown
()
!=
toggling_dropdown
);
/*//%%if (isCurrent()) {
// Hide caret
// Hide caret
wxCaret* caret = editor().GetCaret();
wxCaret* caret = editor().GetCaret();
if (caret->IsVisible()) caret->Hide();
if (caret->IsVisible()) caret->Hide();
...
@@ -1291,7 +1312,7 @@ void TextValueEditor::redrawWordListIndicators() {
...
@@ -1291,7 +1312,7 @@ void TextValueEditor::redrawWordListIndicators() {
drawWordListIndicators(*editor().overdrawDC(), true);
drawWordListIndicators(*editor().overdrawDC(), true);
if (isCurrent()) {
if (isCurrent()) {
showCaret();
showCaret();
}
}
*/
}
}
void
TextValueEditor
::
drawWordListIndicators
(
RotatedDC
&
dc
,
bool
redrawing
)
{
void
TextValueEditor
::
drawWordListIndicators
(
RotatedDC
&
dc
,
bool
redrawing
)
{
...
@@ -1322,9 +1343,6 @@ void TextValueEditor::drawWordListIndicators(RotatedDC& dc, bool redrawing) {
...
@@ -1322,9 +1343,6 @@ void TextValueEditor::drawWordListIndicators(RotatedDC& dc, bool redrawing) {
// capture background?
// capture background?
if
(
!
redrawing
)
{
if
(
!
redrawing
)
{
wl
->
behind
=
dc
.
GetBackground
(
RealRect
(
r
.
right
(),
r
.
top
()
-
1
,
10
,
r
.
height
+
3
));
wl
->
behind
=
dc
.
GetBackground
(
RealRect
(
r
.
right
(),
r
.
top
()
-
1
,
10
,
r
.
height
+
3
));
}
else
if
(
small
&&
wl
->
behind
.
Ok
())
{
// restore background
dc
.
DrawBitmap
(
wl
->
behind
,
r
.
topRight
()
+
RealSize
(
0
,
-
1
));
}
}
// draw rectangle around value
// draw rectangle around value
dc
.
SetBrush
(
*
wxTRANSPARENT_BRUSH
);
dc
.
SetBrush
(
*
wxTRANSPARENT_BRUSH
);
...
...
src/gui/value/text.hpp
View file @
c51fcb0b
...
@@ -172,8 +172,10 @@ class TextValueEditor : public TextValueViewer, public ValueEditor {
...
@@ -172,8 +172,10 @@ class TextValueEditor : public TextValueViewer, public ValueEditor {
void
findWordLists
();
void
findWordLists
();
/// Draw word list indicators
/// Draw word list indicators
void
drawWordListIndicators
(
RotatedDC
&
dc
,
bool
redrawing
=
false
);
void
drawWordListIndicators
(
RotatedDC
&
dc
,
bool
redrawing
=
false
);
/// Remove word list indicators
void
clearWordListIndicators
(
RotatedDC
&
dc
);
/// Re-draw word list indicators
/// Re-draw word list indicators
void
redrawWordListIndicators
();
void
redrawWordListIndicators
(
bool
toggling_dropdown
=
false
);
/// Find a WordListPos under the mouse cursor (if any), pos is in internal coordinates
/// Find a WordListPos under the mouse cursor (if any), pos is in internal coordinates
WordListPosP
findWordList
(
const
RealPoint
&
pos
)
const
;
WordListPosP
findWordList
(
const
RealPoint
&
pos
)
const
;
/// Find a WordListPos rectangle under the mouse cursor (if any), pos is in internal coordinates
/// Find a WordListPos rectangle under the mouse cursor (if any), pos is in internal coordinates
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment