FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour TGet Spinner bug 2
Posts: 283
Joined: Sat Oct 15, 2005 06:40 AM
TGet Spinner bug 2
Posted: Fri Feb 17, 2006 01:54 PM
Hi Fwh's

Another little bug in my exe FWH 32bit:
is not visible the number TGet when Right, Spinner and WHEN .F. clauses are declared.

In FW 2.5 (16 bit) is not present, I do not test the Feb06 version.

Test this:
#include "FiveWin.ch"

function Main()

   LOCAL oDlg, oGet, nVal0 := 0, nVal1 := 0

   DEFINE DIALOG oDlg
   @ 1,1 GET oGet VAR nVal0 OF oDlg SIZE 50, 8 PICTURE "99999.99" SPINNER RIGHT
   @ 3,1 GET oGet VAR nVal1 OF oDlg SIZE 50, 8 PICTURE "99.99" SPINNER WHEN .F. RIGHT

   ACTIVATE DIALOG oDlg

   RETURN Nil


Thank you for the help.
Ciao, best regards,

Ugo
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: TGet Spinner bug 2
Posted: Fri Feb 24, 2006 04:07 PM
This is a possible fix (TGet:Paint() method):

#define SM_CYHSCROLL          3

      do case 
         case lAnd( GetWindowLong( ::hWnd, GWL_STYLE ), ES_CENTER ) 
              SetTextAlign( ::hDC, TA_CENTER ) 
              ExtTextOut( ::hDC, 1, ( ::nWidth() - 7 - GetSysMetrics( SM_CYHSCROLL ) ) / 2,;
                { 0, 0, ::nHeight(), ::nWidth() }, GetWindowText( ::hWnd ) )
              
         case lAnd( GetWindowLong( ::hWnd, GWL_STYLE ), ES_RIGHT ) 
              SetTextAlign( ::hDC, TA_RIGHT ) 
              ExtTextOut( ::hDC, 1, ::nWidth() - 7 - GetSysMetrics( SM_CYHSCROLL ),;
                { 0, 0, ::nHeight(), ::nWidth() }, GetWindowText( ::hWnd ) )
             
         otherwise 
              SetTextAlign( ::hDC, TA_LEFT ) 
              ExtTextOut( ::hDC, 1, 0,;
                { 0, 0, ::nHeight(), ::nWidth() }, GetWindowText( ::hWnd ) )
      endcase


EMG
Posts: 283
Joined: Sat Oct 15, 2005 06:40 AM
Re: TGet Spinner bug 2
Posted: Fri Feb 24, 2006 11:14 PM
EnricoMaria wrote:This is a possible fix (TGet:Paint() method):
EMG


Dear Enrico,

your fix work perfectly!

Thank you.
Ciao, best regards,

Ugo
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
TGet Spinner bug 2
Posted: Sun Feb 26, 2006 07:03 AM

Enrico,

Thanks! :)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
TGet Spinner bug 2
Posted: Sun Feb 26, 2006 10:47 AM

Please note that I haven't tried with the CENTER option.

EMG

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
TGet Spinner bug 2
Posted: Sun Feb 26, 2006 10:58 AM

Enrico,

But that fix should check if Spinner is used, right ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
TGet Spinner bug 2
Posted: Sun Feb 26, 2006 11:07 AM
Antonio Linares wrote:Enrico,

But that fix should check if Spinner is used, right ?


Ops! Right. :-)

EMG
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
TGet Spinner bug 2
Posted: Sun Feb 26, 2006 11:54 AM

Enrico,

I have added a new DATA lSpinner, to use it at Method Paint()

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
TGet Spinner bug 2
Posted: Sun Feb 26, 2006 11:58 AM
...
      do case 
         case lAnd( GetWindowLong( ::hWnd, GWL_STYLE ), ES_CENTER ) 
              SetTextAlign( ::hDC, TA_CENTER ) 
              if ::lSpinner
                 ExtTextOut( ::hDC, 1, ( ::nWidth() - 7 - GetSysMetrics( SM_CYHSCROLL ) ) / 2,; 
                    { 0, 0, ::nHeight(), ::nWidth() }, GetWindowText( ::hWnd ) )
              else     
                 ExtTextOut( ::hDC, 0, ::nWidth() / 2,;
                   { 0, 0, ::nHeight(), ::nWidth() }, GetWindowText( ::hWnd ) )
              endif     
              
         case lAnd( GetWindowLong( ::hWnd, GWL_STYLE ), ES_RIGHT ) 
              SetTextAlign( ::hDC, TA_RIGHT ) 
              if ::lSpinner
                 ExtTextOut( ::hDC, 1, ::nWidth() - 7 - GetSysMetrics( SM_CYHSCROLL ),; 
                    { 0, 0, ::nHeight(), ::nWidth() }, GetWindowText( ::hWnd ) ) 
              else      
                 ExtTextOut( ::hDC, 0, ::nWidth() - 4,;
                    { 0, 0, ::nHeight(), ::nWidth() }, GetWindowText( ::hWnd ) )
              endif      
...
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM

Continue the discussion