CXTPStatusBar |
Post Reply |
Author | |
VolkerE
Newbie Joined: 09 February 2006 Location: Germany Status: Offline Points: 8 |
Post Options
Thanks(0)
Posted: 07 July 2008 at 5:52am |
Hello,
I made he same experience as posted by Guybrush (https://forum.codejock.com/forum_posts.asp?TID=10432) when using CXTPStatusBar::SetPaneText().
The problem can be easily reproduced using the MDITextEditor sample:
1. In MainFrm.h add a method to access the status bar member:
CXTPStatusBar& GetStatusBar(){return ( m_wndStatusBar );};
2. In CMDITextEditorApp::OnFileOpen() display the path of each file as it is being opened:
if (!ActivateExisting(csFilePath)) { CString status; status.Format("Opening file: %s ...", csFilePath); m_pMainFrame->GetStatusBar().SetPaneText(0, status); m_pDocTemplate->OpenDocumentFile(csFilePath); } After building this with ToolKitPro 11.2.2 select a couple of files to be opened: you will see the status bar updated for each file being opened.
Trying the same with 12.0.0 or 12.0.1 gives a different result: the status text will never be displayed, there is always the standard "Ready" status visible!
|
|
Simon HB9DRV
Senior Member Joined: 07 July 2005 Location: Switzerland Status: Offline Points: 458 |
Post Options
Thanks(0)
|
I think the 12.0.x behaviour is in fact correct, you should really use an onupdate handler to update status bar panes.
|
|
Simon HB9DRV
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Try
m_pMainFrame->SetMessageText(status);
instead.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
VolkerE
Newbie Joined: 09 February 2006 Location: Germany Status: Offline Points: 8 |
Post Options
Thanks(0)
|
Hi Oleg,
I did try, but it doesn't help. SetMessageText() will also call
XTPStatusBar::SetPaneText() finally, and has the same effect: the new text will not display
|
|
Smucker
Senior Member Joined: 02 February 2008 Status: Offline Points: 156 |
Post Options
Thanks(0)
|
GetStatusBar()->UpdateAllPanes(TRUE, TRUE);
(FALSE, TRUE) if you don't want the rectangles to be adjusted. |
|
Product: Xtreme Toolkit Pro version 13.2 (Unicode, static build)
Platform: Windows 200x/XP/Vista/Win7 (32/64 bit) Language: Visual C++ 9.0 (Studio 2008) |
|
VolkerE
Newbie Joined: 09 February 2006 Location: Germany Status: Offline Points: 8 |
Post Options
Thanks(0)
|
Hi Smucker,
thank you, but this is already in my real application, where I encountered the problem. I just now tried it in the MDITextEditor sample, with no effect.
In the current 12.2.x implementation the second argument 'bUpdateText' of UpdateAllPanes() is ignored, and the method will do nothing if the the first argument is FALSE:
void CXTPStatusBar::UpdateAllPanes(BOOL bUpdateRects, BOOL /*bUpdateText*/) { if (bUpdateRects) { RecalcLayout(); } } Thanks anyway,
Volker
|
|
Smucker
Senior Member Joined: 02 February 2008 Status: Offline Points: 156 |
Post Options
Thanks(0)
|
Strange. I wonder why I'm not seeing the problem. I derive my status
bar class from CXTPStatusBar, and include member pointers to the panes.
Below is my code for my "doing" status pane (added using AddIndicator()). It updates during long operations, such as reading a folder. Perhaps it's one of the other methods that's making it display. I also have several other indicator panes, and don't have any problems with them either. None of my panes has an ID of zero. I think I remember reading here that CJ handles them differently. void CtpStatusBar::StatusDoing(LPCTSTR text, BOOL append) { if (m_pdoing) { if (text && text[0]) { if (append) m_doing += text; else m_doing = text; m_pdoing->SetText(m_doing); m_pdoing->SetVisible(TRUE); } else { m_doing = _T(""); m_pdoing->SetText(_T("")); m_pdoing->SetVisible(FALSE); } m_pdoing->BestFit(); PositionControls(); UpdateAllPanes(TRUE, TRUE); } } m_pdoing is defined as: CXTPStatusBarPane* m_pdoing; And it is created using: AddIndicator(m_pdoing = new CXTPStatusBarPane(), SID_DOING, 3); |
|
Product: Xtreme Toolkit Pro version 13.2 (Unicode, static build)
Platform: Windows 200x/XP/Vista/Win7 (32/64 bit) Language: Visual C++ 9.0 (Studio 2008) |
|
rdhd
Senior Member Joined: 13 August 2007 Location: United States Status: Offline Points: 891 |
Post Options
Thanks(0)
|
After calling SetPaneText, call SendMessage( WM_PAINT ) to force the paint to occur in real time. Otherwise the user may not see all of the messages your are trying to set when there is no message processing between calls. For instance, if you call SetPaneText a number of times while doing extensive processing, the user will only see the last message when your processing is done and you the system returns to the message loop and starts dispatching the messages.
|
|
VolkerE
Newbie Joined: 09 February 2006 Location: Germany Status: Offline Points: 8 |
Post Options
Thanks(0)
|
Hi,
thanks a lot, this helped!
Regards,
Volker
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |