mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-11 05:07:00 -04:00
Added value actions for common value types; drop down list is now correctly aligned
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@92 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -32,7 +32,11 @@ void CardViewer::onChange() {
|
||||
}
|
||||
|
||||
void CardViewer::onPaint(wxPaintEvent&) {
|
||||
wxBufferedPaintDC dc(this);
|
||||
wxSize cs = GetClientSize();
|
||||
if (!buffer.Ok() || buffer.GetWidth() != cs.GetWidth() || buffer.GetHeight() != cs.GetHeight()) {
|
||||
buffer = Bitmap(cs.GetWidth(), cs.GetHeight());
|
||||
}
|
||||
wxBufferedPaintDC dc(this, buffer);
|
||||
dc.BeginDrawing();
|
||||
draw(dc);
|
||||
dc.EndDrawing();
|
||||
|
||||
@@ -29,7 +29,6 @@ class CardViewer : public wxControl, public DataViewer {
|
||||
DECLARE_EVENT_TABLE();
|
||||
|
||||
void onPaint(wxPaintEvent&);
|
||||
void onSize(wxSizeEvent&);
|
||||
|
||||
Bitmap buffer; /// < Off-screen buffer we draw to
|
||||
};
|
||||
|
||||
@@ -159,7 +159,7 @@ void GalleryList::OnDraw(DC& dc) {
|
||||
bool selected = i == selection;
|
||||
Color c = selected ? wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT) : unselected;
|
||||
dc.SetPen(c);
|
||||
dc.SetBrush(lerp(background, c, 0.3));
|
||||
dc.SetBrush(saturate(lerp(background, c, 0.3), selected ? 0.5 : 0));
|
||||
RealPoint pos = itemPos(i);
|
||||
dc.DrawRectangle(pos.x - BORDER, pos.y - BORDER, item_size.width + 2*BORDER, item_size.height + 2*BORDER);
|
||||
// draw item
|
||||
|
||||
@@ -21,8 +21,12 @@ NativeLookEditor::NativeLookEditor(Window* parent, int id, long style)
|
||||
: DataEditor(parent, id, style)
|
||||
{}
|
||||
|
||||
Rotation NativeLookEditor::getRotation() const {
|
||||
return Rotation(0, RealRect(RealPoint(0,0),GetClientSize()));
|
||||
}
|
||||
|
||||
void NativeLookEditor::draw(DC& dc) {
|
||||
RotatedDC rdc(dc, 0, RealRect(RealPoint(0,0),GetClientSize()), 1, 0);
|
||||
RotatedDC rdc(dc, getRotation(), false);
|
||||
DataViewer::draw(rdc, wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
|
||||
}
|
||||
void NativeLookEditor::drawViewer(RotatedDC& dc, ValueViewer& v) {
|
||||
|
||||
@@ -22,6 +22,7 @@ class NativeLookEditor : public DataEditor {
|
||||
/// Uses a native look
|
||||
virtual bool nativeLook() const { return true; }
|
||||
virtual bool drawBorders() const { return false; }
|
||||
virtual Rotation getRotation() const;
|
||||
|
||||
virtual void draw(DC& dc);
|
||||
virtual void drawViewer(RotatedDC& dc, ValueViewer& v);
|
||||
|
||||
Reference in New Issue
Block a user