Re: Set the tooltip of a datagrid
Well I just discovered an amazing thing. You can get the dgData of a CONTROL of a datagrid and it still returns the data. For instance if you know that the dgLine you want is 3 and the control name is siteid 0003, you can put the dgDataOfLine [3] of field "siteid 0003" into aData and you will get the array for that line! It appears you can do that for ANY control in a datagrid! Why is this important?? Because if all I know is the name of the target (in this case a field in a datagrid) I can at least get the line number it belongs to, but how do I then discern the name of the datagrid it belongs to in order to get the dgDataOfLine?? Turns out that because of this you do not need to! You might think getting the owner of the control would do it, but you at least have to get the owner of the owner, and for some datagrids there are two other groups that are parent owners of THAT group before you get to the actual datagrid group. It just all depends. All irrelevant because the syntax above works a peach! Bob S ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Set the tooltip of a datagrid
BUT you can set the toolTipDelay, to speed up or slow down its appearance. That's about it. Phil Davis On 7/12/17 10:54 AM, Bob Sneidar via use-livecode wrote: Yes just figured that out thank you. Initially it wasn't displaying, but I think that was because of an early bug which I already quashed. Apparently there is no command for showing a tooltip. Bob S On Jul 12, 2017, at 10:52 , Mike Bonner via use-livecodewrote: Are you sure you need that line at all? Seems like once the tooltip is set, it will show up after the tooltipdelay has passed. At least it did for me in my quicky experiment. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Set the tooltip of a datagrid
On 07/12/2017 10:47 AM, Bob Sneidar via use-livecode wrote: Okay now my problem is that now the line "show the toolTip of tTarget" generates an error, but it doesn't say WHAT the error is. If I use a try catch and get the error I get this: 69,112,12,1. sitename: Integrated Office Technologies Santa Fe Springs 547,112,12 Could it be that for some reason the tooltip is too long?? More likely because that isn't valid syntax. If you want to do that instead of letting the OS handle it you're going to have to create your own tooltip mechanism. Better to set the tooltip text and let the computer do its magic. -- Mark Wieder ahsoftw...@gmail.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Set the tooltip of a datagrid
Yes just figured that out thank you. Initially it wasn't displaying, but I think that was because of an early bug which I already quashed. Apparently there is no command for showing a tooltip. Bob S > On Jul 12, 2017, at 10:52 , Mike Bonner via use-livecode >wrote: > > Are you sure you need that line at all? Seems like once the tooltip is > set, it will show up after the tooltipdelay has passed. At least it did > for me in my quicky experiment. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Set the tooltip of a datagrid
Are you sure you need that line at all? Seems like once the tooltip is set, it will show up after the tooltipdelay has passed. At least it did for me in my quicky experiment. On Wed, Jul 12, 2017 at 11:47 AM, Bob Sneidar via use-livecode < use-livecode@lists.runrev.com> wrote: > Okay now my problem is that now the line "show the toolTip of tTarget" > generates an error, but it doesn't say WHAT the error is. If I use a try > catch and get the error I get this: > > 69,112,12,1. sitename: Integrated Office Technologies Santa Fe Springs > 547,112,12 > > Could it be that for some reason the tooltip is too long?? > > Bob S > > > > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your > subscription preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode > ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Set the tooltip of a datagrid
Okay now my problem is that now the line "show the toolTip of tTarget" generates an error, but it doesn't say WHAT the error is. If I use a try catch and get the error I get this: 69,112,12,1. sitename: Integrated Office Technologies Santa Fe Springs 547,112,12 Could it be that for some reason the tooltip is too long?? Bob S ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Set the tooltip of a datagrid
rather than get the data of the line (unkeyed) can you just grab the index, and use that to pick out your tooltip? (barely glanced at this so far, so i might be way off) On Wed, Jul 12, 2017 at 10:36 AM, Bob Sneidar via use-livecode < use-livecode@lists.runrev.com> wrote: > Great tip! (pun intended) > > So here is what I came up with. Keep in mind that tKeyList is a list of > columns I want in the tooltip. The idea is to present the user with a > tooltip containing summary information on the datagrid data record. I had > to prepend a counter to each key so that it would sort based on the order > of the items in tKeyList. Arrays. SHEESH! Sure would be nice if the keys > were in the order they were added! > > I will probably move the relevant code into another handler in my > Utilities backscript, then pass the long id of the target, and the key list > to that handler. I will also probably update this handler so that in the > event no keylist is passed, I will get the datagrid column labels, and use > those for a key list. > > on mouseEnter >local tKeyList >wait 1 second with messages >put the target into tTargetName >put tTargetName into tTarget -- we need to preserver the original name > >if the first word of tTarget is not "field" then > pass mouseEnter >end if > >put "sitename,addr1,city,state,zip,contactname,contactphone,contactemail," > into tKeyList >put "itname,itphone,itemail" after keyList >replace quote with empty in tTargetName >put the last word of tTargetName into tLine >put the dgDataOfLine [tLine] of me into aLineData > >repeat for each item tKey in tKeyList > add 1 to tCounter > put aLineData [tKey] into aRecordData [tCounter & ". " & tKey] >end repeat > >put arrayToText(aRecordData, "record") into tText >sort lines of tText >set the tooltip of tTarget to tText >show the tooltip of tTarget >breakpoint >pass mouseEnter > end mouseEnter > > function arrayToText aArrayData, pFormat, pStripRecordKeys > if aArrayData is not an array then > put "ERROR: Data passed is not an array!" into theValue > return theValue > end if > > if pStripRecordKeys is not in "true|false" then put false into > pStripRecordKeys > -- sort tArrayKeys ascending > > -- may be an array of values > put the keys of aArrayData into tArrayKeys > sort lines of tArrayKeys numeric ascending > put line 1 of tArrayKeys is 0 into tHasHeader > > -- convert single array to numeric array of arrays > if line 1 of tArrayKeys is not a number then > put aArrayData into aTempArray [1] > put aTempArray into aArrayData > put the keys of aArrayData into tArrayKeys > end if > > switch pFormat > case "record" > repeat for each line tArrayKey in tArrayKeys > put aArrayData [tArrayKey] into aArrayRecord > put the keys of aArrayRecord into tColumnKeys > > repeat for each line tColumnKey in tColumnKeys > put tColumnKey & ": " & aArrayRecord [tColumnKey] & cr > after tValue > end repeat > end repeat > break > case "table" > -- table header > if not tHasHeader then put cr into tValue > > repeat for each line tArrayKey in tArrayKeys > add 1 to tCount > put aArrayData [tArrayKey] into aArrayRecord > put the keys of aArrayRecord into tColumnKeys > sort lines of tColumnKeys numeric ascending > > repeat for each line tColumnKey in tColumnKeys > if pStripRecordKeys and (char 1 of tColumnKey is "@") > then next repeat > > if tCount = 1 and not tHasHeader then put tColumnKey & > tab after line 1 of tValue > put aArrayRecord [tColumnKey] & tab after tValue > end repeat > > put cr into last char of tValue > end repeat > break > end switch > > return tValue > end arrayToText > > Bob S > > > > On Jul 11, 2017, at 19:09 , Mike Bonner via use-livecode < > use-livecode@lists.runrev.com> wrote: > > > > There should be a couple ways.. Assuming the tooltip data and the > displayed > > data are already associated, you can do as suggested and pass in the > popop > > information as part of the dgdata.. Then in the fillindata you 'set the > > tooltip of field 1 of me to ... the data that was passed in with the > array. > > To do this though i _Think_ you'd need a custom behavior for every > > column. > > > > To get around this, you could use a mouseenter in the script of the > > datagrid itself that does something like.. > > > > on mouseenter > >get the text of the target > >-- then use the text of the target to look up your tooltip data and.. > > set the tooltip of the target to "whateveryouwant" > > > > end
Re: Set the tooltip of a datagrid
Great tip! (pun intended) So here is what I came up with. Keep in mind that tKeyList is a list of columns I want in the tooltip. The idea is to present the user with a tooltip containing summary information on the datagrid data record. I had to prepend a counter to each key so that it would sort based on the order of the items in tKeyList. Arrays. SHEESH! Sure would be nice if the keys were in the order they were added! I will probably move the relevant code into another handler in my Utilities backscript, then pass the long id of the target, and the key list to that handler. I will also probably update this handler so that in the event no keylist is passed, I will get the datagrid column labels, and use those for a key list. on mouseEnter local tKeyList wait 1 second with messages put the target into tTargetName put tTargetName into tTarget -- we need to preserver the original name if the first word of tTarget is not "field" then pass mouseEnter end if put "sitename,addr1,city,state,zip,contactname,contactphone,contactemail," into tKeyList put "itname,itphone,itemail" after keyList replace quote with empty in tTargetName put the last word of tTargetName into tLine put the dgDataOfLine [tLine] of me into aLineData repeat for each item tKey in tKeyList add 1 to tCounter put aLineData [tKey] into aRecordData [tCounter & ". " & tKey] end repeat put arrayToText(aRecordData, "record") into tText sort lines of tText set the tooltip of tTarget to tText show the tooltip of tTarget breakpoint pass mouseEnter end mouseEnter function arrayToText aArrayData, pFormat, pStripRecordKeys if aArrayData is not an array then put "ERROR: Data passed is not an array!" into theValue return theValue end if if pStripRecordKeys is not in "true|false" then put false into pStripRecordKeys -- sort tArrayKeys ascending -- may be an array of values put the keys of aArrayData into tArrayKeys sort lines of tArrayKeys numeric ascending put line 1 of tArrayKeys is 0 into tHasHeader -- convert single array to numeric array of arrays if line 1 of tArrayKeys is not a number then put aArrayData into aTempArray [1] put aTempArray into aArrayData put the keys of aArrayData into tArrayKeys end if switch pFormat case "record" repeat for each line tArrayKey in tArrayKeys put aArrayData [tArrayKey] into aArrayRecord put the keys of aArrayRecord into tColumnKeys repeat for each line tColumnKey in tColumnKeys put tColumnKey & ": " & aArrayRecord [tColumnKey] & cr after tValue end repeat end repeat break case "table" -- table header if not tHasHeader then put cr into tValue repeat for each line tArrayKey in tArrayKeys add 1 to tCount put aArrayData [tArrayKey] into aArrayRecord put the keys of aArrayRecord into tColumnKeys sort lines of tColumnKeys numeric ascending repeat for each line tColumnKey in tColumnKeys if pStripRecordKeys and (char 1 of tColumnKey is "@") then next repeat if tCount = 1 and not tHasHeader then put tColumnKey & tab after line 1 of tValue put aArrayRecord [tColumnKey] & tab after tValue end repeat put cr into last char of tValue end repeat break end switch return tValue end arrayToText Bob S > On Jul 11, 2017, at 19:09 , Mike Bonner via use-livecode >wrote: > > There should be a couple ways.. Assuming the tooltip data and the displayed > data are already associated, you can do as suggested and pass in the popop > information as part of the dgdata.. Then in the fillindata you 'set the > tooltip of field 1 of me to ... the data that was passed in with the array. > To do this though i _Think_ you'd need a custom behavior for every > column. > > To get around this, you could use a mouseenter in the script of the > datagrid itself that does something like.. > > on mouseenter >get the text of the target >-- then use the text of the target to look up your tooltip data and.. > set the tooltip of the target to "whateveryouwant" > > end mouseenter > > i tested by setting the tooltip to a random number and it seems to work > fine. > > If you're using a form rather than a grid, its much easier, just use the > first method in the behavior script to set whatever tooltips you like as > part of the fillindata. A single script edit to handle all tooltips. ___ use-livecode
Re: Set the tooltip of a datagrid
There should be a couple ways.. Assuming the tooltip data and the displayed data are already associated, you can do as suggested and pass in the popop information as part of the dgdata.. Then in the fillindata you 'set the tooltip of field 1 of me to ... the data that was passed in with the array. To do this though i _Think_ you'd need a custom behavior for every column. To get around this, you could use a mouseenter in the script of the datagrid itself that does something like.. on mouseenter get the text of the target -- then use the text of the target to look up your tooltip data and.. set the tooltip of the target to "whateveryouwant" end mouseenter i tested by setting the tooltip to a random number and it seems to work fine. If you're using a form rather than a grid, its much easier, just use the first method in the behavior script to set whatever tooltips you like as part of the fillindata. A single script edit to handle all tooltips. On Tue, Jul 11, 2017 at 7:43 PM, Bob Sneidar via use-livecode < use-livecode@lists.runrev.com> wrote: > Yup. But now what I want to do is intercept the hover message, or whatever > that is that detects I am over a datagrid control, then set the tooltip to > a string that represents selected datagrid data. The idea is that even > though I have a subset of data actually displaying in the datagrid, I > preload ALL the columns of the table in the dgData, and I want to be able > to display more data from a particular record in the tooltip, depending on > which record I am hovering over. That means I need some kind of message > that gets sent to the datagrid when I am hovering over an element. > > I tried editing the script of the behavior, but of course that cannot be > edited. I suppose I will have to copy the behavior of the datagrid to an > independent button to play around with this. I was hoping there might be an > easier way to do this. > > Bob S > > > > On Jul 11, 2017, at 18:37 , Mark Wieder via use-livecode < > use-livecode@lists.runrev.com> wrote: > > > > It's a tooltip. > > You shouldn't have to do anything special. > > Here's how I set the tooltip of widgets in the PowerTools datagrid: > > > > set the tooltip of image tWidgetNum of me to "someString" > > > > -- > > Mark Wieder > > > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your > subscription preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode > ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Set the tooltip of a datagrid
Yup. But now what I want to do is intercept the hover message, or whatever that is that detects I am over a datagrid control, then set the tooltip to a string that represents selected datagrid data. The idea is that even though I have a subset of data actually displaying in the datagrid, I preload ALL the columns of the table in the dgData, and I want to be able to display more data from a particular record in the tooltip, depending on which record I am hovering over. That means I need some kind of message that gets sent to the datagrid when I am hovering over an element. I tried editing the script of the behavior, but of course that cannot be edited. I suppose I will have to copy the behavior of the datagrid to an independent button to play around with this. I was hoping there might be an easier way to do this. Bob S > On Jul 11, 2017, at 18:37 , Mark Wieder via use-livecode >wrote: > > It's a tooltip. > You shouldn't have to do anything special. > Here's how I set the tooltip of widgets in the PowerTools datagrid: > > set the tooltip of image tWidgetNum of me to "someString" > > -- > Mark Wieder ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Set the tooltip of a datagrid
On 07/11/2017 06:11 PM, Bob Sneidar via use-livecode wrote: That is half the battle, but the trick is how to detect I am hovering over a datagrid element in the first place. It's a tooltip. You shouldn't have to do anything special. Here's how I set the tooltip of widgets in the PowerTools datagrid: set the tooltip of image tWidgetNum of me to "someString" -- Mark Wieder ahsoftw...@gmail.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Set the tooltip of a datagrid
That is half the battle, but the trick is how to detect I am hovering over a datagrid element in the first place. Bob S > On Jul 11, 2017, at 16:54 , Mark Wieder via use-livecode >wrote: > >> Hi all. >> Not sure if anyone has thought of a way to get the dgDataOfHover (so to >> speak) of a datagrid. By that I mean, I would like to display a tooltip of >> selected data from a table datagrid record whenever I hover over a control >> of that record. That would have to bean a mouseWithin handler in the >> datagrid script that waited a period of time with messages, then triggered a >> handler that would discern the control being hovered over and deduce the >> record from that. > > Don't know if this meets your needs, but I set the tooltip of datagrid > elements in the FillInData handler of the datagrid row behavior script. > > -- > Mark Wieder > ahsoftw...@gmail.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Set the tooltip of a datagrid
On 07/11/2017 04:03 PM, Bob Sneidar via use-livecode wrote: Hi all. Not sure if anyone has thought of a way to get the dgDataOfHover (so to speak) of a datagrid. By that I mean, I would like to display a tooltip of selected data from a table datagrid record whenever I hover over a control of that record. That would have to bean a mouseWithin handler in the datagrid script that waited a period of time with messages, then triggered a handler that would discern the control being hovered over and deduce the record from that. Don't know if this meets your needs, but I set the tooltip of datagrid elements in the FillInData handler of the datagrid row behavior script. -- Mark Wieder ahsoftw...@gmail.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode