TGet Spinner bug 2

TGet Spinner bug 2

Postby Ugo » Fri Feb 17, 2006 1: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:
Code: Select all  Expand view  RUN
#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
User avatar
Ugo
 
Posts: 283
Joined: Sat Oct 15, 2005 6:40 am
Location: Turin, Italy

Re: TGet Spinner bug 2

Postby Enrico Maria Giordano » Fri Feb 24, 2006 4:07 pm

This is a possible fix (TGet:Paint() method):

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

Re: TGet Spinner bug 2

Postby Ugo » 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
User avatar
Ugo
 
Posts: 283
Joined: Sat Oct 15, 2005 6:40 am
Location: Turin, Italy

Postby Antonio Linares » Sun Feb 26, 2006 7:03 am

Enrico,

Thanks! :)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Enrico Maria Giordano » Sun Feb 26, 2006 10:47 am

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

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

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

Postby Enrico Maria Giordano » Sun Feb 26, 2006 11:07 am

Antonio Linares wrote:Enrico,

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


Ops! Right. :-)

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

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

Postby Antonio Linares » Sun Feb 26, 2006 11:58 am

Code: Select all  Expand view  RUN
...
      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
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Enrico Maria Giordano » Sun Feb 26, 2006 12:00 pm

Thank you.

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


Return to FiveWin for Harbour/xHarbour

Who is online

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