Fixes for ender to beat 9-1 reviewed winfe specific changes from Bill Law

This commit is contained in:
mjudge%netscape.com 1998-09-01 18:51:22 +00:00
Родитель 314b8aaf56
Коммит 258a6ea6b2
11 изменённых файлов: 304 добавлений и 2160 удалений

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -90,6 +90,145 @@ BEGIN_MESSAGE_MAP(CComboToolBar, CToolBar)
END_MESSAGE_MAP() END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
BOOL CComboToolBar::CreateFloater(CWnd* pParent, UINT nIDBar, UINT nIDCaption,
UINT * pIDArray, int nIDCount, // Command ID array and count
UINT * pIDArray2,int nIDCount2,
UINT nIDBitmap, SIZE sizeButton, SIZE sizeImage )
{
ASSERT( pParent );
ASSERT(nIDCount >= 1); // must be at least one of them
ASSERT(pIDArray == NULL ||
AfxIsValidAddress(pIDArray, sizeof(UINT) * nIDCount, FALSE));
DWORD dwStyle = WS_CHILD|CBRS_TOOLTIPS|CBRS_BOTTOM|CBRS_FLYBY|CBRS_SIZE_DYNAMIC;
// Toolbar is NOT initially visible
if (!CToolBar::Create(pParent,
dwStyle,
nIDBar ) )
{
TRACE0("Failed to create CToolBar for CComboToolBar\n");
return FALSE;
}
if ( nIDBitmap && !LoadBitmap(nIDBitmap) )
{
TRACE0("Failed to load bitmap for CComboToolBar\n");
return FALSE;
}
// Allocate space for buttons in base class
if ( ! SetButtons( NULL, nIDCount+nIDCount2 ) ){
return FALSE;
}
// Allocate memory for our info structues
m_pInfo = new TB_CONTROLINFO[nIDCount+nIDCount2];
ASSERT( m_pInfo );
// clear out!
memset( (void*)m_pInfo, 0, (nIDCount+nIDCount2) * sizeof(TB_CONTROLINFO) );
// Allocate memory for config array
m_pEnableConfig = new BOOL[nIDCount+nIDCount2];
ASSERT( m_pEnableConfig );
memset( (void*)m_pEnableConfig, 0, (nIDCount+nIDCount2) * sizeof(BOOL) );
// Fill our info array and set each item's info in base class
UINT * pID = pIDArray;
// Save it
m_sizeButton = sizeButton;
// Set the size of the toolbar buttons and images
SetSizes(sizeButton, sizeImage );
// Save stuff
m_sizeImage = sizeImage;
m_nIDBitmap = nIDBitmap;
// Extra margin to try to center any comboboxes (Buttons are at + 5)
// (Approximate -- probably depends on font etc...)
// m_nComboTop = 5 + ( (sizeButton.cy - 22 ) / 2);
LPTB_CONTROLINFO pInfo = m_pInfo;
for ( int i=0; i < nIDCount; i++, pID++, pInfo++ ) {
pInfo->nID = *pID;
if ( pInfo->nID == ID_SEPARATOR ) {
pInfo->nWidth = SEPARATOR_WIDTH; // Default separator
SetButtonInfo( i, pInfo->nID, TBBS_SEPARATOR, pInfo->nWidth );
}
else if ( *pID == ID_COMBOBOX ) {
pInfo->bComboBox = TRUE;
// Set base class info - probably not really needed
// since we must fill in ComboBox data later!
// Last param = width, which we set later with SetComboBox()
// ***** SetButtonInfo( i, 0, TBBS_SEPARATOR, 0 ); // CAUSES CRASH??
m_nComboBoxCount++;
pInfo->pComboBox = NULL; // Owner of toolbar must set this later!
}
else {
SetButtonInfo( i, pInfo->nID, TBBS_BUTTON, m_nButtonCount );
pInfo->nImageIndex = m_nButtonCount++;
pInfo->bIsButton = TRUE;
pInfo->nWidth = sizeImage.cx;
}
pInfo->bShow = TRUE;
// Default is to show allow configuring all items
m_pEnableConfig[i] = TRUE;
}
pID = pIDArray2;
for ( i=nIDCount; i < (nIDCount2+nIDCount); i++, pID++, pInfo++ ) {
pInfo->nID = *pID;
if ( pInfo->nID == ID_SEPARATOR ) {
pInfo->nWidth = SEPARATOR_WIDTH; // Default separator
SetButtonInfo( i, pInfo->nID, TBBS_SEPARATOR, pInfo->nWidth );
}
else if ( *pID == ID_COMBOBOX ) {
pInfo->bComboBox = TRUE;
// Set base class info - probably not really needed
// since we must fill in ComboBox data later!
// Last param = width, which we set later with SetComboBox()
// ***** SetButtonInfo( i, 0, TBBS_SEPARATOR, 0 ); // CAUSES CRASH??
m_nComboBoxCount++;
pInfo->pComboBox = NULL; // Owner of toolbar must set this later!
}
else {
SetButtonInfo( i, pInfo->nID, TBBS_BUTTON, m_nButtonCount );
pInfo->nImageIndex = m_nButtonCount++;
pInfo->bIsButton = TRUE;
pInfo->nWidth = sizeImage.cx;
}
pInfo->bShow = TRUE;
// Default is to show allow configuring all items
m_pEnableConfig[i] = TRUE;
}
m_nControlCount = m_nButtonCount + m_nComboBoxCount;
// Upper limit imposed by resource ID allocation range
// for configuring which controls show on toolbar
ASSERT( m_nControlCount<= MAX_TOOLBAR_CONTROLS );
// ASSUME WE WANT DOCKING AND TOOLTIPS!
EnableDocking(CBRS_ALIGN_BOTTOM);
// Set caption that shows if toolbar is floating
if ( nIDCaption ) {
SetWindowText(szLoadString(nIDCaption));
}
return TRUE;
}
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
BOOL CComboToolBar::Create( BOOL bIsPageComposer, CWnd* pParent, UINT nIDBar, UINT nIDCaption, BOOL CComboToolBar::Create( BOOL bIsPageComposer, CWnd* pParent, UINT nIDBar, UINT nIDCaption,
UINT * pIDArray, int nIDCount, // Command ID array and count UINT * pIDArray, int nIDCount, // Command ID array and count
@ -582,7 +721,8 @@ void CComboToolBar::SetCNSToolbar(CNSToolbar2 *pToolbar)
void CComboToolBar::OnUpdateCmdUI( CFrameWnd* pTarget, BOOL bDisableIfNoHndler ) void CComboToolBar::OnUpdateCmdUI( CFrameWnd* pTarget, BOOL bDisableIfNoHndler )
{ {
m_pToolbar->OnUpdateCmdUI(pTarget, bDisableIfNoHndler); if (m_pToolbar)
m_pToolbar->OnUpdateCmdUI(pTarget, bDisableIfNoHndler);
CToolBar::OnUpdateCmdUI(pTarget, bDisableIfNoHndler); CToolBar::OnUpdateCmdUI(pTarget, bDisableIfNoHndler);
} }
@ -594,14 +734,16 @@ CSize CComboToolBar::CalcDynamicLayout(int nLength, DWORD dwMode )
#ifdef XP_WIN32 #ifdef XP_WIN32
size = CToolBar::CalcDynamicLayout(nLength, dwMode); size = CToolBar::CalcDynamicLayout(nLength, dwMode);
#endif #endif
if (m_pToolbar)
int nHeight = m_pToolbar->GetHeight(); {
int nHeight = m_pToolbar->GetHeight();
if(size.cy < nHeight) if(size.cy < nHeight)
{ {
// 6 is what a CToolbar starts off as without any buttons // 6 is what a CToolbar starts off as without any buttons
size.cy = nHeight + 8; size.cy = nHeight + 8;
} }
}
return size; return size;

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

@ -108,6 +108,10 @@ public:
UINT * pIDArray, int nIDCount, // Command ID array and count UINT * pIDArray, int nIDCount, // Command ID array and count
UINT nIDBitmap, SIZE sizeButton, SIZE sizeImage ); UINT nIDBitmap, SIZE sizeButton, SIZE sizeImage );
BOOL CreateFloater(CWnd* pParent, UINT nIDBar, UINT nIDCaption,
UINT * pIDArray, int nIDCount, // Command ID array and count
UINT * pIDArray2,int nIDCount2,
UINT nIDBitmap, SIZE sizeButton, SIZE sizeImage );
// After creating toobar, call this to enable/disable action on button down // After creating toobar, call this to enable/disable action on button down
// Used primarily when action is creation of a CDropdownToolbar // Used primarily when action is creation of a CDropdownToolbar
void SetDoOnButtonDown( UINT nID, BOOL bSet ); void SetDoOnButtonDown( UINT nID, BOOL bSet );

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

