Print Page | Close Window

Problems about Toolbar with Colorselector

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=2123
Printed Date: 17 July 2025 at 4:59pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Problems about Toolbar with Colorselector
Posted By: youfly
Subject: Problems about Toolbar with Colorselector
Date Posted: 18 April 2005 at 12:05pm

Excuse me,Sir
    I used a Toolbar with a Colorselector in my MFC application,just as the sample "TearOffPopups".But the colorselector didn't work well,maybe I lost some key codes.
    In my application, my View class was based on CView,but not CRichEditView,so when I complied it,some errs always appeared.

    void CMyView::OnUpdateSelectorText(CCmdUI* pCmd)
{
 CXTPCommandBar* pToolBar = (CXTPToolBar*)pCmd->m_pOther;
 if (pToolBar)
 { 
  CHARFORMAT& cfm = GetCharFormatSelection( ); 
  CXTPControlColorSelector* pSelector = (CXTPControlColorSelector*)pToolBar->GetControls()-> ; ;Ge tAt(pCmd->m_nIndex);
  pSelector->SetColor(cfm.dwEffects & CFE_AUTOCOLOR? -1: cfm.crTextColor);
 }
 pCmd->Enable(TRUE);
}

and CMyView was based on CView ,not CRichEditView,so the complier told me that
error C3861: 'GetCharFormatSelection': identifier not found, even with argument-dependent lookup

I had added this to my application
#include <afxrich.h>  // MFC rich edit classes
but it still didn't work .

Will anybody please help me? Thank you very much.
I'm waiting for your reply.....




Replies:
Posted By: Oleg
Date Posted: 19 April 2005 at 7:46am

If you don't use CRichEditView then you don't need GetCharFormatSelection,

 

use it like:

CXTPControlColorSelector* pSelector = (CXTPControlColorSelector*)pToolBar->GetControls()->Ge tAt(pCmd->m_nIndex);
  pSelector->SetColor(m_clrTextColor);
 



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


Posted By: youfly
Date Posted: 21 April 2005 at 12:43pm
Thank you,oleg.I had done as what you said above.It worked quite well.
Thank you!!



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