Page 1 of 4

DrawEdge - New feature

Posted: Sat Dec 07, 2013 10:57 pm
by Pablo César
The Win32 API features a new function called DrawEdge. Its purpose is to draw 3D effects for all Windows applications. And this function was missing in HMG and Minigui.

The DrawEdge function is a useful function provided by the Win32 API. It can draw a variety of the edge styles used to draw buttons, frames and borders around controls and forms.

I made a Demo to show how each controls can be draw it. Not all components looks like pretty, but can be used as you wish.

I added a GetControlCoords which returns the coordinates for one specific control (position/size). There is also a 3rd parameter which programmer can use just to adjust for fit around the control in pixels. IMO this function would it beadd to HMG library at h_controlmisc.prg, so that everyone can use with some certain frequency.

If anyone has any suggestions or has made ​​some improvement, please excite in to say/describe so we can improve the code.

I hope this resource is useful and you enjoyed.

<Attached files was removed. Please note in last message of topic updated version.>

Re: DrawEdge - New feature

Posted: Sat Dec 07, 2013 11:15 pm
by esgici
Pablo César wrote:The Win32 API features a new function called DrawEdge. Its purpose is to draw 3D effects for all Windows applications. And this function was missing in HMG and Minigui.

The DrawEdge function is a useful function provided by the Win32 API. It can draw a variety of the edge styles used to draw buttons, frames and borders around controls and forms.

I made a Demo to show how each controls can be draw it. Not all components looks like pretty, but can be used as you wish.

I added a GetControlCoords which returns the coordinates for one specific control (position/size). There is also a 3rd parameter which programmer can use just to adjust for fit around the control in pixels. IMO this function would it beadd to HMG library at h_controlmisc.prg, so that everyone can use with some certain frequency.

If anyone has any suggestions or has made ​​some improvement, please excite in to say/describe so we can improve the code.

I hope this resource is useful and you enjoyed.
hbmk2: Compiling Harbour sources...
Harbour 3.2.0dev (Rev. 18911)
Copyright (c) 1999-2013, http: // harbour - project . org
C:\test\DrawEdge\main.prg(43) Error E0030 Syntax error "syntax error at '.'"
...
C:\test\DrawEdge\main.prg(160) Error E0030 Syntax error "syntax error at '.'"

44 errors

No code generated.

<this post edited by author (BE) >


DrawEdge - New feature

Posted: Sat Dec 07, 2013 11:45 pm
by Pablo César
esgici wrote:
Pablo César wrote:The Win32 API features a new function called DrawEdge. Its purpose is to draw 3D effects for all Windows applications. And this function was missing in HMG and Minigui.

The DrawEdge function is a useful function provided by the Win32 API. It can draw a variety of the edge styles used to draw buttons, frames and borders around controls and forms.

I made a Demo to show how each controls can be draw it. Not all components looks like pretty, but can be used as you wish.

I added a GetControlCoords which returns the coordinates for one specific control (position/size). There is also a 3rd parameter which programmer can use just to adjust for fit around the control in pixels. IMO this function would it beadd to HMG library at h_controlmisc.prg, so that everyone can use with some certain frequency.

If anyone has any suggestions or has made ​​some improvement, please excite in to say/describe so we can improve the code.

I hope this resource is useful and you enjoyed.

Code: Select all

hbmk2: Compiling Harbour sources...
Harbour 3.2.0dev (Rev. 18911)
Copyright (c) 1999-2013, http://harbour-project.org" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;

C:\test\DrawEdge\main.prg(43) Error E0030  Syntax error "syntax error at '.'"
C:\test\DrawEdge\main.prg(44) Error E0030  Syntax error "syntax error at '.'"
C:\test\DrawEdge\main.prg(45) Error E0030  Syntax error "syntax error at '.'"
C:\test\DrawEdge\main.prg(46) Error E0030  Syntax error "syntax error at '.'"
C:\test\DrawEdge\main.prg(56) Error E0030  Syntax error "syntax error at '.'"
C:\test\DrawEdge\main.prg(57) Error E0030  Syntax error "syntax error at '.'"
C:\test\DrawEdge\main.prg(58) Error E0030  Syntax error "syntax error at '.'"
C:\test\DrawEdge\main.prg(59) Error E0030  Syntax error "syntax error at '.'"
C:\test\DrawEdge\main.prg(69) Error E0030  Syntax error "syntax error at '.'"
C:\test\DrawEdge\main.prg(70) Error E0030  Syntax error "syntax error at '.'"
C:\test\DrawEdge\main.prg(71) Error E0030  Syntax error "syntax error at '.'"
C:\test\DrawEdge\main.prg(72) Error E0030  Syntax error "syntax error at '.'"
C:\test\DrawEdge\main.prg(82) Error E0030  Syntax error "syntax error at '.'"
C:\test\DrawEdge\main.prg(83) Error E0030  Syntax error "syntax error at '.'"
C:\test\DrawEdge\main.prg(84) Error E0030  Syntax error "syntax error at '.'"
C:\test\DrawEdge\main.prg(85) Error E0030  Syntax error "syntax error at '.'"
C:\test\DrawEdge\main.prg(95) Error E0030  Syntax error "syntax error at '.'"
C:\test\DrawEdge\main.prg(96) Error E0030  Syntax error "syntax error at '.'"
C:\test\DrawEdge\main.prg(97) Error E0030  Syntax error "syntax error at '.'"
C:\test\DrawEdge\main.prg(98) Error E0030  Syntax error "syntax error at '.'"
C:\test\DrawEdge\main.prg(108) Error E0030  Syntax error "syntax error at '.'"
C:\test\DrawEdge\main.prg(109) Error E0030  Syntax error "syntax error at '.'"
C:\test\DrawEdge\main.prg(110) Error E0030  Syntax error "syntax error at '.'"
C:\test\DrawEdge\main.prg(111) Error E0030  Syntax error "syntax error at '.'"
C:\test\DrawEdge\main.prg(129) Error E0030  Syntax error "syntax error at '.'"
C:\test\DrawEdge\main.prg(130) Error E0030  Syntax error "syntax error at '.'"
C:\test\DrawEdge\main.prg(131) Error E0030  Syntax error "syntax error at '.'"
C:\test\DrawEdge\main.prg(132) Error E0030  Syntax error "syntax error at '.'"
C:\test\DrawEdge\main.prg(134) Error E0030  Syntax error "syntax error at '.'"
C:\test\DrawEdge\main.prg(135) Error E0030  Syntax error "syntax error at '.'"
C:\test\DrawEdge\main.prg(136) Error E0030  Syntax error "syntax error at '.'"
C:\test\DrawEdge\main.prg(137) Error E0030  Syntax error "syntax error at '.'"
C:\test\DrawEdge\main.prg(139) Error E0030  Syntax error "syntax error at '.'"
C:\test\DrawEdge\main.prg(140) Error E0030  Syntax error "syntax error at '.'"
C:\test\DrawEdge\main.prg(141) Error E0030  Syntax error "syntax error at '.'"
C:\test\DrawEdge\main.prg(142) Error E0030  Syntax error "syntax error at '.'"
C:\test\DrawEdge\main.prg(144) Error E0030  Syntax error "syntax error at '.'"
C:\test\DrawEdge\main.prg(145) Error E0030  Syntax error "syntax error at '.'"
C:\test\DrawEdge\main.prg(146) Error E0030  Syntax error "syntax error at '.'"
C:\test\DrawEdge\main.prg(147) Error E0030  Syntax error "syntax error at '.'"
C:\test\DrawEdge\main.prg(157) Error E0030  Syntax error "syntax error at '.'"
C:\test\DrawEdge\main.prg(158) Error E0030  Syntax error "syntax error at '.'"
C:\test\DrawEdge\main.prg(159) Error E0030  Syntax error "syntax error at '.'"
C:\test\DrawEdge\main.prg(160) Error E0030  Syntax error "syntax error at '.'"

