GET NO MODIFY

GET NO MODIFY

Postby ukservice » Thu Dec 08, 2011 9: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:
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.
FWH 11.11, Harbour 3.1 and Borland C++ 5.82
User avatar
ukservice
 
Posts: 417
Joined: Tue Feb 23, 2010 3:09 pm
Location: John

Re: GET NO MODIFY

Postby Enrico Maria Giordano » Thu Dec 08, 2011 11:36 am

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
User avatar
Enrico Maria Giordano
 
Posts: 8402
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: GET NO MODIFY

Postby Antonio Linares » Thu Dec 08, 2011 11:47 am

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
      ...
 
regards, saludos

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

Re: GET NO MODIFY

Postby ukservice » 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
User avatar
ukservice
 
Posts: 417
Joined: Tue Feb 23, 2010 3:09 pm
Location: John

Re: GET NO MODIFY

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


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

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

Re: GET NO MODIFY

Postby ukservice » Thu Dec 08, 2011 3: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
User avatar
ukservice
 
Posts: 417
Joined: Tue Feb 23, 2010 3:09 pm
Location: John

Re: GET NO MODIFY

Postby ukservice » Sat Dec 10, 2011 2:42 pm

FWH 11.11, Harbour 3.1 and Borland C++ 5.82
User avatar
ukservice
 
Posts: 417
Joined: Tue Feb 23, 2010 3:09 pm
Location: John

Re: GET NO MODIFY

Postby ukservice » Mon Dec 12, 2011 8:32 pm

Any news?.

Thank you.
FWH 11.11, Harbour 3.1 and Borland C++ 5.82
User avatar
ukservice
 
Posts: 417
Joined: Tue Feb 23, 2010 3:09 pm
Location: John

Re: GET NO MODIFY

Postby Antonio Linares » Mon Dec 12, 2011 8:45 pm

John,

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

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

Re: GET NO MODIFY

Postby ukservice » Tue Dec 13, 2011 8: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
User avatar
ukservice
 
Posts: 417
Joined: Tue Feb 23, 2010 3:09 pm
Location: John

Re: GET NO MODIFY

Postby driessen » Tue Dec 13, 2011 10:18 am

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.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.02 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc77
User avatar
driessen
 
Posts: 1399
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: GET NO MODIFY

Postby ukservice » 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
User avatar
ukservice
 
Posts: 417
Joined: Tue Feb 23, 2010 3:09 pm
Location: John

Re: GET NO MODIFY

Postby Antonio Linares » Tue Dec 13, 2011 9:42 pm

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()
regards, saludos

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

Re: GET NO MODIFY

Postby ukservice » Wed Dec 14, 2011 10:25 am

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.
FWH 11.11, Harbour 3.1 and Borland C++ 5.82
User avatar
ukservice
 
Posts: 417
Joined: Tue Feb 23, 2010 3:09 pm
Location: John

Re: GET NO MODIFY

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

Next

Return to FiveWin for Harbour/xHarbour

Who is online

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