Home Forums FlexGantt Hiding button that pops up the horizon control

  • Author
    Posts
  • Brian
    Participant
    Post count: 21
    #12862 |

    There is a small button in the upper right corner that pops up a selector for adjusting the horizon. I believe this is TimeGranularityTimelineControlPanel. In some cases, I would like to hide that button.
    I know I can find it by name and setEnabled(false), which works, but also leaves me with no icon.
    Is there a more elegant way to temporarily hide/remove that button?

  • Dirk Lemmermann
    Keymaster
    Post count: 64
    #12863 |

    The control in the upper right corner is called “NavigationControlPanel”. It consists of many NavigationControls.

    NavigationControlPane.getNavigationControl(NavigationControlType.TIME_SPAN).setVisible(false);

    Ideally you create your own instance of IComponentFactory (subclass DefaultComponentFactory) and override the createLayerContainerCorner() method. Inside this method always call super.createLayerContainerCorner(). When the corner is “UPPER_RIGHT” you can cast the returned component to NavigationControlPane and call the above method.

     

     

  • Brian
    Participant
    Post count: 21
    #12867 |

    I’ll give that a shot now. I did look over the NavigationControlPanel code a bunch. But, I was focused on a call that would get me a singleton to use. I was afraid that creating another instance would cause problems with the UI rendering or listeners.

You must be logged in to reply to this topic.