Page 1 of 1

DRAW on a Virtual form

Posted: Wed Aug 28, 2013 1:35 pm
by esgici
Hi all

DRAW OK, but erased in first scrolling :(

Any idea ?

Regards
DrawTest.zip
(2.94 KiB) Downloaded 423 times

Re: DRAW on a Virtual form

Posted: Wed Aug 28, 2013 4:07 pm
by andyglezl
Hola esgici

Trata esto
--------------------
Hello Esgici

Try this

Code: Select all

*-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.

PROCEDURE DrawVirt()

   DEFINE WINDOW frmVirtForm  ; 
      AT 0, 0 ;
      WIDTH 640 ;
      HEIGHT 440 ;
      TITLE "Drawing on Virt form ( do scroll to see problem )" ;
      VIRTUAL HEIGHT 1024 ;
      MODAL ;
      ON PAINT F_OnPaint()    //    <======  
     
      ON KEY ESCAPE OF frmVirtForm ACTION ThisWindow.Release
      
   END WINDOW // frmRealForm
   
   frmVirtForm.Center
   frmVirtForm.Activate
   
RETURN // DrawVirt()  
FUNCTION F_OnPaint            //    <======  
    LOCAL hDC, BTstruct

    hDC := BT_CreateDC( "frmVirtForm", BT_HDC_INVALIDCLIENTAREA, @BTstruct ) 

     DRAW RECTANGLE IN WINDOW frmVirtForm ;
          AT 100, 100 ;
          TO 340, 540

     // Here, the commands DRAW    


    BT_DeleteDC( BTstruct )    

RETURN nil

Re: DRAW on a Virtual form

Posted: Wed Aug 28, 2013 4:17 pm
by andyglezl
Lo siento, debes de incluir:
--------------------------
Sorry, you must include:


#include "hfcl.ch"

Re: DRAW on a Virtual form

Posted: Wed Aug 28, 2013 4:47 pm
by esgici
andyglezl wrote:...Try this...
Thanks Andres

Sadly ( due to some reasons ( long strory ) ) I can't use ONPAINT nor BosTaurus :(

Regards