save/restore toolbar collapsed state from RDF

This commit is contained in:
danm%netscape.com 1998-09-01 22:48:17 +00:00
Родитель af352947ec
Коммит 26f89f9d7b
9 изменённых файлов: 96 добавлений и 668 удалений

Просмотреть файл

@ -1,176 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef APICHROM_H
#define APICHROM_H
#ifndef __APIAPI_H
#include "apiapi.h"
#endif
#ifndef __NSGUIDS_H
#include "nsguids.h"
#endif
#define APICLASS_CHROME "Chrome"
#define APICLASS_NSTOOLBAR "NSToolBar"
class CToolbarButton;
class CCustToolbar;
class INSToolBar: public IUnknown {
public:
// Initialization
virtual int Create( CFrameWnd *pParent,
DWORD dwStyle = WS_CHILD|WS_VISIBLE|CBRS_TOP,
UINT nID = AFX_IDW_TOOLBAR ) = 0;
virtual void SetSizes( SIZE sizeButton,
SIZE sizeImage ) = 0;
virtual void SetButtons( const UINT *lpIDArray,
int nIDCount, UINT nBitmapID = 0 ) = 0;
virtual void SetButtonStyle( UINT nIDButtonCommand, DWORD dwButtonStyle ) = 0;
virtual void GetButtonRect( UINT nIDButtonCommand, RECT * pRect ) = 0;
virtual void AddButton( CToolbarButton *pButton, int index = -1 ) = 0;
virtual void RemoveAllButtons() = 0;
virtual CToolbarButton *RemoveButton( int index ) = 0;
virtual CToolbarButton *GetButtonByIndex(int index) = 0;
virtual CToolbarButton *GetButtonByID(int nCmd) = 0;
virtual BOOL LoadBitmap( LPCSTR lpszResourceName ) = 0;
// State
virtual void SetToolbarStyle( int nToolbarStyle ) = 0;
virtual void Show( BOOL bShow = TRUE ) = 0;
// should the buttons be the same width or their own size
virtual void SetButtonsSameWidth(BOOL bSameWidth) = 0;
// Data Access
virtual HWND GetHWnd() = 0;
};
typedef INSToolBar *LPNSTOOLBAR;
class CNetscapeStatusBar;
class INSStatusBar: public IUnknown {
public:
virtual int Create( CWnd* pParentWnd,
DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_BOTTOM,
UINT nID = AFX_IDW_STATUS_BAR,
BOOL bxxx = TRUE, BOOL bTaskbar = TRUE ) = 0;
virtual void Attach( CNetscapeStatusBar *pBar ) = 0;
// Messages
virtual void SetStatusText(const char * = NULL) = 0;
virtual const char *GetStatusText() = 0;
// Progress
virtual void SetProgress(int = 0) = 0;
virtual int GetProgress() = 0;
virtual void ProgressComplete() = 0;
// Create/Remove a modal status window
virtual void ModalStatus( BOOL bModal, UINT uDelay, char * szTitle = NULL ) = 0;
virtual void Show( BOOL bShow = TRUE ) = 0;
virtual HWND GetHWnd() = 0;
// status mode cues
virtual void StartAnimation() = 0;
virtual void StopAnimation() = 0;
};
typedef INSStatusBar *LPNSSTATUSBAR;
#define ApiToolBar(v,unk) APIPTRDEF(IID_INSToolBar,INSToolBar,v,unk)
class INSAnimation: public IUnknown {
public:
virtual void StartAnimation() = 0;
virtual void StopAnimation() = 0;
};
typedef INSAnimation *LPNSANIMATION;
#define ApiAnimation(v,unk) APIPTRDEF(IID_INSAnimation,INSAnimation,v,unk)
class IChrome: public IUnknown {
public:
// Initialization
virtual void Initialize(CFrameWnd *pWnd) = 0;
virtual BOOL procTabNavigation( UINT nChar, UINT forward, UINT controlKey ) = 0;
// Menu bar stuff
virtual void SetMenu( UINT ) = 0;
// General Toolbar functionality
virtual void UpdateURLBars(char* url) = 0;
virtual void ShowToolbar(UINT nToolbarID, BOOL bShow = TRUE) = 0;
virtual BOOL GetToolbarVisible(UINT nToolbarID) = 0;
virtual CWnd *GetToolbar(UINT nToolbarID) = 0;
virtual void SetToolbarFocus(UINT nToolbarID) = 0;
// nPos, bOpen, and bShowing are IN/OUT parameters. Values going in are default values and values
// coming out are the values from the registry or default if not in the registry.
virtual void LoadToolbarConfiguration(UINT nToolbarID, CString &csToolbarName, int32 & nPos, BOOL & bOpen, BOOL & bShowing) = 0;
virtual void SaveToolbarConfiguration(UINT nToolbarID, CString &csToolbarName) = 0;
virtual void SetSaveToolbarInfo(BOOL bSaveToolbarInfo) = 0;
// Animation Stuff
virtual void StartAnimation() = 0;
virtual void StopAnimation() = 0;
// Configurable Toolbar Manager stuff
virtual int CreateRDFToolbar(CString toolbarName, int nMaxToolbars, BOOL bHasAnimation)=0;
virtual int CreateCustomizableToolbar(CString toolbarName, int nMaxToolbars, BOOL bHasAnimation)=0;
virtual int CreateCustomizableToolbar(UINT nStringID, int nMaxToolbars, BOOL bHasAnimation) = 0;
virtual CString GetCustToolbarString() = 0;
virtual void RenameCustomizableToolbar(UINT nStringID) = 0;
virtual void FinishedAddingBrowserToolbars()=0;
virtual void SetToolbarStyle( int nToolbarStyle )=0;
virtual BOOL CustToolbarShowing()=0;
virtual void ViewCustToolbar(BOOL bShow) = 0;
virtual void Customize()=0;
virtual CCustToolbar * GetCustomizableToolbar() = 0;
// MainFrame's Toolbar Stuff
virtual void ImagesButton(BOOL) = 0;
// Window Title Stuff
virtual void SetWindowTitle(const char *) = 0;
virtual void SetDocumentTitle(const char *) = 0;
};
typedef IChrome * LPCHROME;
#define ApiChrome(v,unk) APIPTRDEF(IID_IChrome,IChrome,v,unk)
#endif

Просмотреть файл

@ -312,6 +312,11 @@ int CDragToolbar::GetToolbarHeight(void)
return height; return height;
} }
void CDragToolbar::SetOpen(BOOL bIsOpen)
{
m_bIsOpen = bIsOpen;
}
void CDragToolbar::SetToolbarStyle(int nToolbarStyle) void CDragToolbar::SetToolbarStyle(int nToolbarStyle)
{ {
m_pToolbar->SetToolbarStyle(nToolbarStyle); m_pToolbar->SetToolbarStyle(nToolbarStyle);
@ -927,11 +932,11 @@ CDragToolbar* CCustToolbar::CreateDragBar()
return new CDragToolbar(); return new CDragToolbar();
} }
void CCustToolbar::AddNewWindow(UINT nToolbarID, CToolbarWindow* pWindow, int nPosition, int nNoviceHeight, int nAdvancedHeight, void CCustToolbar::AddNewWindowGuts(UINT nToolbarID, CToolbarWindow* pWindow, int nPosition,
UINT nTabBitmapIndex, CString tabTip, BOOL bIsNoviceMode, BOOL bIsOpen, BOOL bIsAnimation) CString tabTip, BOOL bForceOpen, BOOL bIsOpen)
{ {
if(m_pToolbarArray[nPosition] != NULL || nPosition < 0 || nPosition >= m_nNumToolbars) if(nPosition < 0 || nPosition >= m_nNumToolbars || m_pToolbarArray[nPosition] != NULL)
nPosition = FindFirstAvailablePosition(); nPosition = FindFirstAvailablePosition();
CDragToolbar *pDragToolbar = CreateDragBar(); CDragToolbar *pDragToolbar = CreateDragBar();
@ -941,7 +946,10 @@ void CCustToolbar::AddNewWindow(UINT nToolbarID, CToolbarWindow* pWindow, int nP
m_nNumShowing++; m_nNumShowing++;
m_pToolbarArray[nPosition] = pDragToolbar; m_pToolbarArray[nPosition] = pDragToolbar;
pWindow->GetToolbar()->ShowWindow(SW_SHOW); pWindow->GetToolbar()->ShowWindow(SW_SHOW);
pDragToolbar->SetOpen(bIsOpen); if (bForceOpen)
pDragToolbar->SetOpen(bIsOpen);
else
bIsOpen = pDragToolbar->GetOpen();
pDragToolbar->SetTabTip(tabTip); pDragToolbar->SetTabTip(tabTip);
pDragToolbar->SetToolbarID(nToolbarID); pDragToolbar->SetToolbarID(nToolbarID);
@ -1189,8 +1197,13 @@ void CCustToolbar::SetToolbarStyle(int nToolbarStyle)
m_pParent->RecalcLayout(); m_pParent->RecalcLayout();
RedrawWindow(); RedrawWindow();
}
void CCustToolbar::BeActiveToolbar()
{
for(int i = 0; i < m_nNumToolbars; i++)
if(m_pToolbarArray[i] != NULL)
m_pToolbarArray[i]->BeActiveToolbar();
} }
void CCustToolbar::OnUpdateCmdUI( CFrameWnd* pTarget, BOOL bDisableIfNoHndler ) void CCustToolbar::OnUpdateCmdUI( CFrameWnd* pTarget, BOOL bDisableIfNoHndler )

Просмотреть файл

@ -139,7 +139,7 @@ protected:
public: public:
CDragToolbar(); CDragToolbar();
~CDragToolbar(); ~CDragToolbar();
int Create(CWnd *pParent, CToolbarWindow *pToolbar); virtual int Create(CWnd *pParent, CToolbarWindow *pToolbar);
virtual BOOL ShouldClipChildren() { return TRUE; } virtual BOOL ShouldClipChildren() { return TRUE; }
@ -149,7 +149,7 @@ public:
void SetMouseOffsetWithinToolbar(int y) { m_mouseDownPoint.y = y; } void SetMouseOffsetWithinToolbar(int y) { m_mouseDownPoint.y = y; }
void SetShowing(BOOL bIsShowing) { m_bIsShowing = bIsShowing; } void SetShowing(BOOL bIsShowing) { m_bIsShowing = bIsShowing; }
BOOL GetShowing(void) { return m_bIsShowing; } BOOL GetShowing(void) { return m_bIsShowing; }
void SetOpen(BOOL bIsOpen) { m_bIsOpen = bIsOpen; } virtual void SetOpen(BOOL bIsOpen);
BOOL GetOpen(void) { return m_bIsOpen;} BOOL GetOpen(void) { return m_bIsOpen;}
void SetTabTip(CString tabTip); void SetTabTip(CString tabTip);
CString &GetTabTip (void) { return m_tabTip; } CString &GetTabTip (void) { return m_tabTip; }
@ -158,6 +158,7 @@ public:
void SetToolbarID(int nToolbarID) {m_nToolbarID = nToolbarID;} void SetToolbarID(int nToolbarID) {m_nToolbarID = nToolbarID;}
UINT GetToolbarID(void) { return m_nToolbarID;} UINT GetToolbarID(void) { return m_nToolbarID;}
void SetToolbarStyle(int nToolbarStyle); void SetToolbarStyle(int nToolbarStyle);
virtual void BeActiveToolbar() {}
void SetAnimation(CAnimationBar2 *pAnimation); void SetAnimation(CAnimationBar2 *pAnimation);
HTAB_BITMAP GetHTabType(void) { return m_eHTabType;} HTAB_BITMAP GetHTabType(void) { return m_eHTabType;}
void OnUpdateCmdUI( CFrameWnd* pTarget, BOOL bDisableIfNoHndler ); void OnUpdateCmdUI( CFrameWnd* pTarget, BOOL bDisableIfNoHndler );
@ -245,9 +246,13 @@ public:
//Creation //Creation
int Create(CFrameWnd* pParent, BOOL bHasAnimation); int Create(CFrameWnd* pParent, BOOL bHasAnimation);
void AddNewWindow(UINT nToolbarID, CToolbarWindow* pWindow, int nPosition, int nNoviceHeight, int nAdvancedHeight, inline void AddNewWindow(UINT nToolbarID, CToolbarWindow* pWindow, int nPosition, int nNoviceHeight, int nAdvancedHeight,
UINT nTabBitmapIndex, CString tabTip, BOOL bIsNoviceMode, BOOL bIsOpen, UINT nTabBitmapIndex, CString tabTip, BOOL bIsNoviceMode, BOOL bIsOpen, BOOL bIsAnimation)
BOOL bIsAnimation); { AddNewWindowGuts(nToolbarID, pWindow, nPosition, tabTip, TRUE, bIsOpen); }
inline void AddNewWindow(UINT nToolbarID, CToolbarWindow* pWindow, int nPosition, int nNoviceHeight, int nAdvancedHeight,
UINT nTabBitmapIndex, CString tabTip, BOOL bIsNoviceMode, BOOL bIsAnimation)
{ AddNewWindowGuts(nToolbarID, pWindow, nPosition, tabTip, FALSE, FALSE); }
// Call this function when you are finished adding the toolbars that go in the // Call this function when you are finished adding the toolbars that go in the
// customizable toolbar. // customizable toolbar.
void FinishedAddingNewWindows(void){} void FinishedAddingNewWindows(void){}
@ -258,6 +263,7 @@ public:
void StopAnimation(); void StopAnimation();
void StartAnimation(); void StartAnimation();
void SetToolbarStyle(int nToolbarStyle); void SetToolbarStyle(int nToolbarStyle);
void BeActiveToolbar();
BOOL IsWindowShowing(CWnd *pToolbar); BOOL IsWindowShowing(CWnd *pToolbar);
BOOL IsWindowShowing(UINT nToolbarID); BOOL IsWindowShowing(UINT nToolbarID);
@ -321,6 +327,8 @@ public:
protected: protected:
// virtual BOOL OnNotify( WPARAM wParam, LPARAM lParam, LRESULT* pResult ); // virtual BOOL OnNotify( WPARAM wParam, LPARAM lParam, LRESULT* pResult );
void AddNewWindowGuts(UINT nToolbarID, CToolbarWindow* pWindow, int nPosition,
CString tabTip, BOOL bForceOpen, BOOL bIsOpen);
int CheckOpenButtons(CPoint point); int CheckOpenButtons(CPoint point);
int CheckClosedButtons(CPoint point); int CheckClosedButtons(CPoint point);
BOOL PointInClosedTab(CPoint point, HTAB_BITMAP tabType, int nNumClosedButtons, int nStartX, BOOL PointInClosedTab(CPoint point, HTAB_BITMAP tabType, int nNumClosedButtons, int nStartX,

Просмотреть файл

@ -69,6 +69,7 @@ BEGIN_MESSAGE_MAP(CMainFrame, CGenericFrame)
ON_WM_INITMENUPOPUP() ON_WM_INITMENUPOPUP()
ON_WM_MENUSELECT() ON_WM_MENUSELECT()
ON_WM_SHOWWINDOW() ON_WM_SHOWWINDOW()
ON_WM_ACTIVATE()
ON_COMMAND(ID_OPTIONS_TITLELOCATION_BAR, OnOptionsTitlelocationBar) ON_COMMAND(ID_OPTIONS_TITLELOCATION_BAR, OnOptionsTitlelocationBar)
ON_UPDATE_COMMAND_UI(ID_OPTIONS_TITLELOCATION_BAR, OnUpdateOptionsTitlelocationBar) ON_UPDATE_COMMAND_UI(ID_OPTIONS_TITLELOCATION_BAR, OnUpdateOptionsTitlelocationBar)
ON_WM_TIMER() ON_WM_TIMER()
@ -587,6 +588,14 @@ void CMainFrame::OnShowWindow (BOOL bShow, UINT nStatus)
RecalcLayout(); RecalcLayout();
} }
void CMainFrame::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized)
{
CGenericFrame::OnActivate(nState, pWndOther, bMinimized);
IChrome *chrome = GetChrome();
if (chrome)
chrome->ToolbarActivation();
}
// returns TRUE if something was added to the folder, false otherwise // returns TRUE if something was added to the folder, false otherwise
BOOL CMainFrame::FileBookmark(HT_Resource pFolder) BOOL CMainFrame::FileBookmark(HT_Resource pFolder)
{ {

Просмотреть файл

@ -1015,6 +1015,12 @@ void CGenericChrome::SetToolbarStyle( int nToolbarStyle )
} }
} }
void CGenericChrome::ToolbarActivation()
{
if (m_pCustToolbar != NULL)
m_pCustToolbar->BeActiveToolbar();
}
BOOL CGenericChrome::CustToolbarShowing(void) BOOL CGenericChrome::CustToolbarShowing(void)
{ {
return m_pCustToolbar->IsWindowVisible(); return m_pCustToolbar->IsWindowVisible();

Просмотреть файл

@ -1,279 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef GENCHROM_H
#define GENCHROM_H
#include "apichrom.h"
#include "statbar.h"
#include "animbar.h"
#include "urlbar.h"
#include "csttlbr2.h"
#include "toolbar2.h"
#include "usertlbr.h"
class CGenericToolBar: public INSToolBar, public INSAnimation {
protected:
CCommandToolbar *m_pCommandToolbar;
UINT m_nBitmapID;
LPUNKNOWN m_pOuterUnk;
ULONG m_ulRefCount;
public:
CGenericToolBar( LPUNKNOWN pOuterUnk = NULL );
~CGenericToolBar();
// IUnknown Interface
STDMETHODIMP QueryInterface(REFIID,LPVOID *);
STDMETHODIMP_(ULONG) AddRef();
STDMETHODIMP_(ULONG) Release();
// INSToolbar Interface
virtual int Create( CFrameWnd *pParent,
DWORD dwStyle = WS_CHILD|WS_VISIBLE|CBRS_TOP,
UINT nID = AFX_IDW_TOOLBAR );
virtual void SetSizes( SIZE sizeButton,
SIZE sizeImage );
virtual void SetButtons( const UINT *lpIDArray,
int nIDCount, UINT nBitmapID = 0 );
//cmanske: Added functions convenient adding of popup menu styles to specific buttons
// and getting rect (used for CDropDownToolbar that appears below button)
virtual void SetButtonStyle( UINT nIDButtonCommand, DWORD dwButtonStyle );
virtual void GetButtonRect( UINT nIDButtonCommand, RECT * pRect );
virtual void AddButton( CToolbarButton *pButton, int index = -1 );
virtual void RemoveAllButtons();
virtual CToolbarButton *RemoveButton( int index );
virtual CToolbarButton *GetButtonByIndex(int index);
virtual CToolbarButton *GetButtonByID(int nCmd);
virtual BOOL LoadBitmap( LPCSTR lpszResourceName );
virtual void SetToolbarStyle( int nToolbarStyle );
virtual void Show( BOOL bShow = TRUE );
// should the buttons be the same width or their own size
virtual void SetButtonsSameWidth(BOOL bSameWidth);
virtual HWND GetHWnd();
// INSAnimation Interface
virtual void StartAnimation();
virtual void StopAnimation();
};
class CModalStatus;
class CGenericStatusBar: public INSStatusBar {
protected:
CNetscapeStatusBar *m_pStatusBar;
CNetscapeStatusBar *m_pCreatedBar;
LPUNKNOWN m_pOuterUnk;
ULONG m_ulRefCount;
int m_iProg;
CString m_csStatus;
BOOL m_bModal;
CModalStatus *m_pModalStatus;
public:
CGenericStatusBar( LPUNKNOWN );
~CGenericStatusBar();
// IUnknown Interface
STDMETHODIMP QueryInterface(REFIID,LPVOID *);
STDMETHODIMP_(ULONG) AddRef();
STDMETHODIMP_(ULONG) Release();
// INSStatusBar Interface
virtual BOOL Create( CWnd* pParentWnd,
DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_BOTTOM,
UINT nID = AFX_IDW_STATUS_BAR,
BOOL bxxx = TRUE, BOOL bTaskbar = TRUE );
virtual void Attach( CNetscapeStatusBar *pBar );
// Messages
virtual void SetStatusText(const char * = NULL);
virtual const char *GetStatusText();
// Progress
virtual void SetProgress(int = 0);
virtual int GetProgress();
virtual void ProgressComplete();
// Create/Remove a modal status window
virtual void ModalStatus( BOOL bModal, UINT uDelay, char * pszTitle );
virtual void Show( BOOL bShow = TRUE );
virtual HWND GetHWnd();
// "Cylon" mode cues
virtual void StartAnimation();
virtual void StopAnimation();
CNetscapeStatusBar *GetNetscapeStatusBar();
};
//Begin JOKI
// Purpose: Provide a registry to monitor when a status bar msg. text is changed
class CStatusBarChangeRegistry {
protected:
static CPtrList m_Registry;
POSITION m_rIndex;
CStatusBarChangeRegistry() {}
~CStatusBarChangeRegistry() {m_Registry.RemoveAt(m_rIndex); }
};
class CStatusBarChangeItem : public CStatusBarChangeRegistry {
protected:
DWORD m_dwWindowID;
CStatusBarChangeItem(DWORD dwWindowID) : CStatusBarChangeRegistry() {
m_dwWindowID = dwWindowID;
}
virtual void StatusChanging(LPCSTR lpStatusMsg) = 0;
public:
DWORD GetWindowID() {
return(m_dwWindowID);
}
static void Changing(DWORD dwWindowID, LPCSTR lpStatusMsg);
};
class CDDEStatusBarChangeItem : public CStatusBarChangeItem {
CString m_csServiceName;
CString m_csLastMsgSent;
protected:
CDDEStatusBarChangeItem(CString& csServiceName, DWORD dwWindowID) : CStatusBarChangeItem(dwWindowID) {
m_rIndex = m_Registry.AddTail(this);
m_csServiceName = csServiceName;
}
// Must override.
void StatusChanging(LPCSTR lpStatusMsg);
public:
CString GetServiceName() {
return(m_csServiceName);
}
BOOL IsSameAsLastMsgSent(LPCSTR lpCurMsg);
// Consider these the constructor, destructor.
static BOOL DDERegister(CString &csServiceName, DWORD dwWindowID);
static BOOL DDEUnRegister(CString &csServiceName, DWORD dwWindowID);
};
//End JOKI
class CGenericChrome: public IChrome {
protected:
ULONG m_ulRefCount;
CFrameWnd *m_pParent;
LPUNKNOWN m_pOuterUnk;
CGenericToolBar *m_pToolBar;
CGenericStatusBar *m_pStatusBar;
CString m_csWindowTitle, m_csDocTitle;
BOOL m_bHasStatus;
CCustToolbar *m_pCustToolbar;
CString m_toolbarName;
LPNSTOOLBAR m_pMainToolBar;
//#ifndef NO_TAB_NAVIGATION
virtual BOOL CGenericChrome::procTabNavigation( UINT nChar, UINT forward, UINT controlKey );
UINT m_tabFocusInChrom;
enum { TAB_FOCUS_IN_NULL, TAB_FOCUS_IN_LOCATION_BAR };
//#endif /* NO_TAB_NAVIGATION */
public:
// IUnknown Interface
STDMETHODIMP QueryInterface(REFIID,LPVOID *);
STDMETHODIMP_(ULONG) AddRef(void);
STDMETHODIMP_(ULONG) Release(void);
virtual void Initialize( CFrameWnd *pWnd );
// Menu bar stuff
virtual void SetMenu( UINT );
// General Toolbar functionality
virtual void ShowToolbar(UINT nToolbarID, BOOL bShow = TRUE);
virtual BOOL GetToolbarVisible(UINT nToolbarID);
virtual CWnd *GetToolbar(UINT nToolbarID);
virtual void SetToolbarFocus(UINT nToolbarID);
// nPos, bOpen, and bShowing are IN/OUT parameters. Values going in are default values and values
// coming out are the values from the registry or default if not in the registry.
virtual void LoadToolbarConfiguration(UINT nToolbarID, CString &csToolbarName, int32 & nPos, BOOL & bOpen, BOOL & bShowing);
virtual void SaveToolbarConfiguration(UINT nToolbarID, CString &csToolbarName);
virtual void SetSaveToolbarInfo(BOOL bSaveToolbarInfo);
// URL bars stuff
virtual void UpdateURLBars(char* url);
// Animation Stuff
virtual void StartAnimation();
virtual void StopAnimation();
// Window Title Stuff
virtual void SetWindowTitle(const char *);
virtual void SetDocumentTitle(const char*);
// ToolbarManager Stuff
virtual int CreateRDFToolbar(CString toolbarName, int nMaxToolbars, BOOL bHasAnimation);
virtual int CreateCustomizableToolbar(CString toolbarName, int nMaxToolbars, BOOL bHasAnimation);
virtual int CreateCustomizableToolbar(UINT nStringID, int nMaxToolbars, BOOL bHasAnimation);
virtual CString GetCustToolbarString();
virtual void RenameCustomizableToolbar(UINT nStringID);
virtual void FinishedAddingBrowserToolbars();
virtual void SetToolbarStyle( int nToolbarStyle );
virtual BOOL CustToolbarShowing();
virtual void ViewCustToolbar(BOOL bShow);
virtual void Customize();
virtual CCustToolbar * GetCustomizableToolbar();
// MainFrame's Toolbar Stuff
virtual void ImagesButton(BOOL);
// Constructor and Destructor
CGenericChrome( LPUNKNOWN pOuterUnk );
virtual ~CGenericChrome();
};
#endif

Просмотреть файл

@ -1,201 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
// mainfrm.h : interface of the CMainFrame class
//
/////////////////////////////////////////////////////////////////////////////
#ifndef MAINFRAME_H
#define MAINFRAME_H
#include "tlbutton.h"
#include "urlbar.h"
typedef struct big_rect {
long top, bottom, left, right;
} BIG_RECT;
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
extern IL_RGB animationPalette[];
extern int iLowerSystemColors;
extern int iLowerAnimationColors;
extern int iLowerColors;
extern int colorCubeSize;
#ifdef ENDER
class CEditToolBarController;
class CComboToolBar;
#endif //ENDER
class CMainFrame : public CGenericFrame
{
public: // create from serialization only
CMainFrame();
DECLARE_DYNCREATE(CMainFrame)
// Attributes
public:
CString m_csText;
CStringList m_csImageList;
public:
CWnd * m_pHistoryWindow;
CWnd * m_pDocInfoWindow;
private:
// Some static public data, initialized in framinit.cpp
static int m_FirstFrame;
CURLBar * m_barLocation;
CRDFToolbar *m_barLinks;
CCommandToolbar *m_pCommandToolbar;
#ifdef ENDER
//CEditToolBarController * m_pToolBarController;
CEditToolBarController * m_pToolBarController;
#endif //ENDER
private :
//#ifndef NO_TAB_NAVIGATION
// BOOL CMainFrame::setNextTabableFrame( CMainFrame * pCurrentFrame, int forward );
BOOL CMainFrame::setNextTabFocus( int forward );
int m_SrvrItemCount; // reference counting the server item.
UINT m_tabFocusInMainFrm;
public :
enum { TAB_FOCUS_IN_NULL, TAB_FOCUS_IN_CHROME,TAB_FOCUS_IN_GRID };
void SetTabFocusFlag( int nn ) { m_tabFocusInMainFrm = nn; }
#ifdef ENDER
CComboToolBar *getComposeToolBar();
#endif //ENDER
//#endif /* NO_TAB_NAVIGATION */
// Implementation
public:
virtual ~CMainFrame();
virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext *pContext);
void AddRef() { m_SrvrItemCount++;}
void Release() {m_SrvrItemCount--;}
BOOL HasSrvrItem() { return m_SrvrItemCount > 0; }
BOOL PreTranslateMessage(MSG *pMsg);
BOOL PreCreateWindow(CREATESTRUCT& cs);
virtual void GetMessageString( UINT nID, CString& rMessage ) const;
void Alert(char * Msg);
int Confirm(char * Msg);
char * Prompt(const char * Msg, const char * Dflt);
char * PromptPassword(char * Msg);
void BuildHistoryMenu(CMenu* pMenu);
void OnLoadHomePage();
const char *FindHistoryToolTipText(UINT nCommand);
void FillPlacesMenu(HMENU hMenu);
int CreateLocationBar(void);
int CreateLinkBar(void);
int CreateMainToolbar(void);
virtual void RefreshNewEncoding(int16 csid, BOOL bIgnore=TRUE);
void LoadShortcut(int iShortcutID);
// Needed public for preference callback routines
afx_msg void OnToggleImageLoad();
afx_msg void OnOptionsShowstarterbuttons();
afx_msg void OnOptionsViewToolBar();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
virtual BOOL AllowDocking() {return TRUE;}
virtual void BeginStreamingOfRDFToolbars();
// Generated message map functions
protected:
//{{AFX_MSG(CMainFrame)
afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
afx_msg BOOL OnCommand(UINT wParam,LONG lParam);
afx_msg void OnInitMenuPopup(CMenu* pPopup, UINT nIndex, BOOL bSysMenu);
afx_msg void OnMenuSelect(UINT nItemID, UINT nFl, HMENU hSysMenu);
afx_msg void OnOptionsTitlelocationBar();
afx_msg void OnUpdateOptionsTitlelocationBar(CCmdUI* pCmdUI);
afx_msg void OnDropdownUrl();
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnDestroy();
afx_msg void OnOptionsTogglenetdebug();
afx_msg void OnOptionsToggleProfile();
afx_msg void OnShowTransferStatus();
afx_msg void OnUpdateToggleImageLoad(CCmdUI* pCmdUI);
afx_msg void OnUpdateShowTransferStatus(CCmdUI* pCmdUI);
afx_msg void OnUpdateOptionsTogglenetdebug(CCmdUI* pCmdUI);
afx_msg void OnNetscapeHome();
afx_msg void OnGuide();
afx_msg void OnStartingPoints();
afx_msg void OnMetaIndex();
afx_msg void OnHotlistHotlist();
afx_msg LRESULT OnFindReplace(WPARAM wParam, LPARAM lParam);
afx_msg void OnFlushCache();
afx_msg void OnToggleFancyFtp();
afx_msg void OnUpdateToggleFancyFtp(CCmdUI* pCmdUI);
afx_msg void OnUpdateOptionsShowstarterbuttons(CCmdUI* pCmdUI);
afx_msg void OnUpdateSecurity(CCmdUI* pCmdUI);
afx_msg void OnUpdateSecurityStatus(CCmdUI *pCmdUI);
afx_msg void OnShortcut1();
afx_msg void OnShortcut2();
afx_msg void OnShortcut3();
afx_msg void OnShortcut4();
afx_msg void OnShortcut5();
afx_msg void OnShortcut6();
afx_msg void OnClose();
afx_msg void OnLocalHelp();
afx_msg void OnDropFiles(HDROP hDropInfo);
afx_msg BOOL OnQueryOpen();
afx_msg void OnHelpSecurity();
afx_msg void OnAboutPlugins();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnUpdateEditUndo(CCmdUI* pCmdUI);
afx_msg void OnHelpMenu();
afx_msg LRESULT OnButtonMenuOpen(WPARAM, LPARAM);
afx_msg LRESULT OnFillInToolTip(WPARAM, LPARAM);
afx_msg LRESULT OnFillInToolbarButtonStatus(WPARAM, LPARAM);
afx_msg void OnIncreaseFont();
afx_msg void OnDecreaseFont();
afx_msg void OnNetSearch();
afx_msg void OnUpdateNetSearch(CCmdUI *pCmdUI);
afx_msg void OnUpdateViewCommandToolbar(CCmdUI* pCmdUI);
afx_msg void OnUpdateViewLocationToolbar(CCmdUI* pCmdUI);
afx_msg void OnUpdateViewCustomToolbar(CCmdUI* pCmdUI);
#ifdef ENDER
afx_msg LONG OnToolController(UINT,LONG);
#endif
//}}AFX_MSG
BOOL FileBookmark(HT_Resource pFolder);
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
#endif // MAINFRAME_H

Просмотреть файл

@ -1366,7 +1366,7 @@ static void toolbarNotifyProcedure (HT_Notification ns, HT_Resource n, HT_Event
theApp.m_pToolbarStyle, 43, 27, eSMALL_HTAB); theApp.m_pToolbarStyle, 43, 27, eSMALL_HTAB);
theToolbarHolder->AddNewWindow(ID_PERSONAL_TOOLBAR+toolbarIDCounter, pWindow, toolbarIDCounter, 43, 27, 1, theToolbarHolder->AddNewWindow(ID_PERSONAL_TOOLBAR+toolbarIDCounter, pWindow, toolbarIDCounter, 43, 27, 1,
HT_GetNodeName(HT_TopNode(theNewToolbar->GetHTView())),theApp.m_pToolbarStyle, TRUE, FALSE); HT_GetNodeName(HT_TopNode(theNewToolbar->GetHTView())),theApp.m_pToolbarStyle, FALSE);
toolbarIDCounter++; toolbarIDCounter++;
theToolbarHolder->GetCachedParentWindow()->RecalcLayout(); theToolbarHolder->GetCachedParentWindow()->RecalcLayout();
} }
@ -1533,6 +1533,7 @@ int CRDFToolbar::Create(CWnd *pParent)
BOOL fixedSize = FALSE; BOOL fixedSize = FALSE;
void* data; void* data;
HT_GetTemplateData(topNode, gNavCenter->toolbarButtonsFixedSize, HT_COLUMN_STRING, &data); HT_GetTemplateData(topNode, gNavCenter->toolbarButtonsFixedSize, HT_COLUMN_STRING, &data);
if (data) if (data)
{ {
@ -1683,7 +1684,8 @@ void CRDFToolbar::ChangeButtonSizes(void)
/* RDF toolbars get their style info from RDF. App preference settings /* RDF toolbars get their style info from RDF. App preference settings
make their way into RDF elsewhere. */ make their way into RDF elsewhere. */
void CRDFToolbar::SetToolbarStyle(int nToolbarStyle) { void CRDFToolbar::SetToolbarStyle(int nToolbarStyle)
{
CNSToolbar2::SetToolbarStyle(GetDisplayMode()); CNSToolbar2::SetToolbarStyle(GetDisplayMode());
} }
@ -2460,6 +2462,44 @@ END_MESSAGE_MAP()
extern HBITMAP m_hTabBitmap; extern HBITMAP m_hTabBitmap;
int CRDFDragToolbar::Create(CWnd *pParent, CToolbarWindow *pToolbar)
{
int rtnval = CDragToolbar::Create(pParent, pToolbar);
if (rtnval)
{
char *data;
CRDFToolbar* pToolbar = (CRDFToolbar*)m_pToolbar->GetToolbar();
HT_Resource top = HT_TopNode(pToolbar->GetHTView());
HT_GetNodeData(top, gNavCenter->toolbarCollapsed, HT_COLUMN_STRING, (void **)&data);
if (data)
{
if (data[0] == 'y' || data[0] == 'Y')
SetOpen(FALSE);
}
}
return rtnval;
}
void CRDFDragToolbar::SetOpen(BOOL bIsOpen)
{
CDragToolbar::SetOpen(bIsOpen);
CopySettingsToRDF();
}
void CRDFDragToolbar::BeActiveToolbar()
{
CopySettingsToRDF();
}
void CRDFDragToolbar::CopySettingsToRDF(void)
{
char *data = GetOpen() ? "no" : "yes";
CRDFToolbar* pToolbar = (CRDFToolbar*)m_pToolbar->GetToolbar();
HT_Resource top = HT_TopNode(pToolbar->GetHTView());
HT_SetNodeData(top, gNavCenter->toolbarCollapsed, HT_COLUMN_STRING, data);
}
void CRDFDragToolbar::OnPaint(void) void CRDFDragToolbar::OnPaint(void)
{ {
CPaintDC dcPaint(this); // device context for painting CPaintDC dcPaint(this); // device context for painting

Просмотреть файл

@ -346,6 +346,14 @@ class CRDFDragToolbar : public CDragToolbar
{ {
public: public:
virtual int Create(CWnd *pParent, CToolbarWindow *pToolbar);
virtual void SetOpen(BOOL bIsOpen);
virtual void BeActiveToolbar();
protected:
void CopySettingsToRDF(void);
public:
// Generated message map functions // Generated message map functions
//{{AFX_MSG(CDragToolbar) //{{AFX_MSG(CDragToolbar)
afx_msg void OnPaint(void); afx_msg void OnPaint(void);