forked from mia/Aegisub
Make global hotkeys work when the detached video dialog is focused.
Originally committed to SVN as r3675.
This commit is contained in:
parent
c0364b7be1
commit
75f010f889
2 changed files with 11 additions and 32 deletions
|
@ -34,9 +34,6 @@
|
||||||
/// @ingroup main_ui
|
/// @ingroup main_ui
|
||||||
///
|
///
|
||||||
|
|
||||||
|
|
||||||
///////////
|
|
||||||
// Headers
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#ifndef AGI_PRE
|
#ifndef AGI_PRE
|
||||||
|
@ -53,14 +50,11 @@
|
||||||
|
|
||||||
|
|
||||||
/// @brief Constructor
|
/// @brief Constructor
|
||||||
/// @param par
|
/// @param par FrameMain this was spawned from
|
||||||
/// @param initialDisplaySize
|
/// @param initialDisplaySize Initial size of the window
|
||||||
///
|
|
||||||
DialogDetachedVideo::DialogDetachedVideo(FrameMain *par, const wxSize &initialDisplaySize)
|
DialogDetachedVideo::DialogDetachedVideo(FrameMain *par, const wxSize &initialDisplaySize)
|
||||||
//: wxFrame(par,-1,_("Detached Video"))
|
|
||||||
: wxDialog(par,-1,_T("Detached Video"),wxDefaultPosition,wxSize(400,300),wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxMAXIMIZE_BOX | wxMINIMIZE_BOX | wxWANTS_CHARS)
|
: wxDialog(par,-1,_T("Detached Video"),wxDefaultPosition,wxSize(400,300),wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxMAXIMIZE_BOX | wxMINIMIZE_BOX | wxWANTS_CHARS)
|
||||||
{
|
{
|
||||||
// Set parent
|
|
||||||
parent = par;
|
parent = par;
|
||||||
|
|
||||||
// Set up window
|
// Set up window
|
||||||
|
@ -100,19 +94,18 @@ DialogDetachedVideo::DialogDetachedVideo(FrameMain *par, const wxSize &initialDi
|
||||||
parent->SetDisplayMode(0,-1);
|
parent->SetDisplayMode(0,-1);
|
||||||
Options.SetBool(_T("Detached video"),true);
|
Options.SetBool(_T("Detached video"),true);
|
||||||
Options.Save();
|
Options.Save();
|
||||||
|
|
||||||
|
// Copy the main accelerator table to this dialog
|
||||||
|
wxAcceleratorTable *table = par->GetAcceleratorTable();
|
||||||
|
SetAcceleratorTable(*table);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// @brief Destructor
|
/// @brief Destructor
|
||||||
///
|
|
||||||
DialogDetachedVideo::~DialogDetachedVideo() {
|
DialogDetachedVideo::~DialogDetachedVideo() {
|
||||||
Options.SetBool(_T("Detached video maximized"),IsMaximized());
|
Options.SetBool(_T("Detached video maximized"),IsMaximized());
|
||||||
Options.Save();
|
Options.Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////
|
|
||||||
// Event table
|
// Event table
|
||||||
BEGIN_EVENT_TABLE(DialogDetachedVideo,wxDialog)
|
BEGIN_EVENT_TABLE(DialogDetachedVideo,wxDialog)
|
||||||
EVT_CLOSE(DialogDetachedVideo::OnClose)
|
EVT_CLOSE(DialogDetachedVideo::OnClose)
|
||||||
|
@ -120,9 +113,8 @@ BEGIN_EVENT_TABLE(DialogDetachedVideo,wxDialog)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
/// @brief Close window
|
/// @brief Close window
|
||||||
/// @param event
|
/// @param event UNUSED
|
||||||
///
|
void DialogDetachedVideo::OnClose(wxCloseEvent &WXUNUSED(event)) {
|
||||||
void DialogDetachedVideo::OnClose(wxCloseEvent &event) {
|
|
||||||
FrameMain *par = parent;
|
FrameMain *par = parent;
|
||||||
Options.SetBool(_T("Detached video"),false);
|
Options.SetBool(_T("Detached video"),false);
|
||||||
Destroy();
|
Destroy();
|
||||||
|
@ -130,15 +122,10 @@ void DialogDetachedVideo::OnClose(wxCloseEvent &event) {
|
||||||
par->SetDisplayMode(-1,-1);
|
par->SetDisplayMode(-1,-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// @brief Move window
|
/// @brief Move window
|
||||||
/// @param event
|
/// @param event
|
||||||
///
|
|
||||||
void DialogDetachedVideo::OnMove(wxMoveEvent &event) {
|
void DialogDetachedVideo::OnMove(wxMoveEvent &event) {
|
||||||
wxPoint pos = event.GetPosition();
|
wxPoint pos = event.GetPosition();
|
||||||
Options.SetInt(_T("Detached video last x"),pos.x);
|
Options.SetInt(_T("Detached video last x"),pos.x);
|
||||||
Options.SetInt(_T("Detached video last y"),pos.y);
|
Options.SetInt(_T("Detached video last y"),pos.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -34,20 +34,14 @@
|
||||||
/// @ingroup main_ui
|
/// @ingroup main_ui
|
||||||
///
|
///
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef AGI_PRE
|
#ifndef AGI_PRE
|
||||||
#include <wx/dialog.h>
|
#include <wx/dialog.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//////////////
|
|
||||||
// Prototypes
|
|
||||||
class VideoBox;
|
class VideoBox;
|
||||||
class FrameMain;
|
class FrameMain;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// DOCME
|
/// DOCME
|
||||||
/// @class DialogDetachedVideo
|
/// @class DialogDetachedVideo
|
||||||
/// @brief DOCME
|
/// @brief DOCME
|
||||||
|
@ -71,5 +65,3 @@ public:
|
||||||
|
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue