Added actions for adding/removing keywords

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@254 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-04-13 17:21:35 +00:00
parent f915a491a8
commit 1be1304c94
9 changed files with 233 additions and 5 deletions
+35
View File
@@ -10,6 +10,7 @@
#include <gui/card_select_window.hpp>
#include <gui/util.hpp>
#include <data/set.hpp>
#include <wx/print.h>
DECLARE_TYPEOF_COLLECTION(CardP);
@@ -88,8 +89,42 @@ void TextBufferDC::drawToDevice(DC& dc, int x, int y) {
}
}
// ----------------------------------------------------------------------------- : Layout
/// Layout of a page of cards
class PageLayout {
public:
RealSize card_size; ///< Size of a card
RealSize card_space; ///< Spacing between cards
double margin_left, margin_right, margin_top, margin_bottom; ///< Page margins
int rows, cols; ///< Number of rows/columns of cards
bool landscape; ///< Are cards rotated to landscape orientation?
};
// ----------------------------------------------------------------------------- : Printout
/// A printout object specifying how to print a specified set of cards
class CardsPrintout : wxPrintout {
public:
CardsPrintout(const SetP& set, const vector<CardP>& cards);
/// Determine card size, cards per row
void OnPreparePrinting();
/// Number of pages, and something else I don't understand...
void GetPageInfo(int* pageMin, int* pageMax, int* pageFrom, int* pageTo);
/// Again, 'number of pages', strange wx interface
bool HasPage(int page);
/// Print a page
bool OnPrintPage(int page);
private:
PageLayout layout;
/// Draw a card, that is card_nr on this page, find the postion by asking the layout
void drawCard(DC& dc, const CardP& card, UInt card_nr);
/// Draw a card at the specified coordinates
void drawCard(DC& dc, const CardP& card, double x, double y, int rotation = 0);
};
// ----------------------------------------------------------------------------- : PrintWindow
void print_preview(Window* parent, const SetP& set) {