Get with "flat" border

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

Get with "flat" border

Post by Maurilio Viana »

Hi!

How can I create a get with flat style border? Using FW 16 bits was only set 3D look to false, but with FWH the get border don't get "flat" style...
I tryend oGet:l3Dlook := .F.

regards
Maurilio
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Maurilio,

Will it be ok just to remove its border or you want to remove the 3D effect in the border ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
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,

If you use the theme manifest you get the flat look.

James
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, I want to remove 3D effect (to 'get' assume single border).

Regards,
Maurilio
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Post by nageswaragunupudi »

Using NOBORDER clause while defining Get displays the Get FLAT without any border. ( Whether using Themes or not )

If NOBORDER is NOT used, if the application is Themed Get is displayed with single line border and if the application is Not Themed Get is displayed in 3D box style.
Regards

G. N. Rao.
Hyderabad, India
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 »

In Delphi I use Ctl3D property to False and cause the effect of this image:

Image

Antonio, any idea to quit 3D effect?

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

Post by ShumingWang »

A 'Easy dialog ' sample from Easy report site http://www.reportdesigner.info shows thes tget no 3D but with border clause.
Some other software 'GET' only with underline .
Someone who knows this?
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 »

Maurilio,

This is a working solution. Maybe there is a simpler code for it, but we haven't found it yet. The advantage of this system is that you can choose the border color and thickness:

Code: Select all

#include "FiveWin.ch"

function Main()

   local oDlg, oGet, cTest := Space( 20 )

   DEFINE DIALOG oDlg 

   @ 2, 2 GET oGet VAR cTest SIZE 80, 10 NOBORDER

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

   ACTIVATE DIALOG oDlg CENTERED

return nil

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

Post by Maurilio Viana »

Thanks a lot, Antoio!!!
Where can I define border color?
I think paint blue or red obligatory fields to user get a visual reference.

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

Post by Antonio Linares »

Maurilio,

> Where can I define border color?

Please review the source code of WndBox() in source\function\wndboxes.c

You could easily implement your own border drawing function with the desired colors and thickness
regards, saludos

Antonio Linares
www.fivetechsoft.com
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 »

Thanks a lot again, Antonio!

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,

>I think paint blue or red obligatory fields to user get a visual reference.

I show the background color of the GET as pink if the field is required and empty, and yellow if the field contains questionable data.

You may note that Microsoft has starting doing something simlar--the address field in IE is green when the site is safe.

James
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,

I changed my TGet.prg Paint method to draw a rectangle before DispEnd() call. I created a pen with the color I want the border. And worked fine (I must try under Win 98).

But I want to do the same in combobox control. Do you have idea of a place to insert rectangle call to draw the "new" border of combobox?

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

Post by Antonio Linares »

Maurilio,

You have to implement Method Paint() in Class TComboBox and do similar as we do in Class TButtonBmp: (source\classes\buttonb.prg)

Code: Select all

METHOD Paint() CLASS TComboBox

   local aInfo := ::DispBegin()

   CallWindowProc( ::nOldProc, ::hWnd, WM_PAINT, ::hDC, 0 )

   If( ! Empty( ::bPainted ), Eval( ::bPainted, ::hDC ),)

   ::DispEnd()

return 1
Also you may need to add:

Code: Select all

   METHOD Display() INLINE ::BeginPaint(), ::Paint(), ::EndPaint(), 0
regards, saludos

Antonio Linares
www.fivetechsoft.com
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,

Is there a reason you don't want to just use the themed look? This would give you the flat border on all controls and it is the way most programs are now.

James
Post Reply