Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - CXTPStatusBar
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPStatusBar

 Post Reply Post Reply
Author
Message
VolkerE View Drop Down
Newbie
Newbie
Avatar

Joined: 09 February 2006
Location: Germany
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote VolkerE Quote  Post ReplyReply Direct Link To This Post Topic: CXTPStatusBar
    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!
 
Back to Top
Simon HB9DRV View Drop Down
Senior Member
Senior Member
Avatar

Joined: 07 July 2005
Location: Switzerland
Status: Offline
Points: 458
Post Options Post Options   Thanks (0) Thanks(0)   Quote Simon HB9DRV Quote  Post ReplyReply Direct Link To This Post Posted: 07 July 2008 at 6:02am
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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 08 July 2008 at 6:35am
Hi,
 
Try
 
  m_pMainFrame->SetMessageText(status);
 
instead.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
VolkerE View Drop Down
Newbie
Newbie
Avatar

Joined: 09 February 2006
Location: Germany
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote VolkerE Quote  Post ReplyReply Direct Link To This Post Posted: 08 July 2008 at 6:54am
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
Back to Top
Smucker View Drop Down
Senior Member
Senior Member
Avatar

Joined: 02 February 2008
Status: Offline
Points: 156
Post Options Post Options   Thanks (0) Thanks(0)   Quote Smucker Quote  Post ReplyReply Direct Link To This Post Posted: 08 July 2008 at 8:32am
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)

Back to Top
VolkerE View Drop Down
Newbie
Newbie
Avatar

Joined: 09 February 2006
Location: Germany
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote VolkerE Quote  Post ReplyReply Direct Link To This Post Posted: 08 July 2008 at 9:02am
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
Back to Top
Smucker View Drop Down
Senior Member
Senior Member
Avatar

Joined: 02 February 2008
Status: Offline
Points: 156
Post Options Post Options   Thanks (0) Thanks(0)   Quote Smucker Quote  Post ReplyReply Direct Link To This Post Posted: 08 July 2008 at 12:15pm
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)

Back to Top
rdhd View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 August 2007
Location: United States
Status: Offline
Points: 891
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdhd Quote  Post ReplyReply Direct Link To This Post Posted: 08 April 2009 at 11:37am
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.
Back to Top
VolkerE View Drop Down
Newbie
Newbie
Avatar

Joined: 09 February 2006
Location: Germany
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote VolkerE Quote  Post ReplyReply Direct Link To This Post Posted: 09 April 2009 at 3:33am
Hi,
 
thanks a lot, this helped!
 
Regards,
Volker
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.297 seconds.