1. COMING REAL SOON !

Features of the w32engin.ew library

  This is a new Win32 library written with the advance user in mind.

  This library is not meant to compete with the win32lib but is
  written for the user that is familar with "C" and understands
  some Windows programming.

  I know that there many Euphoria user's who want to use a Window's
  library that can be easily extended without having to be concerned
  with how the internal library code works. Many users don't have
  the time to pore through lines of internal code and patch in
  changes.
  Finaly these same user's want to be able use Window's .res files
  directly within your program without loading external files or
  appending files to the exe.
  The w32engin.ew library solves all these problems
  and allows you to write a single stand-alone program protecting
  your resources from be changed because they are enbedd in your code.

  The majority of the Window's constants, functions, and procedures
  are predefined in the library of about 377k in size.

  When a Window's program is written it will look just as it would
  in "C". Using the real Window's function names which makes it
   easier to translate a "C" source code listing.

  The library comes with a utility called eru.ex that takes a standard
  complied 32-bit Window's .res file reads the file and writes a
  complete stand-alone include file. This allows you to create your
  resources with a resource editor, a dialog editor or a text editor.
  Run in the Window's .rc file through a 32-bit resource compiler
  like the free Borland BRCC32 and then use the eru.ex utility to
  generate a Euphoria include file.
  The final Euphoria generated include file will contain all that is
  needed to use the resources the bmps, icons, cursors, string tables
  and dialogs.
  NO EXTERNAL FILES ARE NEEDED just the Euphoria include file. 

  The end user can add any of the following by adding a discription or
  definition in the piston.ew file WITHOUT CHANGING the INTERNAL
  LIBRARY CODE. This will automatically interface them to all the
  features of the library.

  ANY structure can be described and accessed.
  ANY function or procedure including from ANY NON-WIN32 dll can be
  added and used.

  When I posted this anouncement before only one person showed any
  interest.
  Maybe when I complete the demos and send the library to ROB for
  the Archive the users will realize the value of this library.

  PS: if this text is not formated properly blame the topica e-mail

  Thanks for your attention,

Bernie

new topic     » topic index » view message » categorize

2. Re: COMING REAL SOON !


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

3. Re: COMING REAL SOON !

On 21 Jul 2001, at 2:45, Bernie Ryan wrote:

<snip>

>   When I posted this anouncement before only one person showed any
>   interest.

But i haven't done any *windoze* programming, i still open dos boxes!

>   Maybe when I complete the demos and send the library to ROB for
>   the Archive the users will realize the value of this library.

Maybe, once we browse the docs. smile

Kat

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

4. Re: COMING REAL SOON !

Im almost finished with the same ("similar") thing.
I have all of the common controls that win32lib has
and some extra's. It uses strictly Euphoria's mem handling
and was written to be as optimised as possible.
The user will have to be familiar with some notification
messages but most of these have been written as well.

for instance, this code will handle listview and treeview controls
the parent item in the listview will be returned and in the treeview
the name that appears will be returned. The code that sets these up
is highly optimized and can be called the same as win32lib calls them.


    elsif iMsg = WM_NOTIFY then

          id = peek4s(lParam + NMHDR_hwndFrom)

          if id = ListView then

             iMsg = peek4s(lParam + NMHDR_code)

      if iMsg = LVN_COLUMNCLICK then -- ListView "could run a sort routine here"

      elsif iMsg = NM_CLICK then -- ListView Item Clicked

                   junk = c_func(SendMessage,{ListView1,LVM_GETNEXTITEM,-1,
LVNI_FOCUSED})
                   poke4(lvitem + lvitem_iItem,junk)
                   poke4(lvitem + lvitem_iSubItem,0)
                   poke4(lvitem + lvitem_mask,LVIF_TEXT)
                   txtbuff = allocate(256)
                   poke4(lvitem + lvitem_pszText,txtbuff)
                   poke4(lvitem + lvitem_cchTextMax,256)
                   cmd = c_func(SendMessage,{ListView1, LVM_GETITEM, 0, lvitem})

                   lvtxt = peek_string(txtbuff)

                   free(txtbuff)

              end if

          elsif id = TreeView then

              iMsg = peek4s(lParam + NMHDR_code)

              if iMsg = TVN_SELCHANGED then --NM_CLICK then -- TreeView

                   count = c_func(SendMessage,{TreeView1, TVM_GETCOUNT, 0, 0})
                   item = c_func(SendMessage,{TreeView1,TVM_GETNEXTITEM, 0,
TVGN_ROOT})
                   poke4(tvitem + tvitem_hItem,item)

                   poke4(tvitem + tvitem_mask,TVIF_TEXT)
                   poke4(tvitem + tvitem_stateMask, TVIS_SELECTED)
                   txtbuff = allocate(256)
                   poke4(tvitem + tvitem_pszText,txtbuff)
                   poke4(tvitem + tvitem_cchTextMax,256)

                   ok = c_func(SendMessage,{TreeView1, TVM_GETITEM, 0, tvitem})

                   for i = 1 to count do
                       cmd = peek4s(tvitem + tvitem_state )
                       if and_bits(cmd, TVIS_SELECTED) then
                          exit
                       end if

                       item = c_func(SendMessage,{TreeView1, TVM_GETNEXTITEM,
TVGN_NEXTVISIBLE, item})
                       poke4( tvitem + tvitem_hItem, item)
                       ok = c_func(SendMessage,{TreeView1, TVM_GETITEM, 0,
tvitem})
                   end for

                   lvtxt = peek_string(txtbuff)
                   txtlen = length(lvtxt)



Competition with Win32lib its not but I think it will be just as easy
to write apps with that will be much faster....

Maybe in a couple months when Im tired of adding code to it I'll
release it as a version 1.0.

Euman
euman at bellsouth.net




----- Original Message -----
From: "Bernie Ryan" <xotron at localnet.com>
To: "EUforum" <EUforum at topica.com>
Sent: Friday, July 20, 2001 21:45
Subject: COMING REAL SOON !


>
>
>
>                  Features of the w32engin.ew library
>
>   This is a new Win32 library written with the advance user in mind.
>
>   This library is not meant to compete with the win32lib but is
>   written for the user that is familar with "C" and understands
>   some Windows programming.
>
>   I know that there many Euphoria user's who want to use a Window's
>   library that can be easily extended without having to be concerned
>   with how the internal library code works. Many users don't have
>   the time to pore through lines of internal code and patch in
>   changes.
>   Finaly these same user's want to be able use Window's .res files
>   directly within your program without loading external files or
>   appending files to the exe.
>   The w32engin.ew library solves all these problems
>   and allows you to write a single stand-alone program protecting
>   your resources from be changed because they are enbedd in your code.
>
>   The majority of the Window's constants, functions, and procedures
>   are predefined in the library of about 377k in size.
>
>   When a Window's program is written it will look just as it would
>   in "C". Using the real Window's function names which makes it
>    easier to translate a "C" source code listing.
>
>   The library comes with a utility called eru.ex that takes a standard
>   complied 32-bit Window's .res file reads the file and writes a
>   complete stand-alone include file. This allows you to create your
>   resources with a resource editor, a dialog editor or a text editor.
>   Run in the Window's .rc file through a 32-bit resource compiler
>   like the free Borland BRCC32 and then use the eru.ex utility to
>   generate a Euphoria include file.
>   The final Euphoria generated include file will contain all that is
>   needed to use the resources the bmps, icons, cursors, string tables
>   and dialogs.
>   NO EXTERNAL FILES ARE NEEDED just the Euphoria include file.
>
>   The end user can add any of the following by adding a discription or
>   definition in the piston.ew file WITHOUT CHANGING the INTERNAL
>   LIBRARY CODE. This will automatically interface them to all the
>   features of the library.
>
>   ANY structure can be described and accessed.
>   ANY function or procedure including from ANY NON-WIN32 dll can be
>   added and used.
>
>   When I posted this anouncement before only one person showed any
>   interest.
>   Maybe when I complete the demos and send the library to ROB for
>   the Archive the users will realize the value of this library.
>
>   PS: if this text is not formated properly blame the topica e-mail
>
>   Thanks for your attention,
>
> Bernie
>
>
>
>

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

