FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Bug in TBtnBmp prompt
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Bug in TBtnBmp prompt
Posted: Wed Nov 21, 2007 09:17 AM
In the following sample the prompt is not splitted across two lines and two little squares are displayed instead:

#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
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Bug in TBtnBmp prompt
Posted: Wed Nov 21, 2007 05:04 PM
Enrico,

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


Thanks!
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Bug in TBtnBmp prompt
Posted: Wed Nov 21, 2007 07:01 PM

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

EMG

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Bug in TBtnBmp prompt
Posted: Wed Nov 21, 2007 07:02 PM

Enrico,

It will be available by early December :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Bug in TBtnBmp prompt
Posted: Wed Nov 21, 2007 11:33 PM

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

Best Regards, Saludos



Falconi Silvio
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Bug in TBtnBmp prompt
Posted: Thu Nov 22, 2007 08:30 AM

Silvio,

No, not yet

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 252
Joined: Tue Oct 25, 2005 02:48 PM
Bug in TBtnBmp prompt
Posted: Fri Nov 23, 2007 03: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

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Bug in TBtnBmp prompt
Posted: Fri Nov 23, 2007 04: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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Bug in TBtnBmp prompt
Posted: Fri Nov 23, 2007 04: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

Regards



G. N. Rao.

Hyderabad, India
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Bug in TBtnBmp prompt
Posted: Sun Nov 25, 2007 01: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

Continue the discussion