44 errors

No code generated.
These errors starting in source file at:

Form.HANDLE

It is the same that: GetFormHandle ( cForm )

This example was compilated with 3.1.5 UNICODE (with patches applied).

Source code was optimized a bit. Please replace Form.HANDLE with GetFormHandle ( cForm ) in case is persisting errors in your HMG and recompile it.

DrawEdge - New feature

Posted: Sat Dec 07, 2013 11:47 pm
by Pablo César
Optimized code and added a FRAMEs options too (not so nice) but can gives an idea to replace frames for DrawEdge.

<Attached files was removed. Please see at last message with updated files.>

DrawEdge - New feature

Posted: Sat Dec 07, 2013 11:55 pm
by Pablo César
esgici wrote:
Pablo César wrote:Optimized code and added a FRAMEs options too (not so nice) but can gives an idea to replace frames for DrawEdge.
Harbour 3.2.0dev (Rev. 18911)
Copyright (c) 1999-2013, http://harbour-project.org/" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;

C:\test\DrawEdge\DrawEdge2\main.prg(43) Error E0030 Syntax error "syntax error at '.'"
C:\test\DrawEdge\DrawEdge2\main.prg(58) Error E0030 Syntax error "syntax error at '.'"
C:\test\DrawEdge\DrawEdge2\main.prg(73) Error E0030 Syntax error "syntax error at '.'"
C:\test\DrawEdge\DrawEdge2\main.prg(88) Error E0030 Syntax error "syntax error at '.'"
C:\test\DrawEdge\DrawEdge2\main.prg(103) Error E0030 Syntax error "syntax error at '.'"
C:\test\DrawEdge\DrawEdge2\main.prg(118) Error E0030 Syntax error "syntax error at '.'"
C:\test\DrawEdge\DrawEdge2\main.prg(182) Error E0030 Syntax error "syntax error at '.'"

7 errors

No code generated.


:mrgreen:
Esgici, please note
Pablo César wrote:It is the same that: GetFormHandle ( cForm )

This example was compilated with 3.1.5 UNICODE (with patches applied).

Source code was optimized a bit. Please replace Form.HANDLE with GetFormHandle ( cForm ) in case is persisting errors in your HMG and recompile it.
Because I have NO problems with this compilation here. Which version are you using ? More details please.

Re: DrawEdge - New feature

Posted: Sun Dec 08, 2013 12:07 am
by esgici
OK, fixed;
Draw edges screen shoot
Draw edges screen shoot
DrawEdges.jpg (100.03 KiB) Viewed 6548 times
good improvement, thanks :arrow:

Re: DrawEdge - New feature

Posted: Sun Dec 08, 2013 5:24 am
by bpd2000
Nice improvement Pablo César

DrawEdge - New feature

Posted: Sun Dec 08, 2013 11:00 am
by Pablo César
esgici wrote:OK, fixed
Image
Ok, good. But what it happen ? How you fixed ?

MonthCalendar are displayed in different sizes in XP and Win7. And Width and Height can not manipulate without cutting off part from both. So by this reason is good to use IsXp() to differenciate size/positions. Note in following lines:

Setproperty("Screen_1","Width",GetProperty("Screen_1","Width")+(If(_HMG_SYSDATA [ 250 ],0,100)))

_HMG_SYSDATA [ 250 ] is logical value as true when is in XP.
bpd2000 wrote:Nice improvement Pablo César
Thank you Dave to show your interest. :)

Re: DrawEdge - New feature

Posted: Sun Dec 08, 2013 11:18 am
by serge_girard
Nice Pablo!

Serge

DrawEdge - New feature

Posted: Sun Dec 08, 2013 11:22 am
by Pablo César
serge_girard wrote:Nice Pablo!

Serge
Thank you Dhr. Serge for your interest.

I'm Happy you have liked it :)