grabjacket
06-30-2008, 11:44 AM
Hi,
I'm having trouble implementing a script across my company. The script uses a .NET listview with two columns and N rows. The first row of cells has no text but just a backgroundcolor. The second row has a name in it and has no color. When i run the same script on different computers some don't show these colors. The functions work just fine, but the colors don't show up in the interface. It's all on max2008 btw. The computers not showing the colors are always the same and don't have some distinct feature switched on or off as far as i know.
Here's a piece of the code
(
try(destroyDialog theWhatsMyNameRollout)catch()
global theWhatsMyNameRollout
--the list of names
local nameListArray = #("glas","vloer","rollaag","trasraam","Script by Klaas","wand")
--initialize the listView
function fn_initListview lv =
(
lv.columns.add "" 16 --the color column
lv.columns.add "" 80 --the name column
lv.View = (dotNetClass "System.Windows.Forms.View").Details
lv.HeaderStyle = lv.Headerstyle.none --i don't want to see the columnheader
)
--populate the listview
function fn_populateListview names lv =
(
local theItemArray = #()
for o in names do
(
--the first item is the color
theItem = dotNetObject "listViewItem" ""
theItem.UseItemStyleForSubItems = false--don't use colors of the main item in the subitem
--the subItem hold the actual name
theItem.subItems.add o
----here i'm applying the color. these colors don't display on every computer
theColor = random white black
theItem.backColor = (dotNetClass "System.Drawing.Color").fromARGB theColor.r theColor.g theColor.b
append theItemArray theItem
)
lv.items.addrange theItemArray
)
rollout theWhatsMyNameRollout "whatsmyname"
(
dotNetControl lvNameList "System.Windows.Forms.ListView" width:100 height:100 offset:[-11,0]--pos:[2,35]
--init and populate the list when the rollout opens
on theWhatsMyNameRollout open do
(
theWhatsMyNameRollout.height = (lvNameList.height + 10)
fn_initListview lvNameList
fn_populateListview nameListArray lvNameList
)
)
createDialog theWhatsMyNameRollout 105 10
)
So, is there an option or property in the listview i have to turn on to get consistent results? Or is there a max option which influences the display of these colors? I've got no idea why one computer is different than the other (when running this script).
Klaas
I'm having trouble implementing a script across my company. The script uses a .NET listview with two columns and N rows. The first row of cells has no text but just a backgroundcolor. The second row has a name in it and has no color. When i run the same script on different computers some don't show these colors. The functions work just fine, but the colors don't show up in the interface. It's all on max2008 btw. The computers not showing the colors are always the same and don't have some distinct feature switched on or off as far as i know.
Here's a piece of the code
(
try(destroyDialog theWhatsMyNameRollout)catch()
global theWhatsMyNameRollout
--the list of names
local nameListArray = #("glas","vloer","rollaag","trasraam","Script by Klaas","wand")
--initialize the listView
function fn_initListview lv =
(
lv.columns.add "" 16 --the color column
lv.columns.add "" 80 --the name column
lv.View = (dotNetClass "System.Windows.Forms.View").Details
lv.HeaderStyle = lv.Headerstyle.none --i don't want to see the columnheader
)
--populate the listview
function fn_populateListview names lv =
(
local theItemArray = #()
for o in names do
(
--the first item is the color
theItem = dotNetObject "listViewItem" ""
theItem.UseItemStyleForSubItems = false--don't use colors of the main item in the subitem
--the subItem hold the actual name
theItem.subItems.add o
----here i'm applying the color. these colors don't display on every computer
theColor = random white black
theItem.backColor = (dotNetClass "System.Drawing.Color").fromARGB theColor.r theColor.g theColor.b
append theItemArray theItem
)
lv.items.addrange theItemArray
)
rollout theWhatsMyNameRollout "whatsmyname"
(
dotNetControl lvNameList "System.Windows.Forms.ListView" width:100 height:100 offset:[-11,0]--pos:[2,35]
--init and populate the list when the rollout opens
on theWhatsMyNameRollout open do
(
theWhatsMyNameRollout.height = (lvNameList.height + 10)
fn_initListview lvNameList
fn_populateListview nameListArray lvNameList
)
)
createDialog theWhatsMyNameRollout 105 10
)
So, is there an option or property in the listview i have to turn on to get consistent results? Or is there a max option which influences the display of these colors? I've got no idea why one computer is different than the other (when running this script).
Klaas
