Get with "flat" border

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

Post by James Bott »

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: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

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
Maurilio Viana
Posts: 252
Joined: Tue Oct 25, 2005 2:48 pm
Location: Garça/Garza/Heron City - Brazil
Contact:

Post by Maurilio Viana »

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
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

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
ShumingWang
Posts: 454
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

Post by ShumingWang »

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

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

Post by ShumingWang »

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: 454
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

Post by ShumingWang »

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

Post by Antonio Linares »

Code: Select all

   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
ShumingWang
Posts: 454
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

Post by ShumingWang »

Antonio,
Still paints 3D get :
Image

Regards!
Shuming Wang
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

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
ShumingWang
Posts: 454
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

Post by ShumingWang »

Antonio,
Is there a way to change oget:nstyle ? so get true no border effect ?
Regards!
Shuming Wang
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

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
ShumingWang
Posts: 454
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

Post by ShumingWang »

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

Post by Enrico Maria Giordano »

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
ShumingWang
Posts: 454
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

Post by ShumingWang »

E.M.G,

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

Shuming Wang
Post Reply