FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour GET NO MODIFY
Posts: 417
Joined: Tue Feb 23, 2010 03:09 PM
GET NO MODIFY
Posted: Thu Dec 08, 2011 09:57 AM
Antonio,

When I use a GET with NO MODIFY clause it is quite hard to read as you can see in the picture:


Uploaded with ImageShack.us

This is the code:
Code (fw): Select all Collapse
#Include "FiveWin.Ch"


Function Main()
   Local oDlg
   Local oGet1,oGet2,oGet3,oGet4
   local cVar1 := "HARBOUR IS THE BEST", cvar2 := "testing gets"
   local nVar2 := 0
   local nVar3 := 0
   local dVar4 := date()

   DEFINE DIALOG oDlg from 0,0 to 400,400 pixel  TITLE "GET WITH MO MODIFY"

   @ 15,15 get oGet1 var cVar1 picture "@!" ;
   size 150,12 of oDlg pixel NO MODIFY

   @ 40,15 get oGet2 var cVar2 picture "99999" ;
   size 150,12 of oDlg pixel  NO MODIFY



   @ 65,15 get oGet3 var nVar3 picture "99999.99" ;
   size 50,12 of oDlg pixel right

   @ 90,15 get oGet4 var dVar4  ;
   size 50,12 of oDlg pixel



   @ 7.2, 15 BUTTON "&Cancel" OF oDlg SIZE 46, 13 ACTION oDlg:End()

   ACTIVATE DIALOG oDlg CENTERED

 return nil



Could you please change colours to be read better?. Thank you.
FWH 11.11, Harbour 3.1 and Borland C++ 5.82
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: GET NO MODIFY
Posted: Thu Dec 08, 2011 11:36 AM
Code (fw): Select all Collapse
#Include "FiveWin.Ch"


Function Main()
   Local oDlg
   Local oGet1,oGet2,oGet3,oGet4
   local cVar1 := "HARBOUR IS THE BEST", cvar2 := "testing gets"
   local nVar2 := 0
   local nVar3 := 0
   local dVar4 := date()

   TGet():lDisColors = .F.

   DEFINE DIALOG oDlg from 0,0 to 400,400 pixel  TITLE "GET WITH MO MODIFY"

   @ 15,15 get oGet1 var cVar1 picture "@!" ;
   size 150,12 of oDlg pixel WHEN .F.

   @ 40,15 get oGet2 var cVar2 picture "99999" ;
   size 150,12 of oDlg pixel WHEN .F.



   @ 65,15 get oGet3 var nVar3 picture "99999.99" ;
   size 50,12 of oDlg pixel right

   @ 90,15 get oGet4 var dVar4  ;
   size 50,12 of oDlg pixel



   @ 7.2, 15 BUTTON "&Cancel" OF oDlg SIZE 46, 13 ACTION oDlg:End()

   ACTIVATE DIALOG oDlg CENTERED

 return nil


EMG
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: GET NO MODIFY
Posted: Thu Dec 08, 2011 11:47 AM
John,

Besides Enrico's example, you can also select the disabled colors to use:

Code (fw): Select all Collapse
   TGet():lDisColors = .F.

   DEFINE DIALOG oDlg from 0,0 to 400,400 pixel  TITLE "GET WITH MO MODIFY"

   @ 15,15 get oGet1 var cVar1 picture "@!" ;
   size 150,12 of oDlg pixel NO MODIFY
   
   oGet1:nClrPaneDis = CLR_HCYAN
   oGet1:nClrTextDis = CLR_BLACK

   @ 40,15 get oGet2 var cVar2 picture "99999" ;
   size 150,12 of oDlg pixel  NO MODIFY

   oGet2:nClrPaneDis = CLR_HCYAN
   oGet2:nClrTextDis = CLR_BLACK




BTW, when testing this code we have detected a bug in Class TGet and we have fixed it:
Code (fw): Select all Collapse
   if IsWindowEnabled( ::hWnd ) .and. ! ::lReadOnly  // this lReadOnly check was missing 
      CallWindowProc( ::nOldProc, ::hWnd, WM_PAINT, ::hDC, 0 )
   else
      ...
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 417
Joined: Tue Feb 23, 2010 03:09 PM
Re: GET NO MODIFY
Posted: Thu Dec 08, 2011 12:58 PM

Hello,

Thanks for reply.

Enrico´s TGet():lDisColors = .f. does not work with NO MODIFY clause.

Also, is there a global solution or setting?.

Just to avoid changing every dialog?.

Thanks

FWH 11.11, Harbour 3.1 and Borland C++ 5.82
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: GET NO MODIFY
Posted: Thu Dec 08, 2011 02:33 PM
ukservice wrote:Enrico´s TGet():lDisColors = .f. does not work with NO MODIFY clause.


It will with the above fix from Antonio.

ukservice wrote:Also, is there a global solution or setting?.

Just to avoid changing every dialog?.


Yes:

Code (fw): Select all Collapse
TGet():lDisColors = .f.


It's a global changing not tied to a particular GET.

EMG
Posts: 417
Joined: Tue Feb 23, 2010 03:09 PM
Re: GET NO MODIFY
Posted: Thu Dec 08, 2011 03:41 PM
Enrico,

Thanks for your valuable help and support.

I apply the fix and works.

But when I click on the get, I get an uggly effect:
[IMG=http://img59.imageshack.us/img59/6282/errorkb.png][/IMG]

Uploaded with ImageShack.us
FWH 11.11, Harbour 3.1 and Borland C++ 5.82
Posts: 417
Joined: Tue Feb 23, 2010 03:09 PM
Re: GET NO MODIFY
Posted: Sat Dec 10, 2011 02:42 PM
FWH 11.11, Harbour 3.1 and Borland C++ 5.82
Posts: 417
Joined: Tue Feb 23, 2010 03:09 PM
Re: GET NO MODIFY
Posted: Mon Dec 12, 2011 08:32 PM

Any news?.

Thank you.

FWH 11.11, Harbour 3.1 and Borland C++ 5.82
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: GET NO MODIFY
Posted: Mon Dec 12, 2011 08:45 PM

John,

Try with oGet2:Disable() from the ON INIT clause of the dialog

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 417
Joined: Tue Feb 23, 2010 03:09 PM
Re: GET NO MODIFY
Posted: Tue Dec 13, 2011 08:10 AM

Antonio,

Yes, with oGet2:Disable() there is no uggly effect.

How do I fix tget.prg?.

Thanks.

FWH 11.11, Harbour 3.1 and Borland C++ 5.82
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Re: GET NO MODIFY
Posted: Tue Dec 13, 2011 10:18 AM
Ukservice,

You could change this line in the tget class :
Code (fw): Select all Collapse
define COLOR_GRAYTEXT      17

I changed it into "2" to get a much darker text.

Regards,

Michel D.
Genk (Belgium)


_____________________________________________________________________________________________

I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 417
Joined: Tue Feb 23, 2010 03:09 PM
Re: GET NO MODIFY
Posted: Tue Dec 13, 2011 10:43 AM

Michel,

That changes colour but uggly effect is still present.

The fix is that NO MODIFY clause shows the same as oGet:Disable() but I need Antonio´s help.

Thank you.

FWH 11.11, Harbour 3.1 and Borland C++ 5.82
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: GET NO MODIFY
Posted: Tue Dec 13, 2011 09:42 PM
John,

In fact the fix was already in FWH tget.prg:

Code (fw): Select all Collapse
   if ::lReadOnly .and. ::nClrText == GetSysColor( COLOR_WINDOWTEXT ) ;
      .and. ::nClrPane == GetSysColor( COLOR_WINDOW )
      ::SetColor( GetSysColor(COLOR_GRAYTEXT) , GetSysColor( COLOR_BTNFACE ))
//     ::Disable()
   endif


Just uncomment ::Disable()
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 417
Joined: Tue Feb 23, 2010 03:09 PM
Re: GET NO MODIFY
Posted: Wed Dec 14, 2011 10:25 AM
Yes, it is working.

Code (fw): Select all Collapse
   if ::lReadOnly .and. ::nClrText == GetSysColor( COLOR_WINDOWTEXT ) ;
      .and. ::nClrPane == GetSysColor( COLOR_WINDOW )
      ::SetColor( GetSysColor(COLOR_GRAYTEXT) , GetSysColor( COLOR_BTNFACE ))
     ::Disable()
   endif



Did you include it in the new build you published yesterday?.

Thanks.
FWH 11.11, Harbour 3.1 and Borland C++ 5.82
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: GET NO MODIFY
Posted: Wed Dec 14, 2011 11:35 AM

John,

Not yet. Usually we wait for feeback before publishing it

regards, saludos

Antonio Linares
www.fivetechsoft.com