5. Re: COMING REAL SOON !

Interesting Bernie, very interesting!

The code I stuck out there was from a particular project
that Im currently testing functions on. The control
functions will be in seperate include file
e.g: ListView.ew / TreeView.ew and will be consistant.

I see what youve done here and one concern of mine is
why did you change poke4 with put and several other
changes I see. This is confusing to me and sortof reminds
me of win32lib in a way. Win32lib uses store and fetch
and lots of different nameing for built in Euphoria commands.

I will be sticking with names Euphoria uses.

peek, poke, allocate, free but add some commands like
peek_string that are recognisable meanings and extending what
Jacques Deschenes started.

Euman
euman at bellsouth.net

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

6. Re: COMING REAL SOON !

cosider this listview.ew file

global constant
    LVS_REPORT = 1,
    LVS_SHOWSELALWAYS = 8,
    LVIF_TEXT = #0001,
    LVIF_PARAM = #0004,

    LVIS_SELECTED  = #0002,
    LVNI_FOCUSED = 1,

    LVCF_FMT = 1,
    LVCF_WIDTH = 2,
    LVCF_TEXT = 4,
    LVCF_SUBITEM = 8,
    LVCF_ORDER = 20,
    LVCFMT_LEFT = 0,
    LVM_INSERTCOLUMN = 4123,
    LVS_SHAREIMAGELISTS = 40,
    LVM_SETITEM = 4102,
    LVM_INSERTITEM = 4103,
    LVM_GETNEXTITEM = 4108,

    LVM_SETBKCOLOR = 4097,
    LVM_SETTEXTBKCOLOR = 4134,
    LVM_SETTEXTCOLOR = 4132,
    LVM_SETEXTENDEDLISTVIEWSTYLE = 4150,
    LVS_EX_GRIDLINES = 1,
    LVS_EX_TRACKSELECT = 8,
    LVS_EX_HEADERDRAGDROP = 10,
    LVS_EX_FULLROWSELECT = 20,
    LVS_EX_ONECLICKACTIVATE = 40

constant
    lvcol_mask = 0,
    lvcol_fmt = 4,
    lvcol_cx = 8,
    lvcol_pszText = 12,
    lvcol_cchTextMax = 16,
    lvcol_iSubItem = 20,
    lvcol_iOrder = 24,
    sizeof_lvcol = 28

global constant
    lvitem_mask = 0,
    lvitem_iItem = 4,
    lvitem_iSubItem = 8,
    lvitem_state = 12,
    lvitem_stateMask = 16,
    lvitem_pszText = 20,
    lvitem_cchTextMax = 24,
    lvitem_iImage = 28,
    lvitem_lParam = 32,
    lvitem_iIdent = 36,
    sizeof_lvitem = 40

global constant
    LVN_COLUMNCLICK = -108,
    NM_CLICK = -2,
    LVM_GETITEM = 4101,
    LVM_GETITEMSTATE =  4140,
    LVM_GETSELECTEDCOUNT  = 4146

global atom ListView1, lvcol

-- create a listview
global function MakeListView(atom hwnd, sequence name, integer x1, integer y1,
integer x2, integer y2)

atom id, szName, szName2, lvMask
object junk

lvMask =
or_all({LVS_EX_HEADERDRAGDROP,LVS_EX_GRIDLINES,LVS_EX_ONECLICKACTIVATE })

szName = allocate_string("SysListView32")
szName2 = allocate_string(name)

