Re: exw

new topic     » goto parent     » topic index » view thread      » older message » newer message

------ =_NextPart_000_01BCEDDD.07D842E0
Content-Transfer-Encoding: quoted-printable

Much of what was in the demo window program is usually included handled =
in C by the line:

   #include win.h

The rest of it is very close to the original C code. But there is no =
doubt that it's a painful new world.=20

Many of the ugly details of the Win32 environment can be shielded from =
the user. For example, in Win32 it is necessary to be able to completely =
redraw your window at any point in time (say, in response to the user =
resizing the window). This is a concept that is foreign to DOS =
programmers, who are used to text remaining on the screen once they have =
written it.

But it's not that difficult to hide that - just queue up all the pending =
display information in a pendingPrint queue, and the displayed =
information in a printedPrint queue. Something like:

   procedure win_print( sequence s )

      -- place text in queue for display, and trigger an ON_PAINT to =
handle it

      -- place the text in the pending queue
      pendingPrint =3D append( pendingPrint, { PRINT, xCol, yCol, color, =
s } )

      -- force a repainting
      message( self, ON_PAINT )

   end procedure

and in the event loop:

   elsif compare( msg, ON_PAINT ) =3D 0 then

      -- get context, handle
      getContext...     =20

      -- display the pending stuff
      for i =3D 1 to length( pendingPrint ) do

         -- don't display twice...
         if not redisplayAll then
            -- real display routine
            win_puts( pendingPrint[i] )
         end if

         -- save in case entire window needs a redisplay
         printedPrint =3D append( printedPrint, pendingPrint[i] )
      end for
     =20
      -- clear pending array
      pendingPrint =3D {}

      -- redisplay entire window?
      if redisplayAll then
         for i =3D 1 to length( printedPrint ) do
            win_puts( printedPrint[i] )
         end for
      end if

      -- clear flag
      redisplayAll =3D 0

      -- release handle
      releaseContext( ...

In my mind, it's very feasible to create a "generic" environment that =
would allow coders to write Win32 applications without being subjected =
to the complexities of the Win32 environment. After all, environments =
like VisualBasic do it.

I hope to be working on wrappers so you can declare stuff like:

   -- create a new button
   constant button1 new_button( "Press Me", 10, 20, 40, 100 )

   -- create an action for the button
   global procedure onClick_button1()
      message_box( "Ow!", "That hurt!" )
   end procedure

   -- vector the action
   action[button1][ON_CLICK] =3D routine_id( "onClick_button1" )

The event loop would then be driven by the data structures, and =
completely transparent to the user.

From there, it's not that great of a leap to imagine a Visual Euphoria =
environment. But it'll be a lot of hard work to make it easy for other =
programmers.

-- David Cuny
------ =_NextPart_000_01BCEDDD.07D842E0

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu