Various tweaks and fixes, mostly to the drop down lists

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@620 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-08-23 23:29:20 +00:00
parent dc9f08b311
commit d68f73edfc
17 changed files with 246 additions and 92 deletions
+15 -6
View File
@@ -98,21 +98,30 @@ bool CardViewer::shouldDraw(const ValueViewer& v) const {
}
// helper class for overdrawDC()
class CardViewer::OverdrawDC : private wxClientDC, public wxBufferedDC {
public:
OverdrawDC(CardViewer* window)
class CardViewer::OverdrawDC_aux : private wxClientDC {
protected:
wxBufferedDC bufferedDC;
OverdrawDC_aux(CardViewer* window)
: wxClientDC(window)
{
wxBufferedDC::Init((wxClientDC*)this, window->buffer);
bufferedDC.Init((wxClientDC*)this, window->buffer);
}
};
class CardViewer::OverdrawDC : private OverdrawDC_aux, public RotatedDC {
public:
OverdrawDC(CardViewer* window)
: OverdrawDC_aux(window)
, RotatedDC(bufferedDC, window->getRotation(), QUALITY_LOW)
{}
};
shared_ptr<DC> CardViewer::overdrawDC() {
shared_ptr<RotatedDC> CardViewer::overdrawDC() {
#ifdef _DEBUG
// don't call from onPaint
assert(!inOnPaint());
#endif
return shared_ptr<DC>((wxBufferedDC*)new OverdrawDC(this));
return shared_ptr<RotatedDC>(new OverdrawDC(this));
}
Rotation CardViewer::getRotation() const {
+2 -1
View File
@@ -28,7 +28,7 @@ class CardViewer : public wxControl, public DataViewer {
/// Get a dc to draw on the card outside onPaint
/** May NOT be called while in onPaint/draw */
shared_ptr<DC> overdrawDC();
shared_ptr<RotatedDC> overdrawDC();
/// Invalidate and redraw the entire viewer
void redraw();
@@ -59,6 +59,7 @@ class CardViewer : public wxControl, public DataViewer {
bool up_to_date; ///< Is the buffer up to date?
class OverdrawDC;
class OverdrawDC_aux;
};
// ----------------------------------------------------------------------------- : EOF
+4 -4
View File
@@ -87,16 +87,16 @@ GraphData::GraphData(const GraphDataPre& d)
left--;
}
}
// drop empty tail
while (a->groups.size() > 1 && a->groups.back().size == 0) {
a->groups.pop_back();
}
// Also keep non-numeric entries
FOR_EACH(c, counts) {
a->groups.push_back(GraphGroup(c.first, c.second));
a->max = max(a->max, c.second);
a->total += c.second;
}
// drop empty tail
while (a->groups.size() > 1 && a->groups.back().size == 0) {
a->groups.pop_back();
}
} else if (a->order) {
// specific group order
FOR_EACH_CONST(gn, *a->order) {