mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Merge branch 'master' into locales
This commit is contained in:
+8
-1
@@ -10,7 +10,14 @@ Features:
|
|||||||
Bug fixes:
|
Bug fixes:
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
version 2.2.2 (Unofficial), 2022-07-19
|
version 2.3.0 (Unofficial), 2022-07-29
|
||||||
|
------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Features:
|
||||||
|
* Add ability to underline text using `<u>` tags or panel buttons/hotkeys. (haganbmj#30)
|
||||||
|
|
||||||
|
------------------------------------------------------------------------------
|
||||||
|
version 2.2.2 (Unofficial), 2022-07-22
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
|
|
||||||
Bug fixes:
|
Bug fixes:
|
||||||
|
|||||||
+2
-1
@@ -1,6 +1,7 @@
|
|||||||
cmake_minimum_required(VERSION 3.13)
|
cmake_minimum_required(VERSION 3.13)
|
||||||
|
|
||||||
project(magicseteditor VERSION 2.2.2)
|
project(magicseteditor VERSION 2.3.0)
|
||||||
|
add_definitions(-DUNOFFICIAL_BUILD)
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
||||||
|
|||||||
@@ -67,7 +67,8 @@ menu:
|
|||||||
|
|
||||||
format: F&ormat
|
format: F&ormat
|
||||||
bold: &Bold Ctrl+B
|
bold: &Bold Ctrl+B
|
||||||
italic: &Italic Ctrl+I
|
italic: &Italic Ctrl+I
|
||||||
|
underline: &Underline Ctrl+U
|
||||||
symbols: &Symbols Ctrl+M
|
symbols: &Symbols Ctrl+M
|
||||||
reminder text: &Reminder Text Ctrl+R
|
reminder text: &Reminder Text Ctrl+R
|
||||||
insert symbol: I&nsert Symbol
|
insert symbol: I&nsert Symbol
|
||||||
@@ -187,7 +188,8 @@ help:
|
|||||||
|
|
||||||
#format:
|
#format:
|
||||||
bold: Makes the selected text bold
|
bold: Makes the selected text bold
|
||||||
italic: Makes the selected text italic
|
italic: Makes the selected text italic
|
||||||
|
underline: Makes the selected text underlined
|
||||||
symbols: Draws the selected text with symbols
|
symbols: Draws the selected text with symbols
|
||||||
reminder text: Show reminder text for the selected keyword
|
reminder text: Show reminder text for the selected keyword
|
||||||
# spelling
|
# spelling
|
||||||
@@ -390,6 +392,7 @@ tooltip:
|
|||||||
|
|
||||||
bold: Bold
|
bold: Bold
|
||||||
italic: Italic
|
italic: Italic
|
||||||
|
underline: Underline
|
||||||
symbols: Symbols
|
symbols: Symbols
|
||||||
reminder text: Reminder Text
|
reminder text: Reminder Text
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 273 B |
@@ -39,6 +39,7 @@ tool/find IMAGE "tool/find.png"
|
|||||||
|
|
||||||
tool/bold IMAGE "tool/bold.png"
|
tool/bold IMAGE "tool/bold.png"
|
||||||
tool/italic IMAGE "tool/italic.png"
|
tool/italic IMAGE "tool/italic.png"
|
||||||
|
tool/underline IMAGE "tool/underline.png"
|
||||||
tool/symbol IMAGE "tool/symbol.png"
|
tool/symbol IMAGE "tool/symbol.png"
|
||||||
tool/reminder IMAGE "tool/reminder.png"
|
tool/reminder IMAGE "tool/reminder.png"
|
||||||
tool/no_auto IMAGE "tool/no_auto.png"
|
tool/no_auto IMAGE "tool/no_auto.png"
|
||||||
|
|||||||
+4
-1
@@ -50,7 +50,7 @@ void Font::initDependencies(Context& ctx, const Dependency& dep) const {
|
|||||||
shadow_color.initDependencies(ctx, dep);
|
shadow_color.initDependencies(ctx, dep);
|
||||||
}
|
}
|
||||||
|
|
||||||
FontP Font::make(int add_flags, String const* other_family, Color const* other_color, double const* other_size) const {
|
FontP Font::make(int add_flags, bool add_underline, String const* other_family, Color const* other_color, double const* other_size) const {
|
||||||
FontP f(new Font(*this));
|
FontP f(new Font(*this));
|
||||||
f->flags |= add_flags;
|
f->flags |= add_flags;
|
||||||
if (add_flags & FONT_CODE_STRING) {
|
if (add_flags & FONT_CODE_STRING) {
|
||||||
@@ -66,6 +66,9 @@ FontP Font::make(int add_flags, String const* other_family, Color const* other_c
|
|||||||
if (add_flags & FONT_SOFT) {
|
if (add_flags & FONT_SOFT) {
|
||||||
f->color = f->separator_color;
|
f->color = f->separator_color;
|
||||||
f->shadow_displacement = RealSize(0,0); // no shadow
|
f->shadow_displacement = RealSize(0,0); // no shadow
|
||||||
|
}
|
||||||
|
if (add_underline) {
|
||||||
|
f->underline = true;
|
||||||
}
|
}
|
||||||
if (other_color) {
|
if (other_color) {
|
||||||
f->color = *other_color;
|
f->color = *other_color;
|
||||||
|
|||||||
+1
-1
@@ -60,7 +60,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Add style to a font, and optionally change the font family, color and size
|
/// Add style to a font, and optionally change the font family, color and size
|
||||||
FontP make(int add_flags, String const* other_family, Color const* other_color, double const* other_size) const;
|
FontP make(int add_flags, bool add_underline, String const* other_family, Color const* other_color, double const* other_size) const;
|
||||||
|
|
||||||
/// Convert this font to a wxFont
|
/// Convert this font to a wxFont
|
||||||
wxFont toWxFont(double scale) const;
|
wxFont toWxFont(double scale) const;
|
||||||
|
|||||||
@@ -88,7 +88,8 @@ CardsPanel::CardsPanel(Window* parent, int id)
|
|||||||
|
|
||||||
menuFormat = new wxMenu();
|
menuFormat = new wxMenu();
|
||||||
add_menu_item_tr(menuFormat, ID_FORMAT_BOLD, "bold", "bold", wxITEM_CHECK);
|
add_menu_item_tr(menuFormat, ID_FORMAT_BOLD, "bold", "bold", wxITEM_CHECK);
|
||||||
add_menu_item_tr(menuFormat, ID_FORMAT_ITALIC, "italic", "italic", wxITEM_CHECK);
|
add_menu_item_tr(menuFormat, ID_FORMAT_ITALIC, "italic", "italic", wxITEM_CHECK);
|
||||||
|
add_menu_item_tr(menuFormat, ID_FORMAT_UNDERLINE, "underline", "underline", wxITEM_CHECK);
|
||||||
add_menu_item_tr(menuFormat, ID_FORMAT_SYMBOL, "symbol", "symbols", wxITEM_CHECK);
|
add_menu_item_tr(menuFormat, ID_FORMAT_SYMBOL, "symbol", "symbols", wxITEM_CHECK);
|
||||||
add_menu_item_tr(menuFormat, ID_FORMAT_REMINDER, "reminder", "reminder_text", wxITEM_CHECK);
|
add_menu_item_tr(menuFormat, ID_FORMAT_REMINDER, "reminder", "reminder_text", wxITEM_CHECK);
|
||||||
menuFormat->AppendSeparator();
|
menuFormat->AppendSeparator();
|
||||||
@@ -184,7 +185,8 @@ wxMenu* CardsPanel::makeAddCardsSubmenu(bool add_single_card_option) {
|
|||||||
void CardsPanel::initUI(wxToolBar* tb, wxMenuBar* mb) {
|
void CardsPanel::initUI(wxToolBar* tb, wxMenuBar* mb) {
|
||||||
// Toolbar
|
// Toolbar
|
||||||
add_tool_tr(tb, ID_FORMAT_BOLD, "bold", "bold", false, wxITEM_CHECK);
|
add_tool_tr(tb, ID_FORMAT_BOLD, "bold", "bold", false, wxITEM_CHECK);
|
||||||
add_tool_tr(tb, ID_FORMAT_ITALIC, "italic", "italic", false, wxITEM_CHECK);
|
add_tool_tr(tb, ID_FORMAT_ITALIC, "italic", "italic", false, wxITEM_CHECK);
|
||||||
|
add_tool_tr(tb, ID_FORMAT_UNDERLINE, "underline", "underline", false, wxITEM_CHECK);
|
||||||
add_tool_tr(tb, ID_FORMAT_SYMBOL, "symbol", "symbols", false, wxITEM_CHECK);
|
add_tool_tr(tb, ID_FORMAT_SYMBOL, "symbol", "symbols", false, wxITEM_CHECK);
|
||||||
add_tool_tr(tb, ID_FORMAT_REMINDER, "reminder", "reminder_text", false, wxITEM_CHECK);
|
add_tool_tr(tb, ID_FORMAT_REMINDER, "reminder", "reminder_text", false, wxITEM_CHECK);
|
||||||
tb->AddSeparator();
|
tb->AddSeparator();
|
||||||
@@ -214,7 +216,8 @@ void CardsPanel::initUI(wxToolBar* tb, wxMenuBar* mb) {
|
|||||||
void CardsPanel::destroyUI(wxToolBar* tb, wxMenuBar* mb) {
|
void CardsPanel::destroyUI(wxToolBar* tb, wxMenuBar* mb) {
|
||||||
// Toolbar
|
// Toolbar
|
||||||
tb->DeleteTool(ID_FORMAT_BOLD);
|
tb->DeleteTool(ID_FORMAT_BOLD);
|
||||||
tb->DeleteTool(ID_FORMAT_ITALIC);
|
tb->DeleteTool(ID_FORMAT_ITALIC);
|
||||||
|
tb->DeleteTool(ID_FORMAT_UNDERLINE);
|
||||||
tb->DeleteTool(ID_FORMAT_SYMBOL);
|
tb->DeleteTool(ID_FORMAT_SYMBOL);
|
||||||
tb->DeleteTool(ID_FORMAT_REMINDER);
|
tb->DeleteTool(ID_FORMAT_REMINDER);
|
||||||
tb->DeleteTool(ID_CARD_ADD);
|
tb->DeleteTool(ID_CARD_ADD);
|
||||||
@@ -253,7 +256,7 @@ void CardsPanel::onUpdateUI(wxUpdateUIEvent& ev) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ID_CARD_REMOVE: ev.Enable(card_list->canDelete()); break;
|
case ID_CARD_REMOVE: ev.Enable(card_list->canDelete()); break;
|
||||||
case ID_FORMAT_BOLD: case ID_FORMAT_ITALIC: case ID_FORMAT_SYMBOL: case ID_FORMAT_REMINDER: {
|
case ID_FORMAT_BOLD: case ID_FORMAT_ITALIC: case ID_FORMAT_UNDERLINE: case ID_FORMAT_SYMBOL: case ID_FORMAT_REMINDER: {
|
||||||
if (focused_control(this) == ID_EDITOR) {
|
if (focused_control(this) == ID_EDITOR) {
|
||||||
ev.Enable(editor->canFormat(ev.GetId()));
|
ev.Enable(editor->canFormat(ev.GetId()));
|
||||||
ev.Check (editor->hasFormat(ev.GetId()));
|
ev.Check (editor->hasFormat(ev.GetId()));
|
||||||
@@ -327,7 +330,7 @@ void CardsPanel::onCommand(int id) {
|
|||||||
case ID_SELECT_COLUMNS: {
|
case ID_SELECT_COLUMNS: {
|
||||||
card_list->selectColumns();
|
card_list->selectColumns();
|
||||||
}
|
}
|
||||||
case ID_FORMAT_BOLD: case ID_FORMAT_ITALIC: case ID_FORMAT_SYMBOL: case ID_FORMAT_REMINDER: {
|
case ID_FORMAT_BOLD: case ID_FORMAT_ITALIC: case ID_FORMAT_UNDERLINE: case ID_FORMAT_SYMBOL: case ID_FORMAT_REMINDER: {
|
||||||
if (focused_control(this) == ID_EDITOR) {
|
if (focused_control(this) == ID_EDITOR) {
|
||||||
editor->doFormat(id);
|
editor->doFormat(id);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,14 +35,16 @@ void SetInfoPanel::onChangeSet() {
|
|||||||
void SetInfoPanel::initUI(wxToolBar* tb, wxMenuBar* mb) {
|
void SetInfoPanel::initUI(wxToolBar* tb, wxMenuBar* mb) {
|
||||||
// Toolbar
|
// Toolbar
|
||||||
add_tool_tr(tb, ID_FORMAT_BOLD, "bold", "bold", false, wxITEM_CHECK);
|
add_tool_tr(tb, ID_FORMAT_BOLD, "bold", "bold", false, wxITEM_CHECK);
|
||||||
add_tool_tr(tb, ID_FORMAT_ITALIC, "italic", "italic", false, wxITEM_CHECK);
|
add_tool_tr(tb, ID_FORMAT_ITALIC, "italic", "italic", false, wxITEM_CHECK);
|
||||||
|
add_tool_tr(tb, ID_FORMAT_UNDERLINE, "underline", "underline", false, wxITEM_CHECK);
|
||||||
add_tool_tr(tb, ID_FORMAT_SYMBOL, "symbol", "symbols", false, wxITEM_CHECK);
|
add_tool_tr(tb, ID_FORMAT_SYMBOL, "symbol", "symbols", false, wxITEM_CHECK);
|
||||||
add_tool_tr(tb, ID_FORMAT_REMINDER, "reminder", "reminder_text", false, wxITEM_CHECK);
|
add_tool_tr(tb, ID_FORMAT_REMINDER, "reminder", "reminder_text", false, wxITEM_CHECK);
|
||||||
tb->Realize();
|
tb->Realize();
|
||||||
// Menus
|
// Menus
|
||||||
auto menuFormat = new wxMenu();
|
auto menuFormat = new wxMenu();
|
||||||
add_menu_item_tr(menuFormat, ID_FORMAT_BOLD, "bold", "bold", wxITEM_CHECK);
|
add_menu_item_tr(menuFormat, ID_FORMAT_BOLD, "bold", "bold", wxITEM_CHECK);
|
||||||
add_menu_item_tr(menuFormat, ID_FORMAT_ITALIC, "italic", "italic", wxITEM_CHECK);
|
add_menu_item_tr(menuFormat, ID_FORMAT_ITALIC, "italic", "italic", wxITEM_CHECK);
|
||||||
|
add_menu_item_tr(menuFormat, ID_FORMAT_UNDERLINE, "underline", "underline", wxITEM_CHECK);
|
||||||
add_menu_item_tr(menuFormat, ID_FORMAT_SYMBOL, "symbol", "symbols", wxITEM_CHECK);
|
add_menu_item_tr(menuFormat, ID_FORMAT_SYMBOL, "symbol", "symbols", wxITEM_CHECK);
|
||||||
add_menu_item_tr(menuFormat, ID_FORMAT_REMINDER, "reminder", "reminder_text", wxITEM_CHECK);
|
add_menu_item_tr(menuFormat, ID_FORMAT_REMINDER, "reminder", "reminder_text", wxITEM_CHECK);
|
||||||
mb->Insert(2, menuFormat, _MENU_("format"));
|
mb->Insert(2, menuFormat, _MENU_("format"));
|
||||||
@@ -53,7 +55,8 @@ void SetInfoPanel::initUI(wxToolBar* tb, wxMenuBar* mb) {
|
|||||||
void SetInfoPanel::destroyUI(wxToolBar* tb, wxMenuBar* mb) {
|
void SetInfoPanel::destroyUI(wxToolBar* tb, wxMenuBar* mb) {
|
||||||
// Toolbar
|
// Toolbar
|
||||||
tb->DeleteTool(ID_FORMAT_BOLD);
|
tb->DeleteTool(ID_FORMAT_BOLD);
|
||||||
tb->DeleteTool(ID_FORMAT_ITALIC);
|
tb->DeleteTool(ID_FORMAT_ITALIC);
|
||||||
|
tb->DeleteTool(ID_FORMAT_UNDERLINE);
|
||||||
tb->DeleteTool(ID_FORMAT_SYMBOL);
|
tb->DeleteTool(ID_FORMAT_SYMBOL);
|
||||||
tb->DeleteTool(ID_FORMAT_REMINDER);
|
tb->DeleteTool(ID_FORMAT_REMINDER);
|
||||||
// Menus
|
// Menus
|
||||||
@@ -62,7 +65,7 @@ void SetInfoPanel::destroyUI(wxToolBar* tb, wxMenuBar* mb) {
|
|||||||
|
|
||||||
void SetInfoPanel::onUpdateUI(wxUpdateUIEvent& ev) {
|
void SetInfoPanel::onUpdateUI(wxUpdateUIEvent& ev) {
|
||||||
switch (ev.GetId()) {
|
switch (ev.GetId()) {
|
||||||
case ID_FORMAT_BOLD: case ID_FORMAT_ITALIC: case ID_FORMAT_SYMBOL: case ID_FORMAT_REMINDER: {
|
case ID_FORMAT_BOLD: case ID_FORMAT_ITALIC: case ID_FORMAT_UNDERLINE: case ID_FORMAT_SYMBOL: case ID_FORMAT_REMINDER: {
|
||||||
ev.Enable(editor->canFormat(ev.GetId()));
|
ev.Enable(editor->canFormat(ev.GetId()));
|
||||||
ev.Check (editor->hasFormat(ev.GetId()));
|
ev.Check (editor->hasFormat(ev.GetId()));
|
||||||
break;
|
break;
|
||||||
@@ -72,7 +75,7 @@ void SetInfoPanel::onUpdateUI(wxUpdateUIEvent& ev) {
|
|||||||
|
|
||||||
void SetInfoPanel::onCommand(int id) {
|
void SetInfoPanel::onCommand(int id) {
|
||||||
switch (id) {
|
switch (id) {
|
||||||
case ID_FORMAT_BOLD: case ID_FORMAT_ITALIC: case ID_FORMAT_SYMBOL: case ID_FORMAT_REMINDER: {
|
case ID_FORMAT_BOLD: case ID_FORMAT_ITALIC: case ID_FORMAT_UNDERLINE: case ID_FORMAT_SYMBOL: case ID_FORMAT_REMINDER: {
|
||||||
editor->doFormat(id);
|
editor->doFormat(id);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -266,8 +266,10 @@ void SymbolPartList::onChar(wxKeyEvent& ev) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// See gui/value/text.cpp
|
// See gui/value/text.cpp
|
||||||
#ifdef __WXMSW__
|
#if defined UNICODE
|
||||||
|
if (ev.GetUnicodeKey() >= WXK_SPACE) {
|
||||||
|
#elif defined __WXMSW__
|
||||||
if (ev.GetKeyCode() >= _(' ') && ev.GetKeyCode() == (int)ev.GetRawKeyCode()) {
|
if (ev.GetKeyCode() >= _(' ') && ev.GetKeyCode() == (int)ev.GetRawKeyCode()) {
|
||||||
#else
|
#else
|
||||||
if (ev.GetKeyCode() >= _(' ') /*&& ev.GetKeyCode() == (int)ev.GetRawKeyCode()*/) {
|
if (ev.GetKeyCode() >= _(' ') /*&& ev.GetKeyCode() == (int)ev.GetRawKeyCode()*/) {
|
||||||
|
|||||||
@@ -805,7 +805,7 @@ bool TextValueEditor::doDelete() {
|
|||||||
|
|
||||||
bool TextValueEditor::canFormat(int type) const {
|
bool TextValueEditor::canFormat(int type) const {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case ID_FORMAT_BOLD: case ID_FORMAT_ITALIC:
|
case ID_FORMAT_BOLD: case ID_FORMAT_ITALIC: case ID_FORMAT_UNDERLINE:
|
||||||
return !style().always_symbol && style().allow_formating;
|
return !style().always_symbol && style().allow_formating;
|
||||||
case ID_FORMAT_SYMBOL:
|
case ID_FORMAT_SYMBOL:
|
||||||
return !style().always_symbol && style().allow_formating && style().symbol_font.valid();
|
return !style().always_symbol && style().allow_formating && style().symbol_font.valid();
|
||||||
@@ -822,7 +822,9 @@ bool TextValueEditor::hasFormat(int type) const {
|
|||||||
case ID_FORMAT_BOLD:
|
case ID_FORMAT_BOLD:
|
||||||
return is_in_tag(value().value(), _("<b"), selection_start_i, selection_end_i);
|
return is_in_tag(value().value(), _("<b"), selection_start_i, selection_end_i);
|
||||||
case ID_FORMAT_ITALIC:
|
case ID_FORMAT_ITALIC:
|
||||||
return is_in_tag(value().value(), _("<i"), selection_start_i, selection_end_i);
|
return is_in_tag(value().value(), _("<i"), selection_start_i, selection_end_i);
|
||||||
|
case ID_FORMAT_UNDERLINE:
|
||||||
|
return is_in_tag(value().value(), _("<u"), selection_start_i, selection_end_i);
|
||||||
case ID_FORMAT_SYMBOL:
|
case ID_FORMAT_SYMBOL:
|
||||||
return is_in_tag(value().value(), _("<sym"), selection_start_i, selection_end_i);
|
return is_in_tag(value().value(), _("<sym"), selection_start_i, selection_end_i);
|
||||||
case ID_FORMAT_REMINDER: {
|
case ID_FORMAT_REMINDER: {
|
||||||
@@ -848,6 +850,10 @@ void TextValueEditor::doFormat(int type) {
|
|||||||
case ID_FORMAT_ITALIC: {
|
case ID_FORMAT_ITALIC: {
|
||||||
addAction(toggle_format_action(valueP(), _("i"), selection_start_i, selection_end_i, selection_start, selection_end, _("Italic")));
|
addAction(toggle_format_action(valueP(), _("i"), selection_start_i, selection_end_i, selection_start, selection_end, _("Italic")));
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
case ID_FORMAT_UNDERLINE: {
|
||||||
|
addAction(toggle_format_action(valueP(), _("u"), selection_start_i, selection_end_i, selection_start, selection_end, _("Underline")));
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
case ID_FORMAT_SYMBOL: {
|
case ID_FORMAT_SYMBOL: {
|
||||||
addAction(toggle_format_action(valueP(), _("sym"), selection_start_i, selection_end_i, selection_start, selection_end, _("Symbols")));
|
addAction(toggle_format_action(valueP(), _("sym"), selection_start_i, selection_end_i, selection_start, selection_end, _("Symbols")));
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ struct Margins {
|
|||||||
// Helper class for TextElements::fromString, to allow persistent formating state accross recusive calls
|
// Helper class for TextElements::fromString, to allow persistent formating state accross recusive calls
|
||||||
struct TextElementsFromString {
|
struct TextElementsFromString {
|
||||||
// What formatting is enabled?
|
// What formatting is enabled?
|
||||||
int bold = 0, italic = 0, symbol = 0;
|
int bold = 0, italic = 0, underline = 0, symbol = 0;
|
||||||
int soft = 0, kwpph = 0, param = 0, line = 0, soft_line = 0;
|
int soft = 0, kwpph = 0, param = 0, line = 0, soft_line = 0;
|
||||||
int code = 0, code_kw = 0, code_string = 0, param_ref = 0;
|
int code = 0, code_kw = 0, code_string = 0, param_ref = 0;
|
||||||
int param_id = 0, li = 0;
|
int param_id = 0, li = 0;
|
||||||
@@ -78,7 +78,9 @@ private:
|
|||||||
if (is_tag(text, tag_start, _( "<b"))) bold += 1;
|
if (is_tag(text, tag_start, _( "<b"))) bold += 1;
|
||||||
else if (is_tag(text, tag_start, _("</b"))) bold -= 1;
|
else if (is_tag(text, tag_start, _("</b"))) bold -= 1;
|
||||||
else if (is_tag(text, tag_start, _( "<i"))) italic += 1;
|
else if (is_tag(text, tag_start, _( "<i"))) italic += 1;
|
||||||
else if (is_tag(text, tag_start, _("</i"))) italic -= 1;
|
else if (is_tag(text, tag_start, _("</i"))) italic -= 1;
|
||||||
|
else if (is_tag(text, tag_start, _("<u"))) underline += 1;
|
||||||
|
else if (is_tag(text, tag_start, _("</u"))) underline -= 1;
|
||||||
else if (is_tag(text, tag_start, _( "<sym"))) symbol += 1;
|
else if (is_tag(text, tag_start, _( "<sym"))) symbol += 1;
|
||||||
else if (is_tag(text, tag_start, _("</sym"))) symbol -= 1;
|
else if (is_tag(text, tag_start, _("</sym"))) symbol -= 1;
|
||||||
else if (is_tag(text, tag_start, _( "<line"))) line += 1;
|
else if (is_tag(text, tag_start, _( "<line"))) line += 1;
|
||||||
@@ -299,7 +301,8 @@ private:
|
|||||||
(kwpph > 0 ? FONT_SOFT : FONT_NORMAL) |
|
(kwpph > 0 ? FONT_SOFT : FONT_NORMAL) |
|
||||||
(code > 0 ? FONT_CODE : FONT_NORMAL) |
|
(code > 0 ? FONT_CODE : FONT_NORMAL) |
|
||||||
(code_kw > 0 ? FONT_CODE_KW : FONT_NORMAL) |
|
(code_kw > 0 ? FONT_CODE_KW : FONT_NORMAL) |
|
||||||
(code_string > 0 ? FONT_CODE_STRING : FONT_NORMAL),
|
(code_string > 0 ? FONT_CODE_STRING : FONT_NORMAL),
|
||||||
|
underline > 0,
|
||||||
fonts.empty() ? nullptr : &fonts.back(),
|
fonts.empty() ? nullptr : &fonts.back(),
|
||||||
param > 0 || param_ref > 0
|
param > 0 || param_ref > 0
|
||||||
? ¶m_colors[(param_id++) % param_colors_count]
|
? ¶m_colors[(param_id++) % param_colors_count]
|
||||||
|
|||||||
@@ -209,7 +209,8 @@ String to_html(const String& str_in, const SymbolFontP& symbol_font, double symb
|
|||||||
String str = remove_tag_contents(str_in,_("<sep-soft"));
|
String str = remove_tag_contents(str_in,_("<sep-soft"));
|
||||||
String ret;
|
String ret;
|
||||||
Tag bold (_("<b>"), _("</b>")),
|
Tag bold (_("<b>"), _("</b>")),
|
||||||
italic(_("<i>"), _("</i>")),
|
italic(_("<i>"), _("</i>")),
|
||||||
|
underline(_("<u>"), _("</u>")),
|
||||||
symbol(_("<span class=\"symbol\">"), _("</span>"));
|
symbol(_("<span class=\"symbol\">"), _("</span>"));
|
||||||
TagStack tags;
|
TagStack tags;
|
||||||
String symbols;
|
String symbols;
|
||||||
@@ -224,7 +225,11 @@ String to_html(const String& str_in, const SymbolFontP& symbol_font, double symb
|
|||||||
} else if (is_substr(str, i, _("i"))) {
|
} else if (is_substr(str, i, _("i"))) {
|
||||||
tags.open (ret, italic);
|
tags.open (ret, italic);
|
||||||
} else if (is_substr(str, i, _("/i"))) {
|
} else if (is_substr(str, i, _("/i"))) {
|
||||||
tags.close(ret, italic);
|
tags.close(ret, italic);
|
||||||
|
} else if (is_substr(str, i, _("u"))) {
|
||||||
|
tags.open(ret, underline);
|
||||||
|
} else if (is_substr(str, i, _("/u"))) {
|
||||||
|
tags.close(ret, underline);
|
||||||
} else if (is_substr(str, i, _("sym"))) {
|
} else if (is_substr(str, i, _("sym"))) {
|
||||||
tags.open (ret, symbol);
|
tags.open (ret, symbol);
|
||||||
} else if (is_substr(str, i, _("/sym"))) {
|
} else if (is_substr(str, i, _("/sym"))) {
|
||||||
@@ -300,7 +305,8 @@ String to_bbcode(const String& str_in) {
|
|||||||
String str = remove_tag_contents(str_in,_("<sep-soft"));
|
String str = remove_tag_contents(str_in,_("<sep-soft"));
|
||||||
String ret;
|
String ret;
|
||||||
Tag bold (_("[b]"), _("[/b]")),
|
Tag bold (_("[b]"), _("[/b]")),
|
||||||
italic(_("[i]"), _("[/i]"));
|
italic(_("[i]"), _("[/i]")),
|
||||||
|
underline(_("[u]"), _("[/u]"));
|
||||||
TagStack tags;
|
TagStack tags;
|
||||||
String symbols;
|
String symbols;
|
||||||
for (size_t i = 0 ; i < str.size() ; ) {
|
for (size_t i = 0 ; i < str.size() ; ) {
|
||||||
@@ -315,7 +321,12 @@ String to_bbcode(const String& str_in) {
|
|||||||
tags.open (ret, italic);
|
tags.open (ret, italic);
|
||||||
} else if (is_substr(str, i, _("/i"))) {
|
} else if (is_substr(str, i, _("/i"))) {
|
||||||
tags.close(ret, italic);
|
tags.close(ret, italic);
|
||||||
} /*else if (is_substr(str, i, _("sym"))) {
|
} else if (is_substr(str, i, _("u"))) {
|
||||||
|
tags.open(ret, underline);
|
||||||
|
} else if (is_substr(str, i, _("/u"))) {
|
||||||
|
tags.close(ret, underline);
|
||||||
|
}
|
||||||
|
/*else if (is_substr(str, i, _("sym"))) {
|
||||||
tags.open (ret, symbol);
|
tags.open (ret, symbol);
|
||||||
} else if (is_substr(str, i, _("/sym"))) {
|
} else if (is_substr(str, i, _("/sym"))) {
|
||||||
if (!symbols.empty()) {
|
if (!symbols.empty()) {
|
||||||
|
|||||||
@@ -645,7 +645,10 @@ String simplify_tagged(const String& str) {
|
|||||||
// (where </tag> is the negation of tag)
|
// (where </tag> is the negation of tag)
|
||||||
bool add_or_cancel_tag(const String& tag, String& stack, bool all = false) {
|
bool add_or_cancel_tag(const String& tag, String& stack, bool all = false) {
|
||||||
if (all || starts_with(tag, _("/")) ||
|
if (all || starts_with(tag, _("/")) ||
|
||||||
starts_with(tag, _("b")) || starts_with(tag, _("i")) || starts_with(tag, _("sym"))) {
|
starts_with(tag, _("b")) ||
|
||||||
|
starts_with(tag, _("i")) ||
|
||||||
|
starts_with(tag, _("u")) ||
|
||||||
|
starts_with(tag, _("sym"))) {
|
||||||
// cancel out all close tags, but not all open tags,
|
// cancel out all close tags, but not all open tags,
|
||||||
// so <xx></xx> is always removed
|
// so <xx></xx> is always removed
|
||||||
// but </xx><xx> is not
|
// but </xx><xx> is not
|
||||||
@@ -692,8 +695,10 @@ String simplify_tagged_overlap(const String& str) {
|
|||||||
Char c = str.GetChar(i);
|
Char c = str.GetChar(i);
|
||||||
if (c == _('<')) {
|
if (c == _('<')) {
|
||||||
String tag = tag_at(str, i);
|
String tag = tag_at(str, i);
|
||||||
if (starts_with(tag, _("b")) || starts_with(tag, _("i")) || starts_with(tag, _("sym")) ||
|
if (starts_with(tag, _("b")) || starts_with(tag, _("/b")) ||
|
||||||
starts_with(tag, _("/b")) || starts_with(tag, _("/i")) || starts_with(tag, _("/sym"))) {
|
starts_with(tag, _("i")) || starts_with(tag, _("/i")) ||
|
||||||
|
starts_with(tag, _("u")) || starts_with(tag, _("/u")) ||
|
||||||
|
starts_with(tag, _("sym")) || starts_with(tag, _("/sym"))) {
|
||||||
// optimize this tag
|
// optimize this tag
|
||||||
if (open_tags.find(_("<") + tag + _(">")) == String::npos) {
|
if (open_tags.find(_("<") + tag + _(">")) == String::npos) {
|
||||||
// we are not already inside this tag
|
// we are not already inside this tag
|
||||||
|
|||||||
@@ -51,11 +51,14 @@ template <> void GetDefaultMember::handle(const Version& v) {
|
|||||||
// ----------------------------------------------------------------------------- : Versions
|
// ----------------------------------------------------------------------------- : Versions
|
||||||
|
|
||||||
// NOTE: Don't use leading zeroes, they mean octal
|
// NOTE: Don't use leading zeroes, they mean octal
|
||||||
const Version app_version = 10000 * MSE_VERSION_MAJOR + 100 * MSE_VERSION_MINOR + MSE_VERSION_PATCH;
|
const Version app_version = 10000 * MSE_VERSION_MAJOR + 100 * MSE_VERSION_MINOR + MSE_VERSION_PATCH;
|
||||||
#ifdef UNICODE
|
|
||||||
const Char* version_suffix = _("");
|
#if defined UNOFFICIAL_BUILD
|
||||||
#else
|
const Char* version_suffix = _(" (Unofficial)");
|
||||||
const Char* version_suffix = _(" (ascii build)");
|
#elif defined UNICODE
|
||||||
|
const Char* version_suffix = _("");
|
||||||
|
#else
|
||||||
|
const Char* version_suffix = _(" (ascii build)");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/// Which version of MSE are the files we write out compatible with?
|
/// Which version of MSE are the files we write out compatible with?
|
||||||
|
|||||||
@@ -115,7 +115,8 @@ enum ChildMenuID {
|
|||||||
|
|
||||||
// Format menu
|
// Format menu
|
||||||
ID_FORMAT_BOLD = 6201,
|
ID_FORMAT_BOLD = 6201,
|
||||||
ID_FORMAT_ITALIC,
|
ID_FORMAT_ITALIC,
|
||||||
|
ID_FORMAT_UNDERLINE,
|
||||||
ID_FORMAT_SYMBOL,
|
ID_FORMAT_SYMBOL,
|
||||||
ID_FORMAT_REMINDER,
|
ID_FORMAT_REMINDER,
|
||||||
ID_INSERT_SYMBOL,
|
ID_INSERT_SYMBOL,
|
||||||
|
|||||||
Reference in New Issue
Block a user