importing pictures into a data grid
Posted: Sat Mar 08, 2014 11:10 pm
Hello,
I am wrestling with importing a picture into a thumbnail of a data grid. The user would take a picture the app imports the view in to the app. The user then types a description and other data then saves it. The save button saves the info to a text file. Upon going to the data grid the data grid loads and displays the contents of the file. I can populate all of the text fields but not the image.
on FillInData pDataArray
set the text of field "EntryDate" of me to pDataArray["Date"]
set the text of field "lon" of me to pDataArray["Ion"]
set the text of field "lat" of me to pDataArray["lat"]
set the text of field "Category" of me to pDataArray["category"]
set the text of field "ItemName" of me to pDataArray["itemname"]
set the text of field "ItemDesc" of me to pDataArray["ItemDesc"]
set the hilited of button "save location" of me to (pDataArray["saveLoc"] is "true")
set the hilited of button "HIgh Rank" of me to (pDataArray["High"] is "true")
set the hilited of button "Med Rank" of me to (pDataArray["Med"] is "true")
set the hilited of button "Low Rank" of me to (pDataArray["Low"] is "true")
set the text of field "Seq Numb" of me to pDataArray["SeqNumb"]
set the text of image "itemimage"of me to pDataArray["picture"]
end FillInData
The Show Item Detail is:
on ShowItemDetail
global gSeqNumb
go to card "ItemEntry"
set itemDel to tab
put url ("file:" & specialFolderPath("documents") & "/ItemList.txt") into tItem
repeat with x = 1 to the number of lines in tItem
if item 1 of line x of tItem is gSeqNumb then
set the text of field "ItemName" to item 2 of line x of tItem
set the text of field "itemDesc" to item 3 of line x of tItem
set the text of field "Category" to item 5 of line x of tItem
set the text of field "EntryDate" to item 4 of line x of tItem
set the text of field "lat" to item 6 of line x of tItem
set the text of field "lon" to item 7 of line x of tItem
set the text of field "ItemImage" to item 8 of line x of tItem
if item 9 of line x of tItem is "true" then
set the hilited of button "high rank" to "true"
else set the hilited of button "high rank" to "false"
if item 10 of line x of tItem is "True" then
set the hilited of button "Med rank" to "True"
else set the hilited of button "med rank" to "false"
if item 11 of line x of tItem is "True" then
set the hilited of button "low rank" to "true"
else set the hilited of button "low rank" to "false"
if item 12of line x of tItem is "True" then
set the hilited of button "save location" to "true"
else set the hilited of button "save location" to "false"
end if
end repeat
end ShowItemDetail
I am unable to get the item to display. Iv'e tried so many ways I have confused myself.
Thank you
Ty
I am wrestling with importing a picture into a thumbnail of a data grid. The user would take a picture the app imports the view in to the app. The user then types a description and other data then saves it. The save button saves the info to a text file. Upon going to the data grid the data grid loads and displays the contents of the file. I can populate all of the text fields but not the image.
on FillInData pDataArray
set the text of field "EntryDate" of me to pDataArray["Date"]
set the text of field "lon" of me to pDataArray["Ion"]
set the text of field "lat" of me to pDataArray["lat"]
set the text of field "Category" of me to pDataArray["category"]
set the text of field "ItemName" of me to pDataArray["itemname"]
set the text of field "ItemDesc" of me to pDataArray["ItemDesc"]
set the hilited of button "save location" of me to (pDataArray["saveLoc"] is "true")
set the hilited of button "HIgh Rank" of me to (pDataArray["High"] is "true")
set the hilited of button "Med Rank" of me to (pDataArray["Med"] is "true")
set the hilited of button "Low Rank" of me to (pDataArray["Low"] is "true")
set the text of field "Seq Numb" of me to pDataArray["SeqNumb"]
set the text of image "itemimage"of me to pDataArray["picture"]
end FillInData
The Show Item Detail is:
on ShowItemDetail
global gSeqNumb
go to card "ItemEntry"
set itemDel to tab
put url ("file:" & specialFolderPath("documents") & "/ItemList.txt") into tItem
repeat with x = 1 to the number of lines in tItem
if item 1 of line x of tItem is gSeqNumb then
set the text of field "ItemName" to item 2 of line x of tItem
set the text of field "itemDesc" to item 3 of line x of tItem
set the text of field "Category" to item 5 of line x of tItem
set the text of field "EntryDate" to item 4 of line x of tItem
set the text of field "lat" to item 6 of line x of tItem
set the text of field "lon" to item 7 of line x of tItem
set the text of field "ItemImage" to item 8 of line x of tItem
if item 9 of line x of tItem is "true" then
set the hilited of button "high rank" to "true"
else set the hilited of button "high rank" to "false"
if item 10 of line x of tItem is "True" then
set the hilited of button "Med rank" to "True"
else set the hilited of button "med rank" to "false"
if item 11 of line x of tItem is "True" then
set the hilited of button "low rank" to "true"
else set the hilited of button "low rank" to "false"
if item 12of line x of tItem is "True" then
set the hilited of button "save location" to "true"
else set the hilited of button "save location" to "false"
end if
end repeat
end ShowItemDetail
I am unable to get the item to display. Iv'e tried so many ways I have confused myself.
Thank you
Ty