diff --git a/core/bitmaps/delete.bmp b/core/bitmaps/delete.bmp new file mode 100644 index 000000000..4afd00449 Binary files /dev/null and b/core/bitmaps/delete.bmp differ diff --git a/core/bitmaps/find_next.bmp b/core/bitmaps/find_next.bmp new file mode 100644 index 000000000..4afd00449 Binary files /dev/null and b/core/bitmaps/find_next.bmp differ diff --git a/core/bitmaps/paste_over.bmp b/core/bitmaps/paste_over.bmp new file mode 100644 index 000000000..4afd00449 Binary files /dev/null and b/core/bitmaps/paste_over.bmp differ diff --git a/core/bitmaps/replace.bmp b/core/bitmaps/replace.bmp new file mode 100644 index 000000000..4afd00449 Binary files /dev/null and b/core/bitmaps/replace.bmp differ diff --git a/core/bitmaps/splash.bmp b/core/bitmaps/splash.bmp index fdcc87ea2..2beb9f0fd 100644 Binary files a/core/bitmaps/splash.bmp and b/core/bitmaps/splash.bmp differ diff --git a/core/frame_main.cpp b/core/frame_main.cpp index 5556b5a93..13c34c1f6 100644 --- a/core/frame_main.cpp +++ b/core/frame_main.cpp @@ -194,7 +194,9 @@ void FrameMain::InitToolbar () { Toolbar->AddTool(Menu_Tools_Fonts_Collector,_("Fonts Collector"),wxBITMAP(font_collector_button),_("Open Fonts Collector")); Toolbar->AddTool(Menu_Tools_Resample,_("Resample"),wxBITMAP(resample_toolbutton),_("Resample script resolution")); Toolbar->AddTool(Menu_Tools_Timing_Processor,_("Timing Post-Processor"),wxBITMAP(timing_processor_toolbutton),_("Open Timing Post-processor dialog")); +#if USE_HUNSPELL == 1 Toolbar->AddTool(Menu_Tools_SpellCheck,_("Spell Checker"),wxBITMAP(spellcheck_toolbutton),_("Open Spell checker")); +#endif Toolbar->AddSeparator(); // Misc @@ -250,12 +252,12 @@ void FrameMain::InitMenu() { AppendBitmapMenuItem(editMenu,Menu_Edit_Cut, _("Cut Lines\t") + Hotkeys.GetText(_T("Cut")), _("Cut subtitles"), wxBITMAP(cut_button)); AppendBitmapMenuItem(editMenu,Menu_Edit_Copy, _("Copy Lines\t") + Hotkeys.GetText(_T("Copy")), _("Copy subtitles"), wxBITMAP(copy_button)); AppendBitmapMenuItem(editMenu,Menu_Edit_Paste, _("Paste Lines\t") + Hotkeys.GetText(_T("Paste")), _("Paste subtitles"), wxBITMAP(paste_button)); - AppendBitmapMenuItem(editMenu,Menu_Edit_Paste_Over, _("Paste Lines Over...\t") + Hotkeys.GetText(_T("Paste Over")) , _("Paste subtitles over others"),wxBITMAP(blank_button)); - AppendBitmapMenuItem(editMenu,Menu_Edit_Delete, _("Delete Lines\t") + Hotkeys.GetText(_T("Grid Delete Rows")), _("Delete selected lines"), wxBITMAP(blank_button)); + AppendBitmapMenuItem(editMenu,Menu_Edit_Paste_Over, _("Paste Lines Over...\t") + Hotkeys.GetText(_T("Paste Over")) , _("Paste subtitles over others"),wxBITMAP(paste_over_button)); + AppendBitmapMenuItem(editMenu,Menu_Edit_Delete, _("Delete Lines\t") + Hotkeys.GetText(_T("Grid Delete Rows")), _("Delete selected lines"), wxBITMAP(delete_button)); editMenu->AppendSeparator(); AppendBitmapMenuItem(editMenu,Menu_Edit_Find, _("&Find...\t") + Hotkeys.GetText(_T("Find")), _("Find words in subtitles"),wxBITMAP(find_button)); - AppendBitmapMenuItem(editMenu,Menu_Edit_Find_Next, _("Find Next\t") + Hotkeys.GetText(_T("Find Next")), _("Find next match of last word"),wxBITMAP(blank_button)); - AppendBitmapMenuItem(editMenu,Menu_Edit_Replace, _("Search and &Replace...\t") + Hotkeys.GetText(_T("Replace")) , _("Find and replace words in subtitles"),wxBITMAP(blank_button)); + AppendBitmapMenuItem(editMenu,Menu_Edit_Find_Next, _("Find Next\t") + Hotkeys.GetText(_T("Find Next")), _("Find next match of last word"),wxBITMAP(find_next_button)); + AppendBitmapMenuItem(editMenu,Menu_Edit_Replace, _("Search and &Replace...\t") + Hotkeys.GetText(_T("Replace")) , _("Find and replace words in subtitles"),wxBITMAP(replace_button)); MenuBar->Append(editMenu, _("&Edit")); // Create subtitles menu @@ -296,7 +298,9 @@ void FrameMain::InitMenu() { AppendBitmapMenuItem (subtitlesMenu,Menu_Tools_Translation, _("&Translation Assistant..."),_("Open translation assistant"), wxBITMAP(translation_toolbutton)); AppendBitmapMenuItem (subtitlesMenu,Menu_Tools_Resample,_("Resample resolution..."), _("Changes resolution and modifies subtitles to conform to change"), wxBITMAP(resample_toolbutton)); AppendBitmapMenuItem (subtitlesMenu,Menu_Tools_Fonts_Collector, _("&Fonts Collector..."),_("Open fonts collector"), wxBITMAP(font_collector_button)); +#if USE_HUNSPELL == 1 AppendBitmapMenuItem (subtitlesMenu,Menu_Tools_SpellCheck, _("Spe&ll checker..."),_("Open spell checker"), wxBITMAP(spellcheck_toolbutton)); +#endif MenuBar->Append(subtitlesMenu, _("&Subtitles")); // Create timing menu diff --git a/core/mythes.cxx b/core/mythes.cxx index b35d2ae30..a1654c34b 100644 --- a/core/mythes.cxx +++ b/core/mythes.cxx @@ -38,11 +38,26 @@ #include #include #include - +#include "setup.h" #include "mythes.hxx" // some basic utility routines +#if USE_HUNSPELL == 0 +// string duplication routine +char * mystrdup(const char * p) +{ + + int sl = strlen(p) + 1; + char * d = (char *)malloc(sl); + if (d) { + memcpy(d,p,sl); + return d; + } + return NULL; +} +#endif + // return index of char in string int mystr_indexOfChar(const char * d, int c) @@ -53,6 +68,17 @@ int mystr_indexOfChar(const char * d, int c) } +// remove cross-platform text line end characters +#if USE_HUNSPELL == 0 +void mychomp(char * s) +{ + int k = strlen(s); + if ((k > 0) && ((*(s+k-1)=='\r') || (*(s+k-1)=='\n'))) *(s+k-1) = '\0'; + if ((k > 1) && (*(s+k-2) == '\r')) *(s+k-2) = '\0'; +} +#endif + + MyThes::MyThes(const char* idxpath, const char * datpath) { nw = 0; diff --git a/core/res.rc b/core/res.rc index 97e9d345c..26a67740c 100644 --- a/core/res.rc +++ b/core/res.rc @@ -69,6 +69,7 @@ snap_subs_to_scene BITMAP "bitmaps/snap_to_scene.bmp" snap_subs_to_scene_disable BITMAP "bitmaps/snap_to_scene_disable.bmp" copy_button BITMAP "bitmaps/copy.bmp" paste_button BITMAP "bitmaps/paste.bmp" +paste_over_button BITMAP "bitmaps/paste_over.bmp" cut_button BITMAP "bitmaps/cut.bmp" undo_button BITMAP "bitmaps/undo.bmp" redo_button BITMAP "bitmaps/redo.bmp" @@ -79,6 +80,9 @@ undo_disable_button BITMAP "bitmaps/undo_disable.bmp" redo_disable_button BITMAP "bitmaps/redo_disable.bmp" irc_button BITMAP "bitmaps/irc.bmp" find_button BITMAP "bitmaps/find.bmp" +find_next_button BITMAP "bitmaps/find_next.bmp" +replace_button BITMAP "bitmaps/replace.bmp" +delete_button BITMAP "bitmaps/delete.bmp" null_button BITMAP "bitmaps/null_button.bmp" select_visible_button BITMAP "bitmaps/select_visible.bmp" toggle_tag_hiding BITMAP "bitmaps/toggle_tag_hiding.bmp"