EverZen
03-20-2008, 02:37 PM
Hi Guys,
I hvae been slowly making some quike exciting progress implementing some .NET UI stuff. I am currently trying to replace a standard Max multiListBox with a much more functional Listview with a couple of columns of checkboxes to turn different features on and off.
Now to get these additional columns of checkboxes (see picture attached) do I still want to be working with a ListView, or would another type of UI Element be more appropriate? I have the functionality for the checkboxes on the left working nicely. But these are native to the List View, by setting the "ListView.checkboxes = true" property.
Is it hard to add information/checkboxes to additional Listview columns? Or am I going about it in the wrong way....
Any advice/examples would be really helpful...
I have included the code that I have developed so far for others that are trying to learn. I am utterly new to this, and these lines of code are heavily inspired by a lot of the more advanced members of this forum. Cheers guys :)
Local lvItems = #("Bob","Ben","Bill","Fred","Sally") --Some random Names for the ListView
dotNetControl lv "System.Windows.Forms.ListView" width:152 height:275 pos:[4,44]
fn ListViewProcess =
(
lv.checkboxes = true --Enable Checkboxes in the listview (down the left hand side)
lv.Columns.add "Col1" 100 --Add a Column
lv.Columns.add "Col2" 50 -- Add another Column
lv.View = (dotNetClass "System.Windows.Forms.View").Details -- Allow Grid layout
--Setup Custom Images and add them to the Image List to represent the checkbox states
CustomImageList = dotnetObject "System.Windows.Forms.ImageList"
CustImageUI = dotNetClass "System.Drawing.Image"
CustomImageList.Images.Add(CustImageUI.FromFile "C:\UnCheckedImage.jpg")
CustomImageList.Images.Add(CustImageUI.FromFile "C:\CheckedImage.jpg")
ListNo = lvItems.count
theRange = #()
for i = 1 to Listno do
(
li = dotNetObject "System.Windows.Forms.ListViewItem" lvItems[i]
append theRange li --Create and create the Listview Items
)--End of for
lv.Items.AddRange theRange --Add them to the ListView
lv.stateimagelist = CustomImageList --Set the Checkbox images in the ListView to our CustomImages
)--End of function ListViewProcess
Thanks for your time everyone :)
Rich
I hvae been slowly making some quike exciting progress implementing some .NET UI stuff. I am currently trying to replace a standard Max multiListBox with a much more functional Listview with a couple of columns of checkboxes to turn different features on and off.
Now to get these additional columns of checkboxes (see picture attached) do I still want to be working with a ListView, or would another type of UI Element be more appropriate? I have the functionality for the checkboxes on the left working nicely. But these are native to the List View, by setting the "ListView.checkboxes = true" property.
Is it hard to add information/checkboxes to additional Listview columns? Or am I going about it in the wrong way....
Any advice/examples would be really helpful...
I have included the code that I have developed so far for others that are trying to learn. I am utterly new to this, and these lines of code are heavily inspired by a lot of the more advanced members of this forum. Cheers guys :)
Local lvItems = #("Bob","Ben","Bill","Fred","Sally") --Some random Names for the ListView
dotNetControl lv "System.Windows.Forms.ListView" width:152 height:275 pos:[4,44]
fn ListViewProcess =
(
lv.checkboxes = true --Enable Checkboxes in the listview (down the left hand side)
lv.Columns.add "Col1" 100 --Add a Column
lv.Columns.add "Col2" 50 -- Add another Column
lv.View = (dotNetClass "System.Windows.Forms.View").Details -- Allow Grid layout
--Setup Custom Images and add them to the Image List to represent the checkbox states
CustomImageList = dotnetObject "System.Windows.Forms.ImageList"
CustImageUI = dotNetClass "System.Drawing.Image"
CustomImageList.Images.Add(CustImageUI.FromFile "C:\UnCheckedImage.jpg")
CustomImageList.Images.Add(CustImageUI.FromFile "C:\CheckedImage.jpg")
ListNo = lvItems.count
theRange = #()
for i = 1 to Listno do
(
li = dotNetObject "System.Windows.Forms.ListViewItem" lvItems[i]
append theRange li --Create and create the Listview Items
)--End of for
lv.Items.AddRange theRange --Add them to the ListView
lv.stateimagelist = CustomImageList --Set the Checkbox images in the ListView to our CustomImages
)--End of function ListViewProcess
Thanks for your time everyone :)
Rich
