mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Code cleanup: remove messy spaces before line continuation (\) in macros
This commit is contained in:
@@ -142,11 +142,11 @@ typedef DataEditor CardEditor;
|
||||
|
||||
// ----------------------------------------------------------------------------- : Utility
|
||||
|
||||
#define FOR_EACH_EDITOR \
|
||||
FOR_EACH(v, viewers) \
|
||||
#define FOR_EACH_EDITOR \
|
||||
FOR_EACH(v, viewers) \
|
||||
if (ValueEditor* e = v->getEditor())
|
||||
#define FOR_EACH_EDITOR_REVERSE \
|
||||
FOR_EACH_REVERSE(v, viewers) \
|
||||
#define FOR_EACH_EDITOR_REVERSE \
|
||||
FOR_EACH_REVERSE(v, viewers) \
|
||||
if (ValueEditor* e = v->getEditor())
|
||||
|
||||
// ----------------------------------------------------------------------------- : EOF
|
||||
|
||||
@@ -24,15 +24,15 @@ DECLARE_LOCAL_EVENT_TYPE(EVENT_CARD_SELECT, <not used>)
|
||||
DECLARE_LOCAL_EVENT_TYPE(EVENT_CARD_ACTIVATE, <not used>)
|
||||
|
||||
/// Handle EVENT_CARD_SELECT events
|
||||
#define EVT_CARD_SELECT(id, handler) \
|
||||
DECLARE_EVENT_TABLE_ENTRY(EVENT_CARD_SELECT, id, -1, \
|
||||
(wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) \
|
||||
#define EVT_CARD_SELECT(id, handler) \
|
||||
DECLARE_EVENT_TABLE_ENTRY(EVENT_CARD_SELECT, id, -1, \
|
||||
(wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) \
|
||||
(void (wxEvtHandler::*)(CardSelectEvent&)) (&handler), (wxObject*) NULL),
|
||||
|
||||
/// Handle EVENT_CARD_ACTIVATE events
|
||||
#define EVT_CARD_ACTIVATE(id, handler) \
|
||||
DECLARE_EVENT_TABLE_ENTRY(EVENT_CARD_ACTIVATE, id, -1, \
|
||||
(wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) \
|
||||
#define EVT_CARD_ACTIVATE(id, handler) \
|
||||
DECLARE_EVENT_TABLE_ENTRY(EVENT_CARD_ACTIVATE, id, -1, \
|
||||
(wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) \
|
||||
(void (wxEvtHandler::*)(CardSelectEvent&)) (&handler), (wxObject*) NULL),
|
||||
|
||||
/// The event of selecting a card
|
||||
|
||||
@@ -21,9 +21,9 @@ typedef intrusive_ptr<Filter<Keyword> > KeywordListFilterP;
|
||||
|
||||
DECLARE_LOCAL_EVENT_TYPE(EVENT_KEYWORD_SELECT, <not used>)
|
||||
/// Handle KeywordSelectEvents
|
||||
#define EVT_KEYWORD_SELECT(id, handler) \
|
||||
DECLARE_EVENT_TABLE_ENTRY(EVENT_KEYWORD_SELECT, id, -1, \
|
||||
(wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) \
|
||||
#define EVT_KEYWORD_SELECT(id, handler) \
|
||||
DECLARE_EVENT_TABLE_ENTRY(EVENT_KEYWORD_SELECT, id, -1, \
|
||||
(wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) \
|
||||
(void (wxEvtHandler::*)(KeywordSelectEvent&)) (&handler), (wxObject*) NULL),
|
||||
|
||||
/// The event of selecting a keyword
|
||||
|
||||
@@ -390,11 +390,11 @@ bool CardsPanel::wantsToHandle(const Action&, bool undone) const {
|
||||
// ----------------------------------------------------------------------------- : Clipboard
|
||||
|
||||
// determine what control to use for clipboard actions
|
||||
#define CUT_COPY_PASTE(op,return) \
|
||||
int id = focused_control(this); \
|
||||
if (id == ID_EDITOR) { return editor->op(); } \
|
||||
else if (id == ID_CARD_LIST) { return card_list->op(); } \
|
||||
else if (id == ID_NOTES) { return notes->op(); } \
|
||||
#define CUT_COPY_PASTE(op,return) \
|
||||
int id = focused_control(this); \
|
||||
if (id == ID_EDITOR) { return editor->op(); } \
|
||||
else if (id == ID_CARD_LIST) { return card_list->op(); } \
|
||||
else if (id == ID_NOTES) { return notes->op(); } \
|
||||
else { return false; }
|
||||
|
||||
bool CardsPanel::canCut() const { CUT_COPY_PASTE(canCut, return) }
|
||||
|
||||
@@ -533,9 +533,9 @@ END_EVENT_TABLE ()
|
||||
// ----------------------------------------------------------------------------- : Clipboard
|
||||
|
||||
// determine what control to use for clipboard actions
|
||||
#define CUT_COPY_PASTE(op,return) \
|
||||
int id = focused_control(this); \
|
||||
if (id == ID_MESSAGE_LIST) { return messages->op(); } \
|
||||
#define CUT_COPY_PASTE(op,return) \
|
||||
int id = focused_control(this); \
|
||||
if (id == ID_MESSAGE_LIST) { return messages->op(); } \
|
||||
else { return false; }
|
||||
|
||||
bool ConsolePanel::canCut() const { return false; }
|
||||
|
||||
@@ -260,15 +260,15 @@ String KeywordsPanel::runRefScript(int find_i) {
|
||||
// ----------------------------------------------------------------------------- : Clipboard
|
||||
|
||||
// determine what control to use for clipboard actions
|
||||
#define CUT_COPY_PASTE(op,return,check) \
|
||||
if (!isInitialized()) return false; \
|
||||
int id = focused_control(this); \
|
||||
if (id == ID_KEYWORD_LIST && keyword ->IsEnabled()) { return list ->op(); } \
|
||||
#define CUT_COPY_PASTE(op,return,check) \
|
||||
if (!isInitialized()) return false; \
|
||||
int id = focused_control(this); \
|
||||
if (id == ID_KEYWORD_LIST && keyword ->IsEnabled()) { return list ->op(); } \
|
||||
else if (check) { return false; } \
|
||||
else if (id == ID_KEYWORD && keyword ->IsEnabled()) { return keyword ->op(); } \
|
||||
else if (id == ID_MATCH && match ->IsEnabled()) { return match ->op(); } \
|
||||
else if (id == ID_REMINDER && reminder->IsEnabled()) { return reminder->op(); } \
|
||||
else if (id == ID_RULES && rules ->IsEnabled()) { return rules ->op(); } \
|
||||
else if (id == ID_KEYWORD && keyword ->IsEnabled()) { return keyword ->op(); } \
|
||||
else if (id == ID_MATCH && match ->IsEnabled()) { return match ->op(); } \
|
||||
else if (id == ID_REMINDER && reminder->IsEnabled()) { return reminder->op(); } \
|
||||
else if (id == ID_RULES && rules ->IsEnabled()) { return rules ->op(); } \
|
||||
else { return false; }
|
||||
|
||||
bool KeywordsPanel::canCopy() const { CUT_COPY_PASTE(canCopy, return, false) }
|
||||
|
||||
@@ -146,11 +146,11 @@ void StylePanel::selectCard(const CardP& card) {
|
||||
// ----------------------------------------------------------------------------- : Clipboard
|
||||
|
||||
// determine what control to use for clipboard actions
|
||||
#define CUT_COPY_PASTE(op,return) \
|
||||
if (!isInitialized()) return false; \
|
||||
int id = focused_control(this); \
|
||||
if (id == ID_EDITOR) { return editor->op(); } \
|
||||
else { return false; }
|
||||
#define CUT_COPY_PASTE(op,return) \
|
||||
if (!isInitialized()) return false; \
|
||||
int id = focused_control(this); \
|
||||
if (id == ID_EDITOR) { return editor->op(); } \
|
||||
else { return false; }
|
||||
|
||||
bool StylePanel::canCopy() const { CUT_COPY_PASTE(canCopy, return) }
|
||||
bool StylePanel::canCut() const { CUT_COPY_PASTE(canCut, return) }
|
||||
|
||||
+14
-14
@@ -135,22 +135,22 @@ class ValueEditor {
|
||||
|
||||
// ----------------------------------------------------------------------------- : Utility
|
||||
|
||||
#define DECLARE_VALUE_EDITOR(Type) \
|
||||
Type##ValueEditor(DataEditor& parent, const Type##StyleP& style); \
|
||||
virtual ValueEditor* getEditor() { return this; } \
|
||||
private: \
|
||||
/** Retrieve the parent editor object */ \
|
||||
inline DataEditor& editor() const { \
|
||||
return static_cast<DataEditor&>(viewer); \
|
||||
} \
|
||||
#define DECLARE_VALUE_EDITOR(Type) \
|
||||
Type##ValueEditor(DataEditor& parent, const Type##StyleP& style); \
|
||||
virtual ValueEditor* getEditor() { return this; } \
|
||||
private: \
|
||||
/** Retrieve the parent editor object */ \
|
||||
inline DataEditor& editor() const { \
|
||||
return static_cast<DataEditor&>(viewer); \
|
||||
} \
|
||||
public:
|
||||
|
||||
#define IMPLEMENT_VALUE_EDITOR(Type) \
|
||||
ValueViewerP Type##Style::makeEditor(DataEditor& parent, const StyleP& thisP) { \
|
||||
assert(thisP.get() == this); \
|
||||
return ValueViewerP(new Type##ValueEditor(parent, static_pointer_cast<Type##Style>(thisP))); \
|
||||
} \
|
||||
Type##ValueEditor::Type##ValueEditor(DataEditor& parent, const Type##StyleP& style) \
|
||||
#define IMPLEMENT_VALUE_EDITOR(Type) \
|
||||
ValueViewerP Type##Style::makeEditor(DataEditor& parent, const StyleP& thisP) { \
|
||||
assert(thisP.get() == this); \
|
||||
return ValueViewerP(new Type##ValueEditor(parent, static_pointer_cast<Type##Style>(thisP))); \
|
||||
} \
|
||||
Type##ValueEditor::Type##ValueEditor(DataEditor& parent, const Type##StyleP& style) \
|
||||
: Type##ValueViewer(parent, style)
|
||||
|
||||
// ----------------------------------------------------------------------------- : EOF
|
||||
|
||||
Reference in New Issue
Block a user