mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-12 21:47:00 -04:00
multiple choice checklists also work in non-native look
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1468 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -113,6 +113,9 @@ void MultipleChoiceValueEditor::determineSize(bool force_fit) {
|
|||||||
bool MultipleChoiceValueEditor::onLeftDown(const RealPoint& pos, wxMouseEvent& ev) {
|
bool MultipleChoiceValueEditor::onLeftDown(const RealPoint& pos, wxMouseEvent& ev) {
|
||||||
// find item under cursor
|
// find item under cursor
|
||||||
if (style().render_style & RENDER_CHECKLIST) {
|
if (style().render_style & RENDER_CHECKLIST) {
|
||||||
|
// TODO: determine actual item height
|
||||||
|
if (item_height == 0) item_height = 16;
|
||||||
|
|
||||||
int id = (int)(pos.y / item_height);
|
int id = (int)(pos.y / item_height);
|
||||||
int end = field().choices->lastId();
|
int end = field().choices->lastId();
|
||||||
if (id >= 0 && id < end) {
|
if (id >= 0 && id < end) {
|
||||||
|
|||||||
@@ -52,8 +52,8 @@ void MultipleChoiceValueViewer::draw(RotatedDC& dc) {
|
|||||||
|
|
||||||
void MultipleChoiceValueViewer::drawChoice(RotatedDC& dc, RealPoint& pos, const String& choice, bool active) {
|
void MultipleChoiceValueViewer::drawChoice(RotatedDC& dc, RealPoint& pos, const String& choice, bool active) {
|
||||||
RealSize size; size.height = item_height;
|
RealSize size; size.height = item_height;
|
||||||
if (nativeLook() && (style().render_style & RENDER_CHECKLIST)) {
|
if (style().render_style & RENDER_CHECKLIST) {
|
||||||
wxRect rect = dc.trRectStraight(RealRect(pos + RealSize(1,1), RealSize(12,12)));
|
wxRect rect = dc.trRectToBB(RealRect(pos + RealSize(1,1), RealSize(12,12)));
|
||||||
draw_checkbox(nullptr, dc.getDC(), rect, active); // TODO
|
draw_checkbox(nullptr, dc.getDC(), rect, active); // TODO
|
||||||
size = add_horizontal(size, RealSize(14,16));
|
size = add_horizontal(size, RealSize(14,16));
|
||||||
}
|
}
|
||||||
@@ -63,12 +63,12 @@ void MultipleChoiceValueViewer::drawChoice(RotatedDC& dc, RealPoint& pos, const
|
|||||||
// TODO: caching
|
// TODO: caching
|
||||||
GeneratedImage::Options options(0,0, &getStylePackage(), &getLocalPackage());
|
GeneratedImage::Options options(0,0, &getStylePackage(), &getLocalPackage());
|
||||||
options.zoom = dc.getZoom();
|
options.zoom = dc.getZoom();
|
||||||
options.angle = dc.trAngle(style().angle);
|
options.angle = dc.getAngle();
|
||||||
Image image = it->second.generate(options);
|
Image image = it->second.generate(options);
|
||||||
ImageCombine combine = it->second.combine();
|
ImageCombine combine = it->second.combine();
|
||||||
// TODO : alignment?
|
// TODO : alignment?
|
||||||
dc.DrawPreRotatedImage(image, RealRect(pos.x + size.width, pos.y, options.width, options.height), combine == COMBINE_DEFAULT ? style().combine : combine);
|
dc.DrawPreRotatedImage(image, RealRect(pos.x + size.width, pos.y, options.width, options.height), combine == COMBINE_DEFAULT ? style().combine : combine);
|
||||||
size.width += options.width;
|
size = add_horizontal(size, dc.trInvS(RealSize(options.width,options.height)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (style().render_style & RENDER_TEXT) {
|
if (style().render_style & RENDER_TEXT) {
|
||||||
|
|||||||
Reference in New Issue
Block a user