Fix warnings

Semi-fix bug #6 (does not work if the zipfile was loaded from a directory)


git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1439 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
coppro
2010-03-04 01:46:04 +00:00
parent cf91f9c43b
commit 85854b1bd2
31 changed files with 93 additions and 71 deletions
+1 -1
View File
@@ -64,8 +64,8 @@ END_EVENT_TABLE ()
HoverButtonBase::HoverButtonBase(Window* parent, int id, bool accepts_focus)
: wxControl(parent, id, wxDefaultPosition, wxDefaultSize, wxNO_BORDER )
, hover(false), focus(false), mouse_down(false), key_down(false)
, accepts_focus(accepts_focus)
, hover(false), focus(false), mouse_down(false), key_down(false)
{}
void HoverButtonBase::onMouseEnter(wxMouseEvent&) {
+3 -3
View File
@@ -178,12 +178,12 @@ AutoReplaceWindow::AutoReplaceWindow(Window* parent, const Game& game)
// enabled?
s->Add(use_auto_replace, 0, wxALL & ~wxBOTTOM, 8);
// list
s->Add(list, 1, wxEXPAND | wxALL & ~wxBOTTOM, 8);
s->Add(list, 1, wxEXPAND | (wxALL & ~wxBOTTOM), 8);
s->AddSpacer(4);
wxSizer* s2 = new wxBoxSizer(wxHORIZONTAL);
s2->Add(add, 0, wxRIGHT, 4);
s2->Add(remove);
s->Add(s2, 0, wxALIGN_RIGHT | wxALL & ~wxTOP & ~wxBOTTOM, 8);
s->Add(s2, 0, wxALIGN_RIGHT | (wxALL & ~wxTOP & ~wxBOTTOM), 8);
// values
wxFlexGridSizer* s3 = new wxFlexGridSizer(2);
s3->AddGrowableCol(1);
@@ -191,7 +191,7 @@ AutoReplaceWindow::AutoReplaceWindow(Window* parent, const Game& game)
s3->Add(match, 1, wxEXPAND | wxBOTTOM, 2);
s3->Add(replaceL, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 4);
s3->Add(replace, 1, wxEXPAND | wxBOTTOM, 2);
s->Add(s3, 0, wxEXPAND | wxALL & ~wxBOTTOM, 8);
s->Add(s3, 0, wxEXPAND | (wxALL & ~wxBOTTOM), 8);
s->AddSpacer(2);
s->Add(whole_word, 0, wxALL & ~wxBOTTOM & ~wxTOP, 8);
s->AddSpacer(4);
+2 -2
View File
@@ -30,8 +30,8 @@ ExportCardSelectionChoice::ExportCardSelectionChoice(const Set& set)
ExportCardSelectionChoice::ExportCardSelectionChoice(const String& label, const vector<CardP>& cards)
: label(label)
, type(EXPORT_SEL_SUBSET)
, own_cards(cards)
, the_cards(&own_cards)
, own_cards(cards)
{}
ExportCardSelectionChoice::ExportCardSelectionChoice(const String& label, const vector<CardP>* cards)
: label(label)
@@ -142,7 +142,7 @@ CardSelectWindow::CardSelectWindow(Window* parent, const SetP& set, const String
s2->Add(sel_all, 0, wxEXPAND | wxRIGHT, 8);
s2->Add(sel_none, 0, wxEXPAND | wxRIGHT, 8);
s2->Add(CreateButtonSizer(wxOK | wxCANCEL), 1, wxEXPAND, 8);
s->Add(s2, 0, wxEXPAND | wxALL & ~wxTOP, 8);
s->Add(s2, 0, wxEXPAND | (wxALL & ~wxTOP), 8);
s->SetSizeHints(this);
SetSizer(s);
SetSize(600,500);
+1 -1
View File
@@ -103,7 +103,7 @@ void CardListBase::onAction(const Action& action, bool undone) {
}
TYPE_CASE(action, ReorderCardsAction) {
if (sort_by_column >= 0) return; // nothing changes for us
if ((long)action.card_id1 < 0 || (long)action.card_id2 >= sorted_list.size()) return;
if ((long)action.card_id1 < 0 || (long)action.card_id2 >= (long)sorted_list.size()) return;
if ((long)action.card_id1 == selected_item_pos || (long)action.card_id2 == selected_item_pos) {
// Selected card has moved; also move in the sorted card list
swap(sorted_list[action.card_id1], sorted_list[action.card_id2]);
+1 -1
View File
@@ -34,7 +34,7 @@ CardListColumnSelectDialog::CardListColumnSelectDialog(Window* parent, const Gam
s3->Add(new wxButton(this, ID_MOVE_DOWN, _BUTTON_("move down")), 0, wxEXPAND | wxTOP, 2);
s3->Add(new wxButton(this, ID_SHOW, _BUTTON_("show")), 0, wxEXPAND | wxTOP, 2);
s3->Add(new wxButton(this, ID_HIDE, _BUTTON_("hide")), 0, wxEXPAND | wxTOP, 2);
s2->Add(s3, 0, wxEXPAND | wxALL & ~wxTOP, 4);
s2->Add(s3, 0, wxEXPAND | (wxALL & ~wxTOP), 4);
s->Add(s2 , 1, wxEXPAND | wxALL, 4);
s->Add(CreateButtonSizer(wxOK | wxCANCEL) , 0, wxEXPAND | wxALL, 8);
s->SetSizeHints(this);
+1 -1
View File
@@ -237,7 +237,7 @@ void GraphData::crossAxis(size_t axis1, size_t axis2, size_t axis3, vector<UInt>
bool matches(const GraphDataElement* v, const vector<int>& match) {
for (size_t i = 0 ; i < match.size() ; ++i) {
if (v->group_nrs[i] == -1 || match[i] != -1 && v->group_nrs[i] != match[i]) {
if (v->group_nrs[i] == -1 || (match[i] != -1 && v->group_nrs[i] != match[i])) {
return false;
}
}
+1 -1
View File
@@ -36,7 +36,7 @@ HtmlExportWindow::HtmlExportWindow(Window* parent, const SetP& set, const Export
// init sizers
wxSizer* s = new wxBoxSizer(wxVERTICAL);
s->Add(new wxStaticText(this, wxID_ANY, _LABEL_("html template")), 0, wxALL, 4);
s->Add(list, 0, wxEXPAND | wxALL & ~wxTOP, 4);
s->Add(list, 0, wxEXPAND | (wxALL & ~wxTOP), 4);
wxSizer* s2 = new wxBoxSizer(wxHORIZONTAL);
s2->Add(ExportWindowBase::Create(), 2, wxEXPAND);
wxSizer* s3 = new wxStaticBoxSizer(wxVERTICAL, this, _LABEL_("html export options"));
+2 -2
View File
@@ -145,7 +145,7 @@ ImageSliceWindow::ImageSliceWindow(Window* parent, const Image& source, const wx
s5->Add(s6, 0, wxEXPAND | wxALL, 4);
s5->AddStretchSpacer(1);
wxSizer* s8 = zoom_sizer = new wxStaticBoxSizer(wxVERTICAL, this, _LABEL_("zoom"));
s8->Add(fix_aspect, 0, wxEXPAND | wxALL & ~wxBOTTOM, 4);
s8->Add(fix_aspect, 0, wxEXPAND | (wxALL & ~wxBOTTOM), 4);
wxSizer* s9 = zoom_fixed = new wxFlexGridSizer(0, 3, 4, 5);
s9->Add(new wxStaticText(this, wxID_ANY, _LABEL_("zoom amount")), 0, wxALIGN_CENTER_VERTICAL);
s9->Add(zoom, 0, wxEXPAND);
@@ -162,7 +162,7 @@ ImageSliceWindow::ImageSliceWindow(Window* parent, const Image& source, const wx
s5->Add(s8, 0, wxEXPAND | wxALL, 4);
s5->AddStretchSpacer(1);
wxSizer* sB = new wxStaticBoxSizer(wxVERTICAL, this, _LABEL_("filter"));
sB->Add(sharpen, 0, wxEXPAND | wxALL & ~wxBOTTOM, 4);
sB->Add(sharpen, 0, wxEXPAND | (wxALL & ~wxBOTTOM), 4);
sB->Add(sharpen_amount, 0, wxEXPAND | wxALL, 4);
s5->Add(sB, 0, wxEXPAND | wxALL, 4);
s5->AddStretchSpacer(1);
+4 -4
View File
@@ -37,14 +37,14 @@ ImagesExportWindow::ImagesExportWindow(Window* parent, const SetP& set, const Ex
wxSizer* s = new wxBoxSizer(wxVERTICAL);
wxSizer* s2 = new wxStaticBoxSizer(wxVERTICAL, this, _LABEL_("export filenames"));
s2->Add(new wxStaticText(this, -1, _LABEL_("filename format")), 0, wxALL, 4);
s2->Add(format, 0, wxEXPAND | wxALL & ~wxTOP, 4);
s2->Add(format, 0, wxEXPAND | (wxALL & ~wxTOP), 4);
s2->Add(new wxStaticText(this, -1, _HELP_("filename format")), 0, wxALL & ~wxTOP, 4);
s2->Add(new wxStaticText(this, -1, _LABEL_("filename conflicts")), 0, wxALL, 4);
s2->Add(conflicts, 0, wxEXPAND | wxALL & ~wxTOP, 4);
s2->Add(conflicts, 0, wxEXPAND | (wxALL & ~wxTOP), 4);
s->Add(s2, 0, wxEXPAND | wxALL, 8);
wxSizer* s3 = ExportWindowBase::Create();
s->Add(s3, 1, wxEXPAND | wxALL & ~wxTOP, 8);
s->Add(CreateButtonSizer(wxOK | wxCANCEL), 0, wxEXPAND | wxALL & ~wxTOP, 8);
s->Add(s3, 1, wxEXPAND | (wxALL & ~wxTOP), 8);
s->Add(CreateButtonSizer(wxOK | wxCANCEL), 0, wxEXPAND | (wxALL & ~wxTOP), 8);
s->SetSizeHints(this);
SetSizer(s);
SetSize(500,-1);
+3 -3
View File
@@ -37,9 +37,9 @@ NewSetWindow::NewSetWindow(Window* parent)
// init sizer
wxSizer* s = new wxBoxSizer(wxVERTICAL);
s->Add(game_text, 0, wxALL, 4);
s->Add(game_list, 0, wxEXPAND | wxALL & ~wxTOP, 4);
s->Add(game_list, 0, wxEXPAND | (wxALL & ~wxTOP), 4);
s->Add(stylesheet_text, 0, wxALL, 4);
s->Add(stylesheet_list, 0, wxEXPAND | wxALL & ~wxTOP, 4);
s->Add(stylesheet_list, 0, wxEXPAND | (wxALL & ~wxTOP), 4);
s->Add(CreateButtonSizer(wxOK | wxCANCEL) , 0, wxEXPAND | wxALL, 8);
s->SetSizeHints(this);
SetSizer(s);
@@ -147,7 +147,7 @@ SelectStyleSheetWindow::SelectStyleSheetWindow(Window* parent, const Game& game,
wxSizer* s = new wxBoxSizer(wxVERTICAL);
s->Add(description, 0, wxALL, 4);
s->Add(stylesheet_text, 0, wxALL, 4);
s->Add(stylesheet_list, 0, wxEXPAND | wxALL & ~wxTOP, 4);
s->Add(stylesheet_list, 0, wxEXPAND | (wxALL & ~wxTOP), 4);
s->Add(CreateButtonSizer(wxOK | wxCANCEL) , 0, wxEXPAND | wxALL, 8);
s->SetSizeHints(this);
SetSizer(s);
+1 -1
View File
@@ -192,8 +192,8 @@ class PackageIconRequest : public ThumbnailRequest {
PackageUpdateList::PackageUpdateList(Window* parent, const InstallablePackages& packages, bool show_only_installable, int id)
: TreeList(parent, id)
, show_only_installable(show_only_installable)
, packages(packages)
, show_only_installable(show_only_installable)
{
item_height = max(item_height,19);
rebuild();
+3 -3
View File
@@ -255,7 +255,7 @@ void PackagesWindow::init(Window* parent, bool show_only_installable) {
// Init sizer
wxBoxSizer* v = new wxBoxSizer(wxVERTICAL);
v->Add(package_list, 1, wxEXPAND | wxALL & ~wxBOTTOM, 8);
v->Add(package_list, 1, wxEXPAND | (wxALL & ~wxBOTTOM), 8);
v->AddSpacer(4);
wxBoxSizer* h = new wxBoxSizer(wxHORIZONTAL);
h->Add(package_info, 1, wxRIGHT, 4);
@@ -266,8 +266,8 @@ void PackagesWindow::init(Window* parent, bool show_only_installable) {
v2->AddStretchSpacer();
v2->Add(remove_button, 0, wxEXPAND | wxBOTTOM, 0);
h->Add(v2);
v->Add(h, 0, wxEXPAND | wxALL & ~wxTOP, 8);
v->Add(CreateButtonSizer(wxOK | wxCANCEL), 0, wxEXPAND | wxALL & ~wxTOP, 8);
v->Add(h, 0, wxEXPAND | (wxALL & ~wxTOP), 8);
v->Add(CreateButtonSizer(wxOK | wxCANCEL), 0, wxEXPAND | (wxALL & ~wxTOP), 8);
SetSizer(v);
wxUpdateUIEvent::SetMode(wxUPDATE_UI_PROCESS_SPECIFIED);
+9 -9
View File
@@ -116,9 +116,9 @@ PreferencesWindow::PreferencesWindow(Window* parent)
// init sizer
wxSizer* s = new wxBoxSizer(wxVERTICAL);
s->Add(nb, 1, wxEXPAND | wxALL & ~wxBOTTOM, 8);
s->Add(nb, 1, wxEXPAND | (wxALL & ~wxBOTTOM), 8);
s->AddSpacer(4);
s->Add(CreateButtonSizer(wxOK | wxCANCEL), 0, wxEXPAND | wxALL & ~wxTOP, 8);
s->Add(CreateButtonSizer(wxOK | wxCANCEL), 0, wxEXPAND | (wxALL & ~wxTOP), 8);
s->SetSizeHints(this);
SetSizer(s);
}
@@ -168,13 +168,13 @@ GlobalPreferencesPage::GlobalPreferencesPage(Window* parent)
wxSizer* s = new wxBoxSizer(wxVERTICAL);
s->SetSizeHints(this);
wxSizer* s2 = new wxStaticBoxSizer(wxVERTICAL, this, _LABEL_("language"));
s2->Add(new wxStaticText(this, wxID_ANY, _LABEL_("app language")), 0, wxALL, 4);
s2->Add(language, 0, wxEXPAND | wxALL & ~wxTOP, 4);
s2->Add(new wxStaticText(this, wxID_ANY, _HELP_( "app language")), 0, wxALL, 4);
s->Add(s2, 0, wxALL | wxEXPAND, 8);
s2->Add(new wxStaticText(this, wxID_ANY, _LABEL_("app language")), 0, wxALL, 4);
s2->Add(language, 0, wxEXPAND | (wxALL & ~wxTOP), 4);
s2->Add(new wxStaticText(this, wxID_ANY, _HELP_( "app language")), 0, wxALL, 4);
s->Add(s2, 0, wxEXPAND | wxALL, 8);
wxSizer* s3 = new wxStaticBoxSizer(wxVERTICAL, this, _LABEL_("windows"));
s3->Add(open_sets_in_new_window, 0, wxALL, 4);
s->Add(s3, 0, wxALL & ~wxTOP | wxEXPAND, 8);
s->Add(s3, 0, wxEXPAND | (wxALL & ~wxTOP), 8);
SetSizer(s);
}
@@ -216,7 +216,7 @@ DisplayPreferencesPage::DisplayPreferencesPage(Window* parent)
zoom_int = static_cast<int>(settings.default_stylesheet_settings.card_zoom() * 100);
zoom->SetValue(String::Format(_("%d%%"),zoom_int));
int choices[] = {50,66,75,100,120,150,200};
for (int i = 0 ; i < sizeof(choices)/sizeof(choices[0]) ; ++i) {
for (unsigned int i = 0 ; i < sizeof(choices)/sizeof(choices[0]) ; ++i) {
zoom->Append(String::Format(_("%d%%"),choices[i]));
}
#else
@@ -309,7 +309,7 @@ DirsPreferencesPage::DirsPreferencesPage(Window* parent)
wxSizer* s3 = new wxBoxSizer(wxHORIZONTAL);
s3->Add(apprentice, 1, wxEXPAND | wxRIGHT, 4);
s3->Add(ab, 0, wxEXPAND);
s2->Add(s3, 0, wxEXPAND | wxALL & ~wxTOP, 4);
s2->Add(s3, 0, wxEXPAND | (wxALL & ~wxTOP), 4);
s->Add(s2, 0, wxEXPAND | wxALL, 8);
s->SetSizeHints(this);
SetSizer(s);
+1 -1
View File
@@ -58,7 +58,7 @@ void KeywordsPanel::initControls() {
s0->Add(fixedI, 0, wxALIGN_CENTER | wxRIGHT, 10);
s0->Add(fixedL, 0, wxALIGN_CENTER_VERTICAL);
fixed->Add(new wxStaticLine(panel), 0, wxEXPAND | wxBOTTOM, 8);
fixed->Add(s0, 0, wxALL & ~wxTOP | wxALIGN_CENTER, 8);
fixed->Add(s0, 0, (wxALL & ~wxTOP) | wxALIGN_CENTER, 8);
fixed->Add(new wxStaticLine(panel), 0, wxEXPAND | wxBOTTOM, 8);
// init sizer for panel
sp = new wxBoxSizer(wxVERTICAL);
+5 -5
View File
@@ -337,12 +337,12 @@ CustomPackDialog::CustomPackDialog(Window* parent, const SetP& set, const PackTy
s4->AddSpacer(2);
wxFlexGridSizer* packsSizer = new wxFlexGridSizer(0, 2, 4, 4);
packsSizer->AddGrowableCol(0);
s4->Add(packsSizer, 1, wxEXPAND | wxALL & ~wxTOP & ~wxLEFT, 4);
s4->Add(packsSizer, 1, wxEXPAND | (wxALL & ~wxTOP & ~wxLEFT), 4);
s3->Add(s4, 1, wxEXPAND, 8);
wxSizer* s5 = new wxStaticBoxSizer(wxHORIZONTAL, this, _LABEL_("pack totals"));
s5->Add(totals, 1, wxEXPAND | wxALL, 4);
s3->Add(s5, 1, wxEXPAND | wxLEFT, 8);
s->Add(s3, 0, wxEXPAND | wxALL & ~wxTOP, 8);
s->Add(s3, 0, wxEXPAND | (wxALL & ~wxTOP), 8);
wxSizer* s6 = new wxBoxSizer(wxHORIZONTAL);
if (can_remove) {
s6->Add(remove, 0, wxALL & ~wxTOP & ~wxRIGHT, 8);
@@ -467,9 +467,9 @@ void RandomPackPanel::initControls() {
wxSizer* s4b = new wxBoxSizer(wxHORIZONTAL);
packsSizer = new wxFlexGridSizer(0, 2, 4, 4);
packsSizer->AddGrowableCol(0);
s4b->Add(packsSizer, 1, wxEXPAND | wxALL & ~wxTOP & ~wxLEFT, 4);
s4b->Add(packsSizer, 1, wxEXPAND | (wxALL & ~wxTOP & ~wxLEFT), 4);
s4->Add(s4b, 1, wxEXPAND | wxLEFT, 2);
s4->Add(new wxButton(this, ID_CUSTOM_PACK, _BUTTON_("add custom pack")), 0, wxEXPAND | wxALIGN_TOP | wxALL & ~wxTOP, 4);
s4->Add(new wxButton(this, ID_CUSTOM_PACK, _BUTTON_("add custom pack")), 0, wxEXPAND | wxALIGN_TOP | (wxALL & ~wxTOP), 4);
s3->Add(s4, 1, wxEXPAND, 8);
wxSizer* s5 = new wxStaticBoxSizer(wxHORIZONTAL, this, _LABEL_("pack totals"));
s5->Add(totals, 1, wxEXPAND | wxALL, 4);
@@ -486,7 +486,7 @@ void RandomPackPanel::initControls() {
//s6->Add(generate_button, 0, wxTOP | wxALIGN_RIGHT, 8);
s6->Add(generate_button, 1, wxTOP | wxEXPAND, 8);
s3->Add(s6, 0, wxEXPAND | wxLEFT, 8);
s2->Add(s3, 0, wxEXPAND | wxALL & ~wxTOP, 4);
s2->Add(s3, 0, wxEXPAND | (wxALL & ~wxTOP), 4);
s2->Add(card_list, 1, wxEXPAND);
s->Add(s2, 1, wxEXPAND, 8);
s->SetSizeHints(this);
+1 -1
View File
@@ -109,9 +109,9 @@ class StatDimensionList : public GalleryList {
public:
StatDimensionList(Window* parent, int id, bool show_empty, int dimension_count = 3)
: GalleryList(parent, id, wxVERTICAL, false)
, show_empty(show_empty)
, dimension_count(dimension_count)
, prefered_dimension_count(dimension_count)
, show_empty(show_empty)
{
//item_size = wxSize(150, 23);
subcolumns[0].size = wxSize(140,23);
+1 -1
View File
@@ -190,7 +190,7 @@ void show_update_dialog(Window* parent) {
// layout
wxSizer* s = new wxBoxSizer(wxVERTICAL);
s->Add(html, 1, wxEXPAND | wxALL, 8);
s->Add(close, 0, wxALIGN_RIGHT | wxALL & ~wxTOP, 8);
s->Add(close, 0, wxALIGN_RIGHT | (wxALL & ~wxTOP), 8);
dlg->SetSizer(s);
dlg->SetSize(400,400);
dlg->Show();
+1 -1
View File
@@ -111,7 +111,7 @@ struct DropDownWordListItem {
DropDownListP submenu;
inline bool active() const { return flags & FLAG_ACTIVE; }
inline void setActive(bool a) { flags = flags & ~FLAG_ACTIVE | a * FLAG_ACTIVE; }
inline void setActive(bool a) { flags = (flags & ~FLAG_ACTIVE) | a * FLAG_ACTIVE; }
};
class DropDownWordList : public DropDownList {