So I thought I'd put a script on the actual datagrid object, rather than just the button - to see if that registered. It won't even give me an answer "hi".
So before I blow the datagrid up and start again....
Maybe its some scroll code or setting that is getting in the way?
Maybe it's an evil gnome that is just playing with my mind...
The script for the button within the datagrid is below (when I manually put in 1 for theline, it comes up with the correct datagrid info...but it won't give me the initial line.)
Code: Select all
on mouseUp
put the dgHilitedlines of group "mydatagrid3" of card "forum_details" into theline
answer theline
put 1 into theline
put the dgdataofline[theline] of group "mydatagrid3" into theDataA
put theDataA["label 1"] into tuse
replace " " with "" in tuse
answer tuse & " is tuse"
put "mywebsite/deletecomment.cfm&commentID="&tuse&"" into turl
put url(turl) into twhat
answer "Your entry was deleted."
go to card "forum"
end mouseUp
Code: Select all
global gIsScrolling
local scrollid
on preopencard
put the height of this stack into tStackHeight
put the width of this stack into tstackwidth
global gtitlefield
set the icon of button "client.png" to gtitlefield
set the disabledicon of button "client.png" to gtitlefield
set the hilitedicon of button "client.png" to gtitlefield
global gtitlefieldheight
set the height of button "client.png" to gtitlefieldheight
global gtitlefieldwidth
set the width of button "client.png" to gtitlefieldwidth
global gtitleheight
set the height of field "titlefield" to gtitleheight
global gtitletext
set the textsize of field "titlefield" to gtitletext
global ginputtextsize
set the textsize of field "password" to ginputtextsize
set the textsize of field "email_address" to ginputtextsize
set the textsize of field "forum_topic" to ginputtextsize
global ginputheight
set the height of field "password" to ginputheight
set the height of field "email_address" to ginputheight
set the height of field "forum_topic" to ginputheight
global gtextbuttonfontsize
set the textsize of button "respond_button" to gtextbuttonfontsize
set the textsize of button "button_post" to gtextbuttonfontsize
set the textsize of button "button_why" to gtextbuttonfontsize
global gtextbuttonheight
set the height of button "respond_button" to gtextbuttonheight
set the height of button "button_post" to gtextbuttonheight
set the height of button "button_why" to gtextbuttonheight
global gtextsentence
set the textsize of field "forum_description" to gtextsentence
global gtextlabel
set the textsize of field "email_label" to gtextlabel
set the textsize of field "label_password" to gtextlabel
set the textsize of field "label_responses" to gtextlabel
global gnavigation
set the height of image "navigation bg.png" to gnavigation
global gbuttoncall
set the icon of button "call" to gbuttoncall
set the hiliteicon of button "call" to gbuttoncall
global gbuttoncallheight
set the height of button "call" to gbuttoncallheight
set the width of button "call" to gbuttoncallheight
global gbuttonemail
set the icon of button "email" to gbuttonemail
set the hiliteicon of button "email" to gbuttonemail
global gbuttonemailheight
set the height of button "email" to gbuttonemailheight
set the width of button "email" to gbuttonemailheight
global gbuttonmap
set the icon of button "map" to gbuttonmap
set the hiliteicon of button "map" to gbuttonmap
global gbuttonmapheight
set the height of button "map" to gbuttonmapheight
set the width of button "map" to gbuttonmapheight
global gbuttontaskeditor
set the icon of button "task editor" to gbuttontaskeditor
set the hiliteicon of button "task editor" to gbuttontaskeditor
global gbuttontaskeditorheight
set the height of button "task editor" to gbuttontaskeditorheight
set the width of button "task editor" to gbuttontaskeditorheight
global gbuttontasklist
set the icon of button "return button" to gbuttontasklist
set the hiliteicon of button "return button" to gbuttontasklist
global gkeyboard
set the icon of button "button_keyboard" to gkeyboard
set the vis of button "button_keyboard" to false
global gkeyboardwidth
set the width of button "button_keyboard" to gkeyboardwidth
global gkeyboardheight
set the height of button "button_keyboard" to gkeyboardheight
set the right of button "button_keyboard" to tstackwidth
set the top of button "button_keyboard" to 0
if the environment is "mobile"and tstackheight >700 then
set the icon of button "return button" to 1342
set the hiliteicon of button "return button" to 1342
set the height of button "return button" to 48
set the width of button "return button" to 48
set the height of field "forum_description" to 123
set the height of field "response" to 133
set the textsize of field "response" to 18
##set the height of group "mydatagrid3" to 450
set the height of field "response" to 170
set the height of field "label_responses" to 42
else if the environment is "mobile" and tstackheight <=700 then
set the icon of button "return button" to 1498
set the hiliteicon of button "return button" to 1498
set the height of button "return button" to 31
set the width of button "return button" to 35
set the height of field "forum_description" to 70
set the height of field "response" to 100
set the textsize of field "response" to 14
##set the height of group "mydatagrid3" to 220
set the height of field "response" to 126
set the height of field "label_responses" to 26
else
set the icon of button "return button" to 1342
set the hiliteicon of button "return button" to 1342
set the height of button "return button" to 48
set the width of button "return button" to 48
set the height of field "forum_description" to 70
set the height of field "response" to 106
set the textsize of field "response" to 14
##set the height of group "mydatagrid3" to 220
set the height of field "response" to 100
set the height of field "label_responses" to 42
end if
if the environment is "standalone application" then
set the backgroundColor of stack "Answer Dialog" to 231,231,231
end if
set the vis of field "response" of this card to false
set the vis of field "email_address" of this card to false
set the vis of field "email_label" of this card to false
set the vis of field "password" of this card to false
set the vis of field "label_password" of this card to false
set the vis of button "button_post" of this card to false
set the vis of field "black_background" of this card to true
set the vis of field "black_background_front" of this card to false
set the vis of button "respond_button" of this card to true
set the vis of button "button_why" of this card to false
put the width of this stack into tStackWidth
put the height of this stack into tStackHeight
set the height of image "blank.png" of me to tstackheight*0.70
set the width of image "blank.png" of me to tStackwidth*0.85
global gemail
if gemail <> "" then
if the environment is "mobile" and the platform is "android" then
mobileControlSet "mythirteenthInputField", "text", gemail
else
put gemail into field "email_address"
end if
end if
put the width of this stack into tStackWidth
put the height of this stack into tStackHeight
-- ## Use 2% of the width or height for spacing
put (tStackWidth * 0.02) into tHorizontalSpace
put (tStackHeight * 0.02) into tVerticalSpace
set the topLeft of image "tools_background.png" of me to 0,0
set the width of image "tools_background.png" of me to tStackWidth*2
set the height of image "tools_background.png" of me to tStackHeight*2
put the height of button "client.png" of me into theader
if the environment is "mobile" and tstackheight >700 then
set the right of button "client.png" of me to tstackwidth*.60
else if the environment is "mobile" and tstackheight <=700 then
set the right of button "client.png" of me to tstackwidth*.55
else
set the right of button "client.png" of me to tstackwidth*.60
end if
if the environment is "mobile" and tstackheight >700 then
set the height of image "top_background7.png" of me to max(115,tStackHeight*0.15)
else if the environment is "mobile" and tstackheight <=700 then
global gtitlefieldheight
set the height of image "top_background7.png" of me to gtitlefieldheight*1.3
else
set the height of image "top_background7.png" of me to max(115,tStackHeight*0.15)
end if
set the width of image "top_background7.png" of me to tStackWidth
set the height of image "client_background.png" of me to theader + (tStackWidth*0.02)
set the width of image "client_background.png" of me to tStackWidth*2
set the topLeft of image "client_background.png" of me to 0,tStackHeight*0.03
put the width of button "client.png" into twidthheader
set the top of button "client.png" to the top of image "client_background.png" + 5
put 30 into ttitleheight
set the left of field "TitleField" of me to (tStackwidth*.60)
set the width of button "return button" to tstackwidth*0.15
set the height of button "return button" to tstackwidth*.15
set the topleft of button "return button" of me to 0,0
set the width of image "bg-app_docs.png" of me to (tStackwidth*0.95)
if the environment is "mobile" and tstackheight >700 then
set the height of image "bg-app_docs.png" of me to tStackheight - max(115,tStackHeight*0.15) - (tStackHeight * 0.1125)+ tverticalspace*2
else if the environment is "mobile" and tstackheight <=700 then
set the height of image "bg-app_docs.png" to tstackheight - the height of image "top_background7.png" - the height of image "navigation bg.png" + tverticalspace
else
set the height of image "bg-app_docs.png" of me to tStackheight - max(115,tStackHeight*0.15) - (tStackHeight * 0.1125)+ tverticalspace*2
end if
set the top of image "bg-app_docs.png" of me to the bottom of image "top_background7.png"
set the left of image "bg-app_docs.png" of me to tStackwidth*0.025
set the vis of button "button_why" to false
pass preopencard
end preopencard
on opencard
local tRect, tRealRect
if the environment is "mobile" and the platform is "android" then
put the rect of group "mydatagrid3" into tRect
put "0,0,0,0" into tRealRect
put the width of group "mydatagrid3" into third item of tRealRect
put the dgformattedHeight of group "mydatagrid3" into the fourth item of tRealRect
mobileControlCreate "scroller", "listScroller"
mobileControlSet "listScroller", "rect", tRect
mobileControlSet "listScroller", "contentRect", tRealRect
mobileControlSet "listScroller", "canBounce", "false"
mobileControlSet "listScroller", "hIndicator", "true"
mobileControlSet "listScroller", "vIndicator", "true"
mobileControlSet "listScroller", "visible", "true"
mobileControlSet "listScroller", "delayTouches", "true"
else if the environment is "mobile" then
put the rect of group "mydatagrid3" into fldrect
put the formattedheight of group "mydatagrid3" into fldheight
put the width of group "mydatagrid3" into fldwidth
set the height of group "mydatagrid3" to fldheight
set the unboundedVScroll of group "mydatagrid3" to true
iphoneControlCreate "scroller"
put the result into scrollid
iphoneControlSet scrollid, "rect", fldRect
iphoneControlSet scrollid, "contentRect", (0, 0, fldWidth, fldHeight)
iphoneControlSet scrollid, "visible", true
iphoneControlSet scrollid, "canBounce", false
##iphoneControlSet scrollid, "declerationRate", fast
iphoneControlSet scrollid, "scrollingEnabled", true
iphoneControlSet scrollid, "canScrollToTop",true
##iphoneControlSet scrollid, "canCancelTouches",true
##iphoneControlSet scrollid, "delayTouches", true
iphoneControlSet scrollid, "vIndicator", true
iphoneControlSet scrollid, "indicatorStyle", black
iphoneControlSet scrollid, "indicatorInsets", "0,0,5,0"
##iphoneControlSet scrollid, "hscroll", 0
##iphoneControlSet scrollid, "vscroll", 0
##repeat with count = 1 to the number of lines of group "mydatagrid3"
##set the textShift of line count of group "mydatagrid3" to - 10
##end repeat
##put the vScroll of group "mydatagrid3" into fld "use2"
end if
lock screen
layoutCard
unlock screen
pass opencard
end opencard
on layoutCard
put the width of this stack into tStackWidth
put the height of this stack into tStackHeight
-- ## Use 2% of the width or height for spacing
put (tStackWidth * 0.02) into tHorizontalSpace
put (tStackHeight * 0.02) into tVerticalSpace
set the topLeft of image "tools_background.png" of me to 0,0
set the width of image "tools_background.png" of me to tStackWidth*2
set the height of image "tools_background.png" of me to tStackHeight*2
put the height of button "client.png" of me into theader
if the environment is "mobile" and tstackheight >700 then
set the right of button "client.png" of me to tstackwidth*.60
else if the environment is "mobile" and tstackheight <=700 then
set the right of button "client.png" of me to tstackwidth*.55
else
set the right of button "client.png" of me to tstackwidth*.60
end if
if the environment is "mobile" and tstackheight >700 then
set the height of image "top_background7.png" of me to max(115,tStackHeight*0.15)
else if the environment is "mobile" and tstackheight <=700 then
global gtitlefieldheight
set the height of image "top_background7.png" of me to gtitlefieldheight*1.3
else
set the height of image "top_background7.png" of me to max(115,tStackHeight*0.15)
end if
set the width of image "top_background7.png" of me to tStackWidth
set the topLeft of image "top_background7.png" of me to 0,0
set the height of image "client_background.png" of me to theader + (tStackWidth*0.02)
set the width of image "client_background.png" of me to tStackWidth*2
set the topLeft of image "client_background.png" of me to 0,tStackHeight*0.03
put the width of button "client.png" into twidthheader
set the top of button "client.png" to the top of image "client_background.png" + 5
put 30 into ttitleheight
set the left of field "TitleField" of me to (tStackwidth*.60)
set the width of button "return button" to tstackwidth*0.15
set the height of button "return button" to tstackwidth*.15
set the topleft of button "return button" of me to 0,0
set the width of image "bg-app_docs.png" of me to (tStackwidth*0.95)
if the environment is "mobile" and tstackheight >700 then
set the height of image "bg-app_docs.png" of me to tStackheight - max(115,tStackHeight*0.15) - (tStackHeight * 0.1125)+ tverticalspace*2
else if the environment is "mobile" and tstackheight <=700 then
set the height of image "bg-app_docs.png" to tstackheight - the height of image "top_background7.png" - the height of image "navigation bg.png" + tverticalspace
else
set the height of image "bg-app_docs.png" of me to tStackheight - max(115,tStackHeight*0.15) - (tStackHeight * 0.1125)+ tverticalspace*2
end if
set the top of image "bg-app_docs.png" of me to the bottom of image "top_background7.png"
set the left of image "bg-app_docs.png" of me to tStackwidth*0.025
set the height of image "blank.png" of me to tstackheight*0.70
set the width of image "blank.png" of me to tStackwidth*0.85
set the top of image "blank.png" of me to the bottom of image "top_background7.png" + tverticalspace
set the left of image "blank.png" of me to (tStackwidth*0.07)
put field ttopic of card "forum" into field "forum_topic"
put field tdescript of card "forum" into field "forum_description"
global cx
put field tchosen of card "forum" into tid
put "mywebsite/disaster_forum_response.cfm?cx=" & cx & "&forum_ID=" & tid & "" into turl
replace " " with "" in turl
replace TAB with "" in turl
replace RETURN with "" in turl
replace space with "" in turl
put url(turl) into theData_forum_details
if theData_forum_details is "usetabThere are no comments at this time.usetabusetabxyz " then
put "There are no comments at this time." into field "comments"
else
put empty into field "comments"
end if
replace "xyz" with return in theData_forum_details
replace "usetab" with tab in theData_forum_details
--add data
set the dgText[firstLineAreNames] of group "mydatagrid3" to theData_forum_details
put the width of this stack into tStackWidth
put the dgDataOfLine[1] of group "mydatagrid3" into theDataZZ
if theDataZZ["label 1"] is empty then
put 1 into theLine
send "DeleteLines theLine" to grp "mydatagrid3"
end if
if the environment is "mobile" and the platform is "android" then
set the width of scrollbar "dgScrollbar" of group "mydatagrid3" to 40
end if
put 1 into tScale
put the width of this stack into tStackWidth
put the height of this stack into tStackHeight
set the width of image "tools_background.png" to tstackWidth
set the height of image "tools_background.png" to tstackHeight
set the topLeft of image "tools_background.png" to 0,0
## Use 2% of the width or height for spacing
put (tStackWidth * 0.02) into tHorizontalSpace
put (tStackHeight * 0.02) into tVerticalSpace
put (tStackHeight * 0.115) into tTopBackgroundHeight
global gnavigation
put gnavigation into tBottomBackgroundHeight
-- set the width of image "background.png" of me to tStackWidth
-- set the height of image "background.png" of me to tStackHeight
-- set the topLeft of image "background.png" of me to 0,0
set the width of field "black_background" of me to tstackWidth*0.90
set the height of field "black_background" of me to tstackHeight-the height of image "top_background7.png" - the height of image "navigation bg.png" +tverticalspace
set the top of field "black_background" of me to the bottom of image "top_background7.png"
set the left of field "black_background" of me to tstackwidth*0.05
set the width of field "forum_topic" of me to tstackwidth*0.88
set the left of field "forum_topic" of me to tstackwidth*0.06
set the top of field "forum_topic" of me to the top of field "black_background" of me + tverticalspace
set the width of field "forum_description" of me to tstackwidth*0.74
set the top of field "forum_description" of me to the bottom of field "forum_topic" of me + tverticalspace
set the left of field "forum_description" of me to tstackwidth*0.20
set the top of field "label_responses" of me to the bottom of field "forum_description" of me + tverticalspace
set the left of field "label_responses" of me to tstackwidth*0.05
set the width of group "mydatagrid3" to tstackwidth*0.88
if the environment is "mobile" and tstackheight >700 then
put tstackheight - the formattedheight of image "top_background7.png" - the height of image "navigation bg.png" - the height of field "forum_description" - the height of field "forum_topic"- the height of button "respond_button" -height of field "label_responses" - tverticalspace*9 into tavailable
put the dgNumberOfLines of group "mydatagrid3" into tlines
set the height of group "mydatagrid3" of me to min(tavailable,tlines*65)
else if the environment is "mobile" and tstackheight<=700 then
put tstackheight - the height of image "top_background7.png" - the height of image "navigation bg.png" - the height of field "forum_topic" - the height of field "forum_description" - the height of field "label_responses" - tverticalspace*5.5 - the height of button "respond_button" into tavailablegrid
set the height of group "mydatagrid3" of me to tavailablegrid
else
put tstackheight - the height of image "top_background7.png" - the height of image "navigation bg.png" - the height of field "forum_description" - the height of field "forum_topic"- the height of button "respond_button" -height of field "label_responses" - tverticalspace*9 into tavailable
put the dgNumberOfLines of group "mydatagrid3" into tlines
set the height of group "mydatagrid3" of me to min(tavailable,tlines*65)
end if
set the top of group "mydatagrid3" to the bottom of field "label_responses" of me + tverticalspace/2
set the left of group "mydatagrid3" to tstackwidth*0.06
set the top of button "respond_button" to the bottom of group "mydatagrid3" + tverticalspace
set the right of button "respond_button" to the right of group "mydatagrid3"
set the width of field "black_background_front" to the width of field "black_background"
set the height of field "black_background_front" to the height of field "black_background" - the height of field "forum_topic" - the height of field "forum_description" - tverticalspace*5
set the top of field "black_background_front" to the bottom of field "forum_description" + tverticalspace
set the top of button "button_why" to the top of button "respond_button"
set the right of button "button_why" to the left of button "respond_button"-thorizontalspace
global cx
put cx into cx
put "http://www.toolsforbusiness.info/disaster/getrestrictions.cfm?cx="&cx&"" into turl
put url(turl) into trestrictions
if trestrictions is "complete" or trestrictions is "forum_only" then
set the vis of button "button_why" to true
end if
set the left of field "black_background_front" to the left of field "black_background"
set the width of field "email_label" to tstackwidth *.28
set the top of field "email_label" to the bottom of field "forum_description" + tverticalspace
set the top of field "email_address" to the bottom of field "forum_description" + tverticalspace
set the right of field "email_label" to tstackwidth*0.35
set the width of field "email_address" to tstackwidth*0.58
set the left of field "email_address" to tstackwidth*0.38
set the right of field "email_address" to the right of field "black_background_front" - thorizontalspace
if the environment is "mobile" and the platform is "android" then
mobileControlSet "mythirteenthInputField", "rect", the rect of fld "email_address"
end if
set the width of field "password" to the width of field "email_address"
set the top of field "label_password" to the bottom of field "email_address" + tverticalspace
set the top of field "password" to the bottom of field "email_address"+ tverticalspace
set the right of field "label_password" to tstackwidth*0.35
set the left of field "password" to the left of field "email_address"
if the environment is "mobile" and the platform is "android" then
mobileControlSet "myfourteenthInputField", "rect", the rect of fld "password"
end if
set the width of field "response" to the width of field "forum_topic"
set the top of field "response" to the bottom of field "password" + tverticalspace
set the right of field "response" to tstackwidth*.94
if the environment is "mobile" and the platform is "android" then
mobileControlSet "myfifteenthInputField", "rect", the rect of fld "response"
end if
set the top of button "button_post" to the bottom of field "response" + tverticalspace/2
set the right of button "button_post" to the right of field "email_address"
## Resize and position the top buttons
set the width of image "navigation bg.png" to tStackWidth
set the height of image "navigation bg.png" of me to tBottomBackgroundHeight
set the bottomleft of image "navigation bg.png" of me to (0,tstackHeight)
## Resize and position the nav buttons
put the height of button "task editor" into heighttask
put the height of button "call" into heightcall
put the height of button "email" into heightemail
put the height of button "map" into heightmap
set the bottom of button "task editor" of me to the bottom of image "navigation bg.png" - tverticalspace
set the bottom of button "call" of me to the bottom of button "task editor" of me - (heighttask-heightcall)/2
set the bottom of button "email" of me to the bottom of button "task editor" of me - (heighttask-heightemail)/2
set the bottom of button "map" of me to the bottom of button "task editor" of me - (heighttask-heightmap)/2
put (tStackWidth - the width of button "task editor" of me - the width of button "call" of me - the width of button "email" of me - the width of button "map" of me) / 5 into tButtonSpacing
set the left of button "task editor" of me to tButtonSpacing
set the left of button "call" of me to the right of button "task editor" of me + tButtonSpacing
set the left of button "email" of me to the right of button "call" of me + tButtonSpacing
set the left of button "map" of me to the right of button "email" of me + tButtonSpacing
end layoutCard
on resizeStack
## Tell the resources stack to resize all the images relative to the new stack size
send "resizeImages" to card "images" of stack "resources"
layoutCard
pass resizeStack
end resizeStack
on closecard
if the environment is "mobile" and the platform is "android" then
focus on field "invisible_field"
focus on nothing
mobileControlDelete mythirteenthInputField
mobileControlDelete myfourteenthInputField
mobileControlDelete myfifteenthInputField
else if the environment is "mobile" then
iphoneControlDelete scrollid
end if
if the environment is "mobile" and the platform is "android" then
mobileControlDelete "listScroller"
put false into gIsScrolling
end if
focus on nothing
end closecard
on scrollerScrollToTop
iphoneControlSet scrollId, "vscroll", 0
end scrollerScrollToTop
on scrollerBeginDrag
if the platform is "android" then
put true into gIsScrolling
else
##set the hilitedLine of group "mydatagrid3" to empty
##put empty into fld "use2"
end if
end scrollerBeginDrag
on scrollerEndDrag
put false into gIsScrolling
end scrollerEndDrag
on scrollerDidScroll OffsetX, OffsetY
lock screen
if the platform is "android" then
set the dgHscroll of group "mydatagrid3" to OffsetX
set the dgVScroll of group "mydatagrid3" to OffsetY
else
set the dgHScroll of group "mydatagrid3" to OffsetX
set the dgVScroll of group "mydatagrid3" to OffsetY
##put OffsetY into fld "use2"
end if
unlock screen
end scrollerDidScroll