Rows colliding with the currently active one will now be highlighted in grid
Originally committed to SVN as r86.
This commit is contained in:
parent
8ece0ea54f
commit
fd728e90d5
|
@ -281,17 +281,17 @@ void BaseGrid::DrawImage(wxDC &dc) {
|
||||||
|
|
||||||
// Row colors
|
// Row colors
|
||||||
std::vector<wxBrush> rowColors;
|
std::vector<wxBrush> rowColors;
|
||||||
std::vector<wxBrush> foreColors;
|
std::vector<wxColor> foreColors;
|
||||||
rowColors.push_back(wxBrush(wxColour(255,255,255))); // 0 = Standard
|
rowColors.push_back(wxBrush(wxColour(255,255,255))); // 0 = Standard
|
||||||
foreColors.push_back(wxBrush(wxColour(0,0,0)));
|
foreColors.push_back(wxColour(0,0,0));
|
||||||
rowColors.push_back(wxBrush(wxColour(165,207,231))); // 1 = Header
|
rowColors.push_back(wxBrush(wxColour(165,207,231))); // 1 = Header
|
||||||
foreColors.push_back(wxBrush(wxColour(0,0,0)));
|
foreColors.push_back(wxColour(0,0,0));
|
||||||
rowColors.push_back(wxBrush(Options.AsColour(_T("Grid selection background")))); // 2 = Selected
|
rowColors.push_back(wxBrush(Options.AsColour(_T("Grid selection background")))); // 2 = Selected
|
||||||
foreColors.push_back(wxBrush(Options.AsColour(_T("Grid selection foreground"))));
|
foreColors.push_back(Options.AsColour(_T("Grid selection foreground")));
|
||||||
rowColors.push_back(wxBrush(Options.AsColour(_T("Grid comment background")))); // 3 = Commented
|
rowColors.push_back(wxBrush(Options.AsColour(_T("Grid comment background")))); // 3 = Commented
|
||||||
foreColors.push_back(wxBrush(Options.AsColour(_T("Grid selection foreground"))));
|
foreColors.push_back(Options.AsColour(_T("Grid selection foreground")));
|
||||||
rowColors.push_back(wxBrush(Options.AsColour(_T("Grid inframe background")))); // 4 = Video Highlighted
|
rowColors.push_back(wxBrush(Options.AsColour(_T("Grid inframe background")))); // 4 = Video Highlighted
|
||||||
foreColors.push_back(wxBrush(Options.AsColour(_T("Grid selection foreground"))));
|
foreColors.push_back(Options.AsColour(_T("Grid selection foreground")));
|
||||||
|
|
||||||
// First grid row
|
// First grid row
|
||||||
bool drawGrid = true;
|
bool drawGrid = true;
|
||||||
|
@ -313,6 +313,15 @@ void BaseGrid::DrawImage(wxDC &dc) {
|
||||||
dx = 0;
|
dx = 0;
|
||||||
dy = i*lineHeight;
|
dy = i*lineHeight;
|
||||||
|
|
||||||
|
// Check for collisions
|
||||||
|
bool collides = false;
|
||||||
|
if (curDiag) {
|
||||||
|
AssDialogue *sel = GetDialogue(editBox->linen);
|
||||||
|
if (sel && sel != curDiag) {
|
||||||
|
if (curDiag->CollidesWith(sel)) collides = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Text array
|
// Text array
|
||||||
wxArrayString strings;
|
wxArrayString strings;
|
||||||
|
|
||||||
|
@ -356,7 +365,7 @@ void BaseGrid::DrawImage(wxDC &dc) {
|
||||||
int mode = Options.AsInt(_T("Grid Hide Overrides"));
|
int mode = Options.AsInt(_T("Grid Hide Overrides"));
|
||||||
wxString value = _T("");
|
wxString value = _T("");
|
||||||
|
|
||||||
// Hid overrides
|
// Hidden overrides
|
||||||
if (mode == 1 || mode == 2) {
|
if (mode == 1 || mode == 2) {
|
||||||
wxString replaceWith = Options.AsText(_T("Grid hide overrides char"));
|
wxString replaceWith = Options.AsText(_T("Grid hide overrides char"));
|
||||||
curDiag->ParseASSTags();
|
curDiag->ParseASSTags();
|
||||||
|
@ -399,6 +408,12 @@ void BaseGrid::DrawImage(wxDC &dc) {
|
||||||
dc.DrawRectangle((curColor == 1) ? 0 : colWidth[0],i*lineHeight+1,w,lineHeight);
|
dc.DrawRectangle((curColor == 1) ? 0 : colWidth[0],i*lineHeight+1,w,lineHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set text color
|
||||||
|
if (collides) dc.SetTextForeground(wxColour(255,0,0));
|
||||||
|
else {
|
||||||
|
dc.SetTextForeground(foreColors[curColor]);
|
||||||
|
}
|
||||||
|
|
||||||
// Draw text
|
// Draw text
|
||||||
wxRect cur;
|
wxRect cur;
|
||||||
bool isCenter;
|
bool isCenter;
|
||||||
|
@ -417,6 +432,7 @@ void BaseGrid::DrawImage(wxDC &dc) {
|
||||||
dc.DrawLabel(strings[j],cur,isCenter ? wxALIGN_CENTER : (wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT));
|
dc.DrawLabel(strings[j],cur,isCenter ? wxALIGN_CENTER : (wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT));
|
||||||
dx += colWidth[j];
|
dx += colWidth[j];
|
||||||
}
|
}
|
||||||
|
//if (collides) dc.SetPen(wxPen(wxColour(255,0,0)));
|
||||||
|
|
||||||
// Draw grid
|
// Draw grid
|
||||||
dc.DestroyClippingRegion();
|
dc.DestroyClippingRegion();
|
||||||
|
|
|
@ -34,6 +34,7 @@ Please visit http://aegisub.net to download latest version
|
||||||
- Alt+Left/Right on the video seek bar will now seek by increments of 10 frames (increment is customizeable in config.dat) (AMZ)
|
- Alt+Left/Right on the video seek bar will now seek by increments of 10 frames (increment is customizeable in config.dat) (AMZ)
|
||||||
- Added a simple audio resync method for video playback (AMZ)
|
- Added a simple audio resync method for video playback (AMZ)
|
||||||
- Audio timing will now apply to all selected lines, as well as active line (AMZ)
|
- Audio timing will now apply to all selected lines, as well as active line (AMZ)
|
||||||
|
- Rows colliding with the currently active one will now be highlighted in grid (AMZ)
|
||||||
|
|
||||||
|
|
||||||
= 1.09 beta - 2006.01.16 ===========================
|
= 1.09 beta - 2006.01.16 ===========================
|
||||||
|
|
|
@ -106,10 +106,6 @@ SubtitlesGrid::SubtitlesGrid(FrameMain* parentFr, wxWindow *parent, wxWindowID i
|
||||||
int w,h;
|
int w,h;
|
||||||
dc.GetTextExtent(_T("#TWFfgGhH"), &w, &h, NULL, NULL, &font);
|
dc.GetTextExtent(_T("#TWFfgGhH"), &w, &h, NULL, NULL, &font);
|
||||||
RowHeight = h+4;
|
RowHeight = h+4;
|
||||||
|
|
||||||
// Set up
|
|
||||||
//SetSelectionBackground(Options.AsColour(_T("Grid selection background")));
|
|
||||||
//SetSelectionForeground(Options.AsColour(_T("Grid selection foreground")));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue