Page 1 of 1 1
Topic Options
#85715 - 2002-05-24 02:24 AM Paging Shawn... Need Crash Couse in KiXForms
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Shawn,
I need a crash course in KiXForms. Could we do that Vulcan mind-meld thingie? What's the latest and where can I get it? Do you think I could use it to manage an INI file?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#85716 - 2002-05-24 03:30 AM Re: Paging Shawn... Need Crash Couse in KiXForms
Shawn Administrator Offline
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 Offline
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
#85718 - 2002-05-24 04:58 PM Re: Paging Shawn... Need Crash Couse in KiXForms
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Shawn,
Sorry I couldn't reply sooner. Got bumped off the PC at home last night, [Frown] and then today at work our internet was down and I got stuck with HelpDesk duty for a while. Boy, I never get this many calls if other systems are down. This internet must be mission critical stuff!

Will download and look at what you sent and get back at ya.

Thanks
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#85719 - 2002-05-24 08:38 PM Re: Paging Shawn... Need Crash Couse in KiXForms
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Shawn,
You sure know how to ruin a guy's weekend! I just printed out the KiXForms doc (59 pages). You know I'll have to read every page a dozen times for it to sink in. Then I'll have to get some time on the PC to try some of this stuff out.

Therein lies my problem. My wife has a new secret weapon. As if the HoneyDo list wasn't enough! She's taken on a 'project' and insists on first dibs to the one and only home PC. If it were my turn on-call, I could fake a page [Wink] and come in to work (play) [Big Grin] but she knows my schedule better than I do. Sounds like another 'Yeas Dear' weekend... [Frown]
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#85720 - 2002-05-24 08:52 PM Re: Paging Shawn... Need Crash Couse in KiXForms
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Time for a spousal PC. Mine is going to take a C++ programming course this summer and already announced that she'll have lots of homework. So I'm currently gutting obsolete computers to build something that's kind-of-usable.
_________________________
There are two types of vessels, submarines and targets.

Top
#85721 - 2002-06-08 02:14 AM Re: Paging Shawn... Need Crash Couse in KiXForms
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
bump to top

Shawn, a reminder about that other sample script (cart.kix) we discussed off-line? No big rush... I got busy with another script anyway.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#85722 - 2002-06-08 03:48 AM Re: Paging Shawn... Need Crash Couse in KiXForms
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Les - im with you buddy - let me take a quick look - hmmm, its here somewhere ... nope ... ahhh, nope ... ahhh here it is ! Your wanting I should posting it or you wanting I should mailing it ? (hehee)

-Shawn

Top
#85723 - 2002-06-08 04:11 AM Re: Paging Shawn... Need Crash Couse in KiXForms
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Sorry... yanked away.. ya know... HD list...

Either way matters not. I have access to both.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#85724 - 2002-06-08 04:46 AM Re: Paging Shawn... Need Crash Couse in KiXForms
Shawn Administrator Offline
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 Offline
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]

[ 08 June 2002, 04:59: Message edited by: Shawn ]

Top
#85726 - 2002-06-08 05:06 AM Re: Paging Shawn... Need Crash Couse in KiXForms
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Thanks for that Shawn. That should get me started.

One thing I noticed is that for me, @CurDir messes me up. I usally drag my script onto KIX32.EXE but then @CurDir returns C:\. @ScriptDir however works as expected.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#85727 - 2002-06-08 05:14 AM Re: Paging Shawn... Need Crash Couse in KiXForms
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Les, yeah sorry about that, this script is one of the first ones I did, from the early prototype, and I've since learned my lesson about @CURDIR ... so now I always try to use this:

$profile = ".\cart.ini"

Anything on the menu look especially appetizing tonight ? Kinda partial to the "Steak and Skittles" myself.

[ 08 June 2002, 05:29: Message edited by: Shawn ]

Top
#85728 - 2002-06-08 04:49 PM Re: Paging Shawn... Need Crash Couse in KiXForms
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
You left off the "Road Kill Surprise" [Razz]
Guess what it was and you get a second helping for free! [Big Grin]

Haven't had a chance to pop the hood on it yet. This darned HD list... Look forward to work on Monday where I can play.

I'm not sure why they call it "work"...
There's a saying about picking your career... "Choose something you enjoy and you'll never have to WORK a day in your life"

While it may not be entirely accurate, there are after all the days your mother told you about (who knew there'd be so many), it's close.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#85729 - 2002-06-09 04:00 AM Re: Paging Shawn... Need Crash Couse in KiXForms
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
heh.

some ppl play at work.
everyone can't...

but I'm glad that I can!

and now when got this little speedy net,nat and vpn working at home...
I can play as much as I like at weekends too!

Im so glad I don't have wife yet...
_________________________
!

download KiXnet

Top
#85730 - 2002-06-09 05:24 AM Re: Paging Shawn... Need Crash Couse in KiXForms
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
I envy you. I live in the bush and the best I can do is dialup at 26.4 Kbps. [Mad]
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#85731 - 2002-06-09 05:34 AM Re: Paging Shawn... Need Crash Couse in KiXForms
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
mmm...
it is good speed!
don't envy me, I bought only 100Mb line to home.
didn't have money to better one as I'm poor!
_________________________
!

download KiXnet

Top
#85732 - 2002-06-09 05:36 AM Re: Paging Shawn... Need Crash Couse in KiXForms
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Les, you some kind of high-tech Jerimiah Johnson ? (heheh)
Top
#85733 - 2002-06-09 03:47 PM Re: Paging Shawn... Need Crash Couse in KiXForms
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
No mountain scapes or cows to poke here. Just flat land covered in a dense thicket of new growth tag alder, poplar, ash, birch and cedar.

Well except for a few acres around my house where there's just enough room between the trees to weave my lawnmower (hand job) between.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
Page 1 of 1 1


Moderator:  Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1003 anonymous users online.
Newest Members
StuTheCoder, M_Moore, BeeEm, min_seow, Audio
17884 Registered Users

Generated in 0.072 seconds in which 0.026 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org