diff --git a/Kaiplayer/EditBox.cpp b/Kaiplayer/EditBox.cpp index a91885a45..365daaf62 100644 --- a/Kaiplayer/EditBox.cpp +++ b/Kaiplayer/EditBox.cpp @@ -401,7 +401,6 @@ void EditBox::SetLine(int Row, bool setaudio, bool save, bool nochangeline, bool //} done: - VideoCtrl *vb = pan->Video; int pas = vb->vToolbar->videoPlayAfter->GetSelection(); int vsa = vb->vToolbar->videoSeekAfter->GetSelection(); diff --git a/Kaiplayer/KaiTextCtrl.cpp b/Kaiplayer/KaiTextCtrl.cpp index 236f84703..bca85496b 100644 --- a/Kaiplayer/KaiTextCtrl.cpp +++ b/Kaiplayer/KaiTextCtrl.cpp @@ -262,7 +262,7 @@ void KaiTextCtrl::CalcWrap(bool sendevent) positioning.clear(); positioning.Add(0); int w,h,fw=0,fh=0; - GetClientSize(&w,&h); + GetSize(&w,&h); wxMemoryDC dc((bmp) ? *bmp : wxBitmap(10, 10)); dc.SetFont(font); if(KText!="" && multiline){ @@ -274,6 +274,7 @@ void KaiTextCtrl::CalcWrap(bool sendevent) size_t len = KText.Len(); bool seekSpace = true; int mesureSize = w - 10; + if (mesureSize <= 10){ for (int i = 1; i < len; i++){ wraps.Add(i); positioning.Add(5); return; } } int stylewrap = (style & wxALIGN_CENTER_HORIZONTAL) ? 1 : (style & wxALIGN_RIGHT) ? 2 : 0; int pos = 5; while (i < len) @@ -299,6 +300,9 @@ void KaiTextCtrl::CalcWrap(bool sendevent) j--; continue; } + else if (0 >= j - podz + 1){ + j = allwrap = podz + 1; + } //else if (i != j){ // size_t res = KText.find(' ', j); // if (res != -1 && res>podz && res #include #include "KaiMessageBox.h" - +#include "SubsGridPreview.h" bool sortstart(Dialogue *i, Dialogue *j){ @@ -130,9 +130,9 @@ void SubsGridBase::ChangeLine(unsigned char editionType, Dialogue *line1, int wl for (size_t i = 0; i < sels.size(); i++){ ChangeCell(cells, sels[i], line1); } - if (selline){ wline = sels[sels.size() - 1]; } + //if (selline){ wline = sels[sels.size() - 1]; } } - if (wline >= GetCount() - 1 && selline){ + /*if (wline >= GetCount() - 1 && selline){ Dialogue *tmp = new Dialogue(); tmp->State = 1; int eend = line1->End.mstime; @@ -156,9 +156,14 @@ void SubsGridBase::ChangeLine(unsigned char editionType, Dialogue *line1, int wl Refresh(false); if (selline){ Edit->SetLine(lastRow, true, true, false, true); + }*/ + AdjustWidths(cells); + if (selline) + NextLine(); + else{ + Refresh(false); } SetModified(editionType, false, dummy); - } void SubsGridBase::ChangeCell(long wcell, int wline, Dialogue *what) @@ -677,7 +682,7 @@ void SubsGridBase::ChangeTimes(bool byFrame) for (auto cur = tmpmap.begin(); cur != tmpmap.end(); cur++){ auto it = cur; - dialc = cur->first;//file->GetDialogue(cur->second); + dialc = cur->first; it++; if (!(it != tmpmap.end())){ it = cur; hasend = true; } if (correctEndTimes > 0 && dialc->End > it->first->Start && !hasend){ @@ -1366,12 +1371,6 @@ bool SubsGridBase::SetTlMode(bool mode) SpellErrors.clear(); Refresh(false); SetModified((mode) ? GRID_TURN_ON_TLMODE : GRID_TURN_OFF_TLMODE); - //VideoCtrl *vb = ((TabPanel*)GetParent())->Video; - //if(vb->GetState()!=None){ - // vb->OpenSubs(GetVisible()/*SaveText()*/); - // if(vb->GetState()==Paused){vb->Render();} - // Edit->OnVideo=true; - //} return false; } @@ -1391,6 +1390,8 @@ void SubsGridBase::NextLine(int dir) tmp->TextTl = ""; AddLine(tmp); SetModified(GRID_APPEND_LINE, false); + if(subsFormat>TMP) + AdjustWidths(START|END); } int h, w; GetClientSize(&w, &h); @@ -1398,11 +1399,12 @@ void SubsGridBase::NextLine(int dir) file->ClearSelections(); file->InsertSelection(nebrow); lastRow = nebrow; - AdjustWidths(0); + //AdjustWidths(0); Refresh(false); Edit->SetLine(nebrow, true, true, false, true); - //if(Edit->ABox){Edit->ABox->audioDisplay->SetDialogue(Edit->line,nebrow);} - + SubsGrid *grid = (SubsGrid*)this; + if (Comparison){ grid->ShowSecondComparedLine(nebrow); } + else if (grid->preview){ grid->preview->NewSeeking(); } } @@ -1424,8 +1426,6 @@ void SubsGridBase::LoadDefault(bool line, bool sav, bool endload) AddSInfo("ScriptType", "v4.00+", sav); AddSInfo("Last Style Storage", "Default", sav); AddSInfo("YCbCr Matrix", "TV.601", sav); - //Kai->Toolbar->UpdateId(SaveSubs, false); - //Kai->Menubar->Enable(SaveSubs, false); if (endload){ file->EndLoad(NEW_SUBTITLES, 0); } diff --git a/Kaiplayer/SubsGridWindow.cpp b/Kaiplayer/SubsGridWindow.cpp index 198c19ba7..7100b6e6b 100644 --- a/Kaiplayer/SubsGridWindow.cpp +++ b/Kaiplayer/SubsGridWindow.cpp @@ -1048,6 +1048,8 @@ void SubsGridWindow::OnKeyPress(wxKeyEvent &event) { else{ ScrollTo(next); } + if (Comparison){ ShowSecondComparedLine(next); } + else if (preview){ preview->NewSeeking(); } lastRow = next; //return; } diff --git a/Kaiplayer/SubsGridWindow.h b/Kaiplayer/SubsGridWindow.h index 10ecb8128..9f3c72105 100644 --- a/Kaiplayer/SubsGridWindow.h +++ b/Kaiplayer/SubsGridWindow.h @@ -39,6 +39,8 @@ class SubsGridWindow : public SubsGridBase void SelVideoLine(int time = -1); void SetStyle(); void SetVideoLineTime(wxMouseEvent &evt); + void ShowSecondComparedLine(int Line, bool showPreview = false, bool fromPreview = false); + SubsGridPreview *preview = NULL; protected: void OnKeyPress(wxKeyEvent &event); @@ -47,7 +49,6 @@ class SubsGridWindow : public SubsGridBase void OnScroll(wxScrollWinEvent& event); void OnSize(wxSizeEvent& event); void OnLostCapture(wxMouseCaptureLostEvent &evt){ if (HasCapture()){ ReleaseMouse(); } holding = false; }; - void ShowSecondComparedLine(int Line, bool showPreview = false, bool fromPreview = false); bool ShowPreviewWindow(SubsGrid *previewGrid, SubsGrid *windowToDraw, int activeLine, int diffPosition); int GridWidth[13]; @@ -61,7 +62,6 @@ class SubsGridWindow : public SubsGridBase wxBitmap* bmp; wxFont font; - SubsGridPreview *preview = NULL; SubsGridPreview *thisPreview = NULL; private: virtual void ContextMenu(const wxPoint &pos, bool dummy = false){}; diff --git a/Kaiplayer/VersionKainote.h b/Kaiplayer/VersionKainote.h index a6cbcff85..64717c1d0 100644 --- a/Kaiplayer/VersionKainote.h +++ b/Kaiplayer/VersionKainote.h @@ -16,5 +16,5 @@ // This file is for automatic build change // Autoversioning.exe change it after build using commandline -#define VersionKainote "0.9.2.855" -#define NumVersionKainote 0,9,2,855 +#define VersionKainote "0.9.2.858" +#define NumVersionKainote 0,9,2,858 diff --git a/Kaiplayer/VideoFullscreen.cpp b/Kaiplayer/VideoFullscreen.cpp index 7eda2b5d0..2cdde10b2 100644 --- a/Kaiplayer/VideoFullscreen.cpp +++ b/Kaiplayer/VideoFullscreen.cpp @@ -100,7 +100,7 @@ void Fullscreen::OnSize() vslider->SetSize(wxSize(asize.x,14)); if(vc->IsDshow){volslider->Show(); volslider->SetPosition(wxPoint(asize.x-110,17));} else{volslider->Show(false);} - Videolabel->SetSize(asize.x-114,-1); + Videolabel->SetSize(asize.x-758,-1); if(vToolbar->IsShown()){vToolbar->SetSize(asize.x, 22);} panel->SetSize(0, asize.y - panelsize, asize.x, panelsize); } \ No newline at end of file