Here is an example of how to use a function with a nested loop to "get" the cells value, pass it with its cell location to a function that sets colors based on what it is.
-- this is found toward the beginning of the wizard file, as it has to have been recognized and read before it can be called
function setcolors(rating,r,c)
if (rating == "R") then
LumberChartGrid:SetCellBackgroundColour(r, c, wx.wxColour(35,170,35))--green
elseif (rating == "N") then
LumberChartGrid:SetCellBackgroundColour(r, c, wx.wxColour(240,240,100))--yellow
elseif (rating == "E") then
LumberChartGrid:SetCellBackgroundColour(r, c, wx.wxColour(240,0,0))--red
elseif (rating == "G") then
LumberChartGrid:SetCellBackgroundColour(r, c, wx.wxColour(240,240,100))--yellow
elseif (rating == "F") then
LumberChartGrid:SetCellBackgroundColour(r, c, wx.wxColour(35,170,35))--green
elseif (rating == "P") then
LumberChartGrid:SetCellBackgroundColour(r, c, wx.wxColour(100,230,230))--cyan
elseif (rating == "Weak") then
LumberChartGrid:SetCellTextColour(r, c, wx.wxColour(100,230,230))
elseif (rating == "Light") then
LumberChartGrid:SetCellTextColour(r, c, wx.wxColour(35,170,35))
elseif (rating == "Medium") then
LumberChartGrid:SetCellTextColour(r, c, wx.wxColour(150,150,150))
elseif (rating == "Soft") then
LumberChartGrid:SetCellTextColour(r, c, wx.wxColour(140,240,100))
elseif (rating == "Strong") then
LumberChartGrid:SetCellTextColour(r, c, wx.wxColour(240,140,100))
elseif (rating == "Hard") then
LumberChartGrid:SetCellTextColour(r, c, wx.wxColour(0,0,0))--black
elseif (rating == "Heavy") then
LumberChartGrid:SetCellTextColour(r, c, wx.wxColour(240,0,0))--red
end
end
function getcolors()
local rownum = 0
local colnum = 0
local rating = "Ya-Nvr-No"
for rownum = 0, 20 do --Loop through 21 rows
for colnum = 2, 16 do --Loop through 15 columns
local rating = LumberChartGrid:GetCellValue(rownum, colnum)
setcolors(rating,rownum,colnum) -- set the color
end
end
end
--and then this will call the feature so I can use it at load and during editing
getcolors()