#161398 - 2006-05-01 02:23 AM
dynamically creating checkboxes
|
Gilrim
Fresh Scripter
Registered: 2005-07-19
Posts: 20
|
I'm loading a serverlist from a csv (see this thread), and need to create checkboxes from an array called $serverGroups. I've tried something like this: Code:
CreateCheckboxes($serverGroups) Function CreateCheckboxes($boxes) For Each $item In $boxes logLine($item) execute ('$$item = $Form.Controls.CheckBox()') execute ('$$item.CheckState = 0') execute ('$$item.Left = 12') execute ('$$item.Text = "$item"') execute ('$$item.Top = 150') execute ('$$item.OnClick = logLine("blah")') Next EndFunction
but that doesn't quite do it :P
any suggestions?
|
|
Top
|
|
|
|
#161399 - 2006-05-01 03:29 AM
Re: dynamically creating checkboxes
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
Ok, you asked for it you got it ...
Code:
Function CreateCheckboxes($boxes) $Top = 10 For Each $item In $boxes $=Execute('$$$item = $$Form.Controls.CheckBox()') $=Execute('$$$item.CheckState = 0') $=Execute('$$$item.Left = 12') $=Execute('$$$item.Text = "$item"') $=Execute('$$$item.Top = $Top') $=Execute('$$$item.OnClick = "logLine('+"'"+'blah'+"'"+')"') $Top = $Top + 30 Next EndFunction
|
|
Top
|
|
|
|
#161407 - 2006-05-02 10:13 AM
Re: dynamically creating checkboxes
|
Gilrim
Fresh Scripter
Registered: 2005-07-19
Posts: 20
|
Your right as to what I'm attempting to do. Thing is though, the output from this script is to be used as a QuickLaunch menu, aligned to the very edge of the menu. This gives you a menu with pretty much the same functionality as the start menu. That is: each group of servers will make one directory, containing it's respective server-rdp files. Should look something like this:

thus it would make more sense to allow each admin to select groups of servers to be generated, than selecting each server specifically (the list would be *long*).
I'm gonna have a shot at the generating of checkboxes in a little while, and report back on how that works out. (Btw: when it's done I could post the full script somewhere if it's of any use?)
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 1046 anonymous users online.
|
|
|