Audacity 3.2.0
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
FileDialog::Disabler Class Reference
Inheritance diagram for FileDialog::Disabler:
[legend]
Collaboration diagram for FileDialog::Disabler:
[legend]

Public Member Functions

 Disabler ()
 
void Init (wxWindow *root, HWND hwnd)
 

Protected Member Functions

int Enter (wxDialog *dialog)
 
void Exit (wxDialog *dialog)
 
bool IsChild (const wxDialog *dialog) const
 

Private Attributes

wxWindow * mRoot
 
HWND mHwnd
 
int mModalCount
 

Detailed Description

Definition at line 102 of file win/FileDialogPrivate.h.

Constructor & Destructor Documentation

◆ Disabler()

FileDialog::Disabler::Disabler ( )

Definition at line 1163 of file win/FileDialogPrivate.cpp.

1164{
1165 mRoot = NULL;
1166 mHwnd = (HWND) INVALID_HANDLE_VALUE;
1167 mModalCount = 0;
1168
1169 Register();
1170}

References mHwnd, mModalCount, and mRoot.

Member Function Documentation

◆ Enter()

int FileDialog::Disabler::Enter ( wxDialog *  dialog)
protected

Definition at line 1178 of file win/FileDialogPrivate.cpp.

1179{
1180 if (mHwnd != (HWND) INVALID_HANDLE_VALUE)
1181 {
1182 if (IsChild(dialog)) {
1183 ::EnableWindow(mHwnd, FALSE);
1184 mModalCount++;
1185 }
1186 }
1187
1188 return wxID_NONE;
1189}
bool IsChild(const wxDialog *dialog) const

◆ Exit()

void FileDialog::Disabler::Exit ( wxDialog *  dialog)
protected

Definition at line 1191 of file win/FileDialogPrivate.cpp.

1192{
1193 if (mHwnd != (HWND) INVALID_HANDLE_VALUE)
1194 {
1195 if (IsChild(dialog))
1196 {
1197 mModalCount--;
1198 if (mModalCount == 0)
1199 {
1200 ::EnableWindow(mHwnd, TRUE);
1201 ::SetWindowPos(mHwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
1202 }
1203 }
1204 }
1205}

◆ Init()

void FileDialog::Disabler::Init ( wxWindow *  root,
HWND  hwnd 
)

Definition at line 1172 of file win/FileDialogPrivate.cpp.

1173{
1174 mRoot = root;
1175 mHwnd = hwnd;
1176}

References FileDialog::mRoot.

Referenced by FileDialog::MSWOnInitDialog().

Here is the caller graph for this function:

◆ IsChild()

bool FileDialog::Disabler::IsChild ( const wxDialog *  dialog) const
protected

Definition at line 1207 of file win/FileDialogPrivate.cpp.

1208{
1209 if (!dialog)
1210 {
1211 return false;
1212 }
1213
1214 for (const wxWindow *w = dialog->GetParent(); w != NULL; w = w->GetParent())
1215 {
1216 if (w == mRoot)
1217 {
1218 return true;
1219 }
1220 }
1221
1222 return false;
1223}

References FileDialog::mRoot.

Member Data Documentation

◆ mHwnd

HWND FileDialog::Disabler::mHwnd
private

Definition at line 115 of file win/FileDialogPrivate.h.

Referenced by Disabler().

◆ mModalCount

int FileDialog::Disabler::mModalCount
private

Definition at line 116 of file win/FileDialogPrivate.h.

Referenced by Disabler().

◆ mRoot

wxWindow* FileDialog::Disabler::mRoot
private

Definition at line 114 of file win/FileDialogPrivate.h.

Referenced by Disabler().


The documentation for this class was generated from the following files: