Resizing Objects from an on mouseup script in a button
Posted: Fri May 29, 2020 8:56 am
Hi folks, a newbee here, just learning. Thanks in advance for any suggestions!
I need to determine the height of the card stack, one that I've allowed to be resized, and I want get the height while in a button script. I want to resize, relabel and reposition a couple objects based on the value of global variable which is initially set to true and changed to false by clicking the above mentioned button. I'm trying to put together a stack of as many techniques as I can from all the training courses I've watched in the last couple months ... all into one app!
So I'm making an app to display a list of LiveCode Training videos in a data grid table. Ones I've found on YouTube and inserted into a tab delimited list text file. You click on a line item in the data grid to select the video you want to watch, click a button to jump to the next page which holds the browser widget.
I have a text field that is populated with the URL selected from the data grid and a button labeled "Load" to click to insert the URL into the browser. I could load it directly into browser widget but I want to give the option to use the URL code or the "Embeded Code" to view the video. So I added a button labeled "Change Mode" that changes the value of the global variable, gUseURL, from true to false and back again when clicked which handles the needed changes.
At the bottom of the card I add a label field saying "Enter URL" in two lines of text(45 height). Next to the label field is the text field that is populated with the selected URL, in a single line of text(30 height) all centered nicely. When my "Change Mode" button is clicked I want to change the label to read "Enter Embeded Code" in 3 lines (60 height) and because the embeded code is lengthy I want to resize the text field's height to 3 lines(60) as well. The idea is to click the "Change Mode" button then right click in the browser window and select Copy Embeded Code and paste that into the text field containing replacing the URL and then click on a "Load" button to now view the different version.
This brings up another unknown... how can I make a multi-line "answer" dialog pop up to explain the process to the user and have the "Ok" button that then hides the instructions. I tried "answer "Lots of text" & "Line 2 of text" & etc and got error Expression missing factor. Tried && got same error. There must be a symbol for a carriage reurn and line feed. I played with a label field and put the lengthy message into the "contents". Then tried "set the invisible of field "URLInfoLbl" to false" to display an invisible object it but I need an "Ok" button within label field to hide it again... not sure about that one.
I also added a button "Back to List" to take you back to the page with the data grid and at the same time I want to resize, relabel and reposition the two resized objects back to their original size and position.
To position these 2 objects properly from the bottom of a card I obviously need to determine the height of the card stack and store it into a local variable like tCardHeight, and do it from within the button script. And as mentioned above, I want to be able to resize the stack so, of course, the height is going to be unknown when one clicks the "Change Mode" button. If anyone wants to mess with this I'd be glad to share it ... I don't know how to other than by email. Let me know at Lonnie dot Hardesty at my gmail account.
Sorry for the lengthy explanation but you can never have too much info!!
Thanks again, in advance, for any suggestions ...
Lonnie
I need to determine the height of the card stack, one that I've allowed to be resized, and I want get the height while in a button script. I want to resize, relabel and reposition a couple objects based on the value of global variable which is initially set to true and changed to false by clicking the above mentioned button. I'm trying to put together a stack of as many techniques as I can from all the training courses I've watched in the last couple months ... all into one app!
So I'm making an app to display a list of LiveCode Training videos in a data grid table. Ones I've found on YouTube and inserted into a tab delimited list text file. You click on a line item in the data grid to select the video you want to watch, click a button to jump to the next page which holds the browser widget.
I have a text field that is populated with the URL selected from the data grid and a button labeled "Load" to click to insert the URL into the browser. I could load it directly into browser widget but I want to give the option to use the URL code or the "Embeded Code" to view the video. So I added a button labeled "Change Mode" that changes the value of the global variable, gUseURL, from true to false and back again when clicked which handles the needed changes.
At the bottom of the card I add a label field saying "Enter URL" in two lines of text(45 height). Next to the label field is the text field that is populated with the selected URL, in a single line of text(30 height) all centered nicely. When my "Change Mode" button is clicked I want to change the label to read "Enter Embeded Code" in 3 lines (60 height) and because the embeded code is lengthy I want to resize the text field's height to 3 lines(60) as well. The idea is to click the "Change Mode" button then right click in the browser window and select Copy Embeded Code and paste that into the text field containing replacing the URL and then click on a "Load" button to now view the different version.
This brings up another unknown... how can I make a multi-line "answer" dialog pop up to explain the process to the user and have the "Ok" button that then hides the instructions. I tried "answer "Lots of text" & "Line 2 of text" & etc and got error Expression missing factor. Tried && got same error. There must be a symbol for a carriage reurn and line feed. I played with a label field and put the lengthy message into the "contents". Then tried "set the invisible of field "URLInfoLbl" to false" to display an invisible object it but I need an "Ok" button within label field to hide it again... not sure about that one.
I also added a button "Back to List" to take you back to the page with the data grid and at the same time I want to resize, relabel and reposition the two resized objects back to their original size and position.
To position these 2 objects properly from the bottom of a card I obviously need to determine the height of the card stack and store it into a local variable like tCardHeight, and do it from within the button script. And as mentioned above, I want to be able to resize the stack so, of course, the height is going to be unknown when one clicks the "Change Mode" button. If anyone wants to mess with this I'd be glad to share it ... I don't know how to other than by email. Let me know at Lonnie dot Hardesty at my gmail account.
Sorry for the lengthy explanation but you can never have too much info!!
Thanks again, in advance, for any suggestions ...
Lonnie