#91498 - 2003-02-17 08:26 PM
ObjectButton
|
Austin
Seasoned Scripter
Registered: 2002-01-24
Posts: 439
|
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
_________________________
Austin Henderson
|
Top
|
|
|
|
#91499 - 2003-02-17 08:37 PM
Re: ObjectButton
|
Jochen
KiX Supporter
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
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
_________________________
|
Top
|
|
|
|
#91500 - 2003-02-17 09:19 PM
Re: ObjectButton
|
Austin
Seasoned Scripter
Registered: 2002-01-24
Posts: 439
|
Great thanks for the help..
Would something like this work? Because I am doing something wrong I think.
code:
Select Case $Opt1.OnClick $Choice = 1 Case $Opt2.OnClick $Choice = 2 Case $Opt3.OnClick $Choice = 3 Case $Opt4.OnClick $Choice = 4 $UsrDB = $txtDBName.Text EndSelect
_________________________
Austin Henderson
|
Top
|
|
|
|
#91503 - 2003-02-17 09:37 PM
Re: ObjectButton
|
Austin
Seasoned Scripter
Registered: 2002-01-24
Posts: 439
|
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
_________________________
Austin Henderson
|
Top
|
|
|
|
#91505 - 2003-02-18 12:07 AM
Re: ObjectButton
|
Austin
Seasoned Scripter
Registered: 2002-01-24
Posts: 439
|
Ahh yes... I see... Dohh...
Thanks as always for the help.
_________________________
Austin Henderson
|
Top
|
|
|
|
#91506 - 2003-02-25 11:32 PM
Re: ObjectButton
|
Austin
Seasoned Scripter
Registered: 2002-01-24
Posts: 439
|
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.
_________________________
Austin Henderson
|
Top
|
|
|
|
#91508 - 2003-02-25 11:41 PM
Re: ObjectButton
|
Austin
Seasoned Scripter
Registered: 2002-01-24
Posts: 439
|
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:
$ImageList = $Form.ImageList $ImageList.ImageSize = 14,14 $ImageList.Images.Add("$InstallDir\help.bmp") $HLPButton = $Form.ToolButton $HLPButton.Size = 21,21 $HLPButton.Top = 2 $HLPButton.Icon = $ImageList.Images(0) $HLPButton.Left = $lblprocessA.Left + $lblprocessA.WIDTH + 2 $HLPButton.OnClick = "Run $InstPath\help.htm"
Ahh could be the quotes because the path to the htm file has a space in it?
Will post the real one when I get back to my computer.
Thanks
_________________________
Austin Henderson
|
Top
|
|
|
|
#91510 - 2003-02-25 11:44 PM
Re: ObjectButton
|
Austin
Seasoned Scripter
Registered: 2002-01-24
Posts: 439
|
Not sure I know what postprep is? I will search the board for it.
Thanks
_________________________
Austin Henderson
|
Top
|
|
|
|
#91511 - 2003-02-25 11:47 PM
Re: ObjectButton
|
Jochen
KiX Supporter
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
|
Top
|
|
|
|
#91512 - 2003-02-25 11:48 PM
Re: ObjectButton
|
Austin
Seasoned Scripter
Registered: 2002-01-24
Posts: 439
|
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 Henderson
|
Top
|
|
|
|
#91513 - 2003-02-26 01:51 AM
Re: ObjectButton
|
NTDOC
Administrator
Registered: 2000-07-28
Posts: 11623
Loc: CA
|
Austin,
If you look at my Signature you should see a couple of links to download the PostPrep 1.0.1 package.
|
Top
|
|
|
|
#91514 - 2003-02-26 04:01 AM
Re: ObjectButton
|
Austin
Seasoned Scripter
Registered: 2002-01-24
Posts: 439
|
Ok got it.. code:
Function HlpBtn_Click() Dim $ie,$doc,$f,$t $ie = CreateObject("internetexplorer.application") $ie.addressbar=0 $ie.menubar=0 $ie.toolbar=0 $ie.statusbar=0 $ie.navigate("$InstallDir\Help.htm") $ie.visible=1 $Silent = SetFocus("PassSync Help Version $Build") While $ie.visible Sleep 0.1 Loop Exit EndFunction
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?
Thanks
_________________________
Austin Henderson
|
Top
|
|
|
|
#91517 - 2003-02-26 08:27 AM
Re: ObjectButton
|
Jochen
KiX Supporter
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
|
Top
|
|
|
|
Moderator: Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart
|
1 registered
(Allen)
and 466 anonymous users online.
|
|
|