FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour How to emulate Office 2010 colors
Posts: 389
Joined: Mon Oct 13, 2008 11:26 AM
How to emulate Office 2010 colors
Posted: Mon Jul 11, 2011 11:42 AM

Hi, I want to emulate Office 2010 color themes.

Office 2010 has 3 color themes, Black, Blue, Silver

I want to use a combobox to define the color theme of my system.

Can anyone post a sample with ribbonbar, menu, msgbar with colors different from the old blue of 2007 style?

Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
Posts: 417
Joined: Tue Feb 23, 2010 03:09 PM
Re: How to emulate Office 2010 colors
Posted: Thu Jul 14, 2011 11:00 AM

Hi,

With menu and msgbar is not possible as Fivetech does not provide source code.

With Ribbon it is possible to define colours.

Regards

FWH 11.11, Harbour 3.1 and Borland C++ 5.82
Posts: 389
Joined: Mon Oct 13, 2008 11:26 AM
Re: How to emulate Office 2010 colors
Posted: Thu Jul 14, 2011 11:34 AM
Thx for reply, anyone know how to force a color to an object that work on the msgbar, menu and ribbonbar?

Something like:

Code (fw): Select all Collapse
METHOD PaintHeader( nRow, nCol, nHeight, lInvert, hDC ) CLASS TXBrwColumn

   local hBrush
   local oFont
   local aColors, aBitmap
   local cHeader
   local nWidth, nBmpRow, nBmpCol, nBmpNo
   local lOwnDC, nBottom

   DEFAULT lInvert := .f.

   if ::bClrHeader == nil
      ::Adjust()
   endif

   if nCol != nil
      if nCol != 0
         ::nDisplayCol := nCol
      endif
   else
      nCol := ::nDisplayCol
   endif

   if ! lInvert
      aColors := Eval( ::bClrHeader )
   else
      aColors := { CLR_WHITE, CLR_BLUE }
   endif

   if hDC == nil
      hDC := ::oBrw:GetDC()
      lOwnDC := .f.
   else
      lOwnDC := .t.
   endif

   oFont   := ::oHeaderFont
   cHeader := ::cHeader
   nWidth  := ::nWidth
   nBmpNo  := ::nHeadBmpNo

   nBottom = nRow + ( nHeight / 3 )
   if ::oBrw:l2007
      if ! lInvert
         Gradient( hDC, { nRow - 1, nCol, nBottom, nCol + nWidth + 2 },;
                   nRGB( 219, 230, 244 ), nRGB( 207, 221, 239 ), .T. )
         Gradient( hDC, { nBottom + 1, nCol, nRow + nHeight - 1, nCol + nWidth },;
                   nRGB( 201, 217, 237 ), nRGB( 231, 242, 255 ), .T. )
      else
         Gradient( hDC, { nRow - 1, nCol, nBottom, nCol + nWidth },;
                   nRGB( 255, 253, 222 ), nRGB( 255, 231, 151 ), .T. )
         Gradient( hDC, { nBottom + 1, nCol, nRow + nHeight - 1, nCol + nWidth },;
                   nRGB( 255, 215, 84 ), nRGB( 255, 233, 162 ), .T. )
      endif
   else
      hBrush  := CreateSolidBrush( aColors[ 2 ] )
      FillRect( hDC, { nRow, nCol, nRow + nHeight, nCol + nWidth }, hBrush )
      DeleteObject( hBrush )
   endif

   nCol    += ( COL_EXTRAWIDTH / 2 )
   nWidth  -=  COL_EXTRAWIDTH
   nRow    += ( ROW_EXTRAHEIGHT / 2 )
   nHeight -=  ROW_EXTRAHEIGHT

   if nBmpNo > 0 .and. nBmpNo <= Len( ::aBitmaps )
      aBitmap := ::aBitmaps[ nBmpNo ]
      nWidth  -= aBitmap[ BITMAP_WIDTH ]
      if Empty(cHeader)
         nBmpCol := nCol + nwidth / 2
      elseif ::nHeadBmpAlign == AL_LEFT
         nBmpCol := nCol
         nCol    += aBitmap[ BITMAP_WIDTH ] + BMP_EXTRAWIDTH
      else
         nBmpCol := nCol + nWidth
      endif
      nWidth  -= BMP_EXTRAWIDTH
      nBmpRow := ( nHeight - aBitmap[ BITMAP_HEIGHT ] ) / 2 + 4
      if ! ::oBrw:l2007
         PalBmpDraw( hDC, nBmpRow, nBmpCol,;
                     aBitmap[ BITMAP_HANDLE ],;
                     aBitmap[ BITMAP_PALETTE ],;
                     aBitmap[ BITMAP_WIDTH ],;
                     aBitmap[ BITMAP_HEIGHT ];
                     ,, .t., aColors[ 2 ] )
      else

         DEFAULT aBitmap[ BITMAP_ZEROCLR ] := GetZeroZeroClr( hDC, aBitmap[ BITMAP_HANDLE ] )
         SetBkColor( hDC, nRGB( 255, 255, 255 ) )
         TransBmp( aBitmap[ BITMAP_HANDLE ], aBitmap[ BITMAP_WIDTH ], aBitmap[ BITMAP_HEIGHT ],;
                   aBitmap[ BITMAP_ZEROCLR ], hDC, nBmpCol, nBmpRow, nBmpWidth( aBitmap[ BITMAP_HANDLE ] ),;
                   nBmpHeight( aBitmap[ BITMAP_HANDLE ] ) )
      endif
   endif

   if Empty( cHeader )
      ::oBrw:ReleaseDC()
      return nil
   endif

   oFont:Activate( hDC )
   SetTextColor( hDC, aColors[ 1 ] )
   SetBkColor( hDC, aColors[ 2 ] )
   SetBkMode ( hDC, 1 ) // transparent
   DrawTextEx( hDC, cHeader,;
               {nRow, nCol, nRow + nHeight, nCol + nWidth},;
               ::nHeadStyle )
   oFont:Deactivate( hDC )

   if !lOwnDC
      ::oBrw:ReleaseDC()
   endif

return nil
Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: How to emulate Office 2010 colors
Posted: Thu Jul 14, 2011 02:04 PM

For menu, msgbar and ribbonbar we can specify 2010 instead of 2007.
We can not change colors provided by fwh for menu and msgbar as of now. For ribbon bars we can specify our own colors.

Regards



G. N. Rao.

Hyderabad, India
Posts: 389
Joined: Mon Oct 13, 2008 11:26 AM
Re: How to emulate Office 2010 colors
Posted: Fri Jul 15, 2011 12:49 PM

What is the difference of 2007 to 2010?

Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
Posts: 417
Joined: Tue Feb 23, 2010 03:09 PM
Re: How to emulate Office 2010 colors
Posted: Fri Jul 15, 2011 12:58 PM

Please, see bug in viewtopic.php?f=3&t=21944

For changing msgbar and menu Fivetech should provide source code.

When it was launched, it could have been copied by Xailer, but now they have their own 2007 and 2010 style, so maybe source code could be released so as to allow us to change colors and create styles, as users like very much to change this features.

Thank you.

FWH 11.11, Harbour 3.1 and Borland C++ 5.82

Continue the discussion