Add the selection controller to the context

Originally committed to SVN as r5210.
This commit is contained in:
Thomas Goyne 2011-01-16 07:17:02 +00:00
parent 8544565c0e
commit 169d3cd31c
2 changed files with 7 additions and 0 deletions

View File

@ -140,6 +140,9 @@ FrameMain::FrameMain (wxArrayString args)
context->audioController->AddAudioOpenListener(&FrameMain::OnAudioOpen, this); context->audioController->AddAudioOpenListener(&FrameMain::OnAudioOpen, this);
context->audioController->AddAudioCloseListener(&FrameMain::OnAudioClose, this); context->audioController->AddAudioCloseListener(&FrameMain::OnAudioClose, this);
// Initialized later due to that the selection controller is currently the subtitles grid
context->selectionController = 0;
context->videoController = VideoContext::Get(); // derp context->videoController = VideoContext::Get(); // derp
context->videoController->audio = context->audioController; context->videoController->audio = context->audioController;
context->videoController->AddVideoOpenListener(&FrameMain::OnVideoOpen, this); context->videoController->AddVideoOpenListener(&FrameMain::OnVideoOpen, this);
@ -294,6 +297,7 @@ void FrameMain::InitContents() {
StartupLog("Create subtitles grid"); StartupLog("Create subtitles grid");
context->subsGrid = SubsGrid = new SubtitlesGrid(this,Panel,-1,context->ass,wxDefaultPosition,wxSize(600,100),wxWANTS_CHARS | wxSUNKEN_BORDER,"Subs grid"); context->subsGrid = SubsGrid = new SubtitlesGrid(this,Panel,-1,context->ass,wxDefaultPosition,wxSize(600,100),wxWANTS_CHARS | wxSUNKEN_BORDER,"Subs grid");
context->selectionController = context->subsGrid;
context->videoBox->videoSlider->grid = SubsGrid; context->videoBox->videoSlider->grid = SubsGrid;
context->videoController->grid = SubsGrid; context->videoController->grid = SubsGrid;
Search.grid = SubsGrid; Search.grid = SubsGrid;

View File

@ -1,8 +1,10 @@
class AssFile; class AssFile;
class AudioBox; class AudioBox;
class AudioController; class AudioController;
class AssDialogue;
class DialogDetachedVideo; class DialogDetachedVideo;
class DialogStyling; class DialogStyling;
template<class T> class SelectionController;
class SubsEditBox; class SubsEditBox;
class SubtitlesGrid; class SubtitlesGrid;
class VideoBox; class VideoBox;
@ -19,6 +21,7 @@ struct Context {
// Controllers // Controllers
AudioController *audioController; AudioController *audioController;
SelectionController<AssDialogue> *selectionController;
VideoContext *videoController; VideoContext *videoController;
// Things that should probably be in some sort of UI-context-model // Things that should probably be in some sort of UI-context-model