-
March 14th, 2014, 16:52 #11
Oh - and is the GM removing the link or a player?
Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
March 14th, 2014, 16:54 #12
Dulux-Oz
√(-1) 2^3 Σ Π
...And it was Delicious!
Alpha-Geek
ICT Professional
GMing Since 1982
NSW, Australia, UTC +10
LinkedIn Profile: www.linkedin.com/in/mjblack
Watch our games on Twitch: www.twitch.tv/dulux_oz
Support Me on Patreon: www.patreon.com/duluxoz
Past Games, etc, on my YouTube Channel: www.youtube.com/c/duluxoz
-
March 14th, 2014, 17:01 #13
In the table entry that Nickademus references the linkfield (resultlink) is hidden if there is no link to it (setVisible(false)) and set to visible if there is link data, this is done via the updateDisplay function. Perhaps you could do something like that? Of course, the main issue here is that there is no obvious link icon to drag a link to.
Code:<windowclass name="table_result"> <margins control="0,0,0,2" /> <script> function onInit() registerMenuItem(Interface.getString("table_menu_linkdelete"), "erase", 8); updateDisplay(); end function onMenuSelection(selection) if selection == 8 then resultlink.setValue(); end end function updateDisplay() local bLink = not resultlink.isEmpty(); resultlink.setVisible(bLink); end function onDrop(x, y, draginfo) if draginfo.isType("shortcut") then resultlink.setValue(draginfo.getShortcutData()); return true; end end </script> <sheetdata> <genericcontrol name="leftanchor"> <bounds>0,2,0,20</bounds> <disabled /> </genericcontrol> <genericcontrol name="base"> <anchored position="over" /> <script> function onDrop(x, y, draginfo) return window.onDrop(x, y, draginfo); end </script> </genericcontrol> <link_tableresult name="resultlink"> <anchored> <top offset="2" /> <left parent="leftanchor" anchor="right" relation="relative" offset="5" /> </anchored> <invisible /> <script> function onValueChanged() window.updateDisplay(); end function onDrop(x, y, draginfo) return window.onDrop(x, y, draginfo); end </script> </link_tableresult>
Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
March 14th, 2014, 17:33 #14
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,540
I just tried it on my machine, by modifying the table record to test setValue() specifically. It's working as expected.
Looking at your code again, I think the problem is that you do not have "return true" at the end of your onDrop function. What I think is happening is that the value is actually being cleared in your onDrop event handler. However, since there is no return value, FG continues to process the drop event normally, which means that the link gets set again by the built-in windowreferencefield code.
Regards,
JPG
-
March 15th, 2014, 04:57 #15
Dulux-Oz
√(-1) 2^3 Σ Π
...And it was Delicious!
Alpha-Geek
ICT Professional
GMing Since 1982
NSW, Australia, UTC +10
LinkedIn Profile: www.linkedin.com/in/mjblack
Watch our games on Twitch: www.twitch.tv/dulux_oz
Support Me on Patreon: www.patreon.com/duluxoz
Past Games, etc, on my YouTube Channel: www.youtube.com/c/duluxoz
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks