#85716 - 2002-05-24 03:30 AM
Re: Paging Shawn... Need Crash Couse in KiXForms
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
Les
Yeah, sure can, in fact i've got the makings for one kicking around here somewhere, not totally done or anything, but a head start, download kixforms from here:
Kixforms
[im prob doing the same thing your doing - watching the leaf game - we be back online later!]
-Shawn
|
|
Top
|
|
|
|
#85717 - 2002-05-24 04:33 AM
Re: Paging Shawn... Need Crash Couse in KiXForms
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
Please forgive this script Les, its very crude and really doesn't do very much, it was just the start of an ini editor. i know your probably looking to build something different, designed more around your specific application, but its a head start for yeah:
code:
break on $filename = "@curdir\iniedit.ini" $form = createobject("kixtart.form") $form.caption = "IniEditor" $form.width = 640 $form.height = 480 $form.fontname = "verdana" $form.fontsize = 10 $file = $form.menu("File") $open = $file.menubutton("Open...","open_click") $exit = $file.menubutton("Exit","exit_click") $edit = $form.menu("Edit") $new = $edit.menu("New") $newkey = $new.menubutton("Key...","newkey_click") $newvalue = $new.menubutton("Value...","tkpickcolor()") $format = $form.menu("Format") $font = $format.menu("Font") $fontsml = $font.menubutton("Small","$$list.fontsize=8 $$view.fontsize=8") $fontmed = $font.menubutton("Medium","$$list.fontsize=12 $$view.fontsize=12") $fontbig = $font.menubutton("Large","$$list.fontsize=16 $$view.fontsize=16") $list = $form.listbox $list.height = $form.scaleheight-50 $list.width = $form.scalewidth/3 $list.onclick = "list_click" $view = $form.listbox $view.left = $list.right $view.height = $form.scaleheight-50 $view.width = $form.scalewidth-$list.width $view.onclick = "view_click" $form.scaleheight = $list.bottom+10 $form.show while $form.visible $=execute($form.doevents) loop exit 1 function list_click $section = $list.text $view.clear for each $key in split(readprofilestring($filename,"$section",""),chr(10)) if $key $value = readprofilestring($filename,"$section","$key") $string = $key + " = " + $value $view.additem($string) endif next endfunction function view_click ; $list.listindex = -1 ?"value=" $view.text endfunction function newkey_click $key = $form.inputbox("Enter a name for the new key:","New Key") if $key $list.additem($key) endif endfunction function open_click $filename = $form.showfileopen("%windir%\*.ini") if exist($filename) $list.clear $view.clear for each $section in split(readprofilestring($filename,"",""),chr(10)) if $section $list.additem($section) endif next $list.listindex = 0 $section = $list.text for each $key in split(readprofilestring($filename,"$section",""),chr(10)) if $key $value = readprofilestring($filename,"$section","$key") $string = $key + "=" + $value $view.additem($string) endif next endif endfunction function exit_click quit() endfunction function font_click $size = tkinputbox("Enter the font size","Font...") if @error = 0 and $size $view.fontsize = $size $list.fontsize = $size endif endfunction
-Shawn
p.s. Im still developing the inputbox method of the form object (see newkey_click) - it's not done yet - it displays the box but doesn't return the string (yet). If you need an Kixforms inputbox function, there a couple floating around on the board here. I'll dig it up...
-Shawn [ 24 May 2002, 04:40: Message edited by: Shawn ]
|
|
Top
|
|
|
|
#85719 - 2002-05-24 08:38 PM
Re: Paging Shawn... Need Crash Couse in KiXForms
|
Les
KiX Master
   
Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
|
|
|
Top
|
|
|
|
#85724 - 2002-06-08 04:46 AM
Re: Paging Shawn... Need Crash Couse in KiXForms
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
Ok, first get and re-register build 14 from here:
Kixforms Build 14
Then, here's the INI file, sorry for the long lines:
CART.INI
[startup]
caption = KiXtart Shopping Cart title = Shawn's Gross-out Restaurant and Cafe
[offers] Jello sushi = 4 Strawberry popsicle with ranch dressing = 1 Corn-dog covered with chocolate = 3 Lime jello with bacon bits = 2 Sausage milkshake = 2 Fudge bars with little bits of corn inside, topped with carrot shavings = 5 Chocolate-covered shrimp = 10 Magic-Shell-covered shrimp = 10 Cornflakes with catsup = 2 Omlette with marshmallow creme inside = 4 Taco with cherries in the meat sauce = 5 Chili with Junior Mints = 5 Starburst with garlic spread = 2 Carmel-coated lima beans = 3 Smores made with hamburger patties = 5 Vegemite = 1 Banana split with baked beans = 3 Spice cake with chicken lard = 4 Figs, ketchup, and steamed onions = 3 Candy corn smothered in barbeque sauce with fresh dill and mayonnaise = 5 Pickles and milk = 2 Tang and Quik = 2 Rice Krispie squares with ketchup = 3 Beef jerky with marshmallow creme = 5 Graham, cheese & saurkraut S'Mores = 6 Clam chowdah with Oreos = 7 Steak and Skittles = 8 Chicken McNuggets in chocolate sauce = 7 Fudge & oyster milkshake = 10 Brussel sprout tapioca pudding = 5 Tuna milkshake = 5 Peanut-butter and mayonnaise sandwich = 4 Tuna and toffee ice cream with hot chicken grissle fat sauce all packed in a taco shell filled with beef and goat cheese topped with sweet and sour sauce = 10 Donut and squid casserole = 8 Liver merangue pie = 8 Orbitz = 2 Cheese ravioli with rasins and chocolate sauce = 6 Jelly nachos = 3 Orange marmalade on Spam = 4 Hamburger topped with soy sauce, mayonnaise, and vanilla ice-cream (known affectionately as "The Booger Burger") = 10 Asparagus with grape jelly, skim milk, and chili powder = 5 Marshmallow creme in Ministrone soup = 5 Dates with crushed-up cheese-puffs, drenched in peppermint tea = 4 Cottage Cheese Ketchup soup, with fresh mint and chocolate chips = 5 A sandwich of mayonaisse and Cheetos between two thin-mint Girl Scout cookies = 5 Sauerkraut and tapioca pudding, topped with kidney beans = 6 Gazpacho Crunch ice cream = 4 A latte with shredded tuna = 5 Peach marmalade with anchovies = 3
And heres the code:
CART.KIX
code:
break on $profile = "@curdir\cart.ini" $form = createobject("kixtart.form") $form.top = 100 $form.left = 100 $form.width = 640 $form.height = 480 $form.caption = readprofilestring($profile,"startup","caption") $form.center $title = $form.label $title.left = 0 $title.top = 0 $title.width = $form.scalewidth $title.height = $form.scaleheight/10 $title.caption = readprofilestring("$profile","startup","title") $title.alignment = 2 ; centered $title.fontsize = 24 $title.backcolor = &00FF00 $offer = $form.listbox $offer.top = $title.bottom $offer.width = $form.scalewidth / 100 * 40 $offer.height = $form.scaleheight / 100 * 80 $offer.onclick = "offer_click()" for each $item in split(readprofilestring($profile,"offers",""),chr(10)) if $item $offer.additem($item) endif next $detail = $form.label $detail.top = $offer.bottom + 10 $detail.bottom = $form.scalewidth $detail.caption = "" $detail.width = $form.scalewidth $detail.fontsize = 12 $detail.fontbold = 1 $actions = $form.frame $actions.top = $offer.top $actions.left = $offer.right $actions.width = $form.scalewidth / 100 * 20 $actions.height = $offer.height $actions.caption = "Actions:" $buy = $actions.commandbutton $buy.height = $actions.height / 8 $buy.width = $actions.width $buy.caption = ">" $buy.onclick = "buy_click" $buyall = $actions.commandbutton $buyall.top = $buy.bottom $buyall.height = $actions.height / 8 $buyall.width = $actions.width $buyall.caption = ">>" $buyall.onclick = "buyall_click" $return = $actions.commandbutton $return.top = $buyall.bottom $return.height = $actions.height / 8 $return.width = $actions.width $return.caption = "<" $return.onclick = "return_click" $returnall = $actions.commandbutton $returnall.top = $return.bottom $returnall.height = $actions.height / 8 $returnall.width = $actions.width $returnall.caption = "<<" $returnall.onclick = "returnall_click" $amt=0 $amount = $actions.label $amount.top = $returnall.bottom $amount.height = $actions.height / 8 $amount.width = $actions.width $amount.alignment = 2 $amount.fontsize = 12 $amount.fontbold = 1 $amount.caption = "" $due = $actions.label $due.top = $amount.bottom $due.height = $actions.height / 8 $due.alignment = 2 $due.fontsize = 14 $due.fontbold = 1 $due.caption = "Amount Due $$$amt" $due.width = $actions.width $tbd = $actions.commandbutton $tbd.top = $due.bottom $tbd.width = $actions.width $tbd.height = $actions.height / 8 $tbd.caption = "TBD" $tbd.visible = 0 $exit = $actions.commandbutton $exit.top = $tbd.bottom $exit.width = $actions.width $exit.height = $actions.height / 8 $exit.caption = "Exit" $exit.onclick = 'exit_click()' $taken = $form.listbox() $taken.left = $actions.right $taken.top = $title.bottom $taken.width = $form.scalewidth / 10 * 4 $taken.height = $form.scaleheight / 100 * 80 $form.show while $form.visible $=execute($form.doevents) loop function offer_click() $price = readprofilestring($profile,"offers",$offer.text) $detail.caption = $offer.text + " - $$$price" endfunction function buy_click() if $offer.text $price = readprofilestring($profile,"offers",$offer.text) $taken.additem($offer.text) $offer.removeitem($offer.listindex) $detail.caption = $offer.text $amt = $amt + $price $due.caption = "Amount Due"+chr(10)+"$$$amt" $offer.listindex = 0 endif endfunction function buyall_click() for $i = 0 to $offer.listcount - 1 $offer.listindex = $i $price = readprofilestring($profile,"offers",$offer.text) $amt = $amt + $price $taken.additem($offer.text) next $offer.clear $taken.listindex = 0 $due.caption = "Amount Due"+chr(10)+"$$$amt" endfunction function return_click() if $taken.text $price = readprofilestring($profile,"offers",$taken.text) $offer.additem($taken.text) $taken.removeitem($taken.listindex) $amt = $amt - $price $due.caption = "Amount Due"+chr(10)+"$$$amt" $taken.listindex = 0 endif endfunction function returnall_click() for $i = 0 to $taken.listcount - 1 $taken.listindex = $i $price = readprofilestring($profile,"offers",$taken.text) $amt = $amt - $price $offer.additem($taken.text) next $taken.clear $offer.listindex = 0 $due.caption = "Amount Due"+chr(10)+"$$$amt" endfunction function exit_click() quit() endfunction
-Shawn
oi ! im going to go have a vegemite sandwich ! [ 08 June 2002, 04:49: Message edited by: Shawn ]
|
|
Top
|
|
|
|
#85725 - 2002-06-08 04:58 AM
Re: Paging Shawn... Need Crash Couse in KiXForms
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
Oh Les, in case your wondering about these lines:
$offer.width = $form.scalewidth / 100 * 40 $offer.height = $form.scaleheight / 100 * 80
Its an early attempt at building forms based on ratios, for example, the $offer listbox is 40% of the width of the form, and the height is 80% the height of the form. Plus, all the controls have lefts and tops that are relative to other controls - theory being that one can simply change the scale dimensions of the Form - and all the controls will resize and scale automatically - in theory anyways ![[Wink]](images/icons/wink.gif) [ 08 June 2002, 04:59: Message edited by: Shawn ]
|
|
Top
|
|
|
|
Moderator: Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart
|
0 registered
and 1003 anonymous users online.
|
|
|