mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 12:55:46 +00:00
parent
5fa28a0ed0
commit
bd8c574638
@ -48,8 +48,9 @@ extern PRBool gJustGotDeactivate;
|
||||
|
||||
nsFrameWindow::nsFrameWindow() : nsCanvas()
|
||||
{
|
||||
hwndFrame = 0;
|
||||
hwndFrame = 0;
|
||||
fnwpDefFrame = 0;
|
||||
mWindowType = eWindowType_toplevel;
|
||||
}
|
||||
|
||||
nsFrameWindow::~nsFrameWindow()
|
||||
@ -172,9 +173,48 @@ void nsFrameWindow::RealDoCreate( HWND hwndP, nsWindow *aParent,
|
||||
|
||||
ULONG nsFrameWindow::GetFCFlags()
|
||||
{
|
||||
return FCF_TITLEBAR | FCF_SYSMENU | FCF_SIZEBORDER |
|
||||
FCF_MINMAX | FCF_TASKLIST | FCF_NOBYTEALIGN |
|
||||
(gModuleData.bIsDBCS ? FCF_DBE_APPSTAT : 0);
|
||||
ULONG style = FCF_TITLEBAR | FCF_SYSMENU | FCF_TASKLIST |
|
||||
FCF_CLOSEBUTTON | FCF_NOBYTEALIGN |
|
||||
(gModuleData.bIsDBCS ? FCF_DBE_APPSTAT : 0);
|
||||
|
||||
if (mBorderStyle == eBorderStyle_default) {
|
||||
style |= FCF_DLGBORDER;
|
||||
} else {
|
||||
style |= FCF_SIZEBORDER | FCF_MINMAX;
|
||||
}
|
||||
|
||||
if (mBorderStyle != eBorderStyle_default && mBorderStyle != eBorderStyle_all) {
|
||||
if (mBorderStyle == eBorderStyle_none || !(mBorderStyle & eBorderStyle_resizeh)) {
|
||||
style &= ~FCF_SIZEBORDER;
|
||||
style |= FCF_DLGBORDER;
|
||||
}
|
||||
|
||||
if (mBorderStyle == eBorderStyle_none || !(mBorderStyle & eBorderStyle_border))
|
||||
style &= ~(FCF_DLGBORDER | FCF_SIZEBORDER);
|
||||
|
||||
if (mBorderStyle == eBorderStyle_none || !(mBorderStyle & eBorderStyle_title)) {
|
||||
style &= ~(FCF_TITLEBAR | FCF_TASKLIST);
|
||||
}
|
||||
|
||||
if (mBorderStyle == eBorderStyle_none || !(mBorderStyle & eBorderStyle_close))
|
||||
style &= ~FCF_CLOSEBUTTON;
|
||||
|
||||
if (mBorderStyle == eBorderStyle_none ||
|
||||
!(mBorderStyle & (eBorderStyle_menu | eBorderStyle_close)))
|
||||
style &= ~FCF_SYSMENU;
|
||||
// Looks like getting rid of the system menu also does away with the
|
||||
// close box. So, we only get rid of the system menu if you want neither it
|
||||
// nor the close box. How does the Windows "Dialog" window class get just
|
||||
// closebox and no sysmenu? Who knows.
|
||||
|
||||
if (mBorderStyle == eBorderStyle_none || !(mBorderStyle & eBorderStyle_minimize))
|
||||
style &= ~FCF_MINBUTTON;
|
||||
|
||||
if (mBorderStyle == eBorderStyle_none || !(mBorderStyle & eBorderStyle_maximize))
|
||||
style &= ~FCF_MAXBUTTON;
|
||||
}
|
||||
|
||||
return style;
|
||||
}
|
||||
|
||||
void nsFrameWindow::UpdateClientSize()
|
||||
|
@ -156,6 +156,8 @@ nsWindow::nsWindow() : nsBaseWidget()
|
||||
mPreferredWidth = 0;
|
||||
mPreferredHeight = 0;
|
||||
mWindowState = nsWindowState_ePrecreate;
|
||||
mWindowType = eWindowType_child;
|
||||
mBorderStyle = eBorderStyle_default;
|
||||
mFont = nsnull;
|
||||
mOS2Toolkit = nsnull;
|
||||
mMenuBar = nsnull;
|
||||
@ -709,6 +711,11 @@ void nsWindow::DoCreate( HWND hwndP, nsWindow *aParent,
|
||||
{
|
||||
mWindowState = nsWindowState_eInCreate;
|
||||
|
||||
if( aInitData != nsnull) {
|
||||
SetWindowType(aInitData->mWindowType);
|
||||
SetBorderStyle(aInitData->mBorderStyle);
|
||||
}
|
||||
|
||||
// Must ensure toolkit before attempting to thread-switch!
|
||||
if( !mToolkit)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user