FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Font in button bar changes with recent FWH
Posts: 1096
Joined: Fri Oct 28, 2005 02:27 AM
Font in button bar changes with recent FWH
Posted: Wed Nov 16, 2011 02:57 AM
After recompilation with FWH11.8 instead of 10.5, my button bar became from this:


to this:


How do I fix this? TIA.
FWH 11.08/FWH 19.12

BCC5.82/BCC7.3

xHarbour/Harbour
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Font in button bar changes with recent FWH
Posted: Wed Nov 16, 2011 05:03 AM

Hua,

Please post the source code that you are using to create your button bar, thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1096
Joined: Fri Oct 28, 2005 02:27 AM
Re: Font in button bar changes with recent FWH
Posted: Wed Nov 16, 2011 06:23 AM
Hi Antonio. Thank you for the reply. Here's the code:
Code (fw): Select all Collapse
method buildBar() class TWinCMS
   local oPopup, oBtn, oPopup1, obtn1, oFont

   ::oBarBtns := array(BTNBAR_MAX)

   DEFINE BUTTONBAR ::oBar OF ::oWnd SIZE 60, 60 2007

   // Files
   MENU oPopup1 POPUP
      MENUITEM "TradePac Accounting Series"  ACTION  ::xtract(1)
      *MENUITEM "3rd Party Accounting Software"    ACTION  ::xtract(2)
      SEPARATOR
      MENUITEM "Configure..." action ::oXtract:activate()
   ENDMENU

   DEFINE BUTTON ::oBarBtns[BTNBAR_XTRACT] oBtn1 OF ::oBar ACTION ::xtract(1) ;
      RESOURCE "extract" PROMPT "Extract"  ;
      MENU oPopup1 TOOLTIP "Extract A/R" 

   DEFINE BUTTON ::oBarBtns[BTNBAR_NEW] OF ::oBar ACTION ::add() ;
      RESOURCE "new" PROMPT "New" TOOLTIP "New Customer" 
  .
  .


I suspect this is because of the change in TBtnBmp:Paint() because it's defaulting the font from oWnd now. Previously the following code doesn't exist
Code (fw): Select all Collapse
   if ! Empty( ::cCaption )
      if ::oFont == nil
         ::SetFont( ::oWnd:oFont )
         if ::oFont == nil .and. ! Empty( ::oWnd )
            ::SetFont( ::oWnd:oWnd:oFont )
         endif
      endif
   endif


It seems to be used to replace this:
Code (fw): Select all Collapse
   if ::lBarBtn
      ::l2007 = ::oWnd:l2007
      if ::oFont == NIL
         if ::oWnd:oFont != nil
            if ::oWnd:oFont:cFaceName != "Tahoma"
               DEFINE FONT oFont NAME "Tahoma" SIZE 0, -11
               ::oWnd:SetFont( oFont )
            endif
            ::SetFont( ::oWnd:oFont )
         else
            DEFINE FONT oFont NAME "Tahoma" SIZE 0, -11
            ::SetFont( oFont )
         endif
      else
         ::oWnd:SetFont( ::oFont )
      endif
   else
      if ::oFont == nil
         ::SetFont( ::oWnd:oFont )
         if ::oFont == nil .and. ! Empty( ::oWnd )
           ::SetFont( ::oWnd:oWnd:oFont )
         endif
      else
         ::SetFont( ::oFont )
      endif
   endif
FWH 11.08/FWH 19.12

BCC5.82/BCC7.3

xHarbour/Harbour
Posts: 1096
Joined: Fri Oct 28, 2005 02:27 AM
Re: Font in button bar changes with recent FWH
Posted: Wed Nov 16, 2011 06:34 AM
I think for now I'll use the following method to resolve the issue from my code
Code (fw): Select all Collapse
method buildBar() class TWinCMS
   DEFINE FONT oFont NAME "Tahoma" SIZE 0,-11
    .
    .
   aeval(::oBar:aControls, {|o| o:setFont(oFont)})
   oFont:end()
  return nil
FWH 11.08/FWH 19.12

BCC5.82/BCC7.3

xHarbour/Harbour
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Font in button bar changes with recent FWH
Posted: Wed Nov 16, 2011 10:27 AM

Hua,

Yes, thats a good solution. Thanks! :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion