mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 21:06:59 -04:00
Fixed keyword list replacements messing up due to being multi-line.
Fixed GCC warnings. Added linux installer directory. git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@394 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
+11
-11
@@ -199,8 +199,8 @@ RealRect bar_graph_bar(const RealRect& rect, int group, int group_count, int sta
|
||||
double width = width_space / 5 * 4;
|
||||
double space = width_space / 5;
|
||||
double step_height = rect.height / max; // multiplier for bar height
|
||||
int top = rect.bottom() - start * step_height;
|
||||
int bottom = rect.bottom() - end * step_height;
|
||||
int top = (int)(rect.bottom() - start * step_height);
|
||||
int bottom = (int)(rect.bottom() - end * step_height);
|
||||
if (bottom < top) swap(top,bottom);
|
||||
bottom += 1;
|
||||
return RealRect(
|
||||
@@ -215,7 +215,7 @@ int find_bar_graph_column(double width, double x, int count) {
|
||||
double width_space = width / count; // including spacing
|
||||
double space = width_space / 5;
|
||||
// Find column in which the point could be located
|
||||
int col = floor(x / width_space);
|
||||
int col = (int)floor(x / width_space);
|
||||
if (col < 0 || col >= count) return -1; // not a column
|
||||
double in_col = x - col * width_space;
|
||||
if (in_col < space / 2) return -1; // left
|
||||
@@ -322,7 +322,7 @@ bool BarGraph2D::findItem(const RealPoint& pos, const RealRect& rect, vector<int
|
||||
if (col < 0) return false;
|
||||
// row
|
||||
int max_value = (int)axis1.max;
|
||||
int value = (rect.bottom() - pos.y) / rect.height * max_value;
|
||||
int value = (int)((rect.bottom() - pos.y) / rect.height * max_value);
|
||||
if (value < 0 || value > max_value) return false;
|
||||
// find row
|
||||
int row = -1;
|
||||
@@ -460,8 +460,8 @@ bool ScatterGraph::findItem(const RealPoint& pos, const RealRect& rect, vector<i
|
||||
// clicked item
|
||||
GraphAxis& axis1 = axis1_data();
|
||||
GraphAxis& axis2 = axis2_data();
|
||||
int col = floor((pos.x - rect.x) / rect.width * axis1.groups.size());
|
||||
int row = floor((rect.bottom() - pos.y) / rect.height * axis2.groups.size());
|
||||
int col = (int) floor((pos.x - rect.x) / rect.width * axis1.groups.size());
|
||||
int row = (int) floor((rect.bottom() - pos.y) / rect.height * axis2.groups.size());
|
||||
if (col < 0 || col >= (int)axis1.groups.size()) return false;
|
||||
if (row < 0 || row >= (int)axis2.groups.size()) return false;
|
||||
// done
|
||||
@@ -583,7 +583,7 @@ int GraphLegend::findItem(const RealPoint& pos, const RealRect& rect) const {
|
||||
RealPoint mypos = align_in_rect(alignment, size, rect);
|
||||
RealPoint pos2(pos.x - mypos.x, pos.y - mypos.y);
|
||||
if (pos2.x < 0 || pos2.y < 0 || pos2.x >= size.width || pos2.y >= size.height) return -1;
|
||||
int col = floor((pos2.y-1) / item_size.height);
|
||||
int col = (int) floor((pos2.y-1) / item_size.height);
|
||||
if (col < 0 || col >= (int)axis_data().groups.size()) return -1;
|
||||
return reverse ? (int)axis_data().groups.size() - col - 1 : col;
|
||||
}
|
||||
@@ -673,10 +673,10 @@ int GraphLabelAxis::findItem(const RealPoint& pos, const RealRect& rect) const {
|
||||
GraphAxis& axis = axis_data();
|
||||
int col;
|
||||
if (direction == HORIZONTAL) {
|
||||
col = floor((pos.x - rect.x) / rect.width * axis.groups.size());
|
||||
col = (int) floor((pos.x - rect.x) / rect.width * axis.groups.size());
|
||||
if (pos.y < rect.bottom()) return -1;
|
||||
} else {
|
||||
col = floor((rect.bottom() - pos.y) / rect.height * axis.groups.size());
|
||||
col = (int) floor((rect.bottom() - pos.y) / rect.height * axis.groups.size());
|
||||
if (pos.x > rect.left()) return -1;
|
||||
}
|
||||
if (col < 0 || col >= (int)axis.groups.size()) return -1;
|
||||
@@ -693,7 +693,7 @@ void GraphValueAxis::draw(RotatedDC& dc, int current, DrawLayer layer) const {
|
||||
GraphAxis& axis = axis_data();
|
||||
double step_height = rect.height / axis.max; // height of a single value
|
||||
dc.SetFont(*wxNORMAL_FONT);
|
||||
int label_step = ceil(max(1.0, (dc.GetCharHeight()) / step_height)); // values per labeled line
|
||||
int label_step = (int) ceil(max(1.0, (dc.GetCharHeight()) / step_height)); // values per labeled line
|
||||
// Colors
|
||||
Color bg = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW);
|
||||
Color fg = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);
|
||||
@@ -710,7 +710,7 @@ void GraphValueAxis::draw(RotatedDC& dc, int current, DrawLayer layer) const {
|
||||
dc.SetPen(fg);
|
||||
}
|
||||
// draw line
|
||||
int y = rect.bottom() - i * step_height;
|
||||
int y = (int) (rect.bottom() - i * step_height);
|
||||
dc.DrawLine(RealPoint(rect.left() - 2, y), RealPoint(rect.right(), y));
|
||||
// draw label, aligned middle right
|
||||
if (! ((i < highlight && i + label_step > highlight) ||
|
||||
|
||||
@@ -277,9 +277,9 @@ class GraphWithMargins : public Graph {
|
||||
virtual bool findItem(const RealPoint& pos, const RealRect& rect, vector<int>& out) const;
|
||||
virtual void setData(const GraphDataP& d);
|
||||
private:
|
||||
const GraphP graph;
|
||||
double margin_left, margin_top, margin_right, margin_bottom;
|
||||
bool upside_down; // put the coordinate system upside down, since graphs are usually bottom-to-top
|
||||
const GraphP graph;
|
||||
};
|
||||
|
||||
/// A display containing multiple graphs
|
||||
|
||||
@@ -87,8 +87,8 @@ class ItemList : public wxListView {
|
||||
// --------------------------------------------------- : Data
|
||||
VoidP selected_item; ///< The currently selected item
|
||||
long selected_item_pos; ///< Position of the selected item in the sorted_list, or -1 if no card is selected
|
||||
bool sort_ascending; ///< Sort order
|
||||
long sort_by_column; ///< Column to use for sorting, or -1 if not sorted
|
||||
bool sort_ascending; ///< Sort order
|
||||
vector<VoidP> sorted_list; ///< Sorted list of items, can be considered a map: pos->item
|
||||
|
||||
private:
|
||||
|
||||
@@ -165,12 +165,25 @@ bool KeywordList::compareItems(void* a, void* b) const {
|
||||
|
||||
String KeywordList::OnGetItemText (long pos, long col) const {
|
||||
const Keyword& kw = *getKeyword(pos);
|
||||
String formatted;
|
||||
wxChar c;
|
||||
switch(col) {
|
||||
case 0: return kw.keyword;
|
||||
case 1: return match_string(kw);
|
||||
case 2: return kw.mode;
|
||||
case 3: return _("?");
|
||||
case 4: return kw.reminder.getUnparsed();
|
||||
case 4:
|
||||
formatted.Clear();
|
||||
for (size_t i = 0; i < kw.reminder.getUnparsed().Len(); ++i) {
|
||||
c = kw.reminder.getUnparsed().GetChar(i);
|
||||
if (isSpace(c)) {
|
||||
formatted.Trim();
|
||||
formatted += ' ';
|
||||
}
|
||||
else
|
||||
formatted += c;
|
||||
}
|
||||
return formatted;
|
||||
default: return wxEmptyString;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,8 +71,8 @@ void NativeLookEditor::resizeViewers() {
|
||||
if (e) e->determineSize();
|
||||
y += s->height + vspace;
|
||||
}
|
||||
SetVirtualSize(w,y);
|
||||
SetScrollbar(wxVERTICAL, 0, h, y);
|
||||
SetVirtualSize(w, (int)y);
|
||||
SetScrollbar(wxVERTICAL, 0, h, (int) y);
|
||||
if (y >= h) {
|
||||
// Doesn't fit vertically, add scrollbar and resize
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user