![]() |
Ribbon in dialog - 2 questions |
Post Reply ![]() |
Author | ||
irekz ![]() Newbie ![]() Joined: 15 June 2007 Status: Offline Points: 8 |
![]() ![]() ![]() ![]() ![]() 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
|
||
![]() |
||
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
|
Hello,
1. Did you call pRibbonBar->EnableFrameTheme() ?
2. Try to call pRibbonbar->OnRecalcLayout() in the end of method.
|
||
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
||
![]() |
||
irekz ![]() Newbie ![]() Joined: 15 June 2007 Status: Offline Points: 8 |
![]() ![]() ![]() ![]() ![]() |
|
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
|
||
![]() |
||
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
|
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 |
||
![]() |
||
irekz ![]() Newbie ![]() Joined: 15 June 2007 Status: Offline Points: 8 |
![]() ![]() ![]() ![]() ![]() |
|
Hi Oleg!
Do I have to hardcode color or is there a way to return a brush that match current skin?
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
|
||
![]() |
||
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
|
Hi,
Here fixed dialog code: uploads/20070627_153820_t5.zip
|
||
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
||
![]() |
||
irekz ![]() Newbie ![]() Joined: 15 June 2007 Status: Offline Points: 8 |
![]() ![]() ![]() ![]() ![]() |
|
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
|
||
![]() |
||
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
|
Hello,
Attach new sample, I not sure what do you see.
|
||
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 |