FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Bug in the new 2007 clause
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Bug in the new 2007 clause
Posted: Tue Oct 09, 2007 09:59 AM
This is the sample. If you uncomment the 2007 clause the bitmap will be shifted up.

#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oWnd, oBar

    DEFINE WINDOW oWnd

    DEFINE BUTTONBAR oBar OF oWnd //2007

    DEFINE BUTTON OF oBar;
           FILE "C:\FWH\BITMAPS\CLIENT.BMP"

    ACTIVATE WINDOW oWnd

    RETURN NIL


EMG
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Bug in the new 2007 clause
Posted: Tue Oct 09, 2007 06:13 PM

Enrico,

Fixed:

     TransBmp( ::hBitmap1, nBmpWidth( ::hBitmap1 ), nBmpHeight( ::hBitmap1 ), nZeroZeroClr, ::hDC,;
               ( ::nWidth / 2 ) - ( nBmpWidth( ::hBitmap1 ) / 2 ) + If( ::lPressed, 2, 1 ),;
               Max( 0, ( ::nHeight / 3 ) - ( nBmpHeight( ::hBitmap1 ) / 2 ) + If( ::lPressed, 2, 1 ) ),;
               nBmpWidth( ::hBitmap1 ), nBmpHeight( ::hBitmap1 ) )

many thanks for your feedback :-)

We plan to publish a modified 7.10 build this same week with late-changes on Class TBtnBmp

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Bug in the new 2007 clause
Posted: Tue Oct 09, 2007 11:09 PM

Thank you!

EMG

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Bug in the new 2007 clause
Posted: Wed Oct 10, 2007 07:07 AM
A little change to your fix:

         TransBmp( ::hBitmap1, nBmpWidth( ::hBitmap1 ), nBmpHeight( ::hBitmap1 ), nZeroZeroClr, ::hDC,;
                   ( ::nWidth / 2 ) - ( nBmpWidth( ::hBitmap1 ) / 2 ) + If( ::lPressed, 2, 1 ),;
                   Max( 0, ( ::nHeight / 3 ) - ( nBmpHeight( ::hBitmap1 ) / 2 ) ) + If( ::lPressed, 2, 1 ),; 
                   nBmpWidth( ::hBitmap1 ), nBmpHeight( ::hBitmap1 ) )


Without this the buttons are shifted on right instead of right-down when pressed.

EMG
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Bug in the new 2007 clause
Posted: Wed Oct 10, 2007 07:24 AM

Another problem: it seems that the height of the buttons is shorter with 2007 clause. Can you check?

EMG

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Bug in the new 2007 clause
Posted: Wed Oct 10, 2007 07:26 AM
One more bug. In the following sample try to move the mouse over the button and you will see that the font of the messagebar is changed.

#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oWnd, oBar

    DEFINE WINDOW oWnd

    DEFINE BUTTONBAR oBar OF oWnd

    DEFINE BUTTON OF oBar;
           TOOLTIP "Test"

    SET MESSAGE OF oWnd TO "This is a test" 2007

    ACTIVATE WINDOW oWnd

    RETURN NIL


EMG
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Bug in the new 2007 clause
Posted: Wed Oct 10, 2007 08:36 AM

Enrico,

> Without this the buttons are shifted on right instead of right-down when pressed.

My mistake. Yes, you are right, as usual :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Bug in the new 2007 clause
Posted: Wed Oct 10, 2007 08:57 AM
Enrico,

>
In the following sample try to move the mouse over the button and you will see that the font of the messagebar is changed.
>

Fixed. Many thanks for your feedback :-)

Please make this change in Class TMsgBar Method Paint():
      ::Say( ::nHeight / 4,;
             If( ::lCentered, ( ::nWidth / 2 ) - ( GetTextWidth( ::hDC,;
             If( Empty( ::cMsg ), ::cMsgDef, ::cMsg ),;
             ::oWnd:oFont:hFont ) / 2 ), 10 ), If( Empty( ::cMsg ), ::cMsgDef, ::cMsg ),;
             ::nClrText,,, .T., .T. )
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Bug in the new 2007 clause
Posted: Wed Oct 10, 2007 09:03 AM
Thank you. Can you check this too?

EnricoMaria wrote:Another problem: it seems that the height of the buttons is shorter with 2007 clause.


EMG
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Bug in the new 2007 clause
Posted: Wed Oct 10, 2007 09:17 AM
Enrico,

It seems ok. Please check this example using and removing 2007:
#include "Fivewin.ch" 


FUNCTION MAIN() 

    LOCAL oWnd, oBar 

    DEFINE WINDOW oWnd 

    DEFINE BUTTONBAR oBar OF oWnd SIZE 40, 40 // 2007

    DEFINE BUTTON OF oBar ; 
           TOOLTIP "Test" ACTION MsgInfo( oBar:aControls[ 1 ]:nHeight )

    SET MESSAGE OF oWnd TO "This is a test" 2007 

    ACTIVATE WINDOW oWnd 

    RETURN NIL
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Bug in the new 2007 clause
Posted: Wed Oct 10, 2007 09:24 AM
Ok, but try with 3D clause:

DEFINE BUTTONBAR oBar OF oWnd SIZE 40, 40 2007 3D


EMG
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Bug in the new 2007 clause
Posted: Wed Oct 10, 2007 09:26 AM
With the following change we get the same position for message of 2007 and not 2007 style msgbar:

      ::Say( ::nHeight / 4 - 2,;
             If( ::lCentered, ( ::nWidth / 2 ) - ( GetTextWidth( ::hDC,;
             If( Empty( ::cMsg ), ::cMsgDef, ::cMsg ),;
             ::oWnd:oFont:hFont ) / 2 ), 4 ), If( Empty( ::cMsg ), ::cMsgDef, ::cMsg ),;
             ::nClrText,,, .T., .T. )


EMG
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Bug in the new 2007 clause
Posted: Wed Oct 10, 2007 09:42 AM
The bitmaps are no longer centered inside the buttons with 2007 clause:

#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oWnd, oBar

    DEFINE WINDOW oWnd

    DEFINE BUTTONBAR oBar OF oWnd SIZE 40, 40 2007

    DEFINE BUTTON OF oBar;
           FILE "C:\FWH\BITMAPS\CLIENT.BMP"

    ACTIVATE WINDOW oWnd

    RETURN NIL


EMG
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Bug in the new 2007 clause
Posted: Wed Oct 10, 2007 09:52 AM

Enrico,

> Ok, but try with 3D clause:

Yes, you are right, 3D clause should not be used with 2007 clause together, or buttons will not cover all the bar height

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Bug in the new 2007 clause
Posted: Wed Oct 10, 2007 09:54 AM
Antonio Linares wrote:Enrico,

> Ok, but try with 3D clause:

Yes, you are right, 3D clause should not be used with 2007 clause together, or buttons will not cover all the bar height


Right.

EMG