Get with "flat" border

Get with "flat" border

Postby Maurilio Viana » Wed Nov 28, 2007 8:20 pm

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

Postby Antonio Linares » Wed Nov 28, 2007 9:46 pm

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

Postby James Bott » Wed Nov 28, 2007 11:48 pm

Maurilio,

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

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

Postby Maurilio Viana » Thu Nov 29, 2007 10:11 am

Antonio, I want to remove 3D effect (to 'get' assume single border).

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

Postby nageswaragunupudi » Thu Nov 29, 2007 1:33 pm

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
nageswaragunupudi
 
Posts: 10646
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Postby Maurilio Viana » Thu Nov 29, 2007 3:35 pm

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

Postby ShumingWang » Fri Nov 30, 2007 1:33 am

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

Postby Antonio Linares » Fri Nov 30, 2007 4:47 pm

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  Expand view  RUN
#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
Antonio Linares
Site Admin
 
Posts: 42111
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Maurilio Viana » Fri Nov 30, 2007 6:55 pm

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

Postby Antonio Linares » Fri Nov 30, 2007 7:53 pm

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

Postby Maurilio Viana » Fri Nov 30, 2007 8:12 pm

Thanks a lot again, Antonio!

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 » Fri Nov 30, 2007 11:31 pm

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

Postby Maurilio Viana » Mon Dec 03, 2007 4:46 pm

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

Postby Antonio Linares » Mon Dec 03, 2007 4:53 pm

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  Expand view  RUN
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  Expand view  RUN
   METHOD Display() INLINE ::BeginPaint(), ::Paint(), ::EndPaint(), 0
regards, saludos

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

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

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

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 65 guests