1. Re: Editing

This is a multi-part message in MIME format.

------=_NextPart_000_000B_01C2E9AC.CF2AA380
	charset="iso-8859-1"

I picked a ListView and put one on my screen, called MyWin. I selected
Listview Exployer and created column data and made titles for 8 
columns. I
selected Transfer to properties(?) and Listview became the toplevel 
item in
my project.
What might have I done. I assume that I would getint a procedure and 
build a
procedure that I had in the List
Jim Smiley
----- Original Message -----
From: "Judith Evans" <camping at txcyber.com>
To: "EUforum" <EUforum at topica.com>
Sent: Thursday, March 13, 2003 1:21 PM
Subject: Re: Editing



----- Original Message -----
From: jimmy
To: Judith
Sent: Thursday, March 13, 2003 1:00 PM
Subject: Re: Editing

>>Can I define the columns in List view in IDE?

Sure can. Under Menu Edit there is a selection for "ListView 
Explorer".
You
can determine a lot of listView information, columns and row. If you 
have
first dropped a listview control onto window1 and selected it, you 
can
transfer what you "design" in ListView Explorer right to the ListView
properties.
--judith



TOPICA - Start your own email discussion group. FREE!


------=_NextPart_000_000B_01C2E9AC.CF2AA380
Content-Type: application/octet-stream;
	name="Addressbookz.prj"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="Addressbookz.prj"

#Version 0.15.0
#Counter: 40
#WinCounter: 2
#Window 1
#Control: ListView
X       : 0
Y       : 0
CX      : 548
CY      : 432
Title   : "ListView","L Name","F =
Name","Address","Street","City","State","Zip","Phone"
Class   : Window
Enabled : 0
Checked : 0
Parent  :=20
PClass  :=20
Visible : 1
BkColor : 65280
SystemBkColor :=20
EnableC : 1
Style   : 0
TypStyle:=20
ExStyle : 0
Local : 1

#Proc: (General)
atom Handle, myphdc, j, k, charheight,width, hor, ver, column2, xkey
integer listlen, index, pindex, colx, ptrcol, col, z, thisrec, DIM_H, =
DIM_V
integer junk,linecount,charsPerLine, linesPerPage, halfx, halfy
sequence fontSize, printerSize, text,mypr, textinfo, high_extent, 
sav_y, =
temp_num
object line, line2, entry,  pline2, pline3, p2line, p2line2, p2line3, =
dataline, pline,Ple
sequence print_params, prt_dim, wrk_seq, extent, format_dim, result, =
rtn_text, wrk_data
atom v_space, h_space, cur_x, cur_y, prt_done, rtn_code, 
overflow_line, =
record_num
integer qty_Columns, text_len, fit,  pgNumber, page,comma,  f1,isnew, =
haschanged, totRecs, zz
integer savedata_id, adddata_id, new_id, add_id, save_id, del_id, =
eachcol
sequence  lineOfText, lineOfText2, lineOfText3, pp, myCompany
global constant
	r_key =3D 1,
	r_fname =3D 2,
	r_lname=3D 3,
	r_address =3D 4,
	r_city =3D 5,
	r_state =3D 6,
	r_zip =3D 7,
	r_phone =3D 8
global atom xline
sequence hlname, hfname, haddress, hstreet, hcity, hstate, hzip, hphone

include database.e
include misc.e
 DIM_H =3D 3
    DIM_V =3D 4
Ple=3D{}
isnew=3D0 haschanged=3D0
new_id=3Droutine_id("btnNew")
add_id=3Droutine_id("btnAdd")
save_id=3Droutine_id("btnSave")
del_id=3Droutine_id("btnDel")
-----------------------------------------------------------------------
--=
------

procedure loadList()
		atom rtn_code, index, record_num, width_type, 
selected, =
wrk_key,size,hkey
		integer indx
		sequence  wrk_data, wrk_status, line, liney
		selected =3D False
		-- Clear the list view
		eraseItems(List1)
		-- Select the projects table and load all projects
		if db_select_table("addrecords") !=3D DB_OK then
				rtn_code =3D message_box("An error 
occured selecting the" &
					" my records table", "Table 
Selection Error!",	MB_OK)
				return
		end if
		-- Get all records
		for i =3D 1 to db_table_size() do
			wrk_key =3D db_record_key(i)
			wrk_data =3D db_record_data(i)
			hkey =3D (wrk_key)
				hlname =3D wrk_data[1]
				hfname =3D wrk_data[2]
				haddress =3D wrk_data[3]
				hstreet =3D wrk_data[4]
				hcity =3D wrk_data[5]
				hstate =3D wrk_data[6]
				hzip =3D wrk_data[7]
				hphone =3D wrk_data[8]
			line =3D hkey & ", " & hlname & ", " & hfname 
& ", " & haddress & ", =
" & hstreet
			& ", " & hcity & ", " & hstate & ", " & hzip 
& ", " & hphone
				setText(dbText, i)
 -- and "park" it in the listbox.
		addItem(List1, line)
	indx =3D getIndex(List1)
	line =3D getItem(List1,indx)
	setText(dbText, line)
--	junk =3D message_box("line",
--			"Empty entry!", MB_TASKMODAL + MB_ICONWARNING)
	setText(dbText, indx)
--	junk =3D message_box("indx",
--			"Empty entry!", MB_TASKMODAL + MB_ICONWARNING)
	liney =3D(line)
		setText(dbText, liney)
--	junk =3D message_box("liney",
--			"Empty entry!", MB_TASKMODAL + MB_ICONWARNING)
--	 xkey =3D liney[1]
--	setText(dbText, xkey)
	junk =3D message_box("xkey",
			"Empty entry!", MB_TASKMODAL + MB_ICONWARNING)
--	setText(dbText, " ")
	end for
end procedure

-----------------------------------------------------------------------
--=
-----------
procedure deletedb()

-- delete database so we can start fresh
if platform() =3D LINUX then
    system("rm addDB.edb", 2)
else
    system("del addDB.edb", 2)
end if
end procedure
-----------------------------------------------------------------------
--=
----------
procedure createdb()

    if db_create("addDB", DB_LOCK_EXCLUSIVE) !=3D DB_OK then
		setText(dbText, "db_create failed\n")
		abort(1)
    else
		setText(dbText, "Creating new database\n")
    end if
	if db_create_table("addrecords") =3D DB_OK then
    	setText(dbText, "created my_table\n")
    else
    	setText(dbText, "not Creating new table\n")
    end if=09
    	--db_delete_table("keyrecords")
	if db_create_table("keyrecords") =3D DB_OK then
    	setText(dbText, "created keytable\n")
    else
    	setText(dbText, "not Creating new table\n")
	end if
end procedure

-----------------------------------------------------------------------
--=
--------
-- from DaJaRo's threed.ew code,
-- draws a nice 3D frame.

procedure Threed(integer Win_id, sequence xys,sequence hilo,integer =
width )
  integer x1,y1,x2,y2
    x1=3D1
    y1=3D2
    x2=3D3
    y2=3D4
    setPenColor( Win_id, hilo[2] )
  for i =3D 0 to width do
    drawLine( Win_id, xys[x1]-i, xys[y1]-i, xys[x2]+i, xys[y1]-i )
    drawLine( Win_id, xys[x1]-i, xys[y1]-i, xys[x1]-i, xys[y2]+i )
  end for

  setPenColor( Win_id, hilo[1] )
  for i =3D 0 to width do
    drawLine( Win_id, xys[x1]-i, xys[y2]+i, xys[x2]+i, xys[y2]+i )
    drawLine( Win_id, xys[x2]+i, xys[y1]-i, xys[x2]+i, xys[y2]+i )
  end for
end procedure
-----------------------------------------------------------------------
--=
-----------
procedure PaintWin_id(integer Win_id)
  sequence xys, hilo
  integer width
  integer x,y
    x=3D40
    y=3D28
    width  =3D 4
    xys    =3D {5,125,220-width,316-width}
    hilo   =3D { rgb(240,240,240),rgb(75,75,75) }
    Threed(Win_id, xys, hilo, width ) -- frame entry form
    width=3D2
    hilo   =3D { rgb(240,240,240),rgb(75,75,75) }
    xys    =3D {13,9,210-width,32-width}
    Threed(Win_id, xys, hilo, width ) -- frame text window
  setPenColor(MyWin,Black)
  drawLine(MyWin,0,1,228,1)           -- draw line below menu
  end procedure
-----------------------------------------------------------------------
--=
-------
procedure onPaint_MainWindow(integer x1,integer y1,integer x2,integer =
y2)
  PaintWin_id(MyWin)
end procedure
-----------------------------------------------------------------------
--=
----

procedure get_info()
	print_params =3D getPrinter()

	if length(print_params) > 0  then
		setFont(Printer, "Courier New", 12, Normal )
		fontSize =3D getFontSize(Printer)
		printerSize =3D getExtent(Printer)
		charsPerLine =3D floor(printerSize[1]/fontSize[1])
		linesPerPage =3D floor(printerSize[2]/fontSize[2])
		setPosition(PrWin,10,10)
wPuts(PrWin,"...using the \"Courier New\", size 16 font.")
setPosition(PrWin,10,30)
wPuts(PrWin,"character width =3D " & sprintf("%d",fontSize[1]))
setPosition(PrWin,10,50)
wPuts(PrWin,"character height =3D " & sprintf("%d",fontSize[2]))
setPosition(PrWin,10,70)
wPuts(PrWin,"characters per line =3D " & sprintf("%d",charsPerLine))
setPosition(PrWin,10,90)
wPuts(PrWin,"lines per page =3D " & sprintf("%d",linesPerPage))
setPosition(PrWin,10,120)
wPuts(PrWin,"page 'pixel' width =3D " & sprintf("%d",printerSize[1]))
setPosition(PrWin,10,140)
wPuts(PrWin,"page 'pixel' height =3D " & sprintf("%d",printerSize[2]))
end if
end procedure
-----------------------------------------------------------------------
-
procedure get_pchunk()
=09
	comma =3D 0
	f1 =3D 1
	Ple =3D {}
	for i =3D 1 to length(dataline) do
		if dataline[i] =3D ',' then
			comma =3D comma + 1
			 Ple =3Dappend(Ple,dataline[f1..i-1])
			f1 =3D i + 1
		end if
	end for
end procedure
--------------------------------------------------------
procedure print_now()
	sequence Head1, Head2,  eachrec,Ple
	integer lineCount,numberofLines, startnum, totcols, recread, 
pagewidth, =
startcol, linec, rec,
	key
	--get_info()
	Ple =3D {}
	prt_dim =3D {}
	wrk_seq =3D {}
    format_dim =3D {}
    wrk_data =3D {}
    prt_done =3D False
    fit =3D True
    pgNumber =3D 0
 --  print_params =3D getPrinter()
--	high_extent =3D 0
	myCompany =3D " AddressBook For You"
	if length(print_params) then
        setPenWidth(Printer, 6)
        prt_dim =3D getRect(Printer)
        h_space =3D floor(prt_dim[DIM_H] * .006)
        v_space =3D floor(prt_dim[DIM_V] * .003)
        overflow_line =3D prt_dim[DIM_V] - (v_space * 40)
        pagewidth =3D 0
        pgNumber =3D 0
  		pgNumber +=3D 1
   end if
	-- start up the document
	 if startDoc( "My Print Job" ) then
    	 junk =3D startPage()
   -- top of page
     	lineCount =3D 1

 		 Head1 =3D " AddressBook For You"
 	 	Head2 =3D "-------------------------------------------"
 	 	lineOfText =3D Head1
 	 	setPosition( Printer, 0, lineCount*fontSize[2] )
 	 	wPuts( Printer,lineOfText )
 	 	lineCount +=3D  1
	  	lineOfText =3D Head2   --[1..charsPerLine]
 	 	setPosition( Printer, 0, lineCount*fontSize[2] )
 	 	wPuts( Printer,lineOfText )
 	 --lineCount +=3D  1

 	 end if
 	 cur_x =3D 100
	 totcols =3D 2
	 thisrec =3D 0
	 numberofLines =3D 0
 	 totRecs =3D getCount(List1)
 -- Read all records in list
	thisrec =3D 0
  	for  thisrec =3D 1 to db_table_size()    do
  		pline =3D {}
  		pline2 =3D {}
  		pline3 =3D {}
  		zz =3D 0
  		z =3D 0
  		rec =3D -1
  	--	for z =3D 1 to totcols do
  	--	    while rec < 0  do
  	--	    rec =3D	get_record(thisrec)
  	--	    end while
  	--		if rec > 0 then
  	--		=09
	=09
      rec =3D db_record_key(thisrec)
        Ple =3D db_record_data(thisrec)


 --position text on line rec 1 page
   	setText(dbText, (Ple[1])) --& " " & getText(Ple[2]))

				zz =3D z

        pline =3D append(pline, Ple[2] )
		pline2 =3D append(pline2, Ple[2] & Ple[3] & Ple[4])
		pline3 =3D append(pline3, Ple[5] & Ple[6] & Ple[7])
  		--	   			 else
		--		puts(dbText, "Failed to find key:" ) --
 %d\n", key)
  		--	 end if
		end for
		if zz =3D 1 then
			totcols =3D 1
		end if
-- get one 'line 1 ' of text
      	pagewidth =3D  (floor(charsPerLine/totcols)) * h_space
      	lineCount +=3D  1
        linec =3D	lineCount*fontSize[2]
	--	for prtrec =3D 1 to totRecs  do
		-- temp fix--------------------------------

		totcols =3D 1
		for prtrec =3D 1 to totcols  do
			if prtrec =3D 1  then
				colx =3D 10
			else
				colx =3D (colx + (pagewidth * 
totcols) )
			end if=09
			setPosition( Printer, colx, linec)
		   	   	wPuts( Printer,pline[prtrec] )
    	end for
--- print " second line of text    	=09
   	   	lineCount +=3D 1
  		linec =3D	lineCount*fontSize[2]
		for prtrec =3D 1 to totcols  do
			if prtrec =3D 1  then
				colx =3D 10
			else
				colx =3D (colx + (pagewidth * 
totcols) )
			end if		=09
			if  length(pline2[prtrec]) =3D 0	then
				return
			else
	  	   		if length(pline2[prtrec]) > 25 then
   	   				eachrec =3D pline2[prtrec]
[1..25]
   	   			else
					eachrec =3D pline2[prtrec]
   	   			end if
	   	   		setPosition( Printer, colx, linec)
    		   	wPuts( Printer,eachrec)
    			end if
   	   	end for
--- print " third line of text    	=09
   	   		lineCount +=3D 1
  		linec =3D	lineCount*fontSize[2]
	=09
		for prtrec =3D 1 to totcols  do
			if prtrec =3D 1  then
				colx =3D 10
			else
				colx =3D (colx + (pagewidth * 
totcols) )
			end if		=09
--  		if  pline2[prtrec] =3D " "			
	then
--	  	   		if length(pline2[prtrec]) > 25 then
 --  	   			eachrec =3D pline2[prtrec][2..25]
 --   	   		else
--					eachrec =3D pline2[prtrec]
 --   	   		end if
 --	      end if
	     setPosition( Printer, colx, linec)
    	wPuts( Printer,pline3[prtrec])
   	  -- move down one line
  		lineCount +=3D 1
    -- at bottom of page?
   		if lineCount > linesPerPage then
      -- print page
    	 	if not endPage() then
       			exit
     	 	end if
      -- start a new page
     	 	if not startPage() then
      	 		exit
    	 	end if
      -- 	reset counter
     		lineCount =3D 0
     	end if
    end for
	 -- then, finally, send the page to the printer
   	 junk=3DendPage()
  -- end of document
	 if endDoc() then
  -- release the printer
     	releasePrinter()
	 end if
end procedure
--
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3
D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3
D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
function getKey(integer addkey)
integer currentno,f
sequence xdata
--rtn_code =3D db_select_table("keyrecords")
		rtn_code =3D message_box("get Key  rfunction",
 	 		"remind for Win98", MB_ICONWARNING+MB_OK)
		rtn_code =3D message_box("Key creating record",
 	 		"remind for Win98", MB_ICONWARNING+MB_OK)
 =09
 	f =3D db_find_key(addkey)

	  if f >=3D 0 then
 	 	rtn_code =3D message_box("getKey  record",
 	 	"remind for Win98", MB_ICONWARNING+MB_OK)
  	 	 	xdata =3D db_record_data(addkey)
  	 	 	currentno =3D xdata[2]
  	 	 	setText(dbText, currentno)

 	 	currentno =3D currentno + 1
  		db_replace_data(addkey, {"ADD",currentno})
	else
		currentno =3D  001
		if db_insert(addkey,{"ADD",currentno}) !=3D DB_OK then
      		rtn_code =3D message_box("error key insert  record",
 	 		"remind for Win98", MB_ICONWARNING+MB_OK)
  		end if
  	end if
  	=09

		return currentno
end function
-----------------------------------------------------------------------
--=
---
procedure clear_all()
	setText(Sle1, {}) setText(Sle2, {})
	setText(Sle3, {}) setText(Sle4, {})
	setText(Sle5, {}) setText(Sle6, {})
	setText(Sle7, {}) setText(Sle8, {})
end procedure
----------------------------------------------------------------------
function lTrim(sequence string)
	for i =3D 1 to length(string) do
		if (string[i] =3D ',') then
			if string[i+1] =3D ' '  then
				return string[1..i-1]		
	=09
			end if
		end if
	end for=09
	return string
end function
-----------------------------------------------------------------------
--=
---
procedure get_chunk()
	index =3D length(line2) + 3
	if index < length(line)  then
		line =3D line[index..length(line)]
		line2 =3D lTrim(line)
	else line2 =3D " "
	end if
end procedure
-----------------------------------------------------------------------
--=
-------
procedure show_parsed()
integer indxa
sequence  xname


	clear_all()
--	setText(dbText, lTrim(line[1..1]))
indxa =3D getIndex(List1)
	line =3D getItem(List1,indxa)
setText(dbText, line)

rtn_code =3D message_box("show parsed  record",
 	 		"remind for Win98", MB_ICONWARNING+MB_OK)
	--index=3D1
	line2 =3D lTrim(line)
=09
	--setText(Sle1, line2)
	--get_chunk()
	setText(Sle1, line2)
	get_chunk()
	setText(Sle2, line2)
	get_chunk()
	setText(Sle3, line2)
	get_chunk()
	setText(Sle4, line2)
	get_chunk()=09
	setText(Sle5, line2)
	get_chunk()
	setText(Sle6, line2)
	get_chunk()
	setText(Sle7, line2)
	get_chunk()
	setText(Sle8, line2)
	setText(Label1, getText(Sle2) & " " & getText(Sle1))
=09
end procedure
-----------------------------------------------------------------------
--=
---

procedure re_index()
	listlen =3D getCount(List1)
	if listlen > 0 then
		for i =3D 1 to listlen do
			line =3D getItem(List1,i)
			if compare(line, entry) =3D 0 then
				setIndex(List1, i)
			--	show_parsed()
			end if
		end for
	end if
	setFocus(List1)
end procedure

--------------------------------------------------
procedure onKey_btnNew(integer key, integer shift)
	if key=3D13  then
	call_proc(new_id,{}) else	end if
end procedure
onKeyPress [btnNew] =3D routine_id("onKey_btnNew")
--------------------------------------------------
procedure onKey_btnAdd(integer key, integer shift)
	if key=3D13  then call_proc(add_id,{})
		setFocus(btnNew)
	else	end if
end procedure
onKeyPress [btnAdd] =3D routine_id("onKey_btnAdd")
--------------------------------------------------
--procedure onKey_btnSave(integer key, integer shift)
--	if key=3D13  then call_proc(save_id,{})
 --	else	end if
--end procedure
--onKeyPress [btnSave] =3D routine_id("onKey_btnSave")
--------------------------------------------------
procedure onKey_btnDel(integer key, integer shift)
	if key=3D13  then call_proc(del_id,{})
	 else	end if
end procedure
onKeyPress [btnDel] =3D routine_id("onKey_btnDel")

#EndProc

#Proc: onOpen
procedure MyWin_onOpen (integer self, integer event, sequence =
params)--params is ()
	sequence linex, liney
	integer indx
	 PaintWin_id(MyWin)                  -- draw our fancy borders.

--deletedb()
--createdb()
=09
	if db_open("addDB", DB_LOCK_NO) !=3D DB_OK then
		junk =3D message_box("couldn't open database",
			"Empty entry!", MB_TASKMODAL + MB_ICONWARNING)
			abort(1)
	end if
	if db_select_table("addrecords") !=3D DB_OK then
		junk =3D message_box("couldn't open table",
			"Empty entry!", MB_TASKMODAL + MB_ICONWARNING)
			abort(1)
	end if
		loadList()
 	PaintWin_id(MyWin)                  -- draw our fancy borders.
 -- setBitmap( Bitmap1, "race2.bmp" )   -- draw our bitmap.
-- read from a file, IF it exists.
	listlen =3D getCount(List1)
	if listlen > 0 then
			setIndex(List1, 1)
			line =3D getItem(List1,1)
=09
	setFocus(List1)
	indx =3D getIndex(List1)
	line =3D getItem(List1,indx)
--	setText(dbText, line)
--	junk =3D message_box("line",
--			"Empty entry!", MB_TASKMODAL + MB_ICONWARNING)
--	setText(dbText, indx)
--	junk =3D message_box("indx",
--			"Empty entry!", MB_TASKMODAL + MB_ICONWARNING)
	liney =3D(line)
