Bug in the new 2007 clause

Bug in the new 2007 clause

Postby Enrico Maria Giordano » Tue Oct 09, 2007 9:59 am

This is the sample. If you uncomment the 2007 clause the bitmap will be shifted up.

Code: Select all  Expand view
#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
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Antonio Linares » Tue Oct 09, 2007 6: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42079
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Enrico Maria Giordano » Tue Oct 09, 2007 11:09 pm

Thank you!

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Enrico Maria Giordano » Wed Oct 10, 2007 7:07 am

A little change to your fix:

Code: Select all  Expand view
         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
Last edited by Enrico Maria Giordano on Wed Oct 10, 2007 9:04 am, edited 1 time in total.
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Enrico Maria Giordano » Wed Oct 10, 2007 7:24 am

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

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Enrico Maria Giordano » Wed Oct 10, 2007 7: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.

Code: Select all  Expand view
#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
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Antonio Linares » Wed Oct 10, 2007 8: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42079
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Antonio Linares » Wed Oct 10, 2007 8: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():
Code: Select all  Expand view
      ::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
User avatar
Antonio Linares
Site Admin
 
Posts: 42079
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Enrico Maria Giordano » Wed Oct 10, 2007 9: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
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Antonio Linares » Wed Oct 10, 2007 9:17 am

Enrico,

It seems ok. Please check this example using and removing 2007:
Code: Select all  Expand view
#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
User avatar
Antonio Linares
Site Admin
 
Posts: 42079
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Enrico Maria Giordano » Wed Oct 10, 2007 9:24 am

Ok, but try with 3D clause:

Code: Select all  Expand view
DEFINE BUTTONBAR oBar OF oWnd SIZE 40, 40 2007 3D


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Enrico Maria Giordano » Wed Oct 10, 2007 9:26 am

With the following change we get the same position for message of 2007 and not 2007 style msgbar:

Code: Select all  Expand view
      ::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
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Enrico Maria Giordano » Wed Oct 10, 2007 9:42 am

The bitmaps are no longer centered inside the buttons with 2007 clause:

Code: Select all  Expand view
#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
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Antonio Linares » Wed Oct 10, 2007 9: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42079
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Enrico Maria Giordano » Wed Oct 10, 2007 9: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
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 74 guests