Page 1 of 2

GET NO MODIFY

PostPosted: Thu Dec 08, 2011 9:57 am
by ukservice
Antonio,

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

Uploaded with ImageShack.us

This is the code:
Code: Select all  Expand view
#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.

Re: GET NO MODIFY

PostPosted: Thu Dec 08, 2011 11:36 am
by Enrico Maria Giordano
Code: Select all  Expand view
#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

Re: GET NO MODIFY

PostPosted: Thu Dec 08, 2011 11:47 am
by Antonio Linares
John,

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

Code: Select all  Expand view
  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


Image

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

Re: GET NO MODIFY

PostPosted: Thu Dec 08, 2011 12:58 pm
by ukservice
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

Re: GET NO MODIFY

PostPosted: Thu Dec 08, 2011 2:33 pm
by Enrico Maria Giordano
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: Select all  Expand view
TGet():lDisColors = .f.


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

EMG

Re: GET NO MODIFY

PostPosted: Thu Dec 08, 2011 3:41 pm
by ukservice
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

Re: GET NO MODIFY

PostPosted: Sat Dec 10, 2011 2:42 pm
by ukservice

Re: GET NO MODIFY

PostPosted: Mon Dec 12, 2011 8:32 pm
by ukservice
Any news?.

Thank you.

Re: GET NO MODIFY

PostPosted: Mon Dec 12, 2011 8:45 pm
by Antonio Linares
John,

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

Re: GET NO MODIFY

PostPosted: Tue Dec 13, 2011 8:10 am
by ukservice
Antonio,

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

How do I fix tget.prg?.

Thanks.

Re: GET NO MODIFY

PostPosted: Tue Dec 13, 2011 10:18 am
by driessen
Ukservice,

You could change this line in the tget class :
Code: Select all  Expand view
define COLOR_GRAYTEXT      17

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

Re: GET NO MODIFY

PostPosted: Tue Dec 13, 2011 10:43 am
by ukservice
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.

Re: GET NO MODIFY

PostPosted: Tue Dec 13, 2011 9:42 pm
by Antonio Linares
John,

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

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


Just uncomment ::Disable()

Re: GET NO MODIFY

PostPosted: Wed Dec 14, 2011 10:25 am
by ukservice
Yes, it is working.

Code: Select all  Expand view
  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.

Re: GET NO MODIFY

PostPosted: Wed Dec 14, 2011 11:35 am
by Antonio Linares
John,

Not yet. Usually we wait for feeback before publishing it