Implemented ImageValueViewer, and more of the related classes

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@54 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2006-10-27 22:10:09 +00:00
parent d9c9c40adf
commit 7192361c36
35 changed files with 485 additions and 37 deletions
+21
View File
@@ -8,6 +8,7 @@
#include <gui/util.hpp>
#include <util/error.hpp>
#include <util/rotation.hpp>
#include <wx/mstream.h>
// ----------------------------------------------------------------------------- : DC related
@@ -20,6 +21,26 @@ void clearDC(DC& dc, const wxBrush& brush) {
dc.DrawRectangle(0, 0, size.GetWidth(), size.GetHeight());
}
void draw_checker(RotatedDC& dc, const RealRect& rect) {
dc.SetPen(*wxTRANSPARENT_PEN);
dc.SetBrush(*wxWHITE_BRUSH);
dc.DrawRectangle(rect);
dc.SetBrush(Color(235,235,235));
const double checker_size = 10;
int odd = 0;
for (double y = 0 ; y < rect.size.height ; y += checker_size) {
for (double x = odd * checker_size ; x < rect.size.width ; x += checker_size * 2) {
dc.DrawRectangle(RealRect(
rect.position.x + x,
rect.position.y + y,
min(checker_size, rect.size.width - x),
min(checker_size, rect.size.height - y)
));
}
odd = 1 - odd;
}
}
// ----------------------------------------------------------------------------- : Image related
Image load_resource_image(String name) {