mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 21:06:59 -04:00
The 'Big Whine' patch:
Any use of a file from another package without a declared dependency will give a warning; Also added some more _LOCALE_123_ macros so we need less format_string calls git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@753 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -66,7 +66,7 @@ void ImagesExportWindow::onOk(wxCommandEvent&) {
|
||||
else if (sel == 2) gs.images_export_conflicts = CONFLICT_NUMBER;
|
||||
else gs.images_export_conflicts = CONFLICT_NUMBER_OVERWRITE;
|
||||
// Script
|
||||
ScriptP filename_script = parse(gs.images_export_filename, true);
|
||||
ScriptP filename_script = parse(gs.images_export_filename, nullptr, true);
|
||||
// Select filename
|
||||
String name = wxFileSelector(_TITLE_("export images"),_(""), _LABEL_("filename is ignored"),_(""),
|
||||
_LABEL_("filename is ignored")+_("|*"), wxSAVE, this);
|
||||
|
||||
+24
-11
@@ -35,7 +35,7 @@ DECLARE_POINTER_TYPE(PageLayout);
|
||||
*/
|
||||
class TextBufferDC : public wxMemoryDC {
|
||||
public:
|
||||
TextBufferDC(int width, int height);
|
||||
TextBufferDC(int width, int height, bool buffer_text);
|
||||
|
||||
virtual void DoDrawText(const String& str, int x, int y);
|
||||
virtual void DoDrawRotatedText(const String& str, int x, int y, double angle);
|
||||
@@ -62,24 +62,34 @@ class TextBufferDC : public wxMemoryDC {
|
||||
private:
|
||||
vector<TextDrawP> text;
|
||||
Bitmap buffer;
|
||||
bool buffer_text; ///< buffering text?
|
||||
};
|
||||
|
||||
TextBufferDC::TextBufferDC(int width, int height)
|
||||
TextBufferDC::TextBufferDC(int width, int height, bool buffer_text)
|
||||
: buffer(width, height, 32)
|
||||
, buffer_text(buffer_text)
|
||||
{
|
||||
SelectObject(buffer);
|
||||
// initialize to white
|
||||
clearDC(*this,*wxWHITE_BRUSH);
|
||||
}
|
||||
void TextBufferDC::DoDrawText(const String& str, int x, int y) {
|
||||
double usx,usy;
|
||||
GetUserScale(&usx, &usy);
|
||||
text.push_back( new_intrusive7<TextDraw>(GetFont(), GetTextForeground(), usx, usy, x, y, str) );
|
||||
if (buffer_text) {
|
||||
double usx,usy;
|
||||
GetUserScale(&usx, &usy);
|
||||
text.push_back( new_intrusive7<TextDraw>(GetFont(), GetTextForeground(), usx, usy, x, y, str) );
|
||||
} else {
|
||||
wxMemoryDC::DoDrawText(str,x,y);
|
||||
}
|
||||
}
|
||||
void TextBufferDC::DoDrawRotatedText(const String& str, int x, int y, double angle) {
|
||||
double usx,usy;
|
||||
GetUserScale(&usx, &usy);
|
||||
text.push_back( new_intrusive8<TextDraw>(GetFont(), GetTextForeground(), usx, usy, x, y, str, angle) );
|
||||
if (buffer_text) {
|
||||
double usx,usy;
|
||||
GetUserScale(&usx, &usy);
|
||||
text.push_back( new_intrusive8<TextDraw>(GetFont(), GetTextForeground(), usx, usy, x, y, str, angle) );
|
||||
} else {
|
||||
wxMemoryDC::DoDrawRotatedText(str,x,y,angle);
|
||||
}
|
||||
}
|
||||
|
||||
DECLARE_TYPEOF_COLLECTION(TextBufferDC::TextDrawP);
|
||||
@@ -219,13 +229,16 @@ void CardsPrintout::drawCard(DC& dc, const CardP& card, int card_nr) {
|
||||
// create buffers
|
||||
int w = stylesheet.card_width, h = stylesheet.card_height; // in pixels
|
||||
if (rotation == 90) swap(w,h);
|
||||
TextBufferDC bufferDC(w,h);
|
||||
RotatedDC rdc(bufferDC, rotation, RealRect(0,0,w,h), 1.0, QUALITY_SUB_PIXEL);
|
||||
// Draw using text buffer
|
||||
//TextBufferDC bufferDC(w,h,true);
|
||||
//RotatedDC rdc(bufferDC, rotation, RealRect(0,0,w,h), 1.0, QUALITY_SUB_PIXEL);
|
||||
TextBufferDC bufferDC(w*4,h*4,false);
|
||||
RotatedDC rdc(bufferDC, rotation, RealRect(0,0,w*4,h*4), 4.0, QUALITY_AA);
|
||||
// render card to dc
|
||||
viewer.setCard(card);
|
||||
viewer.draw(rdc, *wxWHITE);
|
||||
// render buffer to device
|
||||
double px_per_mm = stylesheet.card_dpi / 25.4;
|
||||
double px_per_mm = 4 * stylesheet.card_dpi / 25.4;
|
||||
dc.SetUserScale(scale_x / px_per_mm, scale_y / px_per_mm);
|
||||
dc.SetDeviceOrigin(scale_x * pos.x, scale_y * pos.y);
|
||||
bufferDC.drawToDevice(dc, 0, 0); // adjust for scaling
|
||||
|
||||
@@ -188,7 +188,7 @@ void CardsPanel::onUpdateUI(wxUpdateUIEvent& ev) {
|
||||
ev.Enable(menu);
|
||||
if (insertSymbolMenu->GetSubMenu() != menu || (menu && menu->GetParent() != menuFormat)) {
|
||||
// re-add the menu
|
||||
menuFormat->Remove(insertSymbolMenu);
|
||||
menuFormat->Remove(ID_INSERT_SYMBOL);
|
||||
insertSymbolMenu->SetSubMenu(menu);
|
||||
menuFormat->Append(insertSymbolMenu);
|
||||
}
|
||||
|
||||
@@ -250,7 +250,7 @@ void KeywordsPanel::doPaste() { CUT_COPY_PASTE(doPaste, return (void), !
|
||||
void KeywordsPanel::onChangeSet() {
|
||||
list->setSet(set);
|
||||
// warning label (depends on game name)
|
||||
fixedL->SetLabel(format_string(_LABEL_("standard keyword"), set->game->short_name));
|
||||
fixedL->SetLabel(_LABEL_1_("standard keyword", set->game->short_name));
|
||||
// init text controls
|
||||
keyword ->setSet(set);
|
||||
keyword ->getStyle().font.size = 16;
|
||||
|
||||
@@ -286,7 +286,7 @@ void SetWindow::updateTitle() {
|
||||
if (identification.empty()) identification = set->name();
|
||||
if (identification.empty()) identification = _TITLE_("untitled");
|
||||
set->short_name = identification;
|
||||
SetTitle(format_string(_TITLE_("%s - magic set editor"),identification));
|
||||
SetTitle(_TITLE_1_("%s - magic set editor",identification));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -335,7 +335,7 @@ void SetWindow::onClose(wxCloseEvent& ev) {
|
||||
bool SetWindow::askSaveAndContinue() {
|
||||
if (set->actions.atSavePoint()) return true;
|
||||
// todo : if more then one window has the set selected it's ok to proceed
|
||||
int save = wxMessageBox(format_string(_LABEL_("save changes"), set->short_name), _TITLE_("save changes"), wxYES_NO | wxCANCEL | wxICON_EXCLAMATION);
|
||||
int save = wxMessageBox(_LABEL_1_("save changes", set->short_name), _TITLE_("save changes"), wxYES_NO | wxCANCEL | wxICON_EXCLAMATION);
|
||||
if (save == wxYES) {
|
||||
// save the set
|
||||
try {
|
||||
|
||||
@@ -29,7 +29,7 @@ SymbolWindow::SymbolWindow(Window* parent) {
|
||||
|
||||
SymbolWindow::SymbolWindow(Window* parent, const String& filename) {
|
||||
// open file
|
||||
Reader reader(new_shared1<wxFileInputStream>(filename), filename);
|
||||
Reader reader(new_shared1<wxFileInputStream>(filename), nullptr, filename);
|
||||
SymbolP symbol;
|
||||
reader.handle_greedy(symbol);
|
||||
init(parent, symbol);
|
||||
@@ -204,7 +204,7 @@ void SymbolWindow::onFileOpen(wxCommandEvent& ev) {
|
||||
String ext = n.GetExt();
|
||||
SymbolP symbol;
|
||||
if (ext.Lower() == _("mse-symbol")) {
|
||||
Reader reader(new_shared1<wxFileInputStream>(name), name);
|
||||
Reader reader(new_shared1<wxFileInputStream>(name), nullptr, name);
|
||||
reader.handle_greedy(symbol);
|
||||
} else {
|
||||
wxBusyCursor busy;
|
||||
|
||||
@@ -297,8 +297,7 @@ void DropDownWordList::select(size_t item) {
|
||||
tve.selection_start_i = pos->start;
|
||||
tve.selection_end_i = pos->end;
|
||||
tve.fixSelection(TYPE_INDEX);
|
||||
tve.replaceSelection(escape(new_value),
|
||||
format_string(_ACTION_("change"), tve.field().name));
|
||||
tve.replaceSelection(escape(new_value), _ACTION_1_("change", tve.field().name));
|
||||
// stay open?
|
||||
if (IsShown()) selection(); // update 'enabled'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user