5E Product Walkthrough Playlist
Page 1 of 3 123 Last

Thread: Context Menus

  1. #1

    Context Menus

    I did a quick scan during break through the radial controls but only found references to the radial graphics themselves within graphics_radial.

    I assume there's no way to create my own custom radial settings or replace it with a context menu.

    I currently have a semi-experimental window I hacked together a few days ago that shows the 3.5 effect icons along with a few extras on a right context click. The intent is to be able to right click a token and add an effect with the eventual side-effect of snapping the CT to that entry with the expanded effect tree for further input.

    The goal here is to bind that window to the radial, or outright replace it with a context menu so I can decorate it as I please.

    Is this possible before I go Easter egg hunting?

  2. #2
    Radial menus are the only context menus available within the FG client.

    You can use the windowcontrol.registerMenuItem function, and windowcontrol.onMenuSelection event to specify your own radial menu options. You can find examples of this usage in the CoreRPG ruleset. (There are also versions for tokeninstance and windowinstance.)

    I don't remember off the top of my head, but I believe the built-in radial menus override any custom defined menus.

    Regards,
    JPG

  3. #3
    Hm, there's a way to jury ring this. I guess there's no plans for focus gain/loss for window controls until unity, and even then there's a backlog for that.

  4. #4
    There are already windowcontrol.onGainFocus and windowcontrol.onLoseFocus events for keyboard focus.

    I can't tell from your post whether that is what you were looking for, but that's what is available for focus change.

    Regards,
    JPG

  5. #5
    I'm not aware? Last time I assumed this I corrected myself as only number control has that documented. Focus control for window control isn't on the ruleset reference. It's a hacky way to spawn/de-spawn a context like window from a radial selection.

    The golden grail is to detect hover loss/gain.

  6. #6
    You're right. The keyboard focus is only available for stringcontrol, chatentrycontrol, and numbercontrol; since most other fields don't have keyboard focus as a possibility.

    For hover, have you already looked at windowcontrol.onHover and windowcontrol.onHoverUpdate events?

    Regards,
    JPG

  7. #7

    Join Date
    Jan 2015
    Location
    Grand Rapids, MI
    Posts
    136
    I'm struggling with even a control that has focus. The basicnumber control has the function setFocus. When I use this, and also attach listener functions to other controls using onGainFocus and onLoseFocus, it's telling me it's doing something. But as soon as I type a key on my keyboard, it's still entering in the previously focused control. Is there anyway to set focus from one number entry field to another?

  8. #8

    Join Date
    Jan 2015
    Location
    Grand Rapids, MI
    Posts
    136
    Actually I went back, it shows that the focus switched to the new control, and then immediately switched back. Is there anyway to stop this from happening?

  9. #9
    It depends on why the focus is changing. The focus will only change if the user clicks somewhere, or another control calls setFocus.

    Regards,
    JPG

  10. #10

    Join Date
    Jan 2015
    Location
    Grand Rapids, MI
    Posts
    136
    I'm performing the setFocus() to a control we'll call editWounds (so editWounds.setFocus()) from within an onDoubleClick() event in a control we'll call wounds (so wounds.onDoubleClick()).
    Each has the following events with the names changed
    function onGainFocus()
    Debug.chat("<controlname> gained focus");
    end

    and

    function onLoseFocus()
    Debug.chat("<controlname> lost focus");
    end

    The work flow is double click on the wounds control, at which point I would like focus to change to the editWounds control. Currently, when I do this, I can see that focus does change to the editWounds control, but then returns to the wounds control.
    This is the output I get.
    wounds has gained focus
    wounds has lost focus
    woundsEdit has gained focus
    woundsEdit has lost focus
    wounds has gained focus

    So I'm not sure what is causing the focus to return to the original control. Is this possibly something at a very low level that the double click even is doing?

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
  •  
STAR TREK 2d20

Log in

Log in