1. Convert .ex to .exw final . Does not like old ellipse or maybe whole programme ?

Hello. Selgor here.

There was a song .."I can't get started" ... And the following programme executes but then just sits on a colour screen!.

And doesn't "start doing what it should be doing .".

Namely , drawing ellipses in each quadrant of the screen colouring them and then clearing and doing more ellipses.

Error message is:- . C:\EUPHORIA\include\graphics.e:130 in procedure ellipse() ellipse() is not supported in Euphoria for WIN32.

So it doesn't like the old ellipse.

I am converting .ex programme to a .exw programme.

I am using 3.1 euphoria. O.S. is Win 7 on 1 computer and win 8.1 on another.

Could someone "get it going" ? .PLEASE.

This done ... then all my conversions are done and complete.

Then ..Derek , maybe we install euph 4.1 on the win 8.1 and see what happens.

Any help here appreciated , as always...

Cheers ..Selgor..

include win32lib.ew 
without warning 
 
atom kersa 
constant 
CXFULL=w32Func(xGetSystemMetrics,{SM_CXSCREEN}), 
CYFULL=w32Func(xGetSystemMetrics,{SM_CYSCREEN}), 
Win  = create(Window,"",0,0,0,CXFULL,CYFULL,{WS_POPUP,WS_DLGFRAME}),--, 
   sx=CXFULL/630,sy=CYFULL/480 
 
constant canvas =  create( Pixmap, "", 0, 0,0, CXFULL, CXFULL, 0 ) 
 
constant Timer = 1 
 
kersa = w32Func(xShowCursor,{False}) 
 
 integer  rgmode, px, py, pc, r, dir, disp,rad, fill, count 
 integer  x,y,x2,y2,x3,y3,x4,y4 
 atom frac, wait , kount,kcount,in,kcol 
 
integer segment 
 
