Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
bjakja committed Aug 3, 2021
1 parent cac5c59 commit c92ee77
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 55 deletions.
17 changes: 4 additions & 13 deletions Kaiplayer/EditBox.cpp
Expand Up @@ -1171,8 +1171,6 @@ void EditBox::DoTooltips()
TlMode->SetToolTip(_("Tryb tłumacza wyświetla i zapisuje zarówno tekst obcojęzyczny, jak i tekst tłumaczenia"));
Bcpall->SetToolTip(_("Kopiuje cały tekst obcojęzyczny do pola z tłumaczeniem"));
Bcpsel->SetToolTip(_("Kopiuje zaznaczony tekst obcojęzyczny do pola z tłumaczeniem"));
//TextEdit->SetToolTip(_("Tekst linijki / tekst tłumaczenia, gdy tryb tłumacza jest włączony."));
//TextEditOrig->SetToolTip(_("tekst obcojęzyczny."));
Comment->SetToolTip(_("Ustawia linijkę jako komentarz. Komentarze nie są wyświetlane"));
LayerEdit->SetToolTip(_("Warstwa linijki, wyższe warstwy są na wierzchu"));
StartEdit->SetToolTip(_("Czas początkowy linijki"));
Expand Down Expand Up @@ -1457,7 +1455,8 @@ void EditBox::OnPasteDifferents(wxCommandEvent& event)

void EditBox::OnEdit(wxCommandEvent& event)
{
//subs preview will switch grid to preview grid that's why we need to change its video, we dont want to change subtitles
//subs preview will switch grid to preview grid that's
//why we need to change its video, we dont want to change subtitles
bool startEndFocus = StartEdit->HasFocus() || EndEdit->HasFocus();
bool durFocus = DurEdit->HasFocus();

Expand Down Expand Up @@ -1562,27 +1561,21 @@ void EditBox::OnColorChange(ColorEvent& event)
PutTagInText(L"\\" + colorNumber + L"c" + choosenColorAsString + L"&",
L"\\" + colorNumber + L"c" + actualColorstr + L"&", false);
}
//else if (found)
//PutTagInText(L"", L"", false);

if (found = FindTag(L"(" + colorNumber + L"a&|alpha.*)", L"", 0, true)){
GetTextResult(&colorString);
if (!colorString.StartsWith(colorNumber + L"a&")){
//colorString = colorString.Mid(5);
wxPoint pos = GetPositionInText();
pos.y++;
pos.x = pos.y;
SetPositionInText(pos);
}
//col.SetAlphaString(colorString);
}

if (actualColor.a != choosenColor.a){
PutTagInText(L"\\" + colorNumber + wxString::Format(L"a&H%02X&", choosenColor.a),
L"\\" + colorNumber + wxString::Format(L"a&H%02X&", actualColor.a), false);
}
//else if (found)
//PutTagInText(L"", L"", false);

}
else{ PutinNonass(L"C:" + choosenColorAsString.Mid(2), L"C:([^}]*)"); }
Expand Down Expand Up @@ -1612,7 +1605,8 @@ void EditBox::OnButtonTag(wxCommandEvent& event)
}
if (!found){ findtag = tag.AfterFirst(L'\\'); }
wxString result;
//fn and r do not have number value we have to treat it special \r works good only when return itself as a value
//fn and r do not have number value we have to treat it special
//\r works good only when return itself as a value
//we did not need this value at all.
bool isFN = findtag.StartsWith(L"fn");
bool isR = findtag.StartsWith(L"r");
Expand Down Expand Up @@ -2158,9 +2152,6 @@ bool EditBox::SetFont(const wxFont &font)
MarginREdit->SetMinSize(wxSize(fw, fh));
MarginVEdit->SetMinSize(wxSize(fw, fh));

/*if (ABox){
ABox->Layout();
}*/
Layout();
return true;
}
43 changes: 1 addition & 42 deletions Kaiplayer/Videobox.cpp
Expand Up @@ -1447,53 +1447,14 @@ void VideoCtrl::ChangeStream()

}

//BOOL CALLBACK MonitorEnumProc(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData)
//{
// std::vector<RECT> * MonRects = (std::vector<RECT>*)dwData;
// WinStruct<MONITORINFO> monitorinfo;
// if (!GetMonitorInfo(hMonitor, &monitorinfo)){
// KaiLog(_("Nie można pobrać informacji o monitorze"));
// return TRUE;
// }
// // Main monitor have to be put as first
// if (monitorinfo.dwFlags == MONITORINFOF_PRIMARY){
// MonRects->insert(MonRects->begin(), monitorinfo.rcMonitor);
// return TRUE;
// }
// MonRects->push_back(monitorinfo.rcMonitor);
// return TRUE;
//}
//
//wxRect VideoCtrl::GetMonitorRect(int wmonitor){
// MonRects.clear();
// EnumDisplayMonitors(NULL, NULL, MonitorEnumProc, (LPARAM)&MonRects);
// wxRect rt(MonRects[0].left, MonRects[0].top, abs(MonRects[0].right - MonRects[0].left), abs(MonRects[0].bottom - MonRects[0].top));
// if (wmonitor == -1 || MonRects.size() == 1){ return rt; }
// else if (wmonitor == 0){
// wxRect rect = Kai->GetRect();
// int x = (rect.width / 2) + rect.x;
// int y = (rect.height / 2) + rect.y;
// for (size_t i = 0; i < MonRects.size(); i++){
// if (MonRects[i].left <= x && x < MonRects[i].right && MonRects[i].top <= y && y < MonRects[i].bottom){
// return wxRect(MonRects[i].left, MonRects[i].top, abs(MonRects[i].right - MonRects[i].left), abs(MonRects[i].bottom - MonRects[i].top));
// }
// }
// }
// else{
// return wxRect(MonRects[wmonitor].left, MonRects[wmonitor].top, abs(MonRects[wmonitor].right - MonRects[wmonitor].left), abs(MonRects[wmonitor].bottom - MonRects[wmonitor].top));
// }
// return rt;
//}

void VideoCtrl::OnChangeVisual(wxCommandEvent &evt)
{
if (!renderer)
return;

EditBox *eb = tab->Edit;
int vis = evt.GetInt();
//VideoToolbar *vTB = (m_IsFullscreen && m_FullScreenWindow) ? m_FullScreenWindow->vToolbar : m_VideoToolbar;


if (vis == eb->Visual){ return; }
if (vis == 0){
renderer->RemoveVisual();
Expand All @@ -1502,8 +1463,6 @@ void VideoCtrl::OnChangeVisual(wxCommandEvent &evt)
if (renderer->m_HasZoom){ renderer->SetZoom(); }
eb->Visual = vis;
renderer->SetVisual();
//if (vis >= VECTORCLIP || (vis >= CHANGEPOS && vis <= ROTATEXY) ){
//renderer->VisualChangeTool(vTB->GetItemToggled()); }
if (!HasArrow()){ SetCursor(wxCURSOR_ARROW); }
SetFocus();
}
Expand Down

0 comments on commit c92ee77

Please sign in to comment.