Thanks Friendesgici wrote:Hats to the airesgici wrote: I'll try![]()
Extremely appreciated dr.![]()
You are a true life-saving hidalgo![]()
Best regards
Draw border
Moderator: Rathinagiri
- srvet_claudio
- Posts: 2223
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact:
Re: Draw border
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: Draw border
Hi Dr.
My teacher said me : "Stay away from macro substitutions whenever possible"
How about a solution like this
( Tested and approved in my side
)
Best regards
My teacher said me : "Stay away from macro substitutions whenever possible"
How about a solution like this
Code: Select all
aColor1 := ACLONE( aColor )
aColor2 := ACLONE( aColor )
DRAW BORDER WINDOW cWindowName CONTROL cControlName UPCOLOR aColor1 DOWNCOLOR aColor2 SPACE nWidnessBest regards
Viva INTERNATIONAL HMG 
- srvet_claudio
- Posts: 2223
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact:
Re: Draw border
Very good!!!esgici wrote:Hi Dr.
My teacher said me : "Stay away from macro substitutions whenever possible"![]()
How about a solution like this![]()
( Tested and approved in my sideCode: Select all
aColor1 := ACLONE( aColor ) aColor2 := ACLONE( aColor ) DRAW BORDER WINDOW cWindowName CONTROL cControlName UPCOLOR aColor1 DOWNCOLOR aColor2 SPACE nWidness)
Best regards
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: Draw border
"Very good" was finding what the cause of the problemsrvet_claudio wrote: Very good!!!
Thanks again
Best regards
Viva INTERNATIONAL HMG 
Re: Draw border
I want to refresh this topic without creating new.
I want to add group a few controls and put them on the colored rectangle - something like frame, but with differend background color from form background color.
I've tried using LABEL as a background, but it causes problem with checkboxes, which become inoperable with mouse.
I thought about Bos Taurus library and BT_DrawGradientFillVertical, but I don't know how to operate on a piece of form, not whole.
Maybe someone knows the way to solve this problem?
I'll try with drawing rectangle, maybe it will be good?
I want to add group a few controls and put them on the colored rectangle - something like frame, but with differend background color from form background color.
I've tried using LABEL as a background, but it causes problem with checkboxes, which become inoperable with mouse.
I thought about Bos Taurus library and BT_DrawGradientFillVertical, but I don't know how to operate on a piece of form, not whole.
Maybe someone knows the way to solve this problem?
I'll try with drawing rectangle, maybe it will be good?
Re: Draw border
Hey guys!
Does anybody know, how to clear form from drawed lines? - Esgici presented his solution for DrawBorder in this topic.
It looks nice, but - how to cleap the form when I want to delete bordered control? How to delete drawed line?
Does anybody have solution for that? Maybe draw line in background color?
Does anybody know, how to clear form from drawed lines? - Esgici presented his solution for DrawBorder in this topic.
It looks nice, but - how to cleap the form when I want to delete bordered control? How to delete drawed line?
Does anybody have solution for that? Maybe draw line in background color?
Re: Draw border
Hi Marek
Once time I copied this about erase lines ...
I hope it is useful to you !
Once time I copied this about erase lines ...
I hope it is useful to you !
Code: Select all
#include <hmg.ch>
#define nMaxPenWidth 10
PROCEDURE Main()
aWinBackColor := { 0xF0, 0xF0, 0xF0 }
aColorS := { YELLOW ,;
PINK ,;
RED ,;
FUCHSIA ,;
BROWN ,;
ORANGE ,;
GREEN ,;
PURPLE ,;
BLACK ,; // WHITE ,;
GRAY ,;
BLUE }
nLineBRow := 0 // Line Beg. Row
nLineBCol := 0 // Line Beg. Column
nLineERow := 0 // Line End Row
nLineECol := 0 // Line End Column
nLinePenW := 0 // Line colour ( form background colour, when erasing )
nLineColr := 0 // Line Pen Width
DEFINE WINDOW frmEraseLine ;
AT 138 , 235 ;
WIDTH 560 ;
HEIGHT 380 ; // BACKCOLOR GRAY ;
TITLE "Erasing drawn line" ;
MAIN ;
BACKCOLOR aWinBackColor ;
ON INIT frmEraseLine.btnEras.Enabled := .F.
ON KEY ESCAPE ACTION frmEraseLine.Release
@ 280, 100 BUTTON btnDraw CAPTION "&Draw" ACTION Draw1Line()
@ 280, 230 BUTTON btnEras CAPTION "&Erase" ACTION Eras1Line( nLineBRow, nLineBCol, nLineERow, nLineECol, aWinBackColor, nLinePenW)
@ 280, 360 BUTTON btnExit CAPTION "E&xit" ACTION frmEraseLine.Release
END WINDOW // frmEraseLine
frmEraseLine.Center
frmEraseLine.Activate
RETURN // Main()
*-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._
PROCEDURE Draw1Line()
LOCAL nOldColor := nLineColr
nLineBRow := HB_RandomInt( 0, frmEraseLine.WIDTH / 2 )
nLineBCol := HB_RandomInt( 0, frmEraseLine.HEIGHT / 2 )
nLineERow := HB_RandomInt( nLineBRow , frmEraseLine.WIDTH )
nLineECol := HB_RandomInt( nLineBCol, frmEraseLine.HEIGHT )
nLinePenW := HB_RandomInt( 1, nMaxPenWidth )
WHILE nOldColor = nLineColr
nLineColr := HB_RandomInt( 1, LEN( aColorS ) )
ENDDO
DRAW LINE IN WINDOW frmEraseLine AT nLineBRow, nLineBCol ;
TO nLineERow, nLineECol ;
PENCOLOR aColorS[ nLineColr ] ;
PENWIDTH nLinePenW
frmEraseLine.btnDraw.Enabled := .F.
frmEraseLine.btnEras.Enabled := .T.
RETURN // Draw1Line()
*-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._
PROCEDURE Eras1Line(;
nBRow,; // Line Beg. Row
nBCol,; // Line Beg. Column
nERow,; // Line End Row
nECol,; // Line End Column
aWBCLr,; // Line erase colour ( form background colour)
nPenW ) // Line Pen Width
DRAW LINE IN WINDOW frmEraseLine AT nLineBRow, nLineBCol ;
TO nLineERow, nLineECol ;
PENCOLOR aWinBackColor ;
PENWIDTH nLinePenW
frmEraseLine.btnDraw.Enabled := .T.
frmEraseLine.btnEras.Enabled := .F.
RETURN // Eras1Line()
*-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._