![]() |
Missing maximize button on ribbon bar |
Post Reply ![]() |
Author | |
Nick Burger ![]() Newbie ![]() ![]() Joined: 31 July 2006 Status: Offline Points: 13 |
![]() ![]() ![]() ![]() ![]() Posted: 11 August 2006 at 11:27am |
When creating a ribbon bar in our MDI application the maximize button of the frame window is missing when the window is in it's restored state.
Whe maximized the restore button is visible. ![]() ![]() Any ideas? greetings from germany Nick |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
Do you have same problem with our sample?
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Nick Burger ![]() Newbie ![]() ![]() Joined: 31 July 2006 Status: Offline Points: 13 |
![]() ![]() ![]() ![]() ![]() |
Have to check it with you samples, but it worked with XTP 9.7!
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
So what versions of what components you use? |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Nick Burger ![]() Newbie ![]() ![]() Joined: 31 July 2006 Status: Offline Points: 13 |
![]() ![]() ![]() ![]() ![]() |
Xtreme ToolkitPro 10.3
MDI Applikation. MainFrame Class derived from CXTPMDIFrameWnd. In OnCreate: CXTPCommandBars* pCommandBars = GetCommandBars(); m_wndMenuBar = pCommandBars->SetMenu(csTitle, IDR_MAINFRAME); m_wndMenuBar->EnableCustomization(FALSE); m_wndMenuBar->EnableDocking(xtpFlagAlignTop); m_wndMenuBar->SetFlags(xtpFlagHideMinimizeBox|xtpFlagHideMaximizeBox|xtpFlagHideClose, 0); m_wndMenuBar->SetFlags(xtpFlagStretched, 1); /* other init code */ OnReloadMenuBar(); MainFrame::OnReleadMenuBar() { CMenu* pMenu = NULL; VARIANT_BOOL vbDatabaseIsOpen; m_spDatabaseManager->IsDatabaseOpen(&vbDatabaseIsOpen); if(vbDatabaseIsOpen == VARIANT_TRUE) { m_LongMenu.DestroyMenu(); m_LongMenu.LoadMenu(IDR_MUITYPE); pMenu = &m_LongMenu; } else { m_ShortMenu.DestroyMenu(); m_ShortMenu.LoadMenu(IDR_MAINFRAME); pMenu = &m_ShortMenu; } m_Coolmenu.LoadMenu(pMenu); } m_Coolmenu has a pointer to m_wndMenuBar and calls LoadMenu on m_wndMenuBar. |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
Strange.. it looks like you use Ribbon instead MenuBar?
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Nick Burger ![]() Newbie ![]() ![]() Joined: 31 July 2006 Status: Offline Points: 13 |
![]() ![]() ![]() ![]() ![]() |
"looks like you use Ribbon instead MenuBar" Great hint
![]() There was a line of code left over from a ribbon test. ThanX. But when I remove all menu and toolbar code, and create a ribbon bar, I'll get this bahavior too. pCommandBars->SetPaintManager(new CXTPRibbonTheme()); /* ...... */ if (!CreateRibbonBar()) { TRACE0("Failed to create ribbon\n"); return -1; } /* ------- */ BOOL CMainFrame::CreateRibbonBar() { CXTPCommandBars* pCommandBars = GetCommandBars(); SetMenu(NULL); CXTPRibbonBar* pRibbonBar = (CXTPRibbonBar*)pCommandBars->Add(_T("The Ribbon"), xtpBarTop, RUNTIME_CLASS(CXTPRibbonBar)); if (!pRibbonBar) { return FALSE; } pRibbonBar->EnableDocking(0); pRibbonBar->SetFlags(xtpFlagHideMDIButtons, 0); // pRibbonBar->SetFlags(xtpFlagStretched, 1); CXTPControlPopup* pControlFile = (CXTPControlPopup*)pRibbonBar->AddSystemButton(); pControlFile->SetCommandBar(m_LongMenu.GetSubMenu(0)); pControlFile->SetCaption(_T("&File")); pControlFile->SetIconId(IDB_GEAR); UINT uCommand = {IDB_GEAR}; pCommandBars->GetImageManager()->SetIcons(IDB_GEAR, &uCommand, 1, xtpImageNormal); CXTPRibbonTab* pTab = pRibbonBar->AddTab(IDR_EDIT_TOOLBAR); CXTPRibbonGroup* pGroupView = pTab->AddGroup(IDS_STATICVIEWTEXT); pGroupView->Add(xtpControlButton, ID_EDIT_SINGLELETTER); pGroupView->Add(xtpControlButton, ID_EDIT_BUILD_HIERARCHY); pGroupView->Add(xtpControlButton, ID_VIEW_CHOOSE_VIEW_DIALOG); pGroupView->Add(xtpControlButton, ID_FORMAT_STATISTIK); pGroupView->Add(xtpControlButton, ID_QUERY_QBE); pRibbonBar->SetCloseable(FALSE); pRibbonBar->EnableFrameTheme(); return TRUE; } What could probably be wrong? |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
Code looks good. Cna you attach whole project? May be you just forget to add this button image or something.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Nick Burger ![]() Newbie ![]() ![]() Joined: 31 July 2006 Status: Offline Points: 13 |
![]() ![]() ![]() ![]() ![]() |
I tried the following code (in CMainFrame::OnCreate):
pCommandBars->SetTheme(xtpThemeRibbon); HMODULE hModule = LoadLibrary(m_csStylesPath + _T("Office2007Blue.dll")); ((CXTPOffice2007Theme*)GetCommandBars()->GetPaintManager())->SetImageHandle(hModule); and copied the style folder from your samples. But still the same problem. if (pControl->GetID() == SC_MAXIMIZE) { pControl->SetHideFlag(xtpHideGeneric, (dwStyle & WS_MAXIMIZE) || ((dwStyle & WS_MAXIMIZEBOX) == 0)); } if (pControl->GetID() == SC_RESTORE) { pControl->SetHideFlag(xtpHideGeneric, !(dwStyle & WS_MAXIMIZE) || ((dwStyle & WS_MAXIMIZEBOX) == 0)); } in CXTPOffice2007FrameHook is called with dwStyle = 0x168f8000 whe frame window is'nt maximized. Am I right, that I do not have to add any bitmaps to may project, when using SetImageHandle() on PaintManager? |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Nick, I need debug your code... May be you just remove WS_MAXIMIZEBOX style from frame...
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Nick Burger ![]() Newbie ![]() ![]() Joined: 31 July 2006 Status: Offline Points: 13 |
![]() ![]() ![]() ![]() ![]() |
dwStyle = 0x168f8000 means, as I assume
![]() 0x168f8000 0x00010000 It works without RibbonBar. Either the bitmaps for MaximizeBox are missing for some reason, or visibility of MaximizeBox is turned off from any other place and reason, which I don't know and have to find. |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi, Nick, I don't see way to help you without debugging your code.... If project not so big, create new issue and attach it, I will help you to find problem... Or try manually set breakpoint in if (pControl->GetID() == SC_MAXIMIZE) block and check if HideFlag == 0.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Nick Burger ![]() Newbie ![]() ![]() Joined: 31 July 2006 Status: Offline Points: 13 |
![]() ![]() ![]() ![]() ![]() |
"manually set breakpoint in if (pControl->GetID() == SC_MAXIMIZE) block and check if HideFlag == 0."
Already did that. HideFlag is definitly 0. Project is much too big plus depends on tons of other COM-modules. I understand that you need to know more about the code to help. Will try to debug the thing. Where will I find the code which actually draws the maximizebox? PaintManager? |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
Set breakpoint in
void CXTPOffice2007Theme::DrawRibbonFrameCaptionButton(CDC* pDC, CRect rc, int nId, BOOL bSelected, BOOL bPressed, BOOL bActive)
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Nick Burger ![]() Newbie ![]() ![]() Joined: 31 July 2006 Status: Offline Points: 13 |
![]() ![]() ![]() ![]() ![]() |
Set the breakpoint, but code is never called for (nId == SC_MAXIMIZE).
In xtpribbonbar.cpp line: 1207 you loop through all control buttons. pControl->IsVisible() return false for Maximize-Control. In CXTPOffice2007FrameHook::RepositionCaptionButtons HideFlag for SC_MAXIMIZE is set to 0. Looks to me like I have two different CXTPControl buttons with m_nID == SC_MAXIMIZE. On is set to visible, but the other should be drawn. Any other idea where I can look/debug to find the problem? |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
btw... check your resource.h may be you have some id that is
equal to SC_MAXIMIZE
SC_MAXIMIZE = 0xF030 = 61488
?
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Nick Burger ![]() Newbie ![]() ![]() Joined: 31 July 2006 Status: Offline Points: 13 |
![]() ![]() ![]() ![]() ![]() |
cool!
![]() Which ID range do you use for XtremeToolkit Pro? |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
Actually tooolkit's resources from 9000 to 10000...
but this is MFC/OS resource.
so better use range from 100 to 9000
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Nick Burger ![]() Newbie ![]() ![]() Joined: 31 July 2006 Status: Offline Points: 13 |
![]() ![]() ![]() ![]() ![]() |
You should see our ResourceId's. It's a project grown through the last 12 years. It was once a 16 bit version. If you want to knwo what evolution means, this is an extraordinary example
![]() |
|
![]() |
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 |