зеркало из https://github.com/mozilla/gecko-dev.git
Adding support for new 'desktop' preferences
This commit is contained in:
Родитель
51fe5f427d
Коммит
23e8a773fa
|
@ -215,6 +215,8 @@ DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CPropertyFrameDialog implementation
|
||||
|
||||
HWND CPropertyFrameDialog::m_hwndShowing = 0;
|
||||
|
||||
// Constructor
|
||||
CPropertyFrameDialog::CPropertyFrameDialog(HWND hwndOwner,
|
||||
int x,
|
||||
|
@ -286,7 +288,7 @@ CPropertyFrameDialog::InitDialog(HWND hdlg)
|
|||
HWND hwnd;
|
||||
|
||||
// Save away the window handle for the dialog
|
||||
m_hdlg = hdlg;
|
||||
m_hwndShowing = m_hdlg = hdlg;
|
||||
|
||||
// Get the bold font we will be using. It's the same font as the
|
||||
// dialog box uses, except it's bold
|
||||
|
@ -885,6 +887,7 @@ CPropertyFrameDialog::DoModal()
|
|||
// Cleanup
|
||||
if (m_pCurPage)
|
||||
m_pCurPage->m_pPage->SetObjects(0, NULL);
|
||||
m_hwndShowing = 0;
|
||||
DestroyWindow(m_hdlg);
|
||||
|
||||
return nResult;
|
||||
|
|
|
@ -48,12 +48,18 @@ class CPropertyFrameDialog {
|
|||
// a chance to translate accelerators
|
||||
HRESULT TranslateAccelerator(LPMSG);
|
||||
|
||||
// Static functions to be used to ensure only one property frame is
|
||||
// showing.
|
||||
static BOOL IsShowing() { return m_hwndShowing != 0; }
|
||||
static void BringToTop() { ::BringWindowToTop(m_hwndShowing); }
|
||||
|
||||
protected:
|
||||
int RunModalLoop();
|
||||
|
||||
private:
|
||||
HWND m_hdlg;
|
||||
HWND m_hwndOwner;
|
||||
static HWND m_hwndShowing;
|
||||
int m_x, m_y;
|
||||
LPCSTR m_lpszCaption;
|
||||
ULONG m_nInitialCategory;
|
||||
|
|
|
@ -330,20 +330,27 @@ NS_CreatePropertyFrame(HWND hwndOwner,
|
|||
if (nCategories == 0)
|
||||
return ResultFromScode(S_FALSE);
|
||||
|
||||
// Create the property frame dialog
|
||||
CPropertyFrameDialog dialog(hwndOwner, x, y, lpszCaption, lpfnNetHelp);
|
||||
|
||||
// Initialize the property frame dialog
|
||||
hres = dialog.CreatePages(nCategories, lplpProviders, nInitial);
|
||||
if (FAILED(hres)) {
|
||||
#ifdef _DEBUG
|
||||
OutputDebugString("CPropertyFrameDialog::CreatePages failed\n");
|
||||
#endif
|
||||
return hres;
|
||||
}
|
||||
|
||||
// Display the property frame as a modal dialog
|
||||
dialog.DoModal();
|
||||
// Catch cases where prefs already showing; we can get here if prefs are
|
||||
// showing and user does "mozilla -prefs", for example.
|
||||
if ( CPropertyFrameDialog::IsShowing() ) {
|
||||
// Bring existing property frame dialog to top.
|
||||
CPropertyFrameDialog::BringToTop();
|
||||
} else {
|
||||
// Create the property frame dialog
|
||||
CPropertyFrameDialog dialog(hwndOwner, x, y, lpszCaption, lpfnNetHelp);
|
||||
|
||||
// Initialize the property frame dialog
|
||||
hres = dialog.CreatePages(nCategories, lplpProviders, nInitial);
|
||||
if (FAILED(hres)) {
|
||||
#ifdef _DEBUG
|
||||
OutputDebugString("CPropertyFrameDialog::CreatePages failed\n");
|
||||
#endif
|
||||
return hres;
|
||||
}
|
||||
|
||||
// Display the property frame as a modal dialog
|
||||
dialog.DoModal();
|
||||
}
|
||||
return NOERROR;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче