Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    limit focus to my children

    Hi, this is a how to question, really:


    I've got a TabSet and two tabs open.
    On tab1, I have some widgets and above it a canvas containing other widgets. This is like a modal window, but not using the standard Window and isModal(true) feature for this, because when the popup is shown on tab1, the user still can navigate to tab2 and do stuff there.

    I would like to limit the tab key (to control focus) use to the widgets in that modal popup. When the user goes to tab2, he can use the tab key as normal there.

    I'm not sure how to achieve this. I can set focus on the popup onDraw, but somehow I would need to know that when the FocusChangedEvent stops at one of the children of the popup, it should set the focus back to the first widget to the first child.
    I now have the problem where pressing the tab key lots of times, puts focus on the widget under the popup.

    We do have a "modal mask" canvas which catches the mouse clicks on all things not from the popup.


    Can you suggest a way to do this?



    TIA

    #2
    The best approach to leverage the framework's built-in support for modality is to place all elements (both tabs) into a modal window. This is probably also the clearest and most familiar interface for the end user.

    Otherwise you could use a combination of keyDown/keyPress handlers to catch tab keyPresses and manually move focus back to the first focusable element. But at this point you would be rebuilding the framework's modality features, and this is very very hard once you understand all the nuances.

    Comment


      #3
      It sounds like you're suggesting this:
      Code:
      when user wants to open an object,
      create a new Tab to show Canvas theUsualTabContent.
      instead of tabset.addTab(new Tab(theUsualTabContent))
      do:
      
      w = new Window()
      w.setIsModal(true)
      w.setItem(theUsualTabContent)
      
      tabset.addTab(new Tab(w))
      Then I have to strip down the Window to not make it look like a Window.
      That's a good idea, if it works, as I thought modality bubbles up to the parent, so the tabset would be 'unclickable' still. So will the modality features be limited then to that tab?

      Then this makes me wonder: is it hard for you to refactor the modality features from Window to Canvas?

      Comment


        #4
        We're not sure of your structure, but our suggestion is: show modal functionality in a modal Window.

        You seem to be considering trying to make just one tab modal while keeping the ability to click on the tab bar - we would say this is a bad idea because end users understand modal windows but not other concepts of modality.

        Comment


          #5
          Hmm, I think most users will understand, and it's just basic behavior of a tabbed application - like Windows:

          - Open up two Windows Explorers
          - Open Tools -> Folder Options
          you can still switch (by clicking on the Windows taskbar) to the other Explorer and do exactly the same.

          Comment


            #6
            What you're describing from Windows is basically window-specific modality - this isn't something we currently support, so you'd need to add your own system for such masking.

            We can't tell if this is intended to be similar to your original description, which sounded like trying to have modality for something that is not in a window.

            Comment

            Working...
            X