@ -123,6 +123,27 @@ static UINT BASED_CODE nIDCharButtonBarArray[] =
}; };
#define CHARBUTTONBAR_ID_COUNT ((sizeof(nIDCharButtonBarArray))/sizeof(UINT)) #define CHARBUTTONBAR_ID_COUNT ((sizeof(nIDCharButtonBarArray))/sizeof(UINT))
static UINT BASED_CODE nIDCharFloatButtonBarArray[] =
{
// same order as in the bitmap for toolbar
ID_SEPARATOR,
ID_FORMAT_CHAR_BOLD,
ID_FORMAT_CHAR_ITALIC,
ID_FORMAT_CHAR_UNDERLINE,
ID_CHECK_SPELLING,
ID_SEPARATOR,
ID_UNUM_LIST,
ID_NUM_LIST,
ID_FORMAT_OUTDENT,
ID_FORMAT_INDENT,
ID_SEPARATOR,
ID_ALIGN_POPUP,
ID_INSERT_POPUP
};
#define CHARBUTTONBARFLOAT_ID_COUNT ((sizeof(nIDCharFloatButtonBarArray))/sizeof(UINT))
#define COLOR_COMBO_INDEX 3 // Location of color combo we hide in Win16/NT3.51 #define COLOR_COMBO_INDEX 3 // Location of color combo we hide in Win16/NT3.51
// Global strings for dropdown property combos // Global strings for dropdown property combos
@ -395,7 +416,7 @@ CEditToolBarController::~CEditToolBarController()
delete m_pCharacterToolbar; delete m_pCharacterToolbar;
} }
BOOL CEditToolBarController::CreateEditBars(MWContext *pMWContext, unsigned ett) BOOL CEditToolBarController::CreateEditBars(MWContext *pMWContext, BOOL bIsFloating, unsigned ett)
{ {
// Initialize things needed by both CNetscapeEditFrame and CComposeFrame // Initialize things needed by both CNetscapeEditFrame and CComposeFrame
CGenericFrame *pParent = (CGenericFrame*)GetParent(); CGenericFrame *pParent = (CGenericFrame*)GetParent();
@ -434,15 +455,28 @@ BOOL CEditToolBarController::CreateEditBars(MWContext *pMWContext, unsigned ett)
if( ett & DISPLAY_CHARACTER_TOOLBAR ){ if( ett & DISPLAY_CHARACTER_TOOLBAR ){
// We don't use the "Insert Object" last item if we are displaying the edit toolbar, // We don't use the "Insert Object" last item if we are displaying the edit toolbar,
// which has these items // which has these items
if (!m_wndCharacterBar.Create(ett & DISPLAY_EDIT_TOOLBAR, GetParent(), IDW_PARA_TOOLBAR, IDS_CHAR_TOOLBAR_CAPTION, if (!bIsFloating)
nIDCharacterBarArray, CHARBAR_ID_COUNT, {
IDB_NEW_FORMAT_TOOLBAR, if (!m_wndCharacterBar.Create(ett & DISPLAY_EDIT_TOOLBAR, GetParent(), IDW_PARA_TOOLBAR, IDS_CHAR_TOOLBAR_CAPTION,
CSize(8, ED_TB_BUTTON_HEIGHT), nIDCharacterBarArray, CHARBAR_ID_COUNT,
CSize(1,ED_TB_BITMAP_HEIGHT) ) ) IDB_NEW_FORMAT_TOOLBAR,
return FALSE; CSize(8, ED_TB_BUTTON_HEIGHT),
m_pCharacterToolbar = CreateCharacterToolbar((ett & DISPLAY_EDIT_TOOLBAR) ? CHARBUTTONBAR_ID_COUNT-1 : CHARBUTTONBAR_ID_COUNT); CSize(1,ED_TB_BITMAP_HEIGHT) ) )
return FALSE;
m_pCharacterToolbar = CreateCharacterToolbar((ett & DISPLAY_EDIT_TOOLBAR) ? CHARBUTTONBAR_ID_COUNT-1 : CHARBUTTONBAR_ID_COUNT);
m_wndCharacterBar.SetCNSToolbar(m_pCharacterToolbar);
}
else
{
if (!m_wndCharacterBar.CreateFloater(GetParent(), IDW_PARA_TOOLBAR, IDS_CHAR_TOOLBAR_CAPTION,
nIDCharacterBarArray, CHARBAR_ID_COUNT, nIDCharFloatButtonBarArray,CHARBUTTONBARFLOAT_ID_COUNT ,
IDB_EDIT_FLOAT_TOOLBAR,
CSize(27, 22),
CSize(20, 16) ) )
return FALSE;
}
m_wndCharacterBar.SetCNSToolbar(m_pCharacterToolbar);
// Paragraph styles Combo // Paragraph styles Combo
@ -539,7 +573,8 @@ BOOL CEditToolBarController::CreateEditBars(MWContext *pMWContext, unsigned ett)
// Note that we use Scroll Width to get size of combobox since users // Note that we use Scroll Width to get size of combobox since users
// can change that in Win95 and NT4.0 and that size determines width // can change that in Win95 and NT4.0 and that size determines width
// of combobox dropdown button // of combobox dropdown button
m_wndCharacterBar.SetComboBox( ID_COMBO_PARA, &m_ParagraphCombo, if (m_wndCharacterBar)
m_wndCharacterBar.SetComboBox( ID_COMBO_PARA, &m_ParagraphCombo,
sysInfo.m_iScrollWidth+61, iMaxParaWidth + 4, 0 ); sysInfo.m_iScrollWidth+61, iMaxParaWidth + 4, 0 );
m_ParagraphCombo.SetCurSel(0); m_ParagraphCombo.SetCurSel(0);
@ -780,7 +815,7 @@ int CEditFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
GetChrome()->CreateCustomizableToolbar("Composer"/*ID_COMPOSER*/, 2, FALSE); GetChrome()->CreateCustomizableToolbar("Composer"/*ID_COMPOSER*/, 2, FALSE);
if ( !m_pToolBarController->CreateEditBars(GetMainContext()->GetContext()) ) if ( !m_pToolBarController->CreateEditBars(GetMainContext()->GetContext(), FALSE) )
return -1; // fail to create return -1; // fail to create
// Need to do this to get accurate toolbar size info // Need to do this to get accurate toolbar size info

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

@ -77,9 +77,9 @@ public:
inline CNSComboBox* GetFontFaceCombo() { return &m_FontFaceCombo; } inline CNSComboBox* GetFontFaceCombo() { return &m_FontFaceCombo; }
inline CNSComboBox* GetFontSizeCombo() { return &m_FontSizeCombo; } inline CNSComboBox* GetFontSizeCombo() { return &m_FontSizeCombo; }
inline CComboToolBar* GetCharacterBar() { return( ::IsWindow(m_wndCharacterBar.m_hWnd) ? &m_wndCharacterBar : 0); } inline CComboToolBar* GetCharacterBar() { return( ::IsWindow(m_wndCharacterBar.m_hWnd) ? &m_wndCharacterBar : 0); }
inline CCommandToolbar *GetCNSToolbar() { return( ::IsWindow(m_pCharacterToolbar->m_hWnd) ? m_pCharacterToolbar : 0); } inline CCommandToolbar *GetCNSToolbar() { if (m_pCharacterToolbar) return( ::IsWindow(m_pCharacterToolbar->m_hWnd) ? m_pCharacterToolbar : 0);else return FALSE; }
// Pass in MWContext to get palette to be used by comboboxes and display status messages // Pass in MWContext to get palette to be used by comboboxes and display status messages
BOOL CreateEditBars(MWContext *pMWContext, BOOL CreateEditBars(MWContext *pMWContext, BOOL isFloating,
unsigned ett = DISPLAY_EDIT_TOOLBAR|DISPLAY_CHARACTER_TOOLBAR); unsigned ett = DISPLAY_EDIT_TOOLBAR|DISPLAY_CHARACTER_TOOLBAR);
// Calls appropriate GetCurSel(), but returns INDEX_OTHER if "Other..." item selected // Calls appropriate GetCurSel(), but returns INDEX_OTHER if "Other..." item selected

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

@ -2027,6 +2027,7 @@ void CDropdownToolbar::Show()
GetParentFrame()->SetActiveWindow(); GetParentFrame()->SetActiveWindow();
} }
IMPLEMENT_DYNAMIC(CDropdownToolbar,CWnd)
BEGIN_MESSAGE_MAP(CDropdownToolbar, CWnd) BEGIN_MESSAGE_MAP(CDropdownToolbar, CWnd)
//{{AFX_MSG_MAP(CDropdownToolbar) //{{AFX_MSG_MAP(CDropdownToolbar)
ON_WM_LBUTTONUP() ON_WM_LBUTTONUP()

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

@ -1132,6 +1132,7 @@ public:
RECT * pCallerRect = NULL, // If null, use mouse position to locate toolbar RECT * pCallerRect = NULL, // If null, use mouse position to locate toolbar
UINT nCallerID = 0, // For tooltip over caller UINT nCallerID = 0, // For tooltip over caller
UINT nInitialID = 0); UINT nInitialID = 0);
DECLARE_DYNAMIC(CDropdownToolbar)
virtual ~CDropdownToolbar(); virtual ~CDropdownToolbar();

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

