DrawEdge - New feature
Moderator: Rathinagiri
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
DrawEdge - New feature
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.>
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.>
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: DrawEdge - New feature
hbmk2: Compiling Harbour sources...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.
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) >
Last edited by esgici on Sun Dec 08, 2013 2:54 pm, edited 2 times in total.
Viva INTERNATIONAL HMG
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
DrawEdge - New feature
These errors starting in source file at: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.
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.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
DrawEdge - New feature
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.>
<Attached files was removed. Please see at last message with updated files.>
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
DrawEdge - New feature
Esgici, please noteesgici wrote:Harbour 3.2.0dev (Rev. 18911)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.
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.
Because I have NO problems with this compilation here. Which version are you using ? More details please.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.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
DrawEdge - New feature
Ok, good. But what it happen ? How you fixed ?esgici wrote:OK, 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.
Thank you Dave to show your interest.bpd2000 wrote:Nice improvement Pablo César
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
- serge_girard
- Posts: 3178
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact:
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
DrawEdge - New feature
Thank you Dhr. Serge for your interest.serge_girard wrote:Nice Pablo!
Serge
I'm Happy you have liked it
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein