Page 1 of 1
How do I create a data grid with a variable height?
Posted: Tue Nov 01, 2011 4:22 am
by Linh
Hello,
I need to create a data grid with a variable height (variable height of the data grid, not height of lines in data grid).
Note: This data grid is in a line of another data grid. I thought it's similar to create a variable line heights, but it did not work in my case.
This is my code:
Code: Select all
put the rect of group "dtgReport" of me into tFieldRect
put item 3 of pControlRect - 5 into item 3 of tFieldRect
set the rect of group "dtgReport" of me to tFieldRect
put (item 2 of tFieldRect) + (the formattedheight of grp "dtgReport" of me) - (the bottommargin of grp "dtgReport" of me) \
into item 4 of tFieldRect
set the rect of group "dtgReport" of me to tFieldRect
put item 4 of tFieldRect into item 4 of pControlRect
Your help is greatly appreciated.
Cheers,
Linh
Re: How do I create a data grid with a variable height?
Posted: Mon Nov 21, 2011 1:44 am
by marksmithhfx
Linh wrote:Hello,
I need to create a data grid with a variable height (variable height of the data grid, not height of lines in data grid).
Cheers,
Linh
set the height of group "my_datagrid" to new_height
where "new_height" is a variable with your new height value.
-- Mark
Re: How do I create a data grid with a variable height?
Posted: Mon Nov 21, 2011 5:52 am
by marksmithhfx
I guess if you are in the datagrid you could also "set the height of me to whatever" but I'm not sure. I haven't really figured out the "me" thing yet and still think in very concrete terms about objects. I probably just have trouble with abstraction.
Cheers,
-- Mark
Re: How do I create a data grid with a variable height?
Posted: Mon Nov 21, 2011 1:54 pm
by cbodell
Hi Mark,
A little late for an update here, just wanted to let you know that the term "me" refers to the object or control that holds the handler or script being invoke/ran. Example, If a "mouseUp" handler is in a button, then you can use the reference to "me" within that mouse up handler instead of calling to/from that button specifically by name or ID.
Hope that Helped!
Re: How do I create a data grid with a variable height?
Posted: Mon Nov 21, 2011 3:27 pm
by marksmithhfx
cbodell wrote:Hi Mark,
A little late for an update here, just wanted to let you know that the term "me" refers to the object or control that holds the handler or script being invoke/ran. Example, If a "mouseUp" handler is in a button, then you can use the reference to "me" within that mouse up handler instead of calling to/from that button specifically by name or ID.
Hope that Helped!
Thanks Chris,
It seems simple enough, doesn't it. But when you have been writing code for 30+ years from a perspective that is outside of everything (ie. beginning with Fortran back in 1973) its extremely difficult to adopt the mindset of writing code from the "inside" of something (ie. inside a button, inside a card, etc). Hey, I've only been at this for two years... I'll get it eventually
Actually, the hardest part for me has been trying to remember where I put stuff and being able to scan or review all of my code in one place. Its a mindset that I'm convinced is more suited to a younger generation
-- M
Re: How do I create a data grid with a variable height?
Posted: Mon Nov 21, 2011 6:19 pm
by FourthWorld
marksmithhfx wrote:cbodell wrote:Actually, the hardest part for me has been trying to remember where I put stuff and being able to scan or review all of my code in one place. Its a mindset that I'm convinced is more suited to a younger generation
Or perhaps a much older generation: a good many LiveCode users cut their teeth on HyperCard some 20 years ago.
If you need to search across all scripts you're welcome to use my 4W Script Search tool. You'll find it in the Stacks section of RevNet - in LiveCode see Development->Plugins->Go RevNet
Re: How do I create a data grid with a variable height?
Posted: Mon Nov 21, 2011 10:17 pm
by cbodell
Hi Guys
Sorry to turn the post over like this.
MarkSmith,
I would understand the difficulty there, i've been coding for 5 years, so i'm still learning myself. If you have difficulty there, as in coding from objects, you could always write code on the cards or stacks, and base actions up the targets for that handler! That way it would all be in one place. But i'm sure that could get a frustrating.
Re: How do I create a data grid with a variable height?
Posted: Tue Nov 22, 2011 4:27 am
by marksmithhfx
FourthWorld wrote:Or perhaps a much older generation: a good many LiveCode users cut their teeth on HyperCard some 20 years ago.
If you need to search across all scripts you're welcome to use my 4W Script Search tool. You'll find it in the Stacks section of RevNet - in LiveCode see Development->Plugins->Go RevNet
Thanks Richard. I will take you up on the generous offer. 20 years ago? Remember TBBS? I was writing dbase code for TBBS systems, ran a BBS and had many users who were into Macs and Hypercard. Unfortunately I did not take the plunge back then when the grey matter was still a little more pliable

(However, the more I learn the more fun it becomes.... with much appreciation to all the generous folks here who help out)
-- Mark
Re: How do I create a data grid with a variable height?
Posted: Tue Nov 22, 2011 4:42 am
by marksmithhfx
cbodell wrote:Hi Guys
Sorry to turn the post over like this.
Ah well, back to work is it
Speaking of pushing code up the message path, I ran across an excellent example of that tonight in Sarah Reichelt (TROZware) Calendar Demo 1.6. She has 31 buttons available on the card (as needed) and clicking on them causes things to happen. But there is not a lick of code in any of them. Ah, I said, the Card then but nope, had to climb all the way to the stack before I found mouse up/down handlers. I would find that a mental stretch, but it does allow her to have a single set of mouse handlers to handle all "calendar day" button presses. Very clever actually.
-- M
Re: How do I create a data grid with a variable height?
Posted: Tue Nov 22, 2011 4:53 am
by marksmithhfx
FourthWorld wrote:If you need to search across all scripts you're welcome to use my 4W Script Search tool. You'll find it in the Stacks section of RevNet - in LiveCode see Development->Plugins->Go RevNet
Wow Richard, revnets an incredible resource. Thanks for point that out. (and I just saw Sarah's Calendar demo listed in the stacks as well, along with 4W_SearchScript. Small world)
-- Mark
Re: How do I create a data grid with a variable height?
Posted: Tue Nov 22, 2011 8:22 am
by cbodell
MarkSmith,
I agree, clever indeed. I like the library stack function, & insert script function. That way you can have before during and after handlers in a sense.
I don't use Mac systems, and i did start until around Rev 2.8.1, but i did get a hold of the HyperCard App, i like the setup. Actually, i like how universally Rev/LiveCode has grown. I wish they would have a way to embed the Revlets on these forums though, that's a good idea i think!
Re: How do I create a data grid with a variable height?
Posted: Tue Nov 22, 2011 4:23 pm
by FourthWorld
marksmithhfx wrote:20 years ago? Remember TBBS?
I don't recall it, but I remember Wildcat BBS fondly. Until FirstClass came along, then the local Mac User Group switched to that and at last we had a GUI collaboration toolkit. Funny, the things we used to do before the Web.
I was writing dbase code for TBBS systems, ran a BBS and had many users who were into Macs and Hypercard. Unfortunately I did not take the plunge back then when the grey matter was still a little more pliable

(However, the more I learn the more fun it becomes.... with much appreciation to all the generous folks here who help out)
I've been spending a lot of time with JavaScript over the last two years, in many ways a chance to become a beginner again (so much has changed since I'd last used it for any serious projects). Definitely good to flex the learning muscle now and then.
marksmithhfx wrote:FourthWorld wrote:If you need to search across all scripts you're welcome to use my 4W Script Search tool. You'll find it in the Stacks section of RevNet - in LiveCode see Development->Plugins->Go RevNet
Wow Richard, revnets an incredible resource. Thanks for point that out. (and I just saw Sarah's Calendar demo listed in the stacks as well, along with 4W_SearchScript. Small world)
Glad that was helpful. I have some significant enhancements in the works for RevNet, and while my client projects make it difficult for me to say exactly when I'll be able to roll those out, if you like RevNet now you'll like it a whole lot more in the coming months.
In the meantime, be sure to check out RevOnline as well. It's RunRev's stack sharing system built right into the IDE, and there's a treasure trove of goodies to be discovered there.
Re: How do I create a data grid with a variable height?
Posted: Wed Nov 23, 2011 6:16 am
by marksmithhfx
cbodell wrote:MarkSmith,
I like the library stack function, & insert script function. That way you can have before during and after handlers in a sense.
I've been reading a bit about library stacks on this forum but had not heard about the insert script option. So much to learn!
-- Mark