|
|
|||||||
I am having trouble using the ObjectButton object in my script. I dont understand how to determine what option was chosen. Can Anyone offer advice? Thanks |
||||||||
|
|
|||||||
OptionButton ? something like this : break on $form = createobject("kixtart.form") $form.Caption = "OptionButton made easy ..." $opt1 = $form.OptionButton("Option 1",20,20,80,15) $opt2 = $form.OptionButton("Option 2",20,60,80,15) $opt3 = $form.OptionButton("Option 3",20,100,80,15) $Opt1.onclick = "Opt_CLick(1)" $Opt2.onclick = "Opt_CLick(2)" $Opt3.onclick = "Opt_CLick(3)" $Opt1.Value = True $lbl = $form.Label("Option 1 is selected",20,$Form.ClientHeight-20,$form.ClientWidth-40,15) $form.Show while $form.Visible $=execute($Form.DoEvents) loop exit 1 function Opt_Click($Opt) $lbl.Caption = "Option " + $Opt + " is selected" endfunction |
||||||||
|
|
|||||||
Great thanks for the help.. Would something like this work? Because I am doing something wrong I think. code:Select |
||||||||
|
|
|||||||
Definetly, as the OnClick Events are 'executed' in the DoEvents loop You should declare each Event before the Loop (Execute-able) hth J. |
||||||||
|
|
|||||||
You can't do this because the OnClick denotes an event that triggers the execution of the specified function. It is not a value. |
||||||||
|
|
|||||||
I just figured that out... ; ( Hmm.. well here is what I am trying to do. Use the optionbutton to get user input but not do anything other than set a variable until I click my execute button.. but I need to set a value based on what is selected in the optionbutton group. Can I do this? Thanks |
||||||||
|
|
|||||||
code:function Opt_Click($Opt) |
||||||||
|
|
|||||||
Ahh yes... I see... Dohh... Thanks as always for the help. |
||||||||
|
|
|||||||
Ok got the image working great.. now trying to use $Object.OnClick to open an html file.. cant seem to figure it out.. can anyone offer advice. |
||||||||
|
|
|||||||
Please show us your code. |
||||||||
|
|
|||||||
Cant get to it at the moment.. working on different machine. I will post it when I get back to my computer. Think something like this was my final attempt. code:Ahh could be the quotes because the path to the htm file has a space in it?$ImageList = $Form.ImageList Will post the real one when I get back to my computer. Thanks |
||||||||
|
|
|||||||
Austin .. take a look at PostPrep 1.0.1 ... especially the function for button 'Preview' |
||||||||
|
|
|||||||
Not sure I know what postprep is? I will search the board for it. Thanks |
||||||||
|
|
|||||||
PostPrep 1.0.1 - Update Release |
||||||||
|
|
|||||||
I think I see where you are going with this.. only trouble I might have is how to assigne the doc to open? Will play with it tonight. Thanks for the direction. |
||||||||
|
|
|||||||
Austin, If you look at my Signature you should see a couple of links to download the PostPrep 1.0.1 package. |
||||||||
|
|
|||||||
Ok got it.. code:Now I have another question in the same line. If I want to be able to double click an image and call a function but I dont want to use the toolbutton because I dont want it to look like a button.. is there a way to make it flat?Function HlpBtn_Click() Thanks |
||||||||
|
|
|||||||
That would be then the PictureBox() object ... sample : break on $form = createobject("Kixtart.form") $form.Caption = "PictureBox sample" $pic = $form.PictureBox $pic.Size = 256,256 $pic.Borderstyle = 0 $pic.Picture = "%SystemRoot%\Prairie Wind.bmp" $pic.OnClick = "$$x = $$form.msgbox('You clicked me !!!',Kixforms,64)" $pic.Center $form.Show while $form.Visible $=execute($Form.DoEvents) loop exit 1 Please note that the DoubleClick event was replaced by OnClick as it seems to happen that the event is not trapped within my latest build 38 J. |
||||||||
|
|
|||||||
I'm sorry... I can't click on YOU!!! right now. |
||||||||
|
|
|||||||
crap ... Shawn should release build 38 as soon as possible ! Each of my sample failed since i have a completely different version Or .... do you just kidding ? errg ... coffee break [ 26. February 2003, 08:29: Message edited by: jpols ] |
||||||||
|
|
|||||||
toolbutton is perfect too ( I use it everywhere) and it does not look like button when you set it's "flatstyle" property to 1 |
||||||||
|
|
|||||||
Works fine Jochen.. just pulling your leg. |
||||||||
|
|
|||||||
Right... I actually ended up using this code.. code:Problem was that I was using a single statement to declare everyting when using the picturebox like this:$ImageList2 = $fraDetails2.ImageList code:Reason it would not work is because I was chaning the picture in other cases in the script with the same call but I was having to redefine the $Image.OnDblClick.$Image = $fraDetails2.Image("$InstallDir\bang.bmp",$lblCHG.WIDTH + 10,$lblCHG.TOP - 2,15,15) Anyways the above code solved the problem. Thanks for the help.. |