--		setText(dbText, liney)
--	junk =3D message_box("liney",
--			"Empty entry!", MB_TASKMODAL + MB_ICONWARNING)
	 xkey =3D liney[1]
--	setText(dbText, xkey)
--	junk =3D message_box("xkey",
--			"Empty entry!", MB_TASKMODAL + MB_ICONWARNING)
	setText(dbText, " ")
	show_parsed()
	end if

end procedure

setHandler( MyWin, w32HOpen, routine_id("MyWin_onOpen"))
#EndProc

#Control: MenuTop
AWindow : 1
X       : 0
Y       : 1
CX      : 0
CY      : 0
Title   : File
Class   : Menu
Enabled : 1
Checked : 0
Parent  :=20
PClass  :=20
Visible : 1
EnableC : 1
Style   : 0
TypStyle:=20
ExStyle : 0
Local : 1

#Control: MenuSave
AWindow : 1
X       : 0
Y       : 2
CX      : 0
CY      : 0
Title   : Save
Class   : MenuItem
Enabled : 1
Checked : 0
Parent  :=20
PClass  :=20
Visible : 1
EnableC : 1
Style   : 0
TypStyle:=20
ExStyle : 0
Local : 1

#Control: MenuPrint
AWindow : 1
X       : 0
Y       : 3
CX      : 0
CY      : 0
Title   : Print
Class   : MenuItem
Enabled : 1
Checked : 0
Parent  :=20
PClass  :=20
Visible : 1
EnableC : 1
Style   : 0
TypStyle:=20
ExStyle : 0
Local : 1

#Proc: onClick
procedure MenuPrint_onClick (integer self, integer event, sequence =
params)--params is ()
	openWindow(PrWin,1)
	get_info()
		--getPrinter()
--	startDoc()
--	startPage()
--	endPage()
--	endDoc()
--	releasePrinter()
 --    routine_id("print_now")
	print_now()
end procedure
setHandler( MenuPrint, w32HClick, routine_id("MenuPrint_onClick"))
#EndProc

#Control: MenuExit
AWindow : 1
X       : 0
Y       : 4
CX      : 0
CY      : 0
Title   : Exit
Class   : MenuItem
Enabled : 1
Checked : 0
Parent  :=20
PClass  :=20
Visible : 1
EnableC : 1
Style   : 0
TypStyle:=20
ExStyle : 0
Local : 1

#Proc: onClick
procedure MenuExit_onClick (integer self, integer event, sequence =
params)--params is ()
	integer junk
--	savedata_id=3D routine_id("btnSave_onClick")

	if haschanged=3D1 then
		junk =3D message_box("You have made changes \n" &
			"Would you like to save them?",
			"Confirm Saving Changes!",
			MB_ICONQUESTION + MB_YESNO + MB_TASKMODAL)
		if junk =3D IDYES then
					--save our database to file
--		call_proc(savedata_id,{})
				=09
--			btnSave_onClick()
--		end if
--	end if
			listlen =3D getCount(List1)
			if listlen > 0  then
				Handle =3D open("mydata3.txt", "w")
				for i =3D 1 to listlen do
					line =3D getItem(List1, i)
					line =3D line & '\n'
					puts(Handle, line)
				end for
			close(Handle)
			end if
		end if
	end if
		haschanged=3D0
		closeWindow(MyWin)
end procedure
setHandler( {MenuExit}, w32HClick, routine_id("MenuExit_onClick"))

#EndProc

#Control: MenuDo
AWindow : 1
X       : 0
Y       : 5
CX      : 0
CY      : 0
Title   : Item
Class   : Menu
Enabled : 1
Checked : 0
Parent  :=20
PClass  :=20
Visible : 1
EnableC : 1
Style   : 0
TypStyle:=20
ExStyle : 0
Local : 1

#Control: MenuNew
AWindow : 1
X       : 0
Y       : 6
CX      : 0
CY      : 0
Title   : New
Class   : MenuItem
Enabled : 1
Checked : 0
Parent  :=20
PClass  :=20
Visible : 1
EnableC : 1
Style   : 0
TypStyle:=20
ExStyle : 0
Local : 1

#Control: AddMenu
AWindow : 1
X       : 0
Y       : 7
CX      : 0
CY      : 0
Title   : Add
Class   : MenuItem
Enabled : 1
Checked : 0
Parent  :=20
PClass  :=20
Visible : 1
EnableC : 1
Style   : 0
TypStyle:=20
ExStyle : 0
Local : 1

#Control: DeleteMenu
AWindow : 1
X       : 0
Y       : 8
CX      : 0
CY      : 0
Title   : Delete
Class   : MenuItem
Enabled : 1
Checked : 0
Parent  :=20
PClass  :=20
Visible : 1
EnableC : 1
Style   : 0
TypStyle:=20
ExStyle : 0
Local : 1

#Control: MenuThank
AWindow : 1
X       : 0
Y       : 9
CX      : 0
CY      : 0
Title   : Thanks
Class   : Menu
Enabled : 1
Checked : 0
Parent  :=20
PClass  :=20
Visible : 1
EnableC : 1
Style   : 0
TypStyle:=20
ExStyle : 0
Local : 1

#Control: MenuTo
AWindow : 1
X       : 0
Y       : 10
CX      : 0
CY      : 0
Title   : To
Class   : MenuItem
Enabled : 1
Checked : 0
Parent  :=20
PClass  :=20
Visible : 1
EnableC : 1
Style   : 0
TypStyle:=20
ExStyle : 0
Local : 1

