dgHilitedLine Function
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 17
- Joined: Sat Aug 10, 2013 3:23 pm
dgHilitedLine Function
Hi,
I am having a problem with this function. I managed to place my images in a datagrid, but the images are not displayed as thumbnails, they are just the various jpg file name. I am trying to use this function, so that when i click on one image name, the image would appear on the image area. Below is my code & i can't seem to see whats wrong. Please help me. This is the code in my button. Can someone guide me on how i can do this function.
on mouseUp
local tFolder
put field "Folder" into tFolder
set the defaultFolder to tFolder
put the files into x
set the dgText of group "Data Grid" to x
if pBtnNum is 1 then
put the dgHilitedLines of group "Data Grid" into theLine
put the dgDataOfLine[theLine] of group "Data Grid" into theDataA
put the dgDataOfLine[theLine]of group "Data Grid" into img "ImageArea"
answer theLine
end if
end mouseUp
I am having a problem with this function. I managed to place my images in a datagrid, but the images are not displayed as thumbnails, they are just the various jpg file name. I am trying to use this function, so that when i click on one image name, the image would appear on the image area. Below is my code & i can't seem to see whats wrong. Please help me. This is the code in my button. Can someone guide me on how i can do this function.
on mouseUp
local tFolder
put field "Folder" into tFolder
set the defaultFolder to tFolder
put the files into x
set the dgText of group "Data Grid" to x
if pBtnNum is 1 then
put the dgHilitedLines of group "Data Grid" into theLine
put the dgDataOfLine[theLine] of group "Data Grid" into theDataA
put the dgDataOfLine[theLine]of group "Data Grid" into img "ImageArea"
answer theLine
end if
end mouseUp
Re: dgHilitedLine Function
Hi.
The "files" returns a list of files in the defaultFolder. A dataGrid, when setting the "dgtext" is going to look for a tab and return delimited dataSet. I use dataGrids for simple text, but am no expert with datagrids that use images and other complex gadgetry. I suspect, though that your DG is simply doing what you told it, loading a return delimited list into the first column. And this assumes that you loaded your defaultFolder (tFolder) with a valid pathname.
Craig Newman
The "files" returns a list of files in the defaultFolder. A dataGrid, when setting the "dgtext" is going to look for a tab and return delimited dataSet. I use dataGrids for simple text, but am no expert with datagrids that use images and other complex gadgetry. I suspect, though that your DG is simply doing what you told it, loading a return delimited list into the first column. And this assumes that you loaded your defaultFolder (tFolder) with a valid pathname.
Craig Newman
Re: dgHilitedLine Function
Here:
http://lessons.runrev.com/s/lessons/m/d ... -of-people
That lesson include how to add images to a datagrid.
Simon
http://lessons.runrev.com/s/lessons/m/d ... -of-people
That lesson include how to add images to a datagrid.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: dgHilitedLine Function
Is it really neccessary to populate the datagrid every time when the user clicks?
Don't forget: http://www.hyperactivesw.com/revscriptc ... ences.html
Don't forget: http://www.hyperactivesw.com/revscriptc ... ences.html

-
- Posts: 17
- Joined: Sat Aug 10, 2013 3:23 pm
Re: dgHilitedLine Function
I dont really know how to explain my problem. Sorry guys, am very new to livecode actually. Well, this is how my live code looks like actually. I want to click on the image in the datagrid & then i want the image to get display'd on the image area. Can someone guide on hw i can proceed from here. ):
I've attach'd a snapshot my livecode
Thank you
I've attach'd a snapshot my livecode
Thank you
- Attachments
-
- I dont really know how to explain my problem. Sorry guys, am very new to livecode actually. Well, this is how my live code looks like actually. I want to click on the image in the datagrid & then i want the image to get display'd on the image area. Can someone guide on hw i can proceed from here. ):
Thank you
Re: dgHilitedLine Function
Oh...errr...
This is for Android?
Well the path would be for the first item in your list:
c:\user\admin...\IMG-2013....jpg
so in the group DataGrid 1: -- if you didn't change it's name
Not sure if this will work on mobile at all.
Simon
EDIT: -- set the filename of image "the right hand image in your pic" to field "the path shown in your pic" & theDataA
Just trying to be clear
This is for Android?
Well the path would be for the first item in your list:
c:\user\admin...\IMG-2013....jpg
so in the group DataGrid 1: -- if you didn't change it's name
Code: Select all
on mouseUp
put the dgHilitedLines of group "DataGrid 1" into theLine
put the dgDataOfLine[theLine] of group "DataGrid 1" into theDataA
combine theDataA with space
put theDataA
-- set the filename of image "the image name" to field "the path shown in your image" & theDataA
end mouseUp
Simon
EDIT: -- set the filename of image "the right hand image in your pic" to field "the path shown in your pic" & theDataA
Just trying to be clear
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!