From b823bfdc99ae35f1ae2f65ed1fe84b71e11990ba Mon Sep 17 00:00:00 2001 From: Rodrigo Braz Monteiro Date: Tue, 21 Feb 2006 21:23:52 +0000 Subject: [PATCH] Inserted lines will now be automatically selected Originally committed to SVN as r97. --- core/changelog.txt | 1 + core/options.cpp | 43 +++++++++++++++++++++++++++++++------------ core/subs_grid.cpp | 8 ++++++++ 3 files changed, 40 insertions(+), 12 deletions(-) diff --git a/core/changelog.txt b/core/changelog.txt index 27a30c60b..762393f92 100644 --- a/core/changelog.txt +++ b/core/changelog.txt @@ -26,6 +26,7 @@ Please visit http://aegisub.net to download latest version o Rows colliding with the currently active one will now be highlighted in grid. o Selected comments are now highlighted in a different color. o Fixed behavior of deleting and joining lines on grid. + o Inserted lines will now be automatically selected. - Toolbar will now properly disable the Jump To buttons if more than one line is selected. (AMZ) - Fixed the toolbar "grey area" glitch (was actually a wxWidgets issue). (AMZ) - Default video zoom can now be set in config.dat and is defaulted to 100%. (AMZ) diff --git a/core/options.cpp b/core/options.cpp index 574901d18..0806fdcfb 100644 --- a/core/options.cpp +++ b/core/options.cpp @@ -45,6 +45,8 @@ #include "main.h" #include "text_file_reader.h" #include "text_file_writer.h" +#include "colorspace.h" +#include "utils.h" /////////////// @@ -108,18 +110,35 @@ void OptionsManager::LoadDefaults() { SetInt(_T("Find Affect"),0); SetInt(_T("Find Field"),0); - SetColour(_T("Grid standard foreground"),wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT)); - SetColour(_T("Grid selection background"),wxColour(206,255,231)); - SetColour(_T("Grid selection foreground"),wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT)); - SetColour(_T("Grid comment background"),wxColour(216,222,245)); - SetColour(_T("Grid collision foreground"),wxColour(255,0,0)); - SetColour(_T("Grid selected comment background"),wxColour(211,238,238)); - SetColour(_T("Grid inframe background"),wxColour(255,253,234)); - SetColour(_T("Grid background"),wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); - SetColour(_T("Grid header"),wxColour(165,207,231)); - SetColour(_T("Grid left column"),wxColour(196,236,201)); - SetColour(_T("Grid active border"),wxColour(255,91,239)); - SetColour(_T("Grid lines"),wxColour(128,128,128)); + // Generate colors + wxColour tempCol = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW); + float r = tempCol.Red() / 255.0; + float g = tempCol.Green() / 255.0; + float b = tempCol.Blue() / 255.0; + wxColour textCol = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT); + wxColour background = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW); + wxColour comment = wxColour(216,222,245); + wxColour selection = wxColour(206,255,231); + wxColour selComment = wxColour(211,238,238); + wxColour header = wxColour(165,207,231); + wxColour labels = wxColour(196,236,201); + wxColour inframe = wxColour(255,253,234); + wxColour active = wxColour(255,91,239); + wxColour grid = wxColour(128,128,128); + wxColour collision = wxColour(255,0,0); + + SetColour(_T("Grid standard foreground"),textCol); + SetColour(_T("Grid selection background"),selection); + SetColour(_T("Grid selection foreground"),textCol); + SetColour(_T("Grid comment background"),comment); + SetColour(_T("Grid collision foreground"),collision); + SetColour(_T("Grid selected comment background"),selComment); + SetColour(_T("Grid inframe background"),inframe); + SetColour(_T("Grid background"),background); + SetColour(_T("Grid header"),header); + SetColour(_T("Grid left column"),labels); + SetColour(_T("Grid active border"),active); + SetColour(_T("Grid lines"),grid); SetInt(_T("Grid hide overrides"),1); wchar_t temp = 0x2600; diff --git a/core/subs_grid.cpp b/core/subs_grid.cpp index b06979b7e..f4317cb19 100644 --- a/core/subs_grid.cpp +++ b/core/subs_grid.cpp @@ -483,6 +483,8 @@ void SubtitlesGrid::OnInsertBefore (wxCommandEvent &event) { // Insert it InsertLine(def,n,false); + SelectRow(n); + editBox->SetToLine(n); } @@ -515,6 +517,8 @@ void SubtitlesGrid::OnInsertAfter (wxCommandEvent &event) { // Insert it InsertLine(def,n,true); + SelectRow(n+1); + editBox->SetToLine(n+1); } @@ -540,6 +544,8 @@ void SubtitlesGrid::OnInsertBeforeVideo (wxCommandEvent &event) { // Insert it InsertLine(def,n,false); + SelectRow(n); + editBox->SetToLine(n); } @@ -565,6 +571,8 @@ void SubtitlesGrid::OnInsertAfterVideo (wxCommandEvent &event) { // Insert it InsertLine(def,n,true); + SelectRow(n+1); + editBox->SetToLine(n+1); }