#Proc: onClick
procedure MenuTo_onClick (integer self, integer event, sequence =
params)--params is ()
	junk =3D message_box("Thanks to Robert Craig for Euphoria,\n" &
	"David Cuney for the win32lib wrapper,\n" &
	" and DaJaro for the 'threed ' routine, \n" &
	" print reoutine ,\n" &
	" to Wolf, \n" &
	" to Judith for IDE !",
	" to Euphoria and all",#2000)
end procedure
setHandler( MenuTo, w32HClick, routine_id("MenuTo_onClick"))
#EndProc

#Control: List1
AWindow : 5
X       : 10
Y       : 10
CX      : 200
CY      : 60
Title   :=20
Class   : SortedList
Enabled : 0
Checked : 0
Parent  :=20
PClass  :=20
Visible : 1
EnableC : 1
Style   : 0
TypStyle:=20
ExStyle : 0
TabOrder : 6
Local : 1

#Proc: onChange
procedure List1_onChange (integer self, integer event, sequence =
params)--params is ()
	integer  l, lenx, indx, lcount, axkey
	atom fcount
	sequence linex, liney
	indx =3D getIndex(List1)
	line =3D getItem(List1,indx)
	setText(dbText, line)
	--rtn_code =3D message_box("List1 line",
 --			"remind for Win98", MB_ICONWARNING+MB_OK)
	setText(dbText, indx)
--	 rtn_code =3D message_box("List1 indx Change ",
 --			"remind for Win98", MB_ICONWARNING+MB_OK)
	liney =3D(line)
		setText(dbText, liney)
--	 rtn_code =3D message_box(" List1 liney Change ",
--			"remind for Win98", MB_ICONWARNING+MB_OK)
	linex =3D lTrim(liney)
		setText(dbText, linex)
--	 rtn_code =3D message_box(" List1 linex Change ",
--			"remind for Win98", MB_ICONWARNING+MB_OK)

	axkey =3D (linex[1])
	xkey =3D (axkey)
		setText(dbText, liney)
--	 rtn_code =3D message_box(" List1 xkey Change ",
--			"remind for Win98", MB_ICONWARNING+MB_OK)

	setText(dbText, xkey)
rtn_code =3D message_box("List1 xkey ",
 			"remind for Win98", MB_ICONWARNING+MB_OK)
	setText(dbText, " ")
	show_parsed()
end procedure
setHandler( List1, w32HChange, routine_id("List1_onChange"))
#EndProc

#Control: Label1
AWindow : 5
X       : 10
Y       : 68
CX      : 210
CY      : 18
Title   :=20
Class   : LText
Enabled : 0
Checked : 0
Parent  :=20
PClass  :=20
Visible : 1
EnableC : 1
Style   : 0
TypStyle:=20
ExStyle : 0
TabOrder : 7
Local : 1

#Control: Label2
AWindow : 5
X       : 10
Y       : 92
CX      : 65
CY      : 20
Title   : Last
Class   : RText
Enabled : 0
Checked : 0
Parent  :=20
PClass  :=20
Visible : 1
EnableC : 1
Style   : 0
TypStyle:=20
ExStyle : 0
TabOrder : 8
Local : 1

#Control: Sle1
AWindow : 5
X       : 80
Y       : 92
CX      : 130
CY      : 22
Title   :=20
Class   : EditText
Enabled : 0
Checked : 0
Parent  :=20
PClass  :=20
Visible : 1
EnableC : 1
Style   : 0
TypStyle:=20
ExStyle : 0
TabOrder : 9
Local : 1

#Control: Sle2
AWindow : 5
X       : 80
Y       : 114
CX      : 130
CY      : 20
Title   :=20
Class   : EditText
Enabled : 0
Checked : 0
Parent  :=20
PClass  :=20
Visible : 1
EnableC : 1
Style   : 0
TypStyle:=20
ExStyle : 0
TabOrder : 11
Local : 1

#Control: Label3
AWindow : 5
X       : 10
Y       : 116
CX      : 65
CY      : 20
Title   : First
Class   : RText
Enabled : 0
Checked : 0
Parent  :=20
PClass  :=20
Visible : 1
EnableC : 1
Style   : 0
TypStyle:=20
ExStyle : 0
TabOrder : 10
Local : 1

#Control: Label4
AWindow : 5
X       : 10
Y       : 140
CX      : 65
CY      : 20
Title   : Address
Class   : RText
Enabled : 0
Checked : 0
Parent  :=20
PClass  :=20
Visible : 1
EnableC : 1
Style   : 0
TypStyle:=20
ExStyle : 0
TabOrder : 12
Local : 1

#Control: Sle3
AWindow : 5
X       : 80
Y       : 140
CX      : 130
CY      : 20
Title   :=20
Class   : EditText
Enabled : 0
Checked : 0
Parent  :=20
PClass  :=20
Visible : 1
EnableC : 1
Style   : 0
TypStyle:=20
ExStyle : 0
TabOrder : 18
Local : 1

#Control: Label5
AWindow : 5
X       : 10
Y       : 164
CX      : 65
CY      : 20
Title   : Street
Class   : RText
Enabled : 0
Checked : 0
Parent  :=20
PClass  :=20
Visible : 1
EnableC : 1
Style   : 0
TypStyle:=20
ExStyle : 0
TabOrder : 13
Local : 1

#Control: Sle4
AWindow : 5
X       : 80
Y       : 164
CX      : 130
CY      : 20
Title   :=20
Class   : EditText
Enabled : 0
Checked : 0
Parent  :=20
PClass  :=20
Visible : 1
EnableC : 1
Style   : 0
TypStyle:=20
ExStyle : 0
TabOrder : 19
Local : 1

#Control: Label6
AWindow : 5
X       : 10
Y       : 188
CX      : 65
CY      : 20
Title   : City
Class   : RText
Enabled : 0
Checked : 0
Parent  :=20
PClass  :=20
Visible : 1
EnableC : 1
Style   : 0
TypStyle:=20
ExStyle : 0
TabOrder : 14
Local : 1

#Control: Sle5
AWindow : 5
X       : 84
Y       : 192
CX      : 130
CY      : 20
Title   :=20
Class   : EditText
Enabled : 0
Checked : 0
Parent  :=20
PClass  :=20
Visible : 1
EnableC : 1
Style   : 0
TypStyle:=20
ExStyle : 0
TabOrder : 20
Local : 1

#Control: Label7
AWindow : 5
X       : 10
Y       : 216
CX      : 65
CY      : 20
Title   : State
Class   : RText
Enabled : 0
Checked : 0
Parent  :=20
PClass  :=20
Visible : 1
EnableC : 1
Style   : 0
TypStyle:=20
ExStyle : 0
TabOrder : 15
Local : 1

#Control: Sle6
AWindow : 5
X       : 84
Y       : 216
CX      : 130
CY      : 20
Title   :=20
Class   : EditText
Enabled : 0
Checked : 0
Parent  :=20
PClass  :=20
Visible : 1
EnableC : 1
Style   : 0
TypStyle:=20
ExStyle : 0
TabOrder : 21
Local : 1

#Control: Label8
AWindow : 5
X       : 10
Y       : 244
CX      : 65
CY      : 20
Title   : Zip
Class   : RText
Enabled : 0
Checked : 0
Parent  :=20
PClass  :=20
Visible : 1
EnableC : 1
Style   : 0
TypStyle:=20
ExStyle : 0
TabOrder : 16
Local : 1

#Control: Sle7
AWindow : 5
X       : 84
Y       : 244
CX      : 130
CY      : 20
Title   :=20
Class   : EditText
Enabled : 0
Checked : 0
Parent  :=20
PClass  :=20
Visible : 1
EnableC : 1
Style   : 0
TypStyle:=20
ExStyle : 0
TabOrder : 22
Local : 1

#Control: Label9
AWindow : 5
X       : 10
Y       : 272
CX      : 65
CY      : 20
Title   : Phone
Class   : RText
Enabled : 0
Checked : 0
Parent  :=20
PClass  :=20
Visible : 1
EnableC : 1
Style   : 0
TypStyle:=20
ExStyle : 0
TabOrder : 17
Local : 1

#Control: Sle8
AWindow : 5
X       : 84
Y       : 272
CX      : 130
CY      : 20
Title   :=20
Class   : EditText
Enabled : 0
Checked : 0
Parent  :=20
PClass  :=20
Visible : 1
EnableC : 1
Style   : 0
TypStyle:=20
ExStyle : 0
TabOrder : 23
Local : 1

#Control: dbText
AWindow : 5
X       : 8
Y       : 306
CX      : 212
CY      : 24
Title   :=20
Class   : EditText
Enabled : 0
Checked : 0
Parent  :=20
PClass  :=20
Visible : 1
EnableC : 1
Style   : 0
TypStyle:=20
ExStyle : 0
TabOrder : 1
Local : 1

#Control: btnNew
AWindow : 5
X       : 8
Y       : 344
CX      : 40
CY      : 25
Title   : New
Class   : PushButton
Enabled : 0
Checked : 0
Parent  :=20
PClass  :=20
Visible : 1
EnableC : 1
Style   : 0
TypStyle:=20
ExStyle : 0
TabOrder : 2
Local : 1

#Proc: onClick
procedure btnNew_onClick (integer self, integer event, sequence =
params)--params is ()
	setFocus(Sle1)
	clear_all()
--	isnew=3D1
end procedure
setHandler( btnNew, w32HClick, routine_id("btnNew_onClick"))
#EndProc

#Proc: onKeyDown
procedure btnNew_onKeyDown (integer self, integer event, sequence =
params)--params is ( atom scanCode, atom shift )
--------------------------------------------------
end procedure
setHandler( btnNew, w32HKeyDown, routine_id("btnNew_onKeyDown"))
#EndProc

#Control: btnAdd
AWindow : 5
X       : 56
Y       : 344
CX      : 40
CY      : 25
Title   : Add
Class   : PushButton
Enabled : 0
Checked : 0
Parent  :=20
PClass  :=20
Visible : 1
EnableC : 1
Style   : 0
TypStyle:=20
ExStyle : 0
TabOrder : 3
Local : 1

#Proc: onClick
procedure btnAdd_onClick (integer self, integer event, sequence =
params)--params is ()
	integer junk, rec, f, key, xkey, indx
	sequence ix, data
	 rtn_code =3D message_box("Start added ",
 			"remind for Win98", MB_ICONWARNING+MB_OK)
	isnew=3D0-- reset tje flag if it was set!
	hlname =3D getText(Sle1)
	hfname=3D getText(Sle2)
	haddress =3D getText(Sle3)
	hstreet =3D getText(Sle4)
	hcity =3D getText(Sle5)
	hstate =3D getText(Sle6)
	hzip =3D getText(Sle7)
	hphone =3D getText(Sle8)
	setText(Label1, getText(Sle2) & " " & getText(Sle1))
	entry =3D 
{hlname,hfname,haddress,hstreet,hcity,hstate,hzip,hphone}
--rtn_code =3D switch to key record
 	 rtn_code =3D db_select_table("keyrecords")
	key =3D   getKey(001)
--   switch to add records=09
	rtn_code =3D db_select_table("addrecords")
    f =3D db_find_key(key)
    if f >=3D 0 then
 	 	rtn_code =3D message_box("duplicate  record",
  		"remind for Win98", MB_ICONWARNING+MB_OK)
	else=09
	   	if db_insert(key,entry) !=3D DB_OK then
      		rtn_code =3D message_box("error adding  record",
 	 		"remind for Win98", MB_ICONWARNING+MB_OK)
  		else
   			 rtn_code =3D message_box("added  record",
 			"remind for Win98", MB_ICONWARNING+MB_OK)
 		end if
 	end if
 	loadList()
end procedure
setHandler( btnAdd, w32HClick, routine_id("btnAdd_onClick"))
#EndProc

#Control: btnSave
AWindow : 5
X       : 104
Y       : 344
CX      : 40
CY      : 25
Title   : Update
Class   : PushButton
Enabled : 0
Checked : 0
Parent  :=20
PClass  :=20
Visible : 1
EnableC : 1
Style   : 0
TypStyle:=20
ExStyle : 0
TabOrder : 4
Local : 1

#Proc: onClick
 procedure btnSave_onClick (integer self, integer event, sequence =
params)--params is ()
	integer f
--	integer junk, rec, f, key, xkey, indx
--	sequence ix, data
	 rtn_code =3D message_box("Start Save",
 			"remind for Win98", MB_ICONWARNING+MB_OK)
	isnew=3D0-- reset tje flag if it was set!
	hlname =3D getText(Sle1)
	hfname=3D getText(Sle2)
	haddress =3D getText(Sle3)
	hstreet =3D getText(Sle4)
	hcity =3D getText(Sle5)
	hstate =3D getText(Sle6)
	hzip =3D getText(Sle7)
	hphone =3D getText(Sle8)
	setText(Label1, getText(Sle2) & " " & getText(Sle1))
	entry =3D 
{hlname,hfname,haddress,hstreet,hcity,hstate,hzip,hphone}
-
	rtn_code =3D db_select_table("addrecords")
    f =3D db_find_key(xkey)
    if f >=3D 1 then
 	 	rtn_code =3D message_box("duplicate  record",
  		"remind for Win98", MB_ICONWARNING+MB_OK)
  	=09
  		db_replace_data(f,entry)
	else=09
	   	if db_insert(xkey,entry) !=3D DB_OK then
      		rtn_code =3D message_box("error adding  record",
 	 		"remind for Win98", MB_ICONWARNING+MB_OK)
  		else
   			 rtn_code =3D message_box("added  record",
 			"remind for Win98", MB_ICONWARNING+MB_OK)
 		end if
 	end if
 	loadList()
=09

end procedure
setHandler( btnSave, w32HClick, routine_id("btnSave_onClick"))
--savedata_id=3Droutine_id("btnSave_onClick")
#EndProc

#Control: btnDel
AWindow : 5
X       : 152
Y       : 344
CX      : 40
CY      : 25
Title   : Del
Class   : PushButton
Enabled : 0
Checked : 0
Parent  :=20
PClass  :=20
Visible : 1
EnableC : 1
Style   : 0
TypStyle:=20
ExStyle : 0
TabOrder : 5
Local : 1

#Proc: onClick
procedure btnDel_onClick (integer self, integer event, sequence =
params)--params is ()
	integer junk, rec, f, key
	 rtn_code =3D message_box("Start delete ",
 			"remind for Win98", MB_ICONWARNING+MB_OK)
	 setText(dbText, xkey)
    f =3D db_find_key(xkey)
    if f >=3D 0 then
 	 	rtn_code =3D message_box("delete this record",
  		"remind for Win98", MB_ICONWARNING+MB_OK)
--  rec =3D db_record_data(key)
  			db_delete_record(xkey)
	else=09
	   	rtn_code =3D message_box("deleted  record",
 			"remind for Win98", MB_ICONWARNING+MB_OK)
 	end if
 	loadList()
	 	 rtn_code =3D message_box("Did loadlist ",
 			"remind for Win98", MB_ICONWARNING+MB_OK)
end procedure
setHandler( btnDel, w32HClick, routine_id("btnDel_onClick"))
#EndProc

#Window 2
#Control: PrWin
X       : 0
Y       : 0
CX      : 300
CY      : 210
Title   : Print Window=20
Class   : Window
Enabled : 0
Checked : 0
Parent  : MyWin
PClass  :=20
Visible : 1
BkColor : 0
EnableC : 1
Style   : 0
TypStyle:=20
ExStyle : 0
Local : 1

#Control: MenuP
AWindow : 1
X       : 0
Y       : 1
CX      : 0
CY      : 0
Title   : Menu Print
Class   : Menu
Enabled : 1
Checked : 0
Parent  :=20
PClass  :=20
Visible : 1
EnableC : 1
Style   : 0
TypStyle:=20
ExStyle : 0
Local : 1

#Control: PNow
AWindow : 1
X       : 0
Y       : 2
CX      : 0
CY      : 0
Title   : &A demo Page
Class   : MenuItem
Enabled : 1
Checked : 0
Parent  :=20
PClass  :=20
Visible : 1
EnableC : 1
Style   : 0
TypStyle:=20
ExStyle : 0
Local : 1


------=_NextPart_000_000B_01C2E9AC.CF2AA380--






-- 
Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu