FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Delete Lines from a graphics
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Delete Lines from a graphics
Posted: Tue Sep 24, 2024 06:59 AM
Do you remember my TCyclometric class ?

I use a cyclometric calculation to predict the numbers that will come out in the next Italian lottery draws, obviously it is a technique already used by many people.




for a sample you can see on figure the numbers of florence 66,77,4,29,37
the prevision numbers are 28,37,42,33



When I click on xbrowse at right on a row it draw the geometric figure into circle
if i click on another row made the same but

it does not delete previously created lines, how can I make the procedure delete previously created lines?


for a sample to calc the distance numbers I use this method

Code (fw): Select all Collapse
METHOD Distance(num1,num2)  CLASS  TCyclometric
   local  aNumpos := ::apos
   local nAt1,nAt2
   local oPen,hOldPen
   local aRect:= {}
   local nDistanza,nYOffset,nXOffset, nY,nX

  // xbrowser aNumpos

   nAt1:= AScan( aNumpos, { | a | a[1] = num1 } )
   nAt2:= AScan( aNumpos, { | a | a[1] = num2 } )

   aRect:= {aNumpos[nAt1][2],aNumpos[nAt1][3],aNumpos[nAt2][2],aNumpos[nAt2][3]}

   ::line( aRect[1],aRect[2],aRect[3],aRect[4], CLR_RED)


   // draw the distance number
         IF num2>num1
             nDistanza:= num2-num1
          else
             nDistanza:= num1-num2
          Endif
          If nDistanza > 45
            nDistanza:= 90-nDistanza
         Endif

       nYOffset = ::oFont:nHeight / 2
       nXOffset = ::oFont:nWidth / 2

       nY  := aRect[2]
       nX  := aRect[4]

  ::Say( nY - nYOffset, nX - nXOffset, LTRIM( STRzero( nDistanza,2 ) ), , , ::oFont, .t.,;
            .t., nil )

   return nil
it create lines and say the numbers , so how I can delete these lines and numbers ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: Delete Lines from a graphics
Posted: Tue Sep 24, 2024 07:52 AM

When working with DC, it is convenient to use FWSaveScreen() and FWRestScreen()

Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Delete Lines from a graphics
Posted: Tue Sep 24, 2024 08:23 AM
Natter wrote:When working with DC, it is convenient to use FWSaveScreen() and FWRestScreen()
can you kindly try to help me if you can erase the lines?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: Delete Lines from a graphics
Posted: Tue Sep 24, 2024 08:33 AM

Sorry, there's no time. It's simple:

  1. first save a fragment of the screen to the variable FWSavescreen()

  2. Draw what you need

  3. Restore fragment FWRestScreen()

Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Delete Lines from a graphics
Posted: Tue Sep 24, 2024 10:41 AM
Now I have the refill run ok

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com

Continue the discussion