View Full Version : help with button ???
mitologys
08-28-2004, 06:55 PM
i want to make a cd that let´s people install what they like, using checkbox´s
for the job.
so i made this that dos not work
[checkbox1]
onclik
result1 = Button.GetState("checkbox1");
[checkbox2]
onclik
result2 = Button.GetState("checkbox2");
.
.
.
.
.
.
and so on......
with a button that makes the final instalation
[install]
onclik
if ( result1 ~= 1 ) then
File.Run("AutoPlay\\Docs\\program1", "", "", SW_SHOWNORMAL, true);
end
if ( result2 ~= 1 ) then
File.Run("AutoPlay\\Docs\\program2", "", "", SW_SHOWNORMAL, true);
end
.
.
.
.
.
.
.
So, can anyone give me a hand ?? thank you
Here is one way you can do it:
First, get rid of the code that you have on the On Click event of each of the checkboxes.
Then, in the On Click event of your ‘Install’ button, try code like this:
result1 = Button.GetState("checkbox1");
if result1 > 0 then
File.Run("AutoPlay\\Docs\\program1", "", "", SW_SHOWNORMAL, true);
end
result2 = Button.GetState("checkbox2");
if result2 > 0 then
File.Run("AutoPlay\\Docs\\program2", "", "", SW_SHOWNORMAL, true);
end
Hope that helps.
Mythwyn
08-29-2004, 02:00 PM
I have a virus removal tool that offers 10 programs, this is the script for the first 3. Each button has 3 states and are toggle enabled.
The individual buttons have no [on click] actions, but on the last button (run selected tools) has the
following [on click] actions. It checks the application buttons to see if toggle is up or down state.
the depending on the state of each runs them in sequence, waiting for each to finish. I have a check
image appear after each app has run. Close to JimS's and you could replace buttons with checkboxes.
I did mine this way for organizing reasons.
Button1State = Button.GetState("Button1");
Button2State = Button.GetState("Button2");
Button3State = Button.GetState("Button3");
--Starter Actions
if (Button1State == BTN_DOWN) then
File.Run("AutoPlay\\Docs\\STARTER\\Starter.exe", "", "AutoPlay\\Docs\\STARTER", SW_SHOWNORMAL, true);
Image.SetVisible("Check1", true);
end
--Avert Actions
if (Button2State == BTN_DOWN) then
File.Run("AutoPlay\\Docs\\AVERT\\scan.exe", "/AD /ALL /SUB /UNZIP /WINMEM", "AutoPlay\\Docs\\AVERT", SW_SHOWNORMAL, true);
Image.SetVisible("Check2", true);
end
--Trend Actions
if (Button3State == BTN_DOWN) then
File.Run("AutoPlay\\Docs\\TREND\\sysclean.exe", "", "AutoPlay\\Docs\\TREND", SW_SHOWNORMAL, true);
Image.SetVisible("Check3", true);
end
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.