Make global hotkeys work when the detached video dialog is focused.

Originally committed to SVN as r3675.
This commit is contained in:
Thomas Goyne 2009-10-10 15:05:17 +00:00
parent c0364b7be1
commit 75f010f889
2 changed files with 11 additions and 32 deletions

View file

@ -34,9 +34,6 @@
/// @ingroup main_ui
///
///////////
// Headers
#include "config.h"
#ifndef AGI_PRE
@ -53,14 +50,11 @@
/// @brief Constructor
/// @param par
/// @param initialDisplaySize
///
/// @param par FrameMain this was spawned from
/// @param initialDisplaySize Initial size of the window
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)
{
// Set parent
parent = par;
// Set up window
@ -100,19 +94,18 @@ DialogDetachedVideo::DialogDetachedVideo(FrameMain *par, const wxSize &initialDi
parent->SetDisplayMode(0,-1);
Options.SetBool(_T("Detached video"),true);
Options.Save();
// Copy the main accelerator table to this dialog
wxAcceleratorTable *table = par->GetAcceleratorTable();
SetAcceleratorTable(*table);
}
/// @brief Destructor
///
DialogDetachedVideo::~DialogDetachedVideo() {
Options.SetBool(_T("Detached video maximized"),IsMaximized());
Options.Save();
}
///////////////
// Event table
BEGIN_EVENT_TABLE(DialogDetachedVideo,wxDialog)
EVT_CLOSE(DialogDetachedVideo::OnClose)
@ -120,9 +113,8 @@ BEGIN_EVENT_TABLE(DialogDetachedVideo,wxDialog)
END_EVENT_TABLE()
/// @brief Close window
/// @param event
///
void DialogDetachedVideo::OnClose(wxCloseEvent &event) {
/// @param event UNUSED
void DialogDetachedVideo::OnClose(wxCloseEvent &WXUNUSED(event)) {
FrameMain *par = parent;
Options.SetBool(_T("Detached video"),false);
Destroy();
@ -130,15 +122,10 @@ void DialogDetachedVideo::OnClose(wxCloseEvent &event) {
par->SetDisplayMode(-1,-1);
}
/// @brief Move window
/// @param event
///
void DialogDetachedVideo::OnMove(wxMoveEvent &event) {
wxPoint pos = event.GetPosition();
Options.SetInt(_T("Detached video last x"),pos.x);
Options.SetInt(_T("Detached video last y"),pos.y);
}

View file

@ -34,20 +34,14 @@
/// @ingroup main_ui
///
#ifndef AGI_PRE
#include <wx/dialog.h>
#endif
//////////////
// Prototypes
class VideoBox;
class FrameMain;
/// DOCME
/// @class DialogDetachedVideo
/// @brief DOCME
@ -71,5 +65,3 @@ public:
DECLARE_EVENT_TABLE()
};