summaryrefslogtreecommitdiff
path: root/win
diff options
context:
space:
mode:
Diffstat (limited to 'win')
-rw-r--r--win/Mainfrm.cpp13
-rw-r--r--win/System.cpp27
2 files changed, 32 insertions, 8 deletions
diff --git a/win/Mainfrm.cpp b/win/Mainfrm.cpp
index 6754379..cb980ab 100644
--- a/win/Mainfrm.cpp
+++ b/win/Mainfrm.cpp
@@ -1082,16 +1082,12 @@ LRESULT CMainFrame::OnSetMessageString(WPARAM wParam, LPARAM lParam)
CString strMessage;
// set the message bar text
- if (!m_strStatusBar.IsEmpty())
- {
- lpsz = m_strStatusBar;
- }
- else if (lParam != 0)
+ if (lParam != 0)
{
ASSERT(wParam == 0); // can't have both an ID and a string
lpsz = (LPCTSTR)lParam; // set an explicit string
}
- else if (wParam != 0)
+ else if ((wParam != 0) && !(wParam == AFX_IDS_IDLEMESSAGE && !m_strStatusBar.IsEmpty()))
{
// map SC_CLOSE to PREVIEW_CLOSE when in print preview mode
if (wParam == AFX_IDS_SCCLOSE && m_lpfnCloseProc != NULL)
@@ -1101,6 +1097,11 @@ LRESULT CMainFrame::OnSetMessageString(WPARAM wParam, LPARAM lParam)
GetMessageString(wParam, strMessage);
lpsz = strMessage;
}
+ else if (!m_strStatusBar.IsEmpty())
+ {
+ lpsz = m_strStatusBar;
+ }
+
pMessageBar->SetWindowText(lpsz);
// update owner of the bar in terms of last message selected
diff --git a/win/System.cpp b/win/System.cpp
index 89b57ca..47db92b 100644
--- a/win/System.cpp
+++ b/win/System.cpp
@@ -586,10 +586,10 @@ void SystemUpdateSnap(const unsigned long nSnap)
// TODO: change Snap None & All (or maybe not ?)
}
-void SystemUpdateSelected(unsigned long flags)
+void SystemUpdateSelected(unsigned long flags, int SelectedCount, Object* Focus)
{
CMenu* pMenu;
- CFrameWnd* pFrame = (CFrameWnd*)AfxGetMainWnd();
+ CMainFrame* pFrame = (CMainFrame*)AfxGetMainWnd();
if (!pFrame)
return;
CToolBar* pBar = (CToolBar*)pFrame->GetControlBar(AFX_IDW_TOOLBAR);
@@ -655,6 +655,29 @@ void SystemUpdateSelected(unsigned long flags)
pCtrl->EnableButton(ID_PIECE_PREVIOUS, flags & LC_SEL_PIECE ? TRUE : FALSE);
pCtrl->EnableButton(ID_PIECE_NEXT, flags & LC_SEL_PIECE ? TRUE : FALSE);
+
+ // Status bar text.
+ if (SelectedCount == 0)
+ {
+ pFrame->SetStatusBarMessage("");
+ pFrame->SetMessageText(AFX_IDS_IDLEMESSAGE);
+ }
+ else if ((SelectedCount == 1) && (Focus != NULL))
+ {
+ pFrame->SetStatusBarMessage(Focus->GetName());
+ pFrame->SetMessageText(Focus->GetName());
+ }
+ else
+ {
+ char Message[256];
+ if (SelectedCount == 1)
+ strcpy(Message, "1 Object selected.");
+ else
+ sprintf(Message, "%d Objects selected.", SelectedCount);
+
+ pFrame->SetStatusBarMessage(Message);
+ pFrame->SetMessageText(Message);
+ }
}
// Changed current step/frame