DICE PACKS BUNDLE
  1. #1

    Restricting update of element from drag

    I'm having an issue where some elements can be updated by drag dropping a string onto them. I know this is normal behavior for FG, but is there a way to disable this? I want it to be able to process Drag and Drops, but I want to make it discard things like string draginfo objects.

    Any thoughts?

    EDIT: Sorry about that. Typo. Sorcerer is right. Meant string. Corrected.
    Last edited by drahkar; May 19th, 2011 at 17:56.
    • Trying to find a community Ruleset, Extension or Information on how to complete a process? Try FGRepository.
    • PM Myself if you have new or updated community Rulesets, Extensions or Information that you'd like added to FGRepository.

  2. #2
    Zeus's Avatar
    Join Date
    Mar 2009
    Location
    Olympus
    Posts
    2,658
    Blog Entries
    2
    I am not sure what you mean when you say ' drag dropping a strong onto them'.

    However in general you can override the standard drag/drop behaviour of any window control by defining and overriding the following event functions:

    • function onDrag( button, x, y, dragdata ) -- Fires when drag starts
    • function onDragEnd(dragdata) -- Fires when drag ends
    • function onDrop( button, x, y, dragdata ) -- Fires when something is dropped

    Just define a script block within each control you want to customise the onDrop handling for, add your own onDrop() function and your good to go.

    More information here.
    Last edited by Zeus; May 19th, 2011 at 17:34.
    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.

  3. #3
    I think he meant to type "string"

  4. #4
    I was actually looking to try and prevent an element from changing when an onDrop was triggered. Ikael made some suggestions on chat about declaring the stringtypes within the onDrop and having the only code within it be a return. I'm going to give that a try and see.

    Thanks for the recommendations, Doc.
    • Trying to find a community Ruleset, Extension or Information on how to complete a process? Try FGRepository.
    • PM Myself if you have new or updated community Rulesets, Extensions or Information that you'd like added to FGRepository.

  5. #5
    There is also a nodrop tag for stringcontrols, which disables the default drop behavior.

    https://www.fantasygrounds.com/refdoc/stringcontrol.xcp

    Cheers,
    JPG

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
FG Spreadshirt Swag

Log in

Log in