Ejemplo n.º 1
0
 private void clearButtons()
 {
     flowLayout.clearChildren();
     foreach (NavigationButton navButton in buttons)
     {
         navButton.Dispose();
     }
     buttons.Clear();
     selectedButton = null;
 }
Ejemplo n.º 2
0
 void navModel_CurrentIndexChanged(NavigationModel navModel)
 {
     if (buttons.Count > 0)
     {
         if (selectedButton != null)
         {
             selectedButton.Selected = false;
         }
         selectedButton          = buttons[navModel.CurrentIndex];
         selectedButton.Selected = true;
     }
 }
Ejemplo n.º 3
0
        private void addButton(String action, String text, String imageKey)
        {
            Button button = iconScrollView.createWidgetT("Button", "VerticalIconTextButton", 0, 0, NavButtonWidth, NavButtonHeight, Align.Default, "") as Button;

            button.Caption = text;
            button.ForwardMouseWheelToParent = true;
            int captionWidth = (int)button.getTextSize().Width;

            button.setSize(captionWidth + CaptionPadding, button.Height);
            button.ImageBox.setItemResource(imageKey);
            NavigationButton navButton = new NavigationButton(button);

            navButton.Clicked += new EventDelegate <NavigationButton>(navButton_Clicked);
            navButton.Action   = action;
            navButton.Visible  = true;
            flowLayout.addChild(navButton.Layout);
            buttons.Add(navButton);

            //Adjust scroll area size
            IntSize2 size = iconScrollView.CanvasSize;

            size.Width = flowLayout.DesiredSize.Width;
            iconScrollView.CanvasSize = size;
        }
Ejemplo n.º 4
0
 void navButton_Clicked(NavigationButton source)
 {
     navModel.CurrentIndex = buttons.IndexOf(source);
     context.runAction(source.Action, ViewHost);
 }