The end desired result is a CMFCStatusBar with 3 panes, 0, 1, 2. Panes 0 & 2 are to contain programmatically set text; pane 1 is a bitmap. Panes 0 & 1 are of fixed length, pane 2 is “Stretch".
I have the following:
//-----------------------------------------------------------------CMainFrameEx.cpp
ON_UPDATE_COMMAND_UI(IDCTL_SB_Pane_0, &CJBK_MF::OnUpdatePane)
p_SBCls = new CJBK_SB; ASSERT(p_SBCls->CreateEx(this, SB_CTRL_STYLE, SB_WND_STYLE, IDCls_SB));
sTemp.LoadStringW(ID_Text_SB_Init); p_SBCls->SetPaneText(0, sTemp, TRUE);
void CJBK_MF::OnUpdatePane(CCmdUI* p_CmdUI)
{
p_CmdUI->Enable(TRUE);
}
//--------------------------------------------------------------Status_Bar_Class.cpp
IDArr[0] = IDCTL_SB_Pane_0;
IDArr[1] = IDCTL_SB_Pane_1;
IDArr[2] = IDCTL_SB_Pane_2;
p_IDArr = &IDArr[0];
ASSERT(this->;SetIndicators(p_IDArr, 3));
//-------------------------------------------------------------------CMainFrameEx.h
afx_msg void OnUpdatePane(CCmdUI* p_CmdUI);
Panes 0 & 1 work correctly.
When I modify CMainframeEx.cpp (see below), Pane 2 does not display the text.
sTemp.LoadStringW(ID_Text_SB_Init);
p_SBCls->SetPaneText(0, sTemp, TRUE);
sTemp.LoadStringW(ID_Text_SB_Init);
p_SBCls->SetPaneText(0, sTemp, TRUE);
sTemp.LoadStringW(ID_Text_SB_ABC);
p_SBCls->SetPaneText(2, sTemp, TRUE);
ON_UPDATE_COMMAND_UI(IDCTL_SB_Pane_0, &CJBK_MF::OnUpdatePane)
ON_UPDATE_COMMAND_UI(IDCTL_SB_Pane_0, &CJBK_MF::OnUpdatePane) ON_UPDATE_COMMAND_UI(IDCTL_SB_Pane_2, &CJBK_MF::OnUpdatePane)
Can anyone please help me spot why Pane 2 does not display? The status bar contains a "gipper"; does that count in the pane count?
Thanks,
Barry