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
ca8e4031
Commit
ca8e4031
authored
Aug 31, 2008
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed: CardViewers fighting over styles when multiple windows are open
parent
7858d5b8
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
11 additions
and
12 deletions
+11
-12
src/gui/control/card_viewer.cpp
src/gui/control/card_viewer.cpp
+5
-2
src/render/card/viewer.cpp
src/render/card/viewer.cpp
+4
-3
src/render/card/viewer.hpp
src/render/card/viewer.hpp
+2
-1
src/render/value/choice.cpp
src/render/value/choice.cpp
+0
-2
src/render/value/color.cpp
src/render/value/color.cpp
+0
-1
src/render/value/image.cpp
src/render/value/image.cpp
+0
-2
src/render/value/multiple_choice.cpp
src/render/value/multiple_choice.cpp
+0
-1
No files found.
src/gui/control/card_viewer.cpp
View file @
ca8e4031
...
@@ -37,7 +37,10 @@ wxSize CardViewer::DoGetBestSize() const {
...
@@ -37,7 +37,10 @@ wxSize CardViewer::DoGetBestSize() const {
}
}
void
CardViewer
::
redraw
(
const
ValueViewer
&
v
)
{
void
CardViewer
::
redraw
(
const
ValueViewer
&
v
)
{
if
(
drawing
)
return
;
// Don't refresh if we OR ANOTHER CardViewer is drawing
// drawing another viewer causes styles to be updated for its active card, which may be different,
// causing the two viewers to continously refresh.
if
(
drawing_card
())
return
;
up_to_date
=
false
;
up_to_date
=
false
;
RefreshRect
(
getRotation
().
trRectToBB
(
v
.
boundingBox
()),
false
);
RefreshRect
(
getRotation
().
trRectToBB
(
v
.
boundingBox
()),
false
);
}
}
...
@@ -47,7 +50,7 @@ void CardViewer::onChange() {
...
@@ -47,7 +50,7 @@ void CardViewer::onChange() {
}
}
void
CardViewer
::
redraw
()
{
void
CardViewer
::
redraw
()
{
if
(
drawing
)
return
;
if
(
drawing
_card
()
)
return
;
up_to_date
=
false
;
up_to_date
=
false
;
Refresh
(
false
);
Refresh
(
false
);
}
}
...
...
src/render/card/viewer.cpp
View file @
ca8e4031
...
@@ -23,11 +23,13 @@ DECLARE_TYPEOF_NO_REV(IndexMap<FieldP COMMA StyleP>);
...
@@ -23,11 +23,13 @@ DECLARE_TYPEOF_NO_REV(IndexMap<FieldP COMMA StyleP>);
// ----------------------------------------------------------------------------- : DataViewer
// ----------------------------------------------------------------------------- : DataViewer
DataViewer
::
DataViewer
()
:
drawing
(
false
)
{}
DataViewer
::
DataViewer
()
{}
DataViewer
::~
DataViewer
()
{}
DataViewer
::~
DataViewer
()
{}
// ----------------------------------------------------------------------------- : Drawing
// ----------------------------------------------------------------------------- : Drawing
IMPLEMENT_DYNAMIC_ARG
(
bool
,
drawing_card
,
false
);
void
DataViewer
::
draw
(
DC
&
dc
)
{
void
DataViewer
::
draw
(
DC
&
dc
)
{
StyleSheetSettings
&
ss
=
settings
.
stylesheetSettingsFor
(
*
stylesheet
);
StyleSheetSettings
&
ss
=
settings
.
stylesheetSettingsFor
(
*
stylesheet
);
RotatedDC
rdc
(
dc
,
getRotation
(),
RotatedDC
rdc
(
dc
,
getRotation
(),
...
@@ -36,7 +38,7 @@ void DataViewer::draw(DC& dc) {
...
@@ -36,7 +38,7 @@ void DataViewer::draw(DC& dc) {
}
}
void
DataViewer
::
draw
(
RotatedDC
&
dc
,
const
Color
&
background
)
{
void
DataViewer
::
draw
(
RotatedDC
&
dc
,
const
Color
&
background
)
{
if
(
!
set
)
return
;
// no set specified, don't draw anything
if
(
!
set
)
return
;
// no set specified, don't draw anything
drawing
=
true
;
WITH_DYNAMIC_ARG
(
drawing_card
,
true
)
;
// fill with background color
// fill with background color
clearDC
(
dc
.
getDC
(),
background
);
clearDC
(
dc
.
getDC
(),
background
);
// update style scripts
// update style scripts
...
@@ -69,7 +71,6 @@ void DataViewer::draw(RotatedDC& dc, const Color& background) {
...
@@ -69,7 +71,6 @@ void DataViewer::draw(RotatedDC& dc, const Color& background) {
}
}
}
}
}
}
drawing
=
false
;
}
}
void
DataViewer
::
drawViewer
(
RotatedDC
&
dc
,
ValueViewer
&
v
)
{
void
DataViewer
::
drawViewer
(
RotatedDC
&
dc
,
ValueViewer
&
v
)
{
v
.
draw
(
dc
);
v
.
draw
(
dc
);
...
...
src/render/card/viewer.hpp
View file @
ca8e4031
...
@@ -20,6 +20,8 @@ class Context;
...
@@ -20,6 +20,8 @@ class Context;
// ----------------------------------------------------------------------------- : DataViewer
// ----------------------------------------------------------------------------- : DataViewer
DECLARE_DYNAMIC_ARG
(
bool
,
drawing_card
);
/// A viewer can generate an image of some values, usually a card.
/// A viewer can generate an image of some values, usually a card.
class
DataViewer
:
public
SetView
{
class
DataViewer
:
public
SetView
{
public:
public:
...
@@ -98,7 +100,6 @@ class DataViewer : public SetView {
...
@@ -98,7 +100,6 @@ class DataViewer : public SetView {
vector
<
ValueViewerP
>
viewers
;
///< The viewers for the different values in the data
vector
<
ValueViewerP
>
viewers
;
///< The viewers for the different values in the data
CardP
card
;
///< The card that is currently displayed, if any
CardP
card
;
///< The card that is currently displayed, if any
bool
drawing
;
///< Are we currently drawing?
mutable
StyleSheetP
stylesheet
;
///< Stylesheet being used
mutable
StyleSheetP
stylesheet
;
///< Stylesheet being used
};
};
...
...
src/render/value/choice.cpp
View file @
ca8e4031
...
@@ -10,8 +10,6 @@
...
@@ -10,8 +10,6 @@
#include <render/value/choice.hpp>
#include <render/value/choice.hpp>
#include <render/card/viewer.hpp>
#include <render/card/viewer.hpp>
DECLARE_TYPEOF_COLLECTION
(
wxPoint
);
// ----------------------------------------------------------------------------- : ChoiceValueViewer
// ----------------------------------------------------------------------------- : ChoiceValueViewer
IMPLEMENT_VALUE_VIEWER
(
Choice
);
IMPLEMENT_VALUE_VIEWER
(
Choice
);
...
...
src/render/value/color.cpp
View file @
ca8e4031
...
@@ -11,7 +11,6 @@
...
@@ -11,7 +11,6 @@
#include <render/card/viewer.hpp>
#include <render/card/viewer.hpp>
DECLARE_TYPEOF_COLLECTION
(
ColorField
::
ChoiceP
);
DECLARE_TYPEOF_COLLECTION
(
ColorField
::
ChoiceP
);
DECLARE_TYPEOF_COLLECTION
(
wxPoint
);
// ----------------------------------------------------------------------------- : ColorValueViewer
// ----------------------------------------------------------------------------- : ColorValueViewer
...
...
src/render/value/image.cpp
View file @
ca8e4031
...
@@ -11,8 +11,6 @@
...
@@ -11,8 +11,6 @@
#include <render/card/viewer.hpp>
#include <render/card/viewer.hpp>
#include <gui/util.hpp>
#include <gui/util.hpp>
DECLARE_TYPEOF_COLLECTION
(
wxPoint
);
// ----------------------------------------------------------------------------- : ImageValueViewer
// ----------------------------------------------------------------------------- : ImageValueViewer
IMPLEMENT_VALUE_VIEWER
(
Image
);
IMPLEMENT_VALUE_VIEWER
(
Image
);
...
...
src/render/value/multiple_choice.cpp
View file @
ca8e4031
...
@@ -13,7 +13,6 @@
...
@@ -13,7 +13,6 @@
#include <gui/util.hpp>
#include <gui/util.hpp>
DECLARE_TYPEOF_COLLECTION
(
String
);
DECLARE_TYPEOF_COLLECTION
(
String
);
DECLARE_TYPEOF_COLLECTION
(
wxPoint
);
// ----------------------------------------------------------------------------- : MultipleChoiceValueViewer
// ----------------------------------------------------------------------------- : MultipleChoiceValueViewer
...
...
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