Window will only start maximized if previous window was too

import/tags/kmeleon03
binaryc 22 years ago
parent 1710e096cf
commit 6fe61aa925
  1. 22
      k-meleon/BrowserFrm.cpp
  2. 6
      k-meleon/KMeleon.dsp
  3. 14
      k-meleon/MfcEmbed.cpp
  4. 4
      k-meleon/Preferences.cpp
  5. 3
      k-meleon/Preferences.h

@ -368,16 +368,18 @@ BOOL CBrowserFrame::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERIN
//
void CBrowserFrame::OnSize(UINT nType, int cx, int cy)
{
CFrameWnd::OnSize(nType, cx, cy);
// Get the ItemRect of the status bar's Pane 1
// That's where the progress bar will be located
RECT rc;
m_wndStatusBar.GetItemRect(1, &rc);
// Move the progress bar into it's correct location
//
m_wndProgressBar.MoveWindow(&rc);
CFrameWnd::OnSize(nType, cx, cy);
// Get the ItemRect of the status bar's Pane 1
// That's where the progress bar will be located
RECT rc;
m_wndStatusBar.GetItemRect(1, &rc);
// Move the progress bar into it's correct location
//
m_wndProgressBar.MoveWindow(&rc);
theApp.preferences.bMaximized = IsZoomed();
}
/////////////////////////////////////////////////////////////////////////////

@ -53,7 +53,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386
# ADD LINK32 xpcom.lib baseembed_s.lib plc4.lib /nologo /subsystem:windows /machine:I386 /out:"..\mozilla\mozilla\dist\WIN32_o.OBJ\bin\k-meleon.exe" /libpath:"c:\projects\mozilla\mozilla\dist\win32_o.obj\lib" /libpath:"..\mozilla\mozilla\dist\WIN32_o.OBJ\lib"
# ADD LINK32 xpcom.lib baseembed_s.lib plc4.lib /nologo /subsystem:windows /machine:I386 /out:"..\mozilla\mozilla\dist\WIN32_o.OBJ\Embed\k-meleon.exe" /libpath:"c:\projects\mozilla\mozilla\dist\win32_o.obj\lib" /libpath:"..\mozilla\mozilla\dist\WIN32_o.OBJ\lib"
# SUBTRACT LINK32 /pdb:none
!ELSEIF "$(CFG)" == "kmeleon - Win32 Debug"
@ -70,7 +70,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\mozilla\mozilla\nsprpub\pr\include" /I "..\..\mozilla\mozilla\nsprpub\_o.obj\include" /I "..\..\mozilla\mozilla\include" /I "..\..\mozilla\mozilla\xpcom\components" /I "..\..\mozilla\mozilla\dist\include" /I "..\..\mozilla\mozilla\dist\WIN32_O.OBJ\include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /D "HW_THREADS" /D "XP_PC" /D "XP_WIN" /D "XP_WIN32" /D WINVER=0x400 /FR /Yu"stdafx.h" /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\mozilla\mozilla\nsprpub\pr\include" /I "..\mozilla\mozilla\nsprpub\_o.obj\include" /I "..\mozilla\mozilla\include" /I "..\mozilla\mozilla\xpcom\components" /I "..\mozilla\mozilla\dist\include" /I "..\mozilla\mozilla\dist\WIN32_O.OBJ\include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /D "HW_THREADS" /D "XP_PC" /D "XP_WIN" /D "XP_WIN32" /D WINVER=0x400 /FR /Yu"stdafx.h" /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL"
@ -80,7 +80,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# ADD LINK32 xpcom.lib baseembed_s.lib /nologo /subsystem:windows /debug /machine:I386 /out:"..\mozilla\mozilla\dist\WIN32_o.OBJ\bin\k-meleon.exe" /pdbtype:sept /libpath:"..\mozilla\mozilla\dist\WIN32_o.OBJ\lib"
# ADD LINK32 xpcom.lib baseembed_s.lib /nologo /subsystem:windows /debug /machine:I386 /out:"..\mozilla\mozilla\dist\WIN32_o.OBJ\Embed\k-meleon.exe" /pdbtype:sept /libpath:"..\mozilla\mozilla\dist\WIN32_o.OBJ\lib"
!ENDIF

@ -138,10 +138,12 @@ BOOL CMfcEmbedApp::InitInstance()
CBrowserFrame *pBrowserFrame = CreateNewBrowserFrame();
//Load the HomePage into the browser view
if(!cmdInfo.m_strFileName.IsEmpty())
pBrowserFrame->m_wndBrowserView.OpenURL(cmdInfo.m_strFileName);
else if(pBrowserFrame)
pBrowserFrame->m_wndBrowserView.LoadHomePage();
if(pBrowserFrame){
if(!cmdInfo.m_strFileName.IsEmpty())
pBrowserFrame->m_wndBrowserView.OpenURL(cmdInfo.m_strFileName);
else
pBrowserFrame->m_wndBrowserView.LoadHomePage();
}
return TRUE;
}
@ -158,7 +160,9 @@ CBrowserFrame* CMfcEmbedApp::CreateNewBrowserFrame(PRUint32 chromeMask,
// Use the Windows default if all are specified as -1
if(x == -1 && y == -1 && cx == -1 && cy == -1){
winSize = CFrameWnd::rectDefault;
style |= WS_MAXIMIZE;
}
if (preferences.bMaximized && !(chromeMask & nsIWebBrowserChrome::CHROME_WITH_SIZE) ) {
style |= WS_MAXIMIZE;
}
// Load the window title from the string resource table

@ -35,6 +35,8 @@ CPreferences::~CPreferences() {
CPreferences::Load() {
bAutoSave = true;
bMaximized = theApp.GetProfileInt(_T("Display"), _T("Maximized"), 1);
bToolbarBackground = theApp.GetProfileInt(_T("Display"), _T("BackgroundImageEnabled"), 1);
toolbarBackground = theApp.GetProfileString(_T("Display"), _T("BackgroundImage"));
@ -59,6 +61,8 @@ CPreferences::Load() {
}
CPreferences::Save() {
theApp.WriteProfileInt(_T("Display"), _T("Maximized"), bMaximized);
theApp.WriteProfileInt(_T("Display"), _T("BackgroundImageEnabled"), bToolbarBackground);
theApp.WriteProfileString(_T("Display"), _T("BackgroundImage"), toolbarBackground);

@ -106,6 +106,9 @@ public:
// this holds the menu.txt files
CString settingsDir;
// true if the window should default to maximized
int bMaximized;
// if true, will call Save on destruction
int bAutoSave;

Loading…
Cancel
Save