forked from mia/Aegisub
Fixed fonts collector and translation dialogue syntax highlighting.
Originally committed to SVN as r2433.
This commit is contained in:
parent
db121de7b6
commit
780e3b566c
3 changed files with 8 additions and 6 deletions
|
@ -54,6 +54,7 @@
|
|||
#include "font_file_lister.h"
|
||||
#include "utils.h"
|
||||
#include "help_button.h"
|
||||
#include "scintilla_text_ctrl.h"
|
||||
|
||||
|
||||
///////
|
||||
|
@ -114,7 +115,7 @@ DialogFontsCollector::DialogFontsCollector(wxWindow *parent)
|
|||
CollectAction->SetSelection(lastAction);
|
||||
|
||||
// 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->SetMarginWidth(1,0);
|
||||
LogBox->SetReadOnly(true);
|
||||
|
@ -334,11 +335,11 @@ void DialogFontsCollector::Update(int value) {
|
|||
void DialogFontsCollector::OnAddText(wxCommandEvent &event) {
|
||||
ColourString *str = (ColourString*) event.GetClientData();
|
||||
LogBox->SetReadOnly(false);
|
||||
int pos = LogBox->GetLength();
|
||||
int pos = LogBox->GetReverseUnicodePosition(LogBox->GetLength());
|
||||
LogBox->AppendText(str->text);
|
||||
if (str->colour) {
|
||||
LogBox->StartStyling(pos,31);
|
||||
LogBox->SetStyling(str->text.Length(),str->colour);
|
||||
LogBox->StartUnicodeStyling(pos,31);
|
||||
LogBox->SetUnicodeStyling(pos,str->text.Length(),str->colour);
|
||||
}
|
||||
delete str;
|
||||
LogBox->GotoPos(pos);
|
||||
|
|
|
@ -50,6 +50,7 @@ class AssOverrideParameter;
|
|||
class DialogFontsCollector;
|
||||
class FrameMain;
|
||||
class wxZipOutputStream;
|
||||
class ScintillaTextCtrl;
|
||||
|
||||
|
||||
/////////////////
|
||||
|
@ -93,7 +94,7 @@ class DialogFontsCollector : public wxDialog {
|
|||
|
||||
private:
|
||||
wxTextCtrl *DestBox;
|
||||
wxStyledTextCtrl *LogBox;
|
||||
ScintillaTextCtrl *LogBox;
|
||||
wxButton *BrowseButton;
|
||||
wxButton *StartButton;
|
||||
wxButton *CloseButton;
|
||||
|
|
|
@ -216,7 +216,7 @@ bool DialogTranslation::JumpToLine(int n,int block) {
|
|||
curBlock = *cur;
|
||||
if (curBlock->GetType() == BLOCK_PLAIN) {
|
||||
pos++;
|
||||
int curLen = OrigText->GetUnicodePosition(OrigText->GetLength());
|
||||
int curLen = OrigText->GetReverseUnicodePosition(OrigText->GetLength());
|
||||
OrigText->AppendText(curBlock->text);
|
||||
if (pos == block) {
|
||||
OrigText->StartUnicodeStyling(curLen);
|
||||
|
|
Loading…
Reference in a new issue