Page 2 of 3

Re: Draw border

Posted: Wed Sep 25, 2013 3:06 pm
by serge_girard
Esgici,
esgici wrote: Sorry for inaccurate information
No problemo !

I thought the was the message....

No I see the problem!

Serge

Re: Draw border

Posted: Wed Sep 25, 2013 3:06 pm
by serge_girard
now..

Re: Draw border

Posted: Wed Sep 25, 2013 4:44 pm
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> ) ]

Re: Draw border

Posted: Wed Sep 25, 2013 5:39 pm
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

Re: Draw border

Posted: Wed Sep 25, 2013 7:04 pm
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

Re: Draw border

Posted: Thu Sep 26, 2013 4:56 am
by bpd2000
Thank you Carlos Britos for HB_Default help

Re: Draw border

Posted: Thu Sep 26, 2013 9:22 am
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 5285 times
TestBorder2.prg.zip
Modified prg for wide order
(794 Bytes) Downloaded 278 times
Happy HMG'ing :D

Re: Draw border

Posted: Thu Sep 26, 2013 12:33 pm
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()

Re: Draw border

Posted: Thu Sep 26, 2013 12:43 pm
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

Re: Draw border

Posted: Thu Sep 26, 2013 12:54 pm
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