Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Missing maximize button on ribbon bar
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Missing maximize button on ribbon bar

 Post Reply Post Reply
Author
Message
Nick Burger View Drop Down
Newbie
Newbie
Avatar

Joined: 31 July 2006
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote Nick Burger Quote  Post ReplyReply Direct Link To This Post Topic: Missing maximize button on ribbon bar
    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

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: 14 August 2006 at 7:59am
Hi,
Do you have same problem with our sample?
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Nick Burger View Drop Down
Newbie
Newbie
Avatar

Joined: 31 July 2006
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote Nick Burger Quote  Post ReplyReply Direct Link To This Post Posted: 14 August 2006 at 9:27am
Have to check it with you samples, but it worked with XTP 9.7!
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: 14 August 2006 at 9:43am

So what versions of what components you use?

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Nick Burger View Drop Down
Newbie
Newbie
Avatar

Joined: 31 July 2006
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote Nick Burger Quote  Post ReplyReply Direct Link To This Post Posted: 14 August 2006 at 10:06am
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.
 


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: 14 August 2006 at 11:15am
Hi,
Strange.. it looks like you use Ribbon instead MenuBar?
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Nick Burger View Drop Down
Newbie
Newbie
Avatar

Joined: 31 July 2006
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote Nick Burger Quote  Post ReplyReply Direct Link To This Post Posted: 15 August 2006 at 3:46am
"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?
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: 15 August 2006 at 10:13am
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
Back to Top
Nick Burger View Drop Down
Newbie
Newbie
Avatar

Joined: 31 July 2006
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote Nick Burger Quote  Post ReplyReply Direct Link To This Post Posted: 16 August 2006 at 4:16am
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?
 
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: 16 August 2006 at 11:27am
Nick, I need debug your code... May be you just remove WS_MAXIMIZEBOX style from frame...
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Nick Burger View Drop Down
Newbie
Newbie
Avatar

Joined: 31 July 2006
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote Nick Burger Quote  Post ReplyReply Direct Link To This Post Posted: 17 August 2006 at 7:22am
dwStyle = 0x168f8000 means, as I assume , that bit 0x00010000 is set, which is WS_MAXIMIZEBOX.

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.

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 August 2006 at 7:45am

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
Back to Top
Nick Burger View Drop Down
Newbie
Newbie
Avatar

Joined: 31 July 2006
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote Nick Burger Quote  Post ReplyReply Direct Link To This Post Posted: 17 August 2006 at 9:14am
"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?

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 August 2006 at 9:46am
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
Back to Top
Nick Burger View Drop Down
Newbie
Newbie
Avatar

Joined: 31 July 2006
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote Nick Burger Quote  Post ReplyReply Direct Link To This Post Posted: 21 August 2006 at 7:46am
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?

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: 21 August 2006 at 8:46am
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
Back to Top
Nick Burger View Drop Down
Newbie
Newbie
Avatar

Joined: 31 July 2006
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote Nick Burger Quote  Post ReplyReply Direct Link To This Post Posted: 21 August 2006 at 9:28am
cool!  That was the problem.

Which ID range do you use for XtremeToolkit Pro?


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: 21 August 2006 at 10:19am
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
Back to Top
Nick Burger View Drop Down
Newbie
Newbie
Avatar

Joined: 31 July 2006
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote Nick Burger Quote  Post ReplyReply Direct Link To This Post Posted: 21 August 2006 at 10:40am
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 .

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.188 seconds.