Re: Highlighting a line in a data grid
Posted: Tue Aug 27, 2013 10:00 pm
there is no code in the button
Questions and answers about the LiveCode platform.
https://forums.livecode.com/
Code: Select all
global thecompound
on preOpenstack
put empty into thecompound
end preOpenstack
on cCompoundinfo
//highlight the correct line
-- select the line thecompound in group "compound info"
-- find the lineIndex of thecompound in group "compound info"
-- put the lineIndex of me into compoundline
-- set the hilitedLine of group "compound info" to thecompound
-- get lineIndex of thecompound of group "compound info"
set the dgHilitedIndex of group "compound info" to 1
//get the line
put the dgHilitedLines of group "compound info" into compoundline
//takes the data of that line and splits it into the right columns
put the dgDataOfLine[compoundLine] of group "compound info" into compoundData
//then it take the data from the right column and puts it into the appropriate field
put compoundData["real name"] into field "name box"
put compoundData["hybrid"] into field "hybrid box"
put compoundData["geo"] into field "geo box"
put compoundData["pol"] into field "pole box"
put compoundData["rez"] into field "rez box"
end cCompoundinfoCode: Select all
global thecompound
on preOpenstack
put empty into thecompound
end preOpenstack
on cCompoundinfo
//highlight the correct line
-- select the line thecompound in group "compound info"
-- find the lineIndex of thecompound in group "compound info"
-- put the lineIndex of me into compoundline
-- set the hilitedLine of group "compound info" to thecompound
-- get lineIndex of thecompound of group "compound info"
set the dgHilitedIndex of group "compound info" to 1
//get the data of the line
put the dgHilitedLines of group "compound info" into compoundline
//takes the data of that line and splits it into the right columns
put the dgDataOfLine[compoundLine] of group "compound info" into compoundData
//then it take the data from the right column and puts it into the appropriate field
put compoundData["real name"] into field "name box"
put compoundData["hybrid"] into field "hybrid box"
put compoundData["geo"] into field "geo box"
put compoundData["pol"] into field "pole box"
put compoundData["rez"] into field "rez box"
end cCompoundinfo
on cBuildcompound
select line thecompound of group "compound builder"
//takes the highlited lines of the field and puts it into a variable
put the dgHilitedLines of group "compound builder" into buildLine
//takes the data of that line and splits it into the right columns
put the dgDataOfLine[buildLine] of group "compound builder" into buildData
//puts the info into the right location
put buildData["center"] into field "box 5"
if buildData["box 1 element"] is empty
then hide field "box 1"
else
put buildData["box 1 element"] into field "box 1"
end if
if buildData["box 2 element"] is empty
then hide field "box 2"
else
put buildData["box 2 element"] into field "box 2"
end if
if buildData["box 3 element"] is empty
then hide field "box 3"
else
put buildData["box 3 element"] into field "box 3"
end if
if buildData["box 4 element"] is empty
then hide field "box 4"
else
put buildData["box 4 element"] into field "box 4"
end if
if buildData["box 6 element"] is empty
then hide field "box 6"
else
put buildData["box 6 element"] into field "box 6"
end if
if buildData["box 7 element"] is empty
then hide field "box 7"
else
put buildData["box 7 element"] into field "box 7"
end if
if buildData["box 8 element"] is empty
then hide field "box 8"
else
put buildData["box 8 element"] into field "box 8"
end if
if buildData["box 9 element"] is empty
then hide field "box 9"
else
put buildData["box 9 element"] into field "box 9"
end if
if buildData["bond 1"] is empty
then hide field "bond 1"
else
put buildData["bond 1"] into field "bond 1"
end if
if buildData["bond 2"] is empty
then hide field "bond 2"
else
put buildData["bond 2"] into field "bond 2"
end if
if buildData["bond 3"] is empty
then hide field "bond 3"
else
put buildData["bond 3"] into field "bond 3"
end if
if buildData["bond 4"] is empty
then hide field "bond 4"
else
put buildData["bond 4"] into field "bond 4"
end if
if buildData["bond 5"] is empty
then hide field "bond 5"
else
put buildData["bond 5"] into field "bond 5"
end if
if buildData["bond 6"] is empty
then hide field "bond 6"
else
put buildData["bond 6"] into field "bond 6"
end if
if buildData["bond 7"] is empty
then hide field "bond 7"
else
put buildData["bond 7"] into field "bond 7"
end if
if buildData["bond 8"] is empty
then hide field "bond 8"
else
put buildData["bond 8"] into field "bond 8"
end if
end cBuildcompound
on cBuildrezcompound
//check for the compound and highlight the line
select line thecompound of group "compound builder"
//takes the highlited lines of the field and puts it into a variable
put the dgHilitedLines of group "compound builder" into buildrezLine
//takes the data of that line and splits it into the right columns
put the dgDataOfLine[buildrezLine] of group "compound builder" into buildrezData
//puts the info into the right location
put buildrezData["rez center"] into field "rez box 5"
if buildrezData["rez box 1 element"] is empty
then hide field "rez box 1"
else
put buildData["rez box 1 element"] into field "rez box 1"
end if
if buildrezData["rez box 2 element"] is empty
then hide field "rez box 2"
else
put buildData["rez box 2 element"] into field "rez box 2"
end if
if buildrezData["rez box 3 element"] is empty
then hide field "rez box 3"
else
put buildData["rez box 3 element"] into field "rez box 3"
end if
if buildrezData["rez box 4 element"] is empty
then hide field "rez box 4"
else
put buildData["rez box 4 element"] into field "rez box 4"
end if
if buildrezData["rez box 6 element"] is empty
then hide field "rez box 6"
else
put buildData["rez box 6 element"] into field "rez box 6"
end if
if buildrezData["rez box 7 element"] is empty
then hide field "rez box 7"
else
put buildData["rez box 7 element"] into field "rez box 7"
end if
if buildrezData["rez box 8 element"] is empty
then hide field "rez box 8"
else
put buildData["rez box 8 element"] into field "rez box 8"
end if
if buildrezData["rez box 9 element"] is empty
then hide field "rez box 9"
else
put buildData["rez box 9 element"] into field "rez box 9"
end if
if buildData["rez bond 1"] is empty
then hide field "rez bond 1"
else
put buildData["rez bond 1"] into field "rez bond 1"
end if
if buildData["rez bond 2"] is empty
then hide field "rez bond 2"
else
put buildData["rez bond 2"] into field "rez bond 2"
end if
if buildData["rez bond 3"] is empty
then hide field "rez bond 3"
else
put buildData["rez bond 3"] into field "rez bond 3"
end if
if buildData["rez bond 4"] is empty
then hide field "rez bond 4"
else
put buildData["rez bond 4"] into field "rez bond 4"
end if
if buildData["rez bond 5"] is empty
then hide field "rez bond 5"
else
put buildData["rez bond 5"] into field "rez bond 5"
end if
if buildData["rez bond 6"] is empty
then hide field "rez bond 6"
else
put buildData["rez bond 6"] into field "rez bond 6"
end if
if buildData["rez bond 7"] is empty
then hide field "rez bond 7"
else
put buildData["rez bond 7"] into field "rez bond 7"
end if
if buildData["rez bond 8"] is empty
then hide field "rez bond 8"
else
put buildData["rez bond 8"] into field "rez bond 8"
end if
end cBuildrezcompound
I don't know what you are referring to?ok none of the code you sent me is there