Eliminated most build errors (gcc,linux,wxGTK).

What is left is mostly:
 - warning: converting double to int
     -> add a cast/to_int or ignore
 - wrong initialization order in ctor
     -> just swap the order to match the class
 - errors about wxCursors
     -> add a function loadResourceCursor


git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@183 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-01-29 00:04:20 +00:00
parent 1cd80a3710
commit 3d9181e5f6
42 changed files with 151 additions and 125 deletions
+1 -1
View File
@@ -100,7 +100,7 @@ struct CompareTabIndex {
Field& af = *as.fieldP, &bf = *bs.fieldP;
if (af.tab_index < bf.tab_index) return true;
if (af.tab_index > bf.tab_index) return false;
if (abs(as.top - bs.top) < 15) {
if (fabs(as.top - bs.top) < 15) {
// the fields are almost on the same 'row'
// compare horizontally first
if (as.left < bs.left) return true; // horizontal sorting
+4 -2
View File
@@ -79,8 +79,10 @@ void CardListColumnSelectDialog::initList() {
// check
int i = list->GetCount() - 1;
list->Check(i, c.settings.visible);
// fix the background color
list->GetItem(i)->SetBackgroundColour(window_color);
#ifdef _WX_MSW_
// fix the background color
list->GetItem(i)->SetBackgroundColour(window_color);
#endif
}
}
+1 -1
View File
@@ -80,7 +80,7 @@ void CardViewer::drawViewer(RotatedDC& dc, ValueViewer& v) {
}
bool CardViewer::shouldDraw(const ValueViewer& v) const {
return GetUpdateRegion().Contains((wxRect)v.boundingBox()) != wxOutRegion;
return GetUpdateRegion().Contains(v.boundingBox().toRect()) != wxOutRegion;
}
// helper class for overdrawDC()
+5 -5
View File
@@ -22,13 +22,13 @@ const int BORDER = 1; // margin between items
GalleryList::GalleryList(Window* parent, int id, int direction)
: wxScrolledWindow(parent, id, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER | (direction == wxHORIZONTAL ? wxHSCROLL : wxVSCROLL) )
, direction(direction)
, selection(NO_SELECTION)
, direction(direction)
{}
void GalleryList::update() {
const int w = item_size.width + MARGIN + 2*BORDER;
const int h = item_size.height + MARGIN + 2*BORDER;
const int w = (int)item_size.width + MARGIN + 2*BORDER;
const int h = (int)item_size.height + MARGIN + 2*BORDER;
// resize and scroll
if (direction == wxHORIZONTAL) {
SetVirtualSize(w * (int)itemCount() + MARGIN, h + MARGIN);
@@ -56,11 +56,11 @@ void GalleryList::update() {
size_t GalleryList::findItem(const wxMouseEvent& ev) const {
if (direction == wxHORIZONTAL) {
int x, w = item_size.width + MARGIN + 2*BORDER;
int x, w = (int)item_size.width + MARGIN + 2*BORDER;
GetViewStart (&x, 0);
return static_cast<size_t>( x + ev.GetX() / w );
} else { // wxVERTICAL
int y, h = item_size.height + MARGIN + 2*BORDER;
int y, h = (int)item_size.height + MARGIN + 2*BORDER;
GetViewStart (0, &y);
return static_cast<size_t>( y + ev.GetY() / h );
}
+2 -2
View File
@@ -40,14 +40,14 @@ void NativeLookEditor::drawViewer(RotatedDC& dc, ValueViewer& v) {
dc.SetFont(*wxNORMAL_FONT);
dc.DrawText(capitalize_sentence(s.fieldP->name), RealPoint(margin_left, s.top + 1));
// draw 3D border
draw_control_border(this, dc.getDC(), wxRect(s.left - 1, s.top - 1, s.width + 2, s.height + 2));
draw_control_border(this, dc.getDC(), RealRect(s.left - 1, s.top - 1, s.width + 2, s.height + 2));
// draw viewer
v.draw(dc);
}
void NativeLookEditor::resizeViewers() {
// size stuff
UInt y = margin;
double y = margin;
int w;
GetClientSize(&w, 0);
const int default_height = 17;
+2 -2
View File
@@ -35,12 +35,12 @@ void PackageList::drawItem(DC& dc, int x, int y, size_t item, bool selected) {
dc.SetFont(wxFont(12,wxSWISS,wxNORMAL,wxBOLD,false,_("Arial")));
dc.GetTextExtent(capitalize(d.package->short_name), &w, &h);
pos = align_in_rect(ALIGN_CENTER, RealSize(w,h), rect);
dc.DrawText(capitalize(d.package->short_name), pos.x, pos.y + 110);
dc.DrawText(capitalize(d.package->short_name), (int)pos.x, (int)pos.y + 110);
// draw name
dc.SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
dc.GetTextExtent(d.package->full_name, &w, &h);
RealPoint text_pos = align_in_rect(ALIGN_CENTER, RealSize(w,h), rect);
dc.DrawText(d.package->full_name, text_pos.x, text_pos.y + 130);
dc.DrawText(d.package->full_name, (int)text_pos.x, (int)text_pos.y + 130);
}
void PackageList::showData(const String& pattern) {
+1
View File
@@ -10,6 +10,7 @@
// ----------------------------------------------------------------------------- : Includes
#include <util/prec.hpp>
#include <util/error.hpp>
#include <gui/control/gallery_list.hpp>
DECLARE_POINTER_TYPE(Packaged);
+2 -1
View File
@@ -11,6 +11,7 @@
#include <util/prec.hpp>
#include <gui/control/card_list.hpp>
#include <set>
// ----------------------------------------------------------------------------- : SelectCardList
@@ -30,7 +31,7 @@ class SelectCardList : public CardListBase {
private:
DECLARE_EVENT_TABLE();
set<CardP> selected; ///< which cards are selected?
std::set<CardP> selected; ///< which cards are selected?
void toggle(const CardP& card);
+1 -1
View File
@@ -55,7 +55,7 @@ void TextCtrl::setValue(String* value) {
style->width = cs.GetWidth() - 2;
style->height = cs.GetHeight() - 2;
viewers.front()->getEditor()->determineSize(true);
SetMinSize(wxSize(style->width + 6, style->height + 6));
SetMinSize(RealSize(style->width + 6, style->height + 6));
}
valueChanged();
}