id = c_func(CreateWindow,{WS_EX_CLIENTEDGE,
                         szName,
                         szName2,
                         or_all({WS_CHILD,
                                 WS_TABSTOP,
                                 WS_VISIBLE,
                                 WS_BORDER,
                                 LVS_REPORT
                                 }),
     x1,
     y1,
     x2,
     y2,
     hwnd,
     0,
     hInst,
     NULL})

free(szName)
free(szName2)

junk = c_func(SendMessage,{id, LVM_SETEXTENDEDLISTVIEWSTYLE, lvMask, lvMask})

junk = c_func(SendMessage,{id,LVM_SETBKCOLOR, 0, 16744576})
junk = c_func(SendMessage,{id,LVM_SETTEXTBKCOLOR, 0, 16744576})
junk = c_func(SendMessage,{id,LVM_SETTEXTCOLOR, 0, 16777088})

lvcol = allocate_struct(sizeof_lvcol)
poke4( lvcol + lvcol_mask, or_all({LVCF_FMT, LVCF_SUBITEM, LVCF_TEXT,
LVCF_WIDTH}))
poke4( lvcol + lvcol_fmt, LVCFMT_LEFT)

return id

end function

-- add listview columns

global procedure ListView_Column(atom id, sequence text, integer item, integer
width )
atom itxt, junk

itxt = allocate_string(text)
poke4( lvcol + lvcol_cx, width)
poke4( lvcol + lvcol_pszText, itxt )
poke4( lvcol + lvcol_iSubItem, item )
junk = c_func(SendMessage,{id, LVM_INSERTCOLUMN, 0, lvcol})
free(itxt)

end procedure


-- The above code is already done for you so,

-- Start of your program

include listview.ew

-- Then in your main winproc( )

    if iMsg = WM_CREATE then

        ListView1 = MakeListView(hwnd, "ListView1", 210, 70, 400, 150)

        ListView_Column(ListView1, "Column One",  0, 133 )
        ListView_Column(ListView1, "Column Two", 1, 133 )

this is all is required to create a listview I dont particularly want the extra
processes involved
with renameing. This code also sets colors for the listview, the text and adds
extended styles
all in one little tiny swoop. Anyone that looks at this can take the color
setting features out
for a particular project but thats what makes it fun and alows others to learn
the API as well.

The code to handle notification messages is done for you too and can be
configured easily
as well.

Look easy? It is! Wait a mnth or so and see.
I still have to finish a little project for PATRAT thats fallen behind.

Euman
euman at bellsouth.net

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

7. Re: COMING REAL SOON !

Someone asked will ListView loading be faster than Win32libs
Certainly, approximately 50 to 80% faster!!!

look at the code!


cString = allocate(256)
mem_set(cString, 0, 256)

poke4(lvitem + lvitem_mask, LVIF_TEXT )

poke4(lvitem + lvitem_pszText, cString)

data_len = length(data)

for ix = data_len to 1 by -1 do
    poke4( lvitem + lvitem_iItem, item)
    item += 1
    subitem = 0

    for xi = 1 to length(data[ix]) do
        subdata = data[ix][xi]
        sub_len = length(subdata)
        poke4(lvitem + lvitem_iSubItem, subitem)
        poke (cString, subdata)
        poke (cString + sub_len , 0)
        poke4(lvitem + lvitem_cchTextMax, sub_len )
        subitem += 1
        if subitem = 1 then
           junk = c_func(SendMessage,{id, LVM_INSERTITEM, 0, lvitem })
        else
           junk = c_func(SendMessage,{id, LVM_SETITEM, item-1, lvitem })
        end if
   end for

end for

free(cString)

junk =
c_func(SendMessage,{id,WM_SETFONT,c_func(GetStockObject,{DEFAULT_GUI_FONT}),0})

junk = c_func(SendMessage,{id,WM_SETREDRAW,1,0})

end procedure


