Print Page | Close Window

Ribbon in dialog - 2 questions

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=7449
Printed Date: 25 April 2024 at 12:56pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Ribbon in dialog - 2 questions
Posted By: irekz
Subject: Ribbon in dialog - 2 questions
Date Posted: 25 June 2007 at 4:07pm
Hi to all :)
 
I have 2 questions regarding ribbon in CXTPDialogBase<CXTResizeDialog> based dialog:
 
Q1) Ribbon in dialog and frame looks OK but dialog itself is not painted with blue background - is there a way to fix it?
 
Q2) My application presents a list of attachments in one of the tabs of ribbon. I need to modify it in run time. All the API seems to be there and works OK except content of ribbon is not redrawn (you need to change tabs to force redraw).
 
Here is my sample code:
 
void CSendEmailDlg::RefreshListOfAttachments()
{
  CXTPRibbonGroup* pGrp = m_pTabAttachments->FindGroup( ID_ATTACHED_FILES_GROUP );
  if( pGrp == NULL )
  {
    pGrp = m_pTabAttachments->AddGroup( ID_ATTACHED_FILES_GROUP );
  }
  pGrp->RemoveAll();
 for(int ix=0; ix<(int)vAttachmentList.size(); ix++)
 {
   CXTPControl* pCtrl = pGrp->Add(xtpControlButton, IDC_ATTACH_REMOVE);
          pCtrl->SetCaption( vAttachmentList[ix] );
          pCtrl->SetTag(ix);
 }
  CString strCaption;
  strCaption.Format( _T("No of attachments: %d"), vAttachmentList.size() );
  pGrp->SetCaption( strCaption );
}
 
Any tips how to fix it (I triend to play with simple Invalidate() but no luck)?
 
Thanks for your excelent support!
Kind regards,
Irek
 



Replies:
Posted By: Oleg
Date Posted: 26 June 2007 at 1:02am
Hello,
 
1. Did you call pRibbonBar->EnableFrameTheme() ?
 
2. Try to call pRibbonbar->OnRecalcLayout() in the end of method.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: irekz
Date Posted: 26 June 2007 at 3:18pm
Hi Oleg :)
 
1) Calling RecalcLayout helps - thanks!
 
2)  Yes I'm calling pRibbonBar->EnableFrameTheme()
 
In attachment there is a screen shoot of my dialog and cpp file with dialog code - maybe that will help.
 
3) I noticed also one other thing: there is an empty space in the bottom of the dialog. It looks like space for status bar (I don't have one in my app).
Any way to get rid of it? (in dialog template edit control is placed to take all remaning space and it has: SetResize(IDC_BODY, SZ_TOP_LEFT, SZ_BOTTOM_RIGHT);
 
uploads/20070626_151244_test.zip
 
Thanks a lot for your great support!
Kind regards!
Irek


Posted By: Oleg
Date Posted: 26 June 2007 at 3:31pm
Hi,
 
oh you mean dialog background ( I thought frame).... EnableFrameTheme
 change only Frame - if you need change background - catch WM_CTLCOLOR for dialog and return some brush.
 
3. try to switch order where you enable frame/set resize options.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: irekz
Date Posted: 27 June 2007 at 2:19pm
Hi Oleg!
 
Originally posted by oleg oleg wrote:

catch WM_CTLCOLOR for dialog and return some brush.
 
Do I have to hardcode color or is there a way to return a brush that match current skin?
 
Originally posted by oleg oleg wrote:

3. try to switch order where you enable frame/set resize options.
 
Could not make it work. I attached a very simple dialog application that demonstrates this problem - can you check it and tell me what's wrong? (could be a good idea to add CDialog based ribbon to toolkit samples).
 
Thanks a lot for your time and help!
Irek
 
https://forum.codejock.com/uploads/20070627_141832_test.zip - uploads/20070627_141832_test.zip
 


Posted By: Oleg
Date Posted: 27 June 2007 at 3:38pm
Hi,
 
Here fixed dialog code: https://forum.codejock.com/uploads/20070627_153820_t5.zip - uploads/20070627_153820_t5.zip


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: irekz
Date Posted: 28 June 2007 at 4:14am
Hi Oleg,
 
It's much better now but problem is not fully resolved.
 
In this dialog there is no status bar and still there is a space reserved at the bottom and I can't place any controls there. If you don't want status bar this space is wasted.
 
Is there a way to get rid of this limitation and put controls to the bottom of dialog (I would like list box to ocupy it with SetResize(IDC_LIST, SZ_TOP_LEFT, SZ_BOTTOM_RIGHT);) ?
 
Thanks for your help and sorry for all those questions
Irek


Posted By: Oleg
Date Posted: 29 June 2007 at 1:10am
Hello,
Attach new sample, I not sure what do you see.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net