![]() |
MiniToolbar - Buttons Disabled |
Post Reply ![]() |
Author | |
barobax ![]() Senior Member ![]() Joined: 07 May 2008 Status: Offline Points: 117 |
![]() ![]() ![]() ![]() ![]() Posted: 03 August 2008 at 8:01pm |
Hi,
my MiniToolbar Buttons are disabled. ON_COMMAND(IDM_VOICES_US, DSyntax::OnUS_Clicked) ON_UPDATE_COMMAND_UI(IDM_US, DSyntax::OnUpdateUS) ON_COMMAND(IDM_VOICES_UK, DSyntax::OnUK_Clicked) ON_UPDATE_COMMAND_UI(IDM_UK, DSyntax::OnUpdateUK) ON_COMMAND(IDM_VOICES_AU, DSyntax::OnAU_Clicked) ON_UPDATE_COMMAND_UI(IDM_AU, DSyntax::OnUpdateAU) m_US = (CXTPControlButton*)m_MiniToolBar->GetControls()->Add(xtpControlButton, IDM_US); m_UK = (CXTPControlButton*)m_MiniToolBar->GetControls()->Add(xtpControlButton, IDM_UK); m_AU = (CXTPControlButton*)m_MiniToolBar->GetControls()->Add(xtpControlButton, IDM_AU); |
|
![]() |
|
Oleg ![]() Senior Member ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
ON_COMMAND(IDM_VOICES_US, DSyntax::OnUS_Clicked)
ON_UPDATE_COMMAND_UI(IDM_US, DSyntax::OnUpdateUS) have to be same.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
barobax ![]() Senior Member ![]() Joined: 07 May 2008 Status: Offline Points: 117 |
![]() ![]() ![]() ![]() ![]() |
sorry for above lines
ON_COMMAND(IDM_US, DSyntax::OnUS_Clicked) ON_UPDATE_COMMAND_UI(IDM_US, DSyntax::OnUpdateUS) ON_COMMAND(IDM_UK, DSyntax::OnUK_Clicked) ON_UPDATE_COMMAND_UI(IDM_UK, DSyntax::OnUpdateUK) ON_COMMAND(IDM_AU, DSyntax::OnAU_Clicked) ON_UPDATE_COMMAND_UI(IDM_AU, DSyntax::OnUpdateAU) m_US = (CXTPControlButton*)m_MiniToolBar->GetControls()->Add(xtpControlButton, IDM_US); m_UK = (CXTPControlButton*)m_MiniToolBar->GetControls()->Add(xtpControlButton, IDM_UK); m_AU = (CXTPControlButton*)m_MiniToolBar->GetControls()->Add(xtpControlButton, IDM_AU); |
|
![]() |
|
Oleg ![]() Senior Member ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
Check if these handlers are really called. if not, you have move them to CMainFrame or to View. not sure what DSyntax is...
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
barobax ![]() Senior Member ![]() Joined: 07 May 2008 Status: Offline Points: 117 |
![]() ![]() ![]() ![]() ![]() |
Hi,
BEGIN_MESSAGE_MAP(DSyntax, CXTPSyntaxEditCtrl) ON_COMMAND(IDM_US, DSyntax::OnUS_Clicked) ON_UPDATE_COMMAND_UI(IDM_US, DSyntax::OnUpdateUS) ON_COMMAND(IDM_UK, DSyntax::OnUK_Clicked) ON_UPDATE_COMMAND_UI(IDM_UK, DSyntax::OnUpdateUK) ON_COMMAND(IDM_AU, DSyntax::OnAU_Clicked) ON_UPDATE_COMMAND_UI(IDM_AU, DSyntax::OnUpdateAU) ON_WM_MOUSEMOVE() ON_WM_CREATE() ON_WM_RBUTTONUP() END_MESSAGE_MAP() |
|
![]() |
|
Oleg ![]() Senior Member ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
Where do you have this DSyntax ? on dialog ?
ToolBars/MiniBar send messages to main site, if you don't recevie them in DSyntax, you have to move handlers to main site (your CMainFrame or main dialog) or manually forward them.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
barobax ![]() Senior Member ![]() Joined: 07 May 2008 Status: Offline Points: 117 |
![]() ![]() ![]() ![]() ![]() |
Hi oleg,
ON_WM_CREATE() does not work when I set a breakpoint in OnCreate Block. My application run without hint to breakpoint. int DSyntax::OnCreate(LPCREATESTRUCT lpCreateStruct) { return CXTPSyntaxEditCtrl::OnCreate(lpCreateStruct); } in (class DEdit : public CXTEdit) is so on and my control created without call to my overrided method. I moved handlers to CMainFrame and is like previous step and my buttons are disabled. MiniToolbar created on OnRButtonUp void DSyntax::OnRButtonUp(UINT nFlags, CPoint point) { if (m_MiniToolBar) { CXTPCommandBars* pCommandBars = ((CMainFrame*)AfxGetMainWnd())->GetCommandBars(); m_MiniToolBar = CXTPMiniToolBar::CreateMiniToolBar(((CMainFrame*)AfxGetMainWnd())->GetCommandBars()); m_MiniToolBar->SetWidth(22 * 3 + 4); m_US = (CXTPControlButton*)m_MiniToolBar->GetControls()->Add(xtpControlButton, IDM_US); m_UK = (CXTPControlButton*)m_MiniToolBar->GetControls()->Add(xtpControlButton, IDM_UK); m_VoiceAU = (CXTPControlButton*)m_MiniToolBar->GetControls()->Add(xtpControlButton, IDM_AU); UINT nIDs[] = {IDM_US, IDM_UK, IDM_AU}; ((CMainFrame*)AfxGetMainWnd())->GetCommandBars()->GetImageManager()->SetIcons(IDB_PNG3, nIDs, 3, CSize(16, 16)); } m_AU->SetEnabled(TRUE); ClientToScreen(&point); m_MiniToolBar->TrackMiniBar(0, point.x, point.y + 30); CXTPSyntaxEditCtrl::OnRButtonUp(nFlags, point); } My Header file class DSyntax : public CXTPSyntaxEditCtrl { private: CXTPMiniToolBar* m_MiniToolBar; CXTPMiniToolBar* m_MiniToolBarOptions; CXTPControlButton* m_US; CXTPControlButton* m_UK; CXTPControlButton* m_AU; CString m_SampleString; DECLARE_MESSAGE_MAP(); public: DSyntax(); ~DSyntax(); afx_msg void OnMouseMove(UINT nFlags, CPoint point); afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); void OnRButtonUp(UINT nFlags, CPoint point); afx_msg void OnUS_Clicked(); void OnUpdateUS(CCmdUI* pCmdUI); afx_msg void OnUK_Clicked(); void OnUpdateUK(CCmdUI* pCmdUI); afx_msg void OnAU_Clicked(); void OnUpdateAU(CCmdUI* pCmdUI); }; |
|
![]() |
|
Oleg ![]() Senior Member ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
I need to see whole picture. Attach sample project, I wll help to fix it.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
barobax ![]() Senior Member ![]() Joined: 07 May 2008 Status: Offline Points: 117 |
![]() ![]() ![]() ![]() ![]() |
Hi,
Thanks for your responses oleg. I solve problem with moving all in CMainFrame. But my Overrided OnCreate does not work. WHY?!?! in any inherited class from CodeJock controls have same problem.(CXTEdit,CXTPSyntaxEditCtrl) |
|
![]() |
|
Oleg ![]() Senior Member ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
Are you sure you create it and not subclass from some control from dialog?
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
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 |