More warnings/minor fixes

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@836 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
coppro
2008-04-06 18:08:32 +00:00
parent 8c84621715
commit e6f466933d
23 changed files with 48 additions and 45 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ wxSize CardViewer::DoGetBestSize() const {
if (set) {
if (!stylesheet) stylesheet = set->stylesheet;
StyleSheetSettings& ss = settings.stylesheetSettingsFor(*stylesheet);
wxSize size(stylesheet->card_width * ss.card_zoom(), stylesheet->card_height * ss.card_zoom());
wxSize size(int(stylesheet->card_width * ss.card_zoom()), int(stylesheet->card_height * ss.card_zoom()));
if (sideways(ss.card_angle())) swap(size.x, size.y);
return size + ws - cs;
}
+1 -1
View File
@@ -116,9 +116,9 @@ size_t TreeList::findParent(size_t start) const {
TreeList::TreeList(Window* parent, int id, long style)
: wxPanel(parent, id, wxDefaultPosition, wxDefaultSize, style | wxWANTS_CHARS | wxVSCROLL)
, selection(NOTHING)
, total_lines(0)
, first_line(0)
, selection(NOTHING)
{
// determine item size
wxClientDC dc(this);
+5 -5
View File
@@ -55,7 +55,7 @@ class TextBufferDC : public wxMemoryDC {
double user_scale_x, user_scale_y;
TextDraw(wxFont font, Color color, double user_scale_x, double user_scale_y, int x, int y, String text, double angle = 0)
: font(font), color(color), user_scale_x(user_scale_x), user_scale_y(user_scale_y), x(x), y(y), text(text), angle(angle)
: font(font), color(color), x(x), y(y), text(text), angle(angle), user_scale_x(user_scale_x), user_scale_y(user_scale_y)
{}
};
public:
@@ -127,8 +127,8 @@ PageLayout::PageLayout(const StyleSheet& stylesheet, const RealSize& page_size)
card_size.width = stylesheet.card_width * 25.4 / stylesheet.card_dpi;
card_size.height = stylesheet.card_height * 25.4 / stylesheet.card_dpi;
card_landscape = card_size.width > card_size.height;
cols = floor(page_size.width / card_size.width);
rows = floor(page_size.height / card_size.height);
cols = int(floor(page_size.width / card_size.width));
rows = int(floor(page_size.height / card_size.height));
// distribute whitespace evenly
margin_left = margin_right = card_spacing.width = (page_size.width - (cols * card_size.width )) / (cols + 1);
margin_top = margin_bottom = card_spacing.height = (page_size.height - (rows * card_size.height)) / (rows + 1);
@@ -228,7 +228,7 @@ void CardsPrintout::drawCard(DC& dc, const CardP& card, int card_nr) {
*/
// create buffers
int w = stylesheet.card_width, h = stylesheet.card_height; // in pixels
int w = int(stylesheet.card_width), h = int(stylesheet.card_height); // in pixels
if (rotation == 90) swap(w,h);
// Draw using text buffer
//TextBufferDC bufferDC(w,h,true);
@@ -241,7 +241,7 @@ void CardsPrintout::drawCard(DC& dc, const CardP& card, int card_nr) {
// render buffer to device
double px_per_mm = 4 * stylesheet.card_dpi / 25.4;
dc.SetUserScale(scale_x / px_per_mm, scale_y / px_per_mm);
dc.SetDeviceOrigin(scale_x * pos.x, scale_y * pos.y);
dc.SetDeviceOrigin(int(scale_x * pos.x), int(scale_y * pos.y));
bufferDC.drawToDevice(dc, 0, 0); // adjust for scaling
}
+3 -3
View File
@@ -38,16 +38,16 @@ void SymbolSymmetryEditor::draw(DC& dc) {
if (symmetry->kind == SYMMETRY_REFLECTION) {
// draw line to handle
dc.SetPen(wxPen(color,1,wxDOT));
dc.DrawLine(center.x, center.y, handle.x, handle.y);
dc.DrawLine(int(center.x), int(center.y), int(handle.x), int(handle.y));
// draw handle
dc.SetPen(*wxBLACK_PEN);
dc.SetBrush(color);
dc.DrawCircle(handle.x, handle.y, hovered == SELECTION_HANDLE ? 7 : 4);
dc.DrawCircle(int(handle.x), int(handle.y), hovered == SELECTION_HANDLE ? 7 : 4);
}
// draw center
dc.SetPen(*wxBLACK_PEN);
dc.SetBrush(color);
dc.DrawCircle(center.x, center.y, hovered == SELECTION_CENTER ? 8 : 5);
dc.DrawCircle(int(center.x), int(center.y), hovered == SELECTION_CENTER ? 8 : 5);
}
}
+1 -1
View File
@@ -117,4 +117,4 @@ void PackageChoiceValueEditor::change(const String& c) {
void PackageChoiceValueEditor::initDropDown() {
if (drop_down) return;
drop_down = new_shared2<DropDownPackageChoiceList>(&editor(), this);
}
}