Bug in TBtnBmp prompt

Post Reply
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Bug in TBtnBmp prompt

Post by Enrico Maria Giordano »

In the following sample the prompt is not splitted across two lines and two little squares are displayed instead:

Code: Select all

#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oWnd, oBar

    DEFINE WINDOW oWnd

    DEFINE BUTTONBAR oBar OF oWnd 2007;
           SIZE 50, 70

    DEFINE BUTTON OF oBar;
           ACTION oWnd:End();
           PROMPT "Close" + CRLF + "Window"

    ACTIVATE WINDOW oWnd

    RETURN NIL
EMG
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Enrico,

In Class TBtnBmp please replace:

Code: Select all

         ::Say( 2 * ( ::nHeight / 3 ) + If( ::lPressed, 1, 0 ),;
                ( ::nWidth / 2 ) - ( GetTextWidth( ::hDC, ::cCaption,;
                ::oWnd:oFont:hFont ) / 2 ) + If( ::lPressed, 1, 0 ),;
                ::cCaption, nClr,, ::oWnd:oFont, .T., .T. )
with

Code: Select all

         nTop = 2 * ( ::nHeight / 3 ) + If( ::lPressed, 1, 0 ) + If( At( CRLF, ::cCaption ) == 0, 5, 0 ) 
         SetBkMode( ::hDC, 1 )
         hOldFont = SelectObject( ::hDC, ::oWnd:oFont:hFont )         
         DrawText( ::hDC, ::cCaption,;
                   { nTop - 5, If( ::lPressed, 1, 0 ), nTop + ::nHeight / 3, ::nWidth + If( ::lPressed, 1, 0 ) },;
                   nOr( DT_VCENTER, DT_CENTER, DT_WORDBREAK ) )
         SelectObject( ::hDC, hOldFont )          
You need these defines:

Code: Select all

#define DT_CENTER           1
#define DT_VCENTER          4
#define DT_WORDBREAK       16
Image
Thanks!
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Post by Enrico Maria Giordano »

I can wait for the new FWH release, thank you. :-)

EMG
Last edited by Enrico Maria Giordano on Wed Nov 21, 2007 10:30 pm, edited 1 time in total.
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Enrico,

It will be available by early December :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Post by Silvio »

Antonio,
Have you modify msgitem ( clock and date ) on msgbar ?
Best Regards, Saludos

Falconi Silvio
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Silvio,

No, not yet
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Maurilio Viana
Posts: 252
Joined: Tue Oct 25, 2005 2:48 pm
Location: Garça/Garza/Heron City - Brazil
Contact:

Post by Maurilio Viana »

Antonio, I don't found this code in my BtnBmp.prg... My version is FWH 7.1 and I have this problem, when I use CRLF to "break" the text in more than 1 line text is displayed in same line and CRLF turn into a square character.

Thanks!
Maurilio
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Maurilio,

Basically the function used to paint the text has to be (Window's) DrawText() instead of TextOut().

The published patch is for FWH 7.11. We have to build another for 7.01
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Post by nageswaragunupudi »

This modification is working for 2007 style only. For non 2007 style both lines of text are painted in the middle of the bitmap

Image
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Post by nageswaragunupudi »

Mr Antonio

Can a fix be made available for multi-line prompts for tbar without 2007 style please?
Regards

G. N. Rao.
Hyderabad, India
Post Reply