Get with "flat" border

Postby James Bott » Mon Dec 03, 2007 5:18 pm

Maurilio,

I re-read the message thread and realized you want to use different border colors as indicators.

Still as I pointed out in a previous message, the method Microsoft has started using is coloring the control's background not the border. So you might want to consider doing this instead (and it would not require modification of any of the FW source).

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby James Bott » Mon Dec 03, 2007 5:30 pm

Maurilio,

Here is an example using controls with colored backgrounds as indicators. The pink field is missing critical data and the yellow field contains questionable data ( the email address is missing the @).

These are a way of addressing my philosophy of not requiring even critical data to be entered before allowing the user to close the dialog. I find that forcing the user to enter all critical fields before closing the dialog just puts the user in the pridicament of having to make up data in order to finish what they are doing. I would rather have no data than wrong data--you can never tell if it is wrong, you can tell if it is missing.

James

Image
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Maurilio Viana » Tue Dec 04, 2007 10:14 am

Antonio:
Thanks a lot, I'll try it!

James:
The intention is paint the border with a different color to mandatory fields (for example) to let the user have a visual reference.
Using themes under XP we have controls with line border or "flat style" but who don't use themes or Win98 don't have it. The only way I found to use this flat borders and colored references is changing controls for myself.

Best regards,
Maurilio
User avatar
Maurilio Viana
 
Posts: 252
Joined: Tue Oct 25, 2005 2:48 pm
Location: Garça/Garza/Heron City - Brazil

Postby James Bott » Tue Dec 04, 2007 4:03 pm

Maurilio,

>The intention is paint the border with a different color to mandatory fields (for example) to let the user have a visual reference.

That is what the pink field is in the example screenshot in my previous message. I have no mandatory fields as explained in my previous message, I call them critical data, but these are what you would call mandatory. They are pink until filled out, then they become white. Or, they could become yellow if the data is suspect.

As I said, if you make fields mandatory and the user doesn't have the needed data, then they will make something up. (I assume by "mandatory" you mean that they must be filled out before the dialog can be saved.)

>Using themes under XP we have controls with line border or "flat style" but who don't use themes or Win98 don't have it. The only way I found to use this flat borders and colored references is changing controls for myself.

You can use field colors in all versions of Windows, and you don't need to modify the FW source. Also, it works with or without themes.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby ShumingWang » Wed Dec 05, 2007 3:21 am

This might Tget add more datas to control features, border color, flat style ,underlined style , etc.

Shuming Wang
ShumingWang
 
Posts: 460
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

Postby ShumingWang » Fri Aug 01, 2008 10:53 am

Hi,
Why I get as follow ? I modified tget.prg paint as adviced.
Image

redefine get xx id 101 of odlg
...

// "@1,1 get xx of odlg noborder", this do well .
// "redefine get "," .rc removed WS_BORDER , not work well .

Regards!
Shuming Wang
ShumingWang
 
Posts: 460
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

Postby ShumingWang » Mon Aug 04, 2008 1:05 am

Hi,
How to disable tget 3D effect or without border ?

redefine get var1 id 101 of odlg

in .rc/dll without WS_BORDER .

EDITTEXT 101, 145, 34, 31, 12

Still with 3D effect .

Thanks !
Shuming Wang
ShumingWang
 
Posts: 460
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

Postby Antonio Linares » Mon Aug 04, 2008 10:31 am

Code: Select all  Expand view
   redefine GET oGet VAR var1 id 101 of oDlg

   oGet:bPainted = { || PaintBorder( oGet, oDlg ) }

   ...

function PaintBorder( oGet, oDlg )

   local aPoint1 := { -1, -1 }
   local aPoint2 := { oGet:nHeight, oGet:nWidth }
   
   aPoint1 = ClientToScreen( oGet:hWnd, aPoint1 )
   aPoint1 = ScreenToClient( oDlg:hWnd, aPoint1 )
   aPoint2 = ClientToScreen( oGet:hWnd, aPoint2 )
   aPoint2 = ScreenToClient( oDlg:hWnd, aPoint2 )
   
   WndBox( oDlg:GetDC(), aPoint1[ 1 ], aPoint1[ 2 ], aPoint2[ 1 ], aPoint2[ 2 ] )
   oDlg:ReleaseDC()
   
return nil

Image
regards, saludos

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

Postby ShumingWang » Tue Aug 05, 2008 1:19 am

Antonio,
Still paints 3D get :
Image

Regards!
Shuming Wang
ShumingWang
 
Posts: 460
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

Postby Antonio Linares » Tue Aug 05, 2008 4:43 am

Shuming,

Please try to reduce the dimensions of the rectangle:

local aPoint2 := { oGet:nHeight - 1, oGet:nWidth - 1 }
regards, saludos

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

Postby ShumingWang » Tue Aug 05, 2008 7:31 am

Antonio,
Is there a way to change oget:nstyle ? so get true no border effect ?
Regards!
Shuming Wang
ShumingWang
 
Posts: 460
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

Postby Antonio Linares » Tue Aug 05, 2008 7:33 am

Shuming,

As far as we know, Windows only allows to use or not a border, but no the type of the border. Thats why we have to paint ours on top of it.
regards, saludos

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

Postby ShumingWang » Thu Aug 07, 2008 3:20 am

Antonio,
According to MR Wensheng Liao's advice, change .rc/dll EXITTEXT --> user defined control, for example:

EDITTEXT 101, 51, 31, 58, 12
change to
CONTROL "", 101,"EDIT",0 , 51, 31, 58, 12

This can do a no border get , then self add a wndbox()

Regards!
Shuming Wang
ShumingWang
 
Posts: 460
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

Postby Enrico Maria Giordano » Thu Aug 07, 2008 11:51 am

EDITTEXT 101, 51, 31, 58, 12

and

CONTROL "", 101,"EDIT",0 , 51, 31, 58, 12

are two different syntaxes for the same control, as far as I know.

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

Postby ShumingWang » Fri Aug 08, 2008 6:27 am

E.M.G,

It seems , Tget class can't Recognizing if .rc/dll EDITTEXT with WS_BORDER clause.

Shuming Wang
ShumingWang
 
Posts: 460
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 15 guests

cron