RE: COMING REAL SOON !
- Posted by Bernie Ryan <xotron at localnet.com> Jul 21, 2001
- 376 views
euman at bellsouth.net wrote: > cosider this listview.ew file I still think your missing the point All the following constants are already predefine in w32engin.ew ------------------------------------ FROM HERE > > 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 > ----------------------------------- TO HERE > constant > lvcol_mask = 0, ------------------------- THESE CONSTANTS ARE NOT > lvcol_fmt = 4, NEEDED in w32engin.ew > 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 > --------------------------------- TO HERE --------------------------------- THESE ARE NOT NEED > global constant > LVN_COLUMNCLICK = -108, > NM_CLICK = -2, > LVM_GETITEM = 4101, > LVM_GETITEMSTATE = 4140, > LVM_GETSELECTEDCOUNT = 4146 > -- This creates a LVITEM structure lvitem = struc( "mask :uint : 1 "& "iItem :int : 1 "& "iSubItem :int : 1 "& "state :uint : 1 "& "stateMask :uint : 1 "& "pszText :pointer : 1 "& "cchTextMax :int : 1 "& "iImage :int : 1 "& "lParam :dword : 1 "& "iIndent :int : 1 ") You will NOTICE that this is along text string ( SEQUENCE ). The function struc() will automatically read this text string ( SEQUENCE ) and build a structure in memory and automatically calculate all the offsets by the sizes that used in your definition and intialize it to all zeros. The pointer returned allows you to manipulate the structure by using JUST THE NAMES that you used in your definition. -- Insert 12345 in "lParam" -- NOTICE A NAME -- in the LVITEM structure pointed to by lvitem -- AND WILL automatically check that your using a DWORD put(lvitem,"lParam",12345) -- return the "stateMask" LVITEM structure pointed to by lvitem grab(lvitem,"stateMask") -- This would print size in bytes of the structure ? sizeof(lvitem) -- If the structure is already PREDEFINED in the library -- You can do declare it like this. lvitem = struc("LVITEM") -- Or you can also declare and initialize it -- Create a RECT structure and initialize at the same time -- to some values rect = struc({"RECT",{0,0,200,300}}) -- clone a structure another_rect = dups(rect) -- Print the size of a PREDEFINED structure by name ? sizeof("RECT") -- or use the rect pointer ? sizeof(rect) ALSO it can use ARRAYS of STRUCTURES etc ............... NO NEED TO CALCULATE OFFSETS AND THE struc() function can do this with ANY structure that you describe to the library. This is only some of the structure features in w32engin.ew. Bernie