Draw border

HMG Samples and Enhancements

Moderator: Rathinagiri

User avatar
serge_girard
Posts: 3161
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: Draw border

Post by serge_girard »

Esgici,
esgici wrote: Sorry for inaccurate information
No problemo !

I thought the was the message....

No I see the problem!

Serge
There's nothing you can do that can't be done...
User avatar
serge_girard
Posts: 3161
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: Draw border

Post by serge_girard »

now..
There's nothing you can do that can't be done...
Carlos Britos
Posts: 245
Joined: Sat Aug 02, 2008 5:03 pm

Re: Draw border

Post by Carlos Britos »

esgici wrote:Hi Dave
bpd2000 wrote: Where to find more about HB_Default()
Thank to your interest and nice words :)

Sadly not found (at least I don't know) any documentation about HB_Default() :(
Hi hb_Default() convert any to value to the value type of the second parameter
Sample
FUNCTION myfun( xqwe )
hb_Default( @xqwe, .T. )
...
xqwe will be .T. if the param is a different type.

if param = 123 -> xqwe = .T.
if param = "string" -> xqwe = .T.
if param = NIL -> xqwe = .T.
if param = .F. -> xqwe = .F.

#xcommand DEFAULT <xVar1> TO <xVal1> [, <xVarN> TO <xValN> ] => ;
hb_default( @<xVar1>, <xVal1> ) [; hb_default( @<xVarN>, <xValN> ) ]

#xcommand DEFAULT <xVar1> := <xVal1> [, <xVarN> := <xValN> ] => ;
hb_default( @<xVar1>, <xVal1> ) [; hb_default( @<xVarN>, <xValN> ) ]
Regards/Saludos, Carlos (bcd12a)
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Draw border

Post by esgici »

Hi Carlos
Carlos Britos wrote:hb_Default() convert any to value to the value type of the second parameter ...
Thank to additional information.

This will be useful to me too :)

Viva HMG :D
Viva INTERNATIONAL HMG :D
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Draw border

Post by esgici »

esgici wrote:Problem is in border of image.
Attempted using BosTaurus to draw line, and
Unrecoverable error 9003: Too many recursive error handler calls
Any idea :(

TIA :D
Viva INTERNATIONAL HMG :D
User avatar
bpd2000
Posts: 1207
Joined: Sat Sep 10, 2011 4:07 am
Location: India

Re: Draw border

Post by bpd2000 »

Thank you Carlos Britos for HB_Default help
BPD
Convert Dream into Reality through HMG
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Draw border

Post by esgici »

Hi All

Another implementation of "Wide Border":
Screen shoot of Wide Border - 1
Screen shoot of Wide Border - 1
WideBorder2.PNG (96.27 KiB) Viewed 5155 times
TestBorder2.prg.zip
Modified prg for wide order
(794 Bytes) Downloaded 275 times
Happy HMG'ing :D
Viva INTERNATIONAL HMG :D
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: Draw border

Post by srvet_claudio »

esgici wrote:By the way, I have a problem; please look at TestBorder.prg line 54-55;

will be appreciated your advice.
Hi Friend,
The DrawLine command runs a codeblock and the problem is when passing the array parameter to the codeblock.
See this fixed code:

Code: Select all

PROCEDURE DrawWideBorder( ;
                     cWindowName,;
					 cControlName,;
					 aColor,;
					 nSpace,; 
					 nStep )
					 
	LOCAL nWidness, cColor
	
	HB_DEFAULT( @nSpace, 10 )
	HB_DEFAULT( @nStep, 1 )
	
	FOR nWidness := 1 TO nSpace STEP nStep
   
      cColor := "{"+hb_ntos(aColor[ 1 ])+","+hb_ntos(aColor[ 2 ])+","+hb_ntos(aColor[ 3 ])+"}"  
       
      DRAW BORDER WINDOW cWindowName CONTROL cControlName UPCOLOR &cColor DOWNCOLOR &cColor SPACE nWidness
       
	   aColor[ 1 ]  -= 10
	   aColor[ 2 ]  -= 10
	   aColor[ 3 ]  += 10
    NEXT nWidness 

RETURN  // DrawWideBorder()
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Draw border

Post by esgici »

srvet_claudio wrote: The DrawLine command runs a codeblock and the problem is when passing the array parameter to the codeblock.
Thank you very much Hidalgo :)

I'll try

Best regards :D
Viva INTERNATIONAL HMG :D
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Draw border

Post by esgici »

esgici wrote: I'll try
Hats to the air :shock:

Extremely appreciated dr. :arrow:

You are a true life-saving hidalgo 8-)

Best regards :D
Viva INTERNATIONAL HMG :D
Post Reply