I really have to thank Derek Parnell for giving me the idea though I did find
how to do this in MASM32 or was that Icezlion's tutes hummm oh well,
either way, its bunches faster.


Question is, is anyone interested in my project>?

Euman
euman at bellsouth.net

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

8. Re: COMING REAL SOON !

Bernie you must think Im arguing with you, Im not!
I think you have a fantastic idea just curious is all.

Looking at these two structures there is a difference
hParent and hInsertAfter are declared in one not the other

constant
    TVINSERTSTRUCT_hParent = 0,
    TVINSERTSTRUCT_hInsertAfter = 4,
    TVINSERTSTRUCTITEM_mask = 8,
    TVINSERTSTRUCTITEM_hItem = 12,
    TVINSERTSTRUCTITEM_state = 16,
    TVINSERTSTRUCTITEM_stateMask = 20,
    TVINSERTSTRUCTITEM_pszText = 24,
    TVINSERTSTRUCTITEM_cchTextMax = 28,
    TVINSERTSTRUCTITEM_iImage = 32,
    TVINSERTSTRUCTITEM_iSelectedImage = 36,
    TVINSERTSTRUCTITEM_cChildren = 40,
    TVINSERTSTRUCTITEM_lParam = 44,
    SIZEOF_tvstruct = 48

global constant
    tvitem_mask = 0,
    tvitem_hItem = 4,
    tvitem_state = 8,
    tvitem_stateMask = 12,
    tvitem_pszText = 16,
    tvitem_cchTextMax = 20,
    tvitem_iImage = 24,
    tvitem_iSelectedImage = 28,
    tvitem_cChildren = 32,
    tvitem_lParam = 36,
    SIZEOF_tvitem = 40


in another language would be used like this:

  mov tvinsert.hParent,NULL
  mov tvinsert.hInsertAfter,TVI_ROOT
  mov tvinsert.item.imask,TVIF_TEXT+TVIF_IMAGE+TVIF_SELECTEDIMAGE
  mov tvinsert.item.pszText,offset Parent
  mov tvinsert.item.iImage,0
  mov tvinsert.item.iSelectedImage,1

and Euphoria:

  tvstruct = allocate_struct( SIZEOF_tvstruct )
  poke4( tvstruct + TVINSERTSTRUCT_hParent,NULL)
  poke4( tvstruct + TVINSERTSTRUCT_hInsertAfter,TVI_ROOT)
  poke4( tvstruct +
TVINSERTSTRUCTITEM_mask,or_all({TVIF_TEXT+TVIF_IMAGE+TVIF_SELECTEDIMAGE}))
  poke4( tvstruct + TVINSERTSTRUCTITEM_iImage,0)
  poke4( tvstruct + TVINSERTSTRUCTITEM_iSelectedImage,1)

there is no difference in the two languages as for functioning code (sorta)

Are you going to take this into consideration, there is a catch in notifying
the control owner and this is where the second structure come into play.

              if iMsg = TVN_SELCHANGED then --NM_CLICK then -- TreeView

                   count = c_func(SendMessage,{id, TVM_GETCOUNT, 0, 0})
                   item = c_func(SendMessage,{id,TVM_GETNEXTITEM, 0, TVGN_ROOT})
                   poke4(tvitem + tvitem_hItem,item)

                   poke4(tvitem + tvitem_mask,TVIF_TEXT)
                   poke4(tvitem + tvitem_stateMask, TVIS_SELECTED)
                   txtbuff = allocate(256)
                   poke4(tvitem + tvitem_pszText,txtbuff)
                   poke4(tvitem + tvitem_cchTextMax,256)

note that the structure used here for the treeview notification is not the same
as the first
used to create the treeview, it's the second because of its 8 bytes offset. A
question
I recently asked the list about and its pretty straight forward. How will your
engine account
for this? Will it be faster than what I already have?

Good luck Bernie,

Euman
euman at bellsouth.net

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

Search



Quick Links

User menu

Not signed in.

Misc Menu