@ -908,7 +908,7 @@ void CNetscapeEditView::OnSetFocus(CWnd *pOldWin)
if (GetEmbedded()) if (GetEmbedded())
{ {
CMainFrame * pFrame = (CMainFrame*)GetParentFrame(); CMainFrame * pFrame = (CMainFrame*)GetParentFrame();
CEnderBar *pControler = pFrame->getComposeToolBar(); CComboToolBar *pControler = pFrame->getComposeToolBar();
if (pControler) if (pControler)
{ {
//must calculate position for toolbar //must calculate position for toolbar
@ -935,6 +935,42 @@ void CNetscapeEditView::OnKillFocus(CWnd *pOldWin)
{ {
MWContext * pMWContext=NULL; MWContext * pMWContext=NULL;
#ifdef ENDER
if (GetEmbedded())
{
CMainFrame * pFrame = (CMainFrame*)GetParentFrame();
CComboToolBar *pControler = pFrame->getComposeToolBar();
CWnd *pWnd=NULL;
CWnd *pCPparent=NULL;
BOOL keepToolbar=FALSE;
if (pOldWin)
{
pWnd = pOldWin->GetParent();
if (pOldWin->IsKindOf(RUNTIME_CLASS(CMiniDockFrameWnd))
||pOldWin->IsKindOf(RUNTIME_CLASS(CDropdownToolbar)))
return;
if (pWnd && (pWnd->IsKindOf(RUNTIME_CLASS(CDropdownToolbar))
||pWnd->IsKindOf(RUNTIME_CLASS(CMiniDockFrameWnd))
||pWnd->IsKindOf(RUNTIME_CLASS(CComboToolBar)))) //thats the toolbar dont go anywhere!
return;
if (pOldWin->IsKindOf(RUNTIME_CLASS(CColorPicker)))
{
pCPparent = ((CColorPicker *)pOldWin)->getParent();
keepToolbar = (CGenericFrame *)::GetFrame(GET_MWCONTEXT) == (CGenericFrame *)pCPparent;
}
}
if (pControler && !keepToolbar)
{
//remember where the controler was!
pFrame->ShowControlBar(pControler,FALSE,FALSE);
pFrame->RecalcLayout();
UpdateWindow();
}
}
#endif //ENDER
//TRACE1("CNetscapeView::KillFocusEdit hOldWin=%X\n", (pOldWin ? pOldWin->GetSafeHwnd() : NULL)); //TRACE1("CNetscapeView::KillFocusEdit hOldWin=%X\n", (pOldWin ? pOldWin->GetSafeHwnd() : NULL));
if ( m_caret.bEnabled && if ( m_caret.bEnabled &&
GetContext() && (NULL != (pMWContext = GET_MWCONTEXT)) && GetContext() && (NULL != (pMWContext = GET_MWCONTEXT)) &&
@ -982,32 +1018,6 @@ void CNetscapeEditView::OnKillFocus(CWnd *pOldWin)
} }
#endif //_IME_COMPOSITION #endif //_IME_COMPOSITION
// CNetscapeView doens't need this? // CNetscapeView doens't need this?
#ifdef ENDER
if (GetEmbedded())
{
CMainFrame * pFrame = (CMainFrame*)GetParentFrame();
CEnderBar *pControler = pFrame->getComposeToolBar();
CWnd *pWnd=NULL;
CWnd *pCPparent=NULL;
BOOL bColorPicker=FALSE;
if (pOldWin)
{
pWnd = pOldWin->GetParent();
if (pOldWin->IsKindOf(RUNTIME_CLASS(CColorPicker)))
{
pCPparent = ((CColorPicker *)pOldWin)->getParent();
bColorPicker= (CGenericFrame *)::GetFrame(GET_MWCONTEXT) == (CGenericFrame *)pCPparent;
}
}
if (pControler && !bColorPicker && (!pWnd || !pWnd->IsKindOf(RUNTIME_CLASS(CComboToolBar))))
{
//remember where the controler was!
pFrame->ShowControlBar(pControler,FALSE,FALSE);
pFrame->RecalcLayout();
UpdateWindow();
}
}
#endif //ENDER
CNetscapeView::OnKillFocus(pOldWin); CNetscapeView::OnKillFocus(pOldWin);
} }

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

@ -487,12 +487,10 @@ void CNetscapeEditView::OnUpdateCharacterStyle(UINT nID, CCmdUI* pCmdUI)
break; break;
} }
if( iStyle != -1 ){ if( iStyle != -1 ){
if (!GetParentFrame()->IsKindOf(RUNTIME_CLASS(CMainFrame))) if ( ((CEditToolBarController *)pVoid)->GetCNSToolbar())
SetCharacterCheck(GET_MWCONTEXT, pCmdUI, ((CEditToolBarController *)pVoid)->GetCNSToolbar(), iStyle); SetCharacterCheck(GET_MWCONTEXT, pCmdUI, ((CEditToolBarController *)pVoid)->GetCNSToolbar(), iStyle);
#ifdef ENDER else if (((CEditToolBarController *)pVoid)->GetCharacterBar())
else SetCharacterCheck(GET_MWCONTEXT, pCmdUI, ((CEditToolBarController *)pVoid)->GetCharacterBar(), iStyle);
SetCharacterCheck(GET_MWCONTEXT, pCmdUI, (CWnd *)pVoid, iStyle);
#endif //ENDER
pCmdUI->Enable( EDT_CanSetCharacterAttribute(GET_MWCONTEXT) ); pCmdUI->Enable( EDT_CanSetCharacterAttribute(GET_MWCONTEXT) );
} }
} }
@ -502,15 +500,7 @@ void CNetscapeEditView::OnUpdateCharacterStyle(UINT nID, CCmdUI* pCmdUI)
void CNetscapeEditView::OnSetFocusParagraphStyle() void CNetscapeEditView::OnSetFocusParagraphStyle()
{ {
CEditToolBarController * pController = NULL; CEditToolBarController * pController = NULL;
#ifdef ENDER pController = (CEditToolBarController *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
CEnderBar *pEnderBar = NULL;
if (GetEmbedded())
{
pEnderBar = (CEnderBar *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
}
else
#endif //ENDER
pController = (CEditToolBarController *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
if (pController) { if (pController) {
@ -522,15 +512,7 @@ void CNetscapeEditView::OnSetFocusParagraphStyle()
void CNetscapeEditView::OnSetFocusFontFace() void CNetscapeEditView::OnSetFocusFontFace()
{ {
CEditToolBarController * pController = NULL; CEditToolBarController * pController = NULL;
#ifdef ENDER pController = (CEditToolBarController *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
CEnderBar *pEnderBar = NULL;
if (GetEmbedded())
{
pEnderBar = (CEnderBar *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
}
else
#endif //ENDER
pController = (CEditToolBarController *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
if (pController) { if (pController) {
pController->GetFontFaceCombo()->SetFocus(); pController->GetFontFaceCombo()->SetFocus();
pController->GetFontFaceCombo()->ShowDropDown(); pController->GetFontFaceCombo()->ShowDropDown();
@ -540,15 +522,7 @@ void CNetscapeEditView::OnSetFocusFontFace()
void CNetscapeEditView::OnSetFocusFontSize() void CNetscapeEditView::OnSetFocusFontSize()
{ {
CEditToolBarController * pController = NULL; CEditToolBarController * pController = NULL;
#ifdef ENDER pController = (CEditToolBarController *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
CEnderBar *pEnderBar = NULL;
if (GetEmbedded())
{
pEnderBar = (CEnderBar *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
}
else
#endif //ENDER
pController = (CEditToolBarController *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
if (pController) { if (pController) {
pController->GetFontSizeCombo()->SetFocus(); pController->GetFontSizeCombo()->SetFocus();
pController->GetFontSizeCombo()->ShowDropDown(); pController->GetFontSizeCombo()->ShowDropDown();
@ -566,15 +540,7 @@ void CNetscapeEditView::OnGetFontColor()
bBusy = TRUE; bBusy = TRUE;
CEditToolBarController * pController = NULL; CEditToolBarController * pController = NULL;
#ifdef ENDER pController = (CEditToolBarController *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
CEnderBar *pEnderBar = NULL;
if (GetEmbedded())
{
pEnderBar = (CEnderBar *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
}
else
#endif //ENDER
pController = (CEditToolBarController *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
if (pController) if (pController)
{ {
pController->GetFontColorCombo()->SendMessage(WM_LBUTTONUP, 0,0);// ShowDropDown(FALSE); pController->GetFontColorCombo()->SendMessage(WM_LBUTTONUP, 0,0);// ShowDropDown(FALSE);
@ -664,15 +630,7 @@ void CNetscapeEditView::OnSelendokParagraphCombo()
// Get index to selected item in Paragraph styles list // Get index to selected item in Paragraph styles list
CEditToolBarController * pController = NULL; CEditToolBarController * pController = NULL;
#ifdef ENDER pController = (CEditToolBarController *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
CEnderBar *pEnderBar = NULL;
if (GetEmbedded())
{
pEnderBar = (CEnderBar *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
}
else
#endif //ENDER
pController = (CEditToolBarController *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
if (pController) { if (pController) {
UINT nSelected = pController->GetParagraphCombo()->GetCurSel(); UINT nSelected = pController->GetParagraphCombo()->GetCurSel();
@ -709,15 +667,7 @@ void CNetscapeEditView::OnUpdateParagraphComboBox(CCmdUI* pCmdUI)
if ( m_EditState.nParagraphFormat != nParagraphFormat ) if ( m_EditState.nParagraphFormat != nParagraphFormat )
{ {
CEditToolBarController * pController = NULL; CEditToolBarController * pController = NULL;
#ifdef ENDER pController = (CEditToolBarController *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
CEnderBar *pEnderBar = NULL;
if (GetEmbedded())
{
pEnderBar = (CEnderBar *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
}
else
#endif //ENDER
pController = (CEditToolBarController *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
if (pController) { if (pController) {
if ( nParagraphFormat == P_UNKNOWN ) if ( nParagraphFormat == P_UNKNOWN )
pController->GetParagraphCombo()->SetCurSel(-1); pController->GetParagraphCombo()->SetCurSel(-1);
@ -751,15 +701,7 @@ void CNetscapeEditView::OnUpdateFontFaceComboBox(CCmdUI* pCmdUI)
MWContext *pMWContext = GET_MWCONTEXT; MWContext *pMWContext = GET_MWCONTEXT;
if(pMWContext){ if(pMWContext){
CEditToolBarController * pController = NULL; CEditToolBarController * pController = NULL;
#ifdef ENDER pController = (CEditToolBarController *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
CEnderBar *pEnderBar = NULL;
if (GetEmbedded())
{
pEnderBar = (CEnderBar *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
}
else
#endif //ENDER
pController = (CEditToolBarController *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
if (pController) { if (pController) {
CNSComboBox * pCombo = pController->GetFontFaceCombo(); CNSComboBox * pCombo = pController->GetFontFaceCombo();
char * pFace = EDT_GetFontFace(pMWContext); char * pFace = EDT_GetFontFace(pMWContext);
@ -792,15 +734,7 @@ void CNetscapeEditView::OnUpdateFontFaceComboBox(CCmdUI* pCmdUI)
void CNetscapeEditView::OnSelendokFontFaceCombo() void CNetscapeEditView::OnSelendokFontFaceCombo()
{ {
CEditToolBarController * pController = NULL; CEditToolBarController * pController = NULL;
#ifdef ENDER pController = (CEditToolBarController *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
CEnderBar *pEnderBar = NULL;
if (GetEmbedded())
{
pEnderBar = (CEnderBar *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
}
else
#endif //ENDER
pController = (CEditToolBarController *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
if (pController) { if (pController) {
int iFontIndex = pController->GetSelectedFontFaceIndex(); int iFontIndex = pController->GetSelectedFontFaceIndex();
// Process "Other..." to get font from dialog and set it // Process "Other..." to get font from dialog and set it
@ -873,15 +807,7 @@ void CNetscapeEditView::OnSelendokFontSizeCombo()
// Font size is 1 more than index to selected item // Font size is 1 more than index to selected item
CEditToolBarController * pController = NULL; CEditToolBarController * pController = NULL;
#ifdef ENDER pController = (CEditToolBarController *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
CEnderBar *pEnderBar = NULL;
if (GetEmbedded())
{
pEnderBar = (CEnderBar *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
}
else
#endif //ENDER
pController = (CEditToolBarController *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
if (pController) { if (pController) {
int iSel = pController->GetFontSizeCombo()->GetCurSel(); int iSel = pController->GetFontSizeCombo()->GetCurSel();
int iNewFontSize = 0; int iNewFontSize = 0;
@ -917,15 +843,7 @@ void CNetscapeEditView::OnSelendokFontSizeCombo()
void CNetscapeEditView::OnFontSizeDropDown() void CNetscapeEditView::OnFontSizeDropDown()
{ {
CEditToolBarController * pController = NULL; CEditToolBarController * pController = NULL;
#ifdef ENDER pController = (CEditToolBarController *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
CEnderBar *pEnderBar = NULL;
if (GetEmbedded())
{
pEnderBar = (CEnderBar *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
}
else
#endif //ENDER
pController = (CEditToolBarController *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
if (pController) { if (pController) {
CNSComboBox * pCombo = pController->GetFontSizeCombo(); CNSComboBox * pCombo = pController->GetFontSizeCombo();
int iSel = pCombo->GetCurSel(); int iSel = pCombo->GetCurSel();
@ -969,15 +887,7 @@ void CNetscapeEditView::OnUpdateFontSizeComboBox(CCmdUI* pCmdUI)
iFontIndex > 1 ) iFontIndex > 1 )
{ {
CEditToolBarController * pController = NULL; CEditToolBarController * pController = NULL;
#ifdef ENDER pController = (CEditToolBarController *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
CEnderBar *pEnderBar = NULL;
if (GetEmbedded())
{
pEnderBar = (CEnderBar *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
}
else
#endif //ENDER
pController = (CEditToolBarController *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
if (pController) if (pController)
{ {
char * pSize = NULL; char * pSize = NULL;
@ -998,15 +908,7 @@ void CNetscapeEditView::OnUpdateFontSizeComboBox(CCmdUI* pCmdUI)
else else
{ {
CEditToolBarController * pController = NULL; CEditToolBarController * pController = NULL;
#ifdef ENDER pController = (CEditToolBarController *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
CEnderBar *pEnderBar = NULL;
if (GetEmbedded())
{
pEnderBar = (CEnderBar *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
}
else
#endif //ENDER
pController = (CEditToolBarController *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
if (pController) if (pController)
pController->GetFontSizeCombo()->FindSelectedOrSetText(NULL); pController->GetFontSizeCombo()->FindSelectedOrSetText(NULL);
} }
@ -1026,15 +928,7 @@ void CNetscapeEditView::UpdateFontSizeCombo()
m_EditState.bFontSizeMaybeChanged = TRUE; m_EditState.bFontSizeMaybeChanged = TRUE;
m_EditState.iFontSize = -2; m_EditState.iFontSize = -2;
CEditToolBarController * pController = NULL; CEditToolBarController * pController = NULL;
#ifdef ENDER pController = (CEditToolBarController *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
CEnderBar *pEnderBar = NULL;
if (GetEmbedded())
{
pEnderBar = (CEnderBar *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
}
else
#endif //ENDER
pController = (CEditToolBarController *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
if (pController) { if (pController) {
wfe_FillFontSizeCombo(GET_MWCONTEXT, pController->GetFontSizeCombo(), wfe_FillFontSizeCombo(GET_MWCONTEXT, pController->GetFontSizeCombo(),
(EDT_GetFontFaceIndex(GET_MWCONTEXT) == 1)); (EDT_GetFontFaceIndex(GET_MWCONTEXT) == 1));
@ -1087,15 +981,7 @@ void CNetscapeEditView::OnFontColorMenu(UINT nID)
void CNetscapeEditView::OnUpdateFontColorComboBox(CCmdUI* pCmdUI) void CNetscapeEditView::OnUpdateFontColorComboBox(CCmdUI* pCmdUI)
{ {
CEditToolBarController * pController = NULL; CEditToolBarController * pController = NULL;
#ifdef ENDER pController = (CEditToolBarController *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
CEnderBar *pEnderBar = NULL;
if (GetEmbedded())
{
pEnderBar = (CEnderBar *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
}
else
#endif //ENDER
pController = (CEditToolBarController *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
if (pController) { if (pController) {
if ( m_EditState.bFontColorMaybeChanged && if ( m_EditState.bFontColorMaybeChanged &&
GetFocus() == this ) GetFocus() == this )
@ -1216,15 +1102,7 @@ void CNetscapeEditView::OnDisplayTables()
void CNetscapeEditView::OnUpdateDisplayTables(CCmdUI* pCmdUI) void CNetscapeEditView::OnUpdateDisplayTables(CCmdUI* pCmdUI)
{ {
CEditToolBarController * pController = NULL; CEditToolBarController * pController = NULL;
#ifdef ENDER pController = (CEditToolBarController *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
CEnderBar *pEnderBar = NULL;
if (GetEmbedded())
{
pEnderBar = (CEnderBar *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
}
else
#endif //ENDER
pController = (CEditToolBarController *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
if( pController && pCmdUI->m_pMenu ){ if( pController && pCmdUI->m_pMenu ){
pCmdUI->m_pMenu->ModifyMenu(ID_DISPLAY_TABLES, MF_BYCOMMAND | MF_STRING, ID_DISPLAY_TABLES, pCmdUI->m_pMenu->ModifyMenu(ID_DISPLAY_TABLES, MF_BYCOMMAND | MF_STRING, ID_DISPLAY_TABLES,
szLoadString(EDT_GetDisplayTables(GET_MWCONTEXT) ? szLoadString(EDT_GetDisplayTables(GET_MWCONTEXT) ?
@ -2644,15 +2522,7 @@ void CNetscapeEditView::UpdateListMenuItem(CCmdUI* pCmdUI, TagType t)
pCmdUI->Enable(CAN_INTERACT); pCmdUI->Enable(CAN_INTERACT);
CEditToolBarController * pController = NULL; CEditToolBarController * pController = NULL;
#ifdef ENDER pController = (CEditToolBarController *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
CEnderBar *pEnderBar = NULL;
if (GetEmbedded())
{
pEnderBar = (CEnderBar *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
}
else
#endif //ENDER
pController = (CEditToolBarController *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
if (pController && CAN_INTERACT && !pCmdUI->m_pMenu && pController->GetCharacterBar() ) { if (pController && CAN_INTERACT && !pCmdUI->m_pMenu && pController->GetCharacterBar() ) {
(pController->GetCharacterBar())->SetCheck( pCmdUI->m_nID, bIsList ); (pController->GetCharacterBar())->SetCheck( pCmdUI->m_nID, bIsList );
} }
@ -2708,15 +2578,7 @@ void CNetscapeEditView::OnAlignPopup()
RECT rectCaller = {0,0, 0, 0}; RECT rectCaller = {0,0, 0, 0};
RECT newRectCaller = {0, 0, 0, 0 }; RECT newRectCaller = {0, 0, 0, 0 };
CEditToolBarController * pController = NULL; CEditToolBarController * pController = NULL;
#ifdef ENDER pController = (CEditToolBarController *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
CEnderBar *pEnderBar = NULL;
if (GetEmbedded())
{
pEnderBar = (CEnderBar *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
}
else
#endif //ENDER
pController = (CEditToolBarController *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
if (pController) { if (pController) {
CComboToolBar * pToolbar = pController->GetCharacterBar(); CComboToolBar * pToolbar = pController->GetCharacterBar();
CCommandToolbar *pCommandToolbar = pController->GetCNSToolbar(); CCommandToolbar *pCommandToolbar = pController->GetCNSToolbar();
@ -3025,15 +2887,7 @@ void CNetscapeEditView::OnDisplayParagraphMarks()
void CNetscapeEditView::OnUpdateDisplayParagraphMarks(CCmdUI* pCmdUI) void CNetscapeEditView::OnUpdateDisplayParagraphMarks(CCmdUI* pCmdUI)
{ {
CEditToolBarController * pController = NULL; CEditToolBarController * pController = NULL;
#ifdef ENDER pController = (CEditToolBarController *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
CEnderBar *pEnderBar = NULL;
if (GetEmbedded())
{
pEnderBar = (CEnderBar *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
}
else
#endif //ENDER
pController = (CEditToolBarController *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
if( pController && pCmdUI->m_pMenu ){ if( pController && pCmdUI->m_pMenu ){
pCmdUI->m_pMenu->ModifyMenu(ID_EDIT_DISPLAY_PARAGRAPH_MARKS, MF_BYCOMMAND | MF_STRING, pCmdUI->m_pMenu->ModifyMenu(ID_EDIT_DISPLAY_PARAGRAPH_MARKS, MF_BYCOMMAND | MF_STRING,
CASTUINT(ID_EDIT_DISPLAY_PARAGRAPH_MARKS), CASTUINT(ID_EDIT_DISPLAY_PARAGRAPH_MARKS),
@ -3051,18 +2905,20 @@ void CNetscapeEditView::OnInsertObjectPopup()
} }
RECT rectCaller = {0,0, 0, 0}; RECT rectCaller = {0,0, 0, 0};
CEditToolBarController * pController = NULL; CEditToolBarController * pController = NULL;
#ifdef ENDER pController = (CEditToolBarController *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
CEnderBar *pEnderBar = NULL;
if (GetEmbedded())
{
pEnderBar = (CEnderBar *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
}
else
#endif //ENDER
pController = (CEditToolBarController *)GetParentFrame()->SendMessage(WM_TOOLCONTROLLER);
if (pController) if (pController)
{ {
// This ALWAYS gets the CharacterToolbar // This ALWAYS gets the CharacterToolbar
#ifdef ENDER //NOT TRUE IN THE EMBEDDED CASE UNFORTUNATELY
if (GetEmbedded())
{
CComboToolBar *t_bar = pController->GetCharacterBar();
if (t_bar)
t_bar->GetButtonRect(ID_INSERT_POPUP, &rectCaller);
}
else
{
#endif //ENDER
CNSToolbar2 *pCNSToolbar = pController->GetCNSToolbar(); CNSToolbar2 *pCNSToolbar = pController->GetCNSToolbar();
if( !pCNSToolbar || !pCNSToolbar->GetButtonRect(ID_INSERT_POPUP, &rectCaller) ) if( !pCNSToolbar || !pCNSToolbar->GetButtonRect(ID_INSERT_POPUP, &rectCaller) )
{ {
@ -3078,6 +2934,9 @@ void CNetscapeEditView::OnInsertObjectPopup()
pIToolBar->Release(); pIToolBar->Release();
} }
} }
#ifdef ENDER
} //this changed to one block if not embedded
#endif //ENDER
} }

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

@ -155,6 +155,14 @@ CMainFrame::~CMainFrame()
} }
#ifdef ENDER
CComboToolBar *
CMainFrame::getComposeToolBar()
{
return m_pToolBarController->GetCharacterBar();
}
#endif //ENDER
// //
// Create the ledges // Create the ledges
// //
@ -186,8 +194,11 @@ BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext *pContext)
#ifdef ENDER #ifdef ENDER
else else
{ {
m_pToolBarController = new CEnderBar(); // Create the HTML edit toolbars. There are currently two separate
if (!m_pToolBarController || !m_pToolBarController->Init(this,TRUE)) // toolbars.. one for formats and another for character operations.
EnableDocking(CBRS_ALIGN_BOTTOM);
m_pToolBarController = new CEditToolBarController(this);
if (!m_pToolBarController || !m_pToolBarController->CreateEditBars(GetMainContext()->GetContext(), TRUE, DISPLAY_CHARACTER_TOOLBAR))
{ {
TRACE("Bad ComposeBar"); TRACE("Bad ComposeBar");
if (m_pToolBarController) if (m_pToolBarController)
@ -195,10 +206,16 @@ BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext *pContext)
m_pToolBarController = NULL; m_pToolBarController = NULL;
return FALSE; return FALSE;
} }
m_pToolBarController->ShowWindow(SW_HIDE); CComboToolBar *t_combobar=m_pToolBarController->GetCharacterBar();
m_pToolBarController->SetWindowText(_T("Edit"));//RESOURCE IT! if (t_combobar)
EnableDocking(CBRS_ALIGN_BOTTOM); {
FloatControlBar(m_pToolBarController,CPoint(0,0),CBRS_ALIGN_LEFT); t_combobar->ShowWindow(SW_HIDE);
//t_combobar->SetWindowText(_T("Edit"));//RESOURCE IT!
DockControlBar(t_combobar,AFX_IDW_DOCKBAR_BOTTOM);
t_combobar->ShowWindow(SW_HIDE);
FloatControlBar(t_combobar,CPoint(0,0),CBRS_ALIGN_BOTTOM);
}
} }
#endif //ENDER #endif //ENDER

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

@ -41,7 +41,8 @@ extern int iLowerColors;
extern int colorCubeSize; extern int colorCubeSize;
#ifdef ENDER #ifdef ENDER
class CEnderBar; class CEditToolBarController;
class CComboToolBar;
#endif //ENDER #endif //ENDER
class CMainFrame : public CGenericFrame class CMainFrame : public CGenericFrame
@ -67,7 +68,7 @@ private:
CCommandToolbar *m_pCommandToolbar; CCommandToolbar *m_pCommandToolbar;
#ifdef ENDER #ifdef ENDER
//CEditToolBarController * m_pToolBarController; //CEditToolBarController * m_pToolBarController;
CEnderBar * m_pToolBarController; CEditToolBarController * m_pToolBarController;
#endif //ENDER #endif //ENDER
@ -82,7 +83,7 @@ public :
enum { TAB_FOCUS_IN_NULL, TAB_FOCUS_IN_CHROME,TAB_FOCUS_IN_GRID }; enum { TAB_FOCUS_IN_NULL, TAB_FOCUS_IN_CHROME,TAB_FOCUS_IN_GRID };
void SetTabFocusFlag( int nn ) { m_tabFocusInMainFrm = nn; } void SetTabFocusFlag( int nn ) { m_tabFocusInMainFrm = nn; }
#ifdef ENDER #ifdef ENDER
CEnderBar *getComposeToolBar(){return m_pToolBarController;} CComboToolBar *getComposeToolBar();
#endif //ENDER #endif //ENDER
//#endif /* NO_TAB_NAVIGATION */ //#endif /* NO_TAB_NAVIGATION */