Bug in TBtnBmp prompt

Bug in TBtnBmp prompt

Postby Enrico Maria Giordano » Wed Nov 21, 2007 9:17 am

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

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

Postby Antonio Linares » Wed Nov 21, 2007 5:04 pm

Enrico,

In Class TBtnBmp please replace:
Code: Select all  Expand view
         ::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  Expand view
         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  Expand view
#define DT_CENTER           1
#define DT_VCENTER          4
#define DT_WORDBREAK       16

Image
Thanks!
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 Nov 21, 2007 7:01 pm

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
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Antonio Linares » Wed Nov 21, 2007 7:02 pm

Enrico,

It will be available by early December :-)
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 Nov 21, 2007 10:30 pm

Great! :-)

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

Postby Silvio » Wed Nov 21, 2007 11:33 pm

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

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby Antonio Linares » Thu Nov 22, 2007 8:30 am

Silvio,

No, not yet
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 Maurilio Viana » Fri Nov 23, 2007 3:15 pm

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
Maurilio Viana
 
Posts: 252
Joined: Tue Oct 25, 2005 2:48 pm
Location: Garça/Garza/Heron City - Brazil

Postby Antonio Linares » Fri Nov 23, 2007 4:17 pm

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
Antonio Linares
Site Admin
 
Posts: 42079
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby nageswaragunupudi » Fri Nov 23, 2007 4:58 pm

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: 10624
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Postby nageswaragunupudi » Sun Nov 25, 2007 1:36 pm

Mr Antonio

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

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 75 guests

cron