FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Get with "flat" border
Posts: 252
Joined: Tue Oct 25, 2005 02:48 PM
Get with "flat" border
Posted: Wed Nov 28, 2007 08: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

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Get with "flat" border
Posted: Wed Nov 28, 2007 09: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
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Get with "flat" border
Posted: Wed Nov 28, 2007 11:48 PM

Maurilio,

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

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 252
Joined: Tue Oct 25, 2005 02:48 PM
Get with "flat" border
Posted: Thu Nov 29, 2007 10:11 AM

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

Regards,
Maurilio

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Get with "flat" border
Posted: Thu Nov 29, 2007 01: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
Posts: 252
Joined: Tue Oct 25, 2005 02:48 PM
Get with "flat" border
Posted: Thu Nov 29, 2007 03:35 PM
In Delphi I use Ctl3D property to False and cause the effect of this image:



Antonio, any idea to quit 3D effect?

Regards
Maurilio
Posts: 474
Joined: Sun Oct 30, 2005 06:37 AM
Get with "flat" border
Posted: Fri Nov 30, 2007 01: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

http://www.xtech2.top
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Get with "flat" border
Posted: Fri Nov 30, 2007 04: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:
#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

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 252
Joined: Tue Oct 25, 2005 02:48 PM
Get with "flat" border
Posted: Fri Nov 30, 2007 06: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

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Get with "flat" border
Posted: Fri Nov 30, 2007 07: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
Posts: 252
Joined: Tue Oct 25, 2005 02:48 PM
Get with "flat" border
Posted: Fri Nov 30, 2007 08:12 PM

Thanks a lot again, Antonio!

Regards
Maurilio

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Get with "flat" border
Posted: 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

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 252
Joined: Tue Oct 25, 2005 02:48 PM
Get with "flat" border
Posted: Mon Dec 03, 2007 04: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

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Get with "flat" border
Posted: Mon Dec 03, 2007 04: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)
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:
   METHOD Display() INLINE ::BeginPaint(), ::Paint(), ::EndPaint(), 0
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Get with "flat" border
Posted: Mon Dec 03, 2007 05: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

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10