Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Flat combobox in a command bar
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Flat combobox in a command bar

 Post Reply Post Reply
Author
Message
HotSouce View Drop Down
Newbie
Newbie


Joined: 15 March 2004
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote HotSouce Quote  Post ReplyReply Direct Link To This Post Topic: Flat combobox in a command bar
    Posted: 15 March 2004 at 5:19am

Hello

Does anybody have idea how to create a flat combobox in a command bar. The problem is that the standard flat combobox is not derived from CXTPControl class , but the Command bar shows only CXTPControl objects. I tried to use SetCommandBar method of the CXTPControlComboBox and as a parameter gave CXTPPopupBar object but the project crashes at run time. I hope there is a decision of that problem.

Thanks in advance!

HotSouce

 

 

 

Back to Top
Alex H. View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 February 2004
Status: Offline
Points: 266
Post Options Post Options   Thanks (0) Thanks(0)   Quote Alex H. Quote  Post ReplyReply Direct Link To This Post Posted: 17 March 2004 at 9:10am

Use this code :

//---------------------------------------------------------- -----------------------------
int CMyFrame::OnCreateControl(LPCREATECONTROLSTRUCT lpCreateControl)
//---------------------------------------------------------- -----------------------------
{
 if (lpCreateControl->bToolBar)
 {
  CXTPToolBar* pToolBar = DYNAMIC_DOWNCAST(CXTPToolBar, lpCreateControl->pCommandBar);
  if (!pToolBar)
   return FALSE;

  if (lpCreateControl->nID == ID_SORT_FIELDSPLACEHOLDER && pToolBar->GetBarID() == IDR_SORT)
  {  
   // create the Sortorders combo box.
   if (!m_wndComboSortOrders.Create( WS_CHILD|WS_VISIBLE|WS_VSCROLL|CBS_DROPDOWNLIST|WS_CLIPCHILD REN,
    CRect(0,0,200,200), this, ID_SORT_FIELDSPLACEHOLDER ))
   {
    XTRACE(0, "Failed to create sort orders  combo.\n");
    XTRACE(-1, _T("CUIChildFrame::OnCreateControl -> 0"));
    return FALSE;
   }

   m_wndComboSortOrders.SetFont(&xtAfxDat a.font);

   UpdateToolbarSortorders();

   CXTPControlCustom* pControl = (CXTPControlCustom*)CXTPControlCustom::CreateObject();
   pControl->SetFlags(xtpFlagManualUpdate) ;
   pControl->SetControl(&m_wndComboSor tOrders);

   lpCreateControl->pControl = pControl;
   return TRUE;

...

CXTFlatComboBox  m_wndComboSortOrders;

Hope this helps :-)

 

Back to Top
kanitamildasan View Drop Down
Senior Member
Senior Member
Avatar

Joined: 01 February 2006
Status: Offline
Points: 102
Post Options Post Options   Thanks (0) Thanks(0)   Quote kanitamildasan Quote  Post ReplyReply Direct Link To This Post Posted: 24 February 2006 at 1:37am

Hi,

I have created CXTFontCombo in toolbar using CXTPControlCustom

But CXTFontCombo's SetListStyle(xtFontBoth) method is not working ? It always shows like 'xtFontGUI'

Thanks in advance

 

Xtreme ToolkitPro 12.1.1
Win XP (32bit) - SP2
Visual C++ 6.0 SP 6
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: 24 February 2006 at 7:53am

People!

Have you ever run any our samples?

see GUI_Office11 as sample of Font Combo in Toolbar.

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
kanitamildasan View Drop Down
Senior Member
Senior Member
Avatar

Joined: 01 February 2006
Status: Offline
Points: 102
Post Options Post Options   Thanks (0) Thanks(0)   Quote kanitamildasan Quote  Post ReplyReply Direct Link To This Post Posted: 25 February 2006 at 12:10am

Hello,

Oleg , Sorry for not explaining my problem clearly

Already I have gone through the examples you've mentioned
but those examples make use of CXTPControlFontComboBox

But i am porting an application that uses the old CXTFontCombo
(with some code customization in the control itself )
I'm trying to add the same old CXTFontCombo through CXTPControlCustom
in the CommandBar so i can make use of my old message handler code without any changes.

i can change the view font through CXTFontCombo in CommandBar but

m_wndComboFont.SetListStyle(xtFontBoth);

is not working ???

thanks for spending your valuable time


 

Xtreme ToolkitPro 12.1.1
Win XP (32bit) - SP2
Visual C++ 6.0 SP 6
Back to Top
kanitamildasan View Drop Down
Senior Member
Senior Member
Avatar

Joined: 01 February 2006
Status: Offline
Points: 102
Post Options Post Options   Thanks (0) Thanks(0)   Quote kanitamildasan Quote  Post ReplyReply Direct Link To This Post Posted: 27 February 2006 at 10:35pm

Hi,

The DrawItem of CXTFontCombo is not called when we put it in CommandBar using CXTPControlCustom

It's working correctly when fontcombo is in Dialog (FontCombo Sample)

any suggestion???

 

Xtreme ToolkitPro 12.1.1
Win XP (32bit) - SP2
Visual C++ 6.0 SP 6
Back to Top
kanitamildasan View Drop Down
Senior Member
Senior Member
Avatar

Joined: 01 February 2006
Status: Offline
Points: 102
Post Options Post Options   Thanks (0) Thanks(0)   Quote kanitamildasan Quote  Post ReplyReply Direct Link To This Post Posted: 01 March 2006 at 5:14am

Hi,

As per https://forum.codejock.com/forum_posts.asp?TID=3114&PN=1

Quote

Hello,

The problem that you reported with the combo box has been corrected with v9.81 release.

Regards,
Codejock Support

Is it possible to use owner drawn CXTFontCombo in mainframe commandbar in 9.81 Pro ?

Xtreme ToolkitPro 12.1.1
Win XP (32bit) - SP2
Visual C++ 6.0 SP 6
Back to Top
kanitamildasan View Drop Down
Senior Member
Senior Member
Avatar

Joined: 01 February 2006
Status: Offline
Points: 102
Post Options Post Options   Thanks (0) Thanks(0)   Quote kanitamildasan Quote  Post ReplyReply Direct Link To This Post Posted: 02 March 2006 at 11:11pm

Hi,

Eureka !!!

Xtreme ToolkitPro 12.1.1
Win XP (32bit) - SP2
Visual C++ 6.0 SP 6
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.109 seconds.