-
March 25th, 2014, 08:26 #1
DragData.setDescription() Help Required
Hi Guys,
Could someone please provide an example of setting the Description (or other elements) of a Dragdata object for a Shortcut item (ie when to call the dragdata.setDescription() function) - I need to set a couple of values so that when I drag an item from a list and drop it onto another list certain values are checked. My onDrop() Code is as follows:
Code:function onDrop(nXPos,nYPos,oDragData) if oDragData.getType() == "shortcut" and oDragData.getShortcutData() == "my_value" then local oChildNode = DB.createChild(getDatabaseNode()); DB.setValue(oChildNode,"name","string",oDragData.getDescription()); DB.setValue(oChildNode,"shortcut","windowreference",oDragData.getShortcutData()); else return true; end end
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 25th, 2014, 10:49 #2
Have a look at the definition of the windowreferencecontrol (or linkfield template) for the objects your dragging, you can auto-set the description of the link (when dragged) by adding the following tag to the windowreferencecontrol/linkfield definition.
Code:<description control=[name of field/control]>
e.g.
Code:<windowclass name="reference_indexitem"> <margins control="0,0,0,2" /> <sheetdata> <linkfield name="listlink"> <bounds>5,2,20,20</bounds> <description control="name" /> <readonly /> </linkfield> <string_list_link name="name"> <bounds>25,2,-1,20</bounds> <linktarget>listlink</linktarget> </string_list_link> </sheetdata> </windowclass>
Last edited by Zeus; March 25th, 2014 at 10:52.
FG Project Development
Next Project(s)*: Starfinder v1.2 Starship Combat
Current Project: Starfinder v1.1 - Character Starships
Completed Projects: Starfinder Ruleset v1.0, Starfinder Core Rulebook, Alien Archive, Paizo Pathfinder Official Theme, D&D 5E data updates
* All fluid by nature and therefore subject to change.
-
March 25th, 2014, 11:09 #3
Thanks Zeus - missed it in my read-through
What the Developer Documentation needs is a really good search function
CheersDulux-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