Reader now warns about invalid UTF-8 files;

Fixed possible hang when reading multiline strings with incorrect indentation;
Warnings from reading are shown also in NewSetWindow;
Script parse errors get reported with the correct line number;

Added support for showing multiple choice fields as a single image;
Added 'line_below' to ChoiceField::Choice, for putting a line below menu items.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@420 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-06-12 19:35:24 +00:00
parent 27833003c8
commit 8b11433cbd
20 changed files with 318 additions and 86 deletions
+8 -4
View File
@@ -33,27 +33,31 @@ DropDownMultipleChoiceList::DropDownMultipleChoiceList
}
void DropDownMultipleChoiceList::select(size_t item) {
MultipleChoiceValueEditor& mcve = dynamic_cast<MultipleChoiceValueEditor&>(cve);
if (isFieldDefault(item)) {
// should not happen
// make default
mcve.getSet().actions.add(value_action(mcve.valueP(), Defaultable<String>()));
} else {
ChoiceField::ChoiceP choice = getChoice(item);
dynamic_cast<MultipleChoiceValueEditor&>(cve).toggle(choice->first_id);
mcve.toggle(choice->first_id);
}
}
void DropDownMultipleChoiceList::drawIcon(DC& dc, int x, int y, size_t item, bool selected) const {
// is this item active?
// is this item active/checked?
bool active = false;
if (!isFieldDefault(item)) {
ChoiceField::ChoiceP choice = getChoice(item);
active = dynamic_cast<MultipleChoiceValueEditor&>(cve).active[choice->first_id];
} else {
active = dynamic_cast<MultipleChoiceValueEditor&>(cve).value().value.isDefault();
}
// draw checkbox
dc.SetPen(*wxTRANSPARENT_PEN);
dc.SetBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
dc.DrawRectangle(x,y,16,16);
wxRect rect = RealRect(x+2,y+2,12,12);
draw_checkbox(nullptr, dc, rect, active);
draw_checkbox(nullptr, dc, rect, active, itemEnabled(item));
// draw icon
DropDownChoiceListBase::drawIcon(dc, x + 16, y, item, selected);
}