procedure init_vars() 
  kount=0 
  kcol=rand(#AEBCDF) 
        kcount=0 
        segment = 0 
         
         
         wait               = 0                             -- Getkey wait flag 
 count              = 0                             -- Loop counter 
 dir                = 0                             -- Draw path direction 
 r                  = 0                             -- Loop exit flag 
 disp               = 0                             -- Inner pat loop length 
 fill               = 1                             -- Fill for circle 
 rad                = 1                             -- Radius of circle drawn 
 
 x                  = 300                           -- Center X Co-ordinate 
 y                  = 250                           -- Center Y Co-ordinate 
 
 rgmode             = graphics_mode(18) 
 
 
  setBackColor(canvas, rand(#BCDFEA))--(Parchment))--colors,Parchment))--[rand(length(colors))])) 
             -- YOU  KNOW  THIS MIGHT BE BETTER AS A LIGHT COLOUR ????? but changeable ???? through the colours "thing" ?? 
end procedure 
 
procedure kullar() 
 
   if remainder(segment, 85) = 0 then ------------ if value 85 was 185 then larger colour group ???? 
    kcol = rand(#BEDFAC) 
  end if 
end procedure 
 
 
 
integer stopped 
stopped = 0 
  --------------------------------------------------- 
procedure w_Mouse(integer self, integer event, sequence params) 
--------------------------------------------------- 
 
        if params[1] = WM_LBUTTONDOWN then 
 
           closeWindow(Win)       closeApp() 
 
        end if 
 
end procedure 
 
setHandler(Win, {w32HClick,w32HMouse}, routine_id("w_Mouse")) 
 
 
procedure WinKey(integer id, integer event, sequence parms) 
  -- Check for key presses. 
  if parms[1] = VK_SPACE then 
   stopped = not stopped 
   if stopped then 
    killTimer( Win, Timer ) 
   else 
    setTimer( Win, Timer, 10 ) 
   end if 
  elsif parms[1] = VK_ESCAPE then 
           closeWindow(Win) 
     kersa = w32Func(xShowCursor,{True}) 
           init_vars() 
     stopped = 0 
  end if 
 
end procedure 
setHandler(Screen, w32HKeyDown, routine_id("WinKey")) 
 
procedure draw_it(integer id, integer event, sequence parms) 
  -- On each tick of the timer, I draw the next segment of the picture. 
 
  if segment >= 800 then 
         segment=1 
 
   setBackColor(canvas, rand(#FEBACD))--(Parchment))---------colors[rand(length(colors))])) 
                return 
  end if 
 
  segment += 1 
  kount+=1 
  kullar() 
  setPenColor(canvas, kcol )--colors[kcol]) 
 
 
  repaintFG(Win) 
 
 if get_key() = 27 then abort(0) end if 
   count            = count + 1 
        --     stall() 
   px               = rand(285)                     -- X for Ist Quadrant 
   py               = rand(235)                     -- Y for Ist Quadrant 
   pc               = rand(14)                      -- Pixel Color 
 
-- disp             = (385 - px) + 3                -- For longer pattern loops 
   disp             = (285 - py) + 3 
 
   frac             = disp / (disp * (1 / 2) * 150) --  Loop step value 
 
   for i            = 1 to disp by frac do 
      dir           = rand(6)                       -- randomly chooses the 
                 --  stall()                               -- location of next pixel 
      if dir        = 1 then 
         px         = px + rad 
         x2         = sx*(x + ( x - px))                 -- X for IInd Quadrant 
         y2         = sy*(y - (y - py))                  -- Y for IInd Quadrant 
         x3         = x + ( x - px)                 -- X for IIIrd Quadrant 
         y3         = y + (y - py)                  -- Y for IIIrd Quadrant 
         x4         = x - ( x - px)                 -- X for IVth Quadrant 
         y4         = y + (y - py)                  -- Y for IVth Quadrant 
         ellipse(pc ,fill,{px , py },{px - 2 * rad , py}) 
         ellipse(pc ,fill,{x4 , y4 },{x4 - 2 * rad , y4}) 
         ellipse(pc ,fill,{x2 , y2 },{x2 - 2 * rad , y2}) 
         ellipse(pc ,fill,{x3 , y3 },{x3 - 2 * rad , y3}) 
 
     elsif dir      = 2 then 
        py          = py + rad 
        x2          = x + ( x - px) 
        y2          = y - (y - py) 
        x3          = x + ( x - px) 
        y3          = y + (y - py) 
        x4          = x - ( x - px) 
        y4          = y + (y - py) 
 
        ellipse(pc + 1,fill,{px, py },{px,py - 2 * rad }) 
        ellipse(pc + 1 ,fill,{x4 , y4 },{x4, y4 - 2 * rad }) 
        ellipse(pc + 1 ,fill,{x2 , y2 },{x2, y2 - 2 * rad }) 
        ellipse(pc + 1 ,fill,{x3 , y3 },{x3, y3 - 2 * rad }) 
 
    elsif dir       = 3 then 
       px           = px + rad 
       py           = py + rad 
       x2           = x + ( x - px) 
       y2           = y - (y - py) 
       x3           = x + ( x - px) 
       y3           = y + (y - py) 
       x4           = x - ( x - px) 
       y4           = y + (y - py) 
       ellipse(pc + 2 ,fill,{px, py},{px - 2 * rad, py  - 2 * rad}) 
       ellipse(pc + 2 ,fill,{x4 , y4 },{x4 - 2 * rad , y4 - 2 * rad }) 
       ellipse(pc + 2 ,fill,{x2 , y2 },{x2 - 2 * rad , y2 - 2 * rad }) 
       ellipse(pc + 2 ,fill,{x3 , y3 },{x3 - 2 * rad , y3 - 2 * rad }) 
 
    elsif dir       = 4 then 
       py           = py - rad 
       x2           = x + ( x - px) 
       y2           = y - (y - py) 
       x3           = x + ( x - px) 
       y3           = y + (y - py) 
       x4           = x - ( x - px) 
       y4           = y + (y - py) 
       ellipse(pc + 3 ,fill,{px, py },{px,py + 2 * rad }) 
       ellipse(pc + 3 ,fill,{x4 , y4 },{x4, y4 - 2 * rad }) 
       ellipse(pc + 3 ,fill,{x2 , y2 },{x2, y2 - 2 * rad }) 
       ellipse(pc + 3 ,fill,{x3 , y3 },{x3, y3 - 2 * rad }) 
 
    elsif dir      = 5 then 
       px          = px - rad 
       py          = py - rad 
       x2          = x + ( x - px) 
       y2          = y - (y - py) 
       x3          = x + ( x - px) 
       y3          = y + (y - py) 
       x4          = x - ( x - px) 
       y4          = y + (y - py) 
       ellipse(pc + 4 ,fill,{px, py},{px + 2 * rad, py  + 2 * rad}) 
       ellipse(pc + 4 ,fill,{x4 , y4 },{x4 - 2 * rad , y4 - 2 * rad }) 
       ellipse(pc + 4 ,fill,{x2 , y2 },{x2 - 2 * rad , y2 - 2 * rad }) 
       ellipse(pc + 4 ,fill,{x3 , y3 },{x3 - 2 * rad , y3 - 2 * rad }) 
 
    elsif dir      = 6 then 
       px          = px - rad 
       x2          = x + ( x - px) 
       y2          = y - (y - py) 
       x3          = x + ( x - px) 
       y3          = y + (y - py) 
       x4          = x - ( x - px) 
       y4          = y + (y - py) 
       ellipse(pc + 5 ,fill,{px , py },{px + 2 * rad , py}) 
       ellipse(pc + 5 ,fill,{x4 , y4 },{x4 - 2 * rad , y4}) 
       ellipse(pc + 5 ,fill,{x2 , y2 },{x2 - 2 * rad , y2}) 
       ellipse(pc + 5 ,fill,{x3 , y3 },{x3 - 2 * rad , y3}) 
    end if 
   end for 
 
   if count > 19 then 
      clear_screen()    --stall() 
      count        = 0 
   end if                    --  stall() 
 
   if pc < 24 then 
     pc            = 1 
    else 
     pc            = 0 
   end if --     stall() 
   wait            = get_key() 
   if wait         > 0 then 
     if wait       = 32 then 
       clear_screen() 
     else 
       r           = 1 
     end if 
   end if             --stall() 
-- end while 
     end procedure 
setHandler(Win, w32HTimer, routine_id( "draw_it" )) 
 
procedure start_it(integer id, integer event, sequence parms) 
 
  setTimer( Win, Timer, 10 ) 
end procedure 
setHandler(Win, w32HActivate, routine_id("start_it")) 
 
setBackColor(canvas, rand(#BCDFEA)) 
procedure paint_it(integer id, integer event, sequence parms) 
 
  copyBlt(Win, 0, 0, canvas) 
 
 
end procedure 
setHandler(Win, w32HPaint, routine_id("paint_it")) 
   
init_vars()    
WinMain( Win, Maximized) 
 
new topic     » topic index » view message » categorize

2. Re: Convert .ex to .exw final . Does not like old ellipse or maybe whole programme ?

Selgor said...

So it doesn't like the old ellipse.

I am converting .ex programme to a .exw programme.

I am using 3.1 euphoria. O.S. is Win 7 on 1 computer and win 8.1 on another.

Could someone "get it going" ? .PLEASE.

As this is a Windows program, you should be using the Windows ellipse function and not the MS-DOS ellipse function. Have a look at the Win32Lib documentation on drawEllipse()

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu