Fixed fonts collector and translation dialogue syntax highlighting.

Originally committed to SVN as r2433.
This commit is contained in:
Rodrigo Braz Monteiro 2008-11-09 01:18:15 +00:00
parent db121de7b6
commit 780e3b566c
3 changed files with 8 additions and 6 deletions

View File

@ -54,6 +54,7 @@
#include "font_file_lister.h" #include "font_file_lister.h"
#include "utils.h" #include "utils.h"
#include "help_button.h" #include "help_button.h"
#include "scintilla_text_ctrl.h"
/////// ///////
@ -114,7 +115,7 @@ DialogFontsCollector::DialogFontsCollector(wxWindow *parent)
CollectAction->SetSelection(lastAction); CollectAction->SetSelection(lastAction);
// Log box // Log box
LogBox = new wxStyledTextCtrl(this,-1,wxDefaultPosition,wxSize(300,210),0,_T("")); LogBox = new ScintillaTextCtrl(this,-1,_T(""),wxDefaultPosition,wxSize(300,210));
LogBox->SetWrapMode(wxSTC_WRAP_WORD); LogBox->SetWrapMode(wxSTC_WRAP_WORD);
LogBox->SetMarginWidth(1,0); LogBox->SetMarginWidth(1,0);
LogBox->SetReadOnly(true); LogBox->SetReadOnly(true);
@ -334,11 +335,11 @@ void DialogFontsCollector::Update(int value) {
void DialogFontsCollector::OnAddText(wxCommandEvent &event) { void DialogFontsCollector::OnAddText(wxCommandEvent &event) {
ColourString *str = (ColourString*) event.GetClientData(); ColourString *str = (ColourString*) event.GetClientData();
LogBox->SetReadOnly(false); LogBox->SetReadOnly(false);
int pos = LogBox->GetLength(); int pos = LogBox->GetReverseUnicodePosition(LogBox->GetLength());
LogBox->AppendText(str->text); LogBox->AppendText(str->text);
if (str->colour) { if (str->colour) {
LogBox->StartStyling(pos,31); LogBox->StartUnicodeStyling(pos,31);
LogBox->SetStyling(str->text.Length(),str->colour); LogBox->SetUnicodeStyling(pos,str->text.Length(),str->colour);
} }
delete str; delete str;
LogBox->GotoPos(pos); LogBox->GotoPos(pos);

View File

@ -50,6 +50,7 @@ class AssOverrideParameter;
class DialogFontsCollector; class DialogFontsCollector;
class FrameMain; class FrameMain;
class wxZipOutputStream; class wxZipOutputStream;
class ScintillaTextCtrl;
///////////////// /////////////////
@ -93,7 +94,7 @@ class DialogFontsCollector : public wxDialog {
private: private:
wxTextCtrl *DestBox; wxTextCtrl *DestBox;
wxStyledTextCtrl *LogBox; ScintillaTextCtrl *LogBox;
wxButton *BrowseButton; wxButton *BrowseButton;
wxButton *StartButton; wxButton *StartButton;
wxButton *CloseButton; wxButton *CloseButton;

View File

@ -216,7 +216,7 @@ bool DialogTranslation::JumpToLine(int n,int block) {
curBlock = *cur; curBlock = *cur;
if (curBlock->GetType() == BLOCK_PLAIN) { if (curBlock->GetType() == BLOCK_PLAIN) {
pos++; pos++;
int curLen = OrigText->GetUnicodePosition(OrigText->GetLength()); int curLen = OrigText->GetReverseUnicodePosition(OrigText->GetLength());
OrigText->AppendText(curBlock->text); OrigText->AppendText(curBlock->text);
if (pos == block) { if (pos == block) {
OrigText->StartUnicodeStyling(curLen); OrigText->StartUnicodeStyling(curLen);