r=mkaply, a=blizzard
Not handling border and window styles
This commit is contained in:
mkaply%us.ibm.com 2000-11-07 22:22:43 +00:00
parent 5fa28a0ed0
commit bd8c574638
2 changed files with 51 additions and 4 deletions

View File

@ -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()

View File

@ -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)
{