Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Controls
  New Posts New Posts RSS Feed - Handle event on Statusbar ???
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Handle event on Statusbar ???

 Post Reply Post Reply
Author
Message
compvis View Drop Down
Groupie
Groupie
Avatar

Joined: 07 March 2008
Location: Vietnam
Status: Offline
Points: 36
Post Options Post Options   Thanks (0) Thanks(0)   Quote compvis Quote  Post ReplyReply Direct Link To This Post Topic: Handle event on Statusbar ???
    Posted: 12 November 2008 at 9:45pm
Hi,
 
I have a status bar with some panes ? How can i handle event when i click left-mouse on a pane of statusbar ? (with pane is a button one state)
 
thanks
I love ToolkitPro, Suite Pro ! Thanks Codejock !
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: 13 November 2008 at 2:40am
Hi,
Add ON_COMMAND in message map for StatusBar Pane's Id.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
compvis View Drop Down
Groupie
Groupie
Avatar

Joined: 07 March 2008
Location: Vietnam
Status: Offline
Points: 36
Post Options Post Options   Thanks (0) Thanks(0)   Quote compvis Quote  Post ReplyReply Direct Link To This Post Posted: 13 November 2008 at 4:20am
thank, Oleg
 
I have tried but no luck
 
my doing:
 ...
pane10.SetButton(TRUE);
....
afx_msg void OnClickPane10();
.....
ON_COMMAND(ID_PANE_10,OnClick10)
.....
 
 
then i have some exceptions...
 
 
 
I love ToolkitPro, Suite Pro ! Thanks Codejock !
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: 13 November 2008 at 8:13am
Hi,
 
Show all code around pane10.SetButton(TRUE);
 
What "some exceptions" ?
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
compvis View Drop Down
Groupie
Groupie
Avatar

Joined: 07 March 2008
Location: Vietnam
Status: Offline
Points: 36
Post Options Post Options   Thanks (0) Thanks(0)   Quote compvis Quote  Post ReplyReply Direct Link To This Post Posted: 13 November 2008 at 10:45pm
hi, this is my codes:
 

if (!m_wndStatusBar.Create(this) ||

!m_wndStatusBar.SetIndicators(indicators,

sizeof(indicators)/sizeof(UINT)))

{

TRACE0("Failed to create status bar\n");

return -1; // fail to create

}

m_wndStatusBar.SetPaneInfo(0, ID_INDICATOR_INFO, SBPS_STRETCH, 0);

//m_wndStatusBar.SetPaneInfo(1, ID_INDICATOR_OVEN1, SBPS_NORMAL, 100);

m_wndStatusBar.SetPaneText(0,_T("Khởi tạo chương trình thành công !"));

//Tạo item logo trên Status bar

CXTPStatusBarPane* pane = m_wndStatusBar.AddIndicator(ID_INDICATOR_LOGO, 0);

pane->SetText(_T("(C) thanhly's 2008"));

pane->SetStyle(pane->GetStyle() | SBPS_POPOUT);

CXTPPaintManager::CNonClientMetrics ncm;

ncm.lfMenuFont.lfWeight = FW_HEAVY;

pane->SetTextFont(&ncm.lfMenuFont);

pane->SetTextColor(GetXtremeColor(COLOR_3DHIGHLIGHT)); //COLOR_3DSHADOW

pane->SetWidth(0); // Best Fit

pane->SetButton(TRUE);

m_wndStatusBar.SetRibbonDividerIndex(2);

m_wndStatusBar.SetPaneStyle(0, m_wndStatusBar.GetPaneStyle(0) | SBPS_NOBORDERS);

and:

afx_msg void OnTime();

and:

ON_COMMAND(ID_INDICATOR_TIME,OnTime)

and:
 

void Ce5ckDlg::OnTime()

{ //Do something here

}

Debug app, one exception occurs and mouse jumps to line 2160 in wincore.cpp file like below:

 

case AfxSig_v_u_p:

{

CPoint point(lParam);

(this->*mmf.pfn_v_u_p)(static_cast<UINT>(wParam), point);

}

break; //-->>this is the mouse points

 

thanks,

I love ToolkitPro, Suite Pro ! Thanks Codejock !
Back to Top
compvis View Drop Down
Groupie
Groupie
Avatar

Joined: 07 March 2008
Location: Vietnam
Status: Offline
Points: 36
Post Options Post Options   Thanks (0) Thanks(0)   Quote compvis Quote  Post ReplyReply Direct Link To This Post Posted: 17 November 2008 at 12:32am
Oleg, help me ???
I love ToolkitPro, Suite Pro ! Thanks Codejock !
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: 17 November 2008 at 9:05am

Hi,

You call SetButton for ID_INDICATOR_LOGO - not for ID_INDICATOR_TIME.  and AfxSig_v_u_p called not for WM_COMMAND - for another handler of your message map.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
compvis View Drop Down
Groupie
Groupie
Avatar

Joined: 07 March 2008
Location: Vietnam
Status: Offline
Points: 36
Post Options Post Options   Thanks (0) Thanks(0)   Quote compvis Quote  Post ReplyReply Direct Link To This Post Posted: 17 November 2008 at 9:40pm
thanks, oleg
 
i changed but nothing better, the same error occurs...
 
pls help !
I love ToolkitPro, Suite Pro ! Thanks Codejock !
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: 18 November 2008 at 3:54am
Hi,
Problem not in this code. Somewhere else. remove some parts from project and send it to support@codejock.com.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
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.219 seconds.