Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » RibboToolGroup question Collapse All
Subject Author Date
tera tera Aug 8, 2009 - 2:08 AM

Hello.


The background color of the point of the red arrow is dark.

It is hard to look.

I want to display it with a bright color.



 


Or can you change it by the setting of this place?


Technical Support Aug 10, 2009 - 1:41 PM

Please update the source code for the following method:

void CExtPaintManager::Ribbon_PaintPushButton(
      CDC & dc,
      CExtPaintManager::PAINTPUSHBUTTONDATA & _ppbd
      )
{
      ASSERT_VALID( this );
      ASSERT( dc.GetSafeHdc() != NULL );
      if( _ppbd.m_rcClient.IsRectEmpty() )
            return;
      if( ! dc.RectVisible( &_ppbd.m_rcClient ) )
            return;
      ASSERT_VALID( _ppbd.m_pHelperSrc );
CExtBarButton * pTBB = DYNAMIC_DOWNCAST( CExtBarButton, _ppbd.m_pHelperSrc );
      ASSERT( pTBB != NULL );
CExtBarButton * pParentTBB = pTBB->ParentButtonGet();
CExtRibbonButton * pRibbonTBB = DYNAMIC_DOWNCAST( CExtRibbonButton, _ppbd.m_pHelperSrc );
CExtSafeString strText = pTBB->GetText();
INT nTextLength = strText.GetLength();
enum e_layout_case_t { __ELC_TOOL, __ELC_SMALL, __ELC_LARGE, };
e_layout_case_t eLC = __ELC_TOOL;
      if( pRibbonTBB != NULL )
      {
            if( pParentTBB == NULL || pParentTBB->IsKindOf( RUNTIME_CLASS( CExtRibbonButtonToolGroup ) ) )
            {
                  if( pParentTBB == NULL )
                  {
                        const CExtRibbonNode * pRibbonNode = pTBB->Ribbon_GetNode();
                        if( pRibbonNode != NULL )
                        {
                              const CExtCustomizeCmdTreeNode * pParentNode = pRibbonNode->GetParentNode();
                              if(         pParentNode != NULL
                                    &&    (     pParentNode->IsKindOf( RUNTIME_CLASS( CExtRibbonNodeRightButtonsCollection ) )
                                          ||    pParentNode->IsKindOf( RUNTIME_CLASS( CExtRibbonNodeQuickAccessButtonsCollection ) )
                                          )
                                    )
                              eLC = __ELC_SMALL;
                        }
                  }
            }
            else
            {
                  if( pRibbonTBB->RibbonILV_Get() == __EXT_RIBBON_ILV_SIMPLE_LARGE )
                        eLC = __ELC_LARGE;
                  else
                        eLC = __ELC_SMALL;
            }
      }
      else
      {
            if( pParentTBB == NULL || ( ! pParentTBB->IsKindOf( RUNTIME_CLASS( CExtRibbonButtonToolGroup ) ) ) )
                  eLC = __ELC_SMALL;
      }
INT nILV = pTBB->RibbonILV_Get();
CRect rcCP = pTBB->OnRibbonGetContentPadding();
CRect rcIcon = _ppbd.m_rcClient;
      rcIcon.DeflateRect( rcCP.left, rcCP.top, rcCP.right, rcCP.bottom );
INT nTextToIconDistance = 0;
CRect rcText =  rcIcon;
CSize _sizeIcon( 0, 0 );
CExtCmdIcon * pCmdIcon = pTBB->GetIconPtr();
      if( pCmdIcon != NULL && (! pCmdIcon->IsEmpty() ) )
      {
            _sizeIcon = Ribbon_GetIconSize( pTBB, nILV, _ppbd.m_lParam );
            if( nTextLength >= 0 )
                  nTextToIconDistance = Ribbon_GetTextToIconDistance( dc, nILV, pTBB, _ppbd.m_lParam );
            if( eLC == __ELC_LARGE )
            {
                  rcIcon.bottom = rcIcon.top + _sizeIcon.cy;
                  rcIcon.OffsetRect( ( rcIcon.Width() - _sizeIcon.cx ) / 2, 4 );
                  if( nTextLength > 0 )
                  {
                        rcText.top = rcIcon.bottom;
                        rcText.top += nTextToIconDistance;
                  };
            }
            else
            {
                  if( nTextLength > 0 )
                  {
                        rcIcon.right = rcText.left = rcIcon.left + _sizeIcon.cx;
                        rcText.left += nTextToIconDistance;
                  }
                  else
                  {
                        rcIcon = _ppbd.m_rcClient;
                        if( pTBB->IsAbleToTrackMenu() && (! pTBB->IsKindOf( RUNTIME_CLASS( CExtRibbonButtonGroup ) ) ) )
                              rcIcon.right -= GetDropDownButtonWidth( _ppbd.m_pHelperSrc, _ppbd.m_lParam );
                        rcIcon.OffsetRect( ( rcIcon.Width() - _sizeIcon.cx ) / 2 + 1, 0 );
                  }
                  rcIcon.OffsetRect( 0, ( rcIcon.Height() - _sizeIcon.cy ) / 2 );
            }
      }
      else
            pCmdIcon = NULL;
bool bDrawDropDownWithText = _ppbd.m_bDropDown;
      switch( eLC )
      {
      case __ELC_TOOL:
      {
            bDrawDropDownWithText = false;
            PAINTPUSHBUTTONDATA _ppbd2 = _ppbd;
            _ppbd2.m_pHelperSrc = NULL;
            _ppbd2.m_pIcon = NULL;
            _ppbd2.m_sText = _T("");
            _ppbd2.m_bTransparentBackground = false;
            _ppbd2.m_bFlat = false;
            if( ! ( _ppbd2.m_bHover || _ppbd2.m_bPushed || _ppbd2.m_bIndeterminate ) )
                  _ppbd2.m_clrForceBk = GetColor( CLR_3DFACE_OUT, _ppbd2.m_pHelperSrc, _ppbd2.m_lParam );
            PaintPushButton( dc, _ppbd2 );
            if( _ppbd2.m_bDropDown )
                  rcIcon.OffsetRect( _ppbd.m_rcClient.left - rcIcon.left + 5, 0 );
      }
      break;
      case __ELC_LARGE:
            ASSERT_VALID( pTBB );
            rcText = Ribbon_CalcLargeDropDownRect( pTBB );
            if( ! pTBB->IsKindOf( RUNTIME_CLASS( CExtRibbonButton ) ) )
                  bDrawDropDownWithText = false;
      case __ELC_SMALL:
      {
            if( _ppbd.m_bEnabled && ( _ppbd.m_bHover || _ppbd.m_bPushed || _ppbd.m_bIndeterminate )  )
            {
                  PAINTPUSHBUTTONDATA _ppbd2 = _ppbd;
                  _ppbd2.m_pHelperSrc = NULL;
                  _ppbd2.m_pIcon = NULL;
                  _ppbd2.m_sText = _T("");
                  _ppbd2.m_bTransparentBackground = false;
                  _ppbd2.m_bNoDropDownArrow = true;
                  bool bDrawSepH = false;
                  if( eLC == __ELC_LARGE )
                  {
                        _ppbd2.m_bDropDown = false;
                        _ppbd2.m_bSeparatedDropDown = false;
                        _ppbd2.m_bPushedDropDown = false;
                        bDrawSepH = _ppbd.m_bDropDown && _ppbd.m_bSeparatedDropDown;
                  }
                  _ppbd2.m_bFlat = true;
                  PaintPushButton( dc, _ppbd2 );
                  if( bDrawSepH )
                  {
                        CRect rcSepH = rcText;
                        rcSepH.bottom = rcSepH.top + 3;
                        rcSepH.DeflateRect( 3, 0, 2, 0 );
                        PaintSeparator( dc, rcSepH, false, true, NULL );
                  }
            }
      }
      break;
      }
      if( pCmdIcon != NULL )
      {
            ASSERT( ! pCmdIcon->IsEmpty() );
            CSize _sizeRealIcon = pCmdIcon->GetSize();
            if( _sizeRealIcon != _sizeIcon )
                  rcIcon.OffsetRect( ( _sizeIcon.cx - _sizeRealIcon.cx ) / 2, ( _sizeIcon.cy - _sizeRealIcon.cy) / 2 );
            rcIcon.right = rcIcon.left + _sizeRealIcon.cx;
            rcIcon.bottom = rcIcon.top + _sizeRealIcon.cy;
            CExtCmdIcon::e_paint_type_t ePT = CExtCmdIcon::__PAINT_DISABLED;
            if( _ppbd.m_bEnabled )
            {
                  if( _ppbd.m_bPushed )
                        ePT = CExtCmdIcon::__PAINT_PRESSED;
                  else if( _ppbd.m_bHover )
                        ePT = CExtCmdIcon::__PAINT_HOVER;
                  else
                        ePT = CExtCmdIcon::__PAINT_NORMAL;
            }
            pCmdIcon->Paint( this, dc.m_hDC, rcIcon, ePT );
      }
      if( nTextLength > 0 || _ppbd.m_bDropDown )
      {
            UINT nDT = 0;
            if( eLC != __ELC_LARGE )
            {
                  strText.Replace( _T("\r"), _T(" ") );
                  strText.Replace( _T("\n"), _T(" ") );
                  strText.Replace( _T("\t"), _T(" ") );
                  strText.Replace( _T("  "), _T(" ") );
                  strText.TrimLeft( _T(" ") );
                  strText.TrimRight( _T(" ") );
                  nTextLength = INT( strText.GetLength() );
                  nDT = DT_CENTER|DT_VCENTER|DT_SINGLELINE;
            }
            else
                  nDT = DT_CENTER|DT_TOP;
            if( nTextLength > 0 || _ppbd.m_bDropDown )
            {
                  CFont * pFont = pTBB->GetBar()->OnGetToolbarFont( false, false );
                  ASSERT( pFont->GetSafeHandle() != NULL );
                  CFont * pOldFont = dc.SelectObject( pFont );
                  int nOldBkMode = dc.SetBkMode( TRANSPARENT );
                  COLORREF clrText = GetColor( _ppbd.m_bEnabled ? COLOR_BTNTEXT : CLR_TEXT_DISABLED );
                  COLORREF clrOldText = dc.SetTextColor( clrText );
                  Ribbon_PaintText(
                        dc, ( nTextLength > 0 ) ? LPCTSTR(strText) : _T(""), rcText, nDT,
                        bDrawDropDownWithText, NULL, _ppbd.m_pHelperSrc, _ppbd.m_lParam
                        );
                  dc.SetTextColor( clrOldText );
                  dc.SetBkMode( nOldBkMode );
                  dc.SelectObject( pOldFont );
            }
      }
}