示例#1
0
            public ViewModel(string id, string name, TabSelected tabSelected)
            {
                Id   = id;
                Name = name;

                TabSelected = tabSelected;
            }
示例#2
0
        /// <summary>
        /// Called when selected tab index is changed.
        /// </summary>
        private void SelectedTabIndexChanged()
        {
            TabSwitcher.SwitchTo(SelectedTabIndex);

            // toggle header
            if (TabHeaderGroup.LayoutChildren.Count > SelectedTabIndex)
            {
                if (SelectedTabIndex < 0)
                {
                    foreach (TabHeader tabHeader in TabHeaderGroup.LayoutChildren)
                    {
                        tabHeader.ToggleValue = false;
                    }
                }
                else
                {
                    (TabHeaderGroup.LayoutChildren[SelectedTabIndex] as TabHeader).ToggleValue = true;

                    var tab = TabSwitcher.ActiveView as Tab;
                    TabSelectionActionData data = new TabSelectionActionData {
                        IsSelected = true, Tab = tab, Item = tab.Item
                    };
                    TabSelected?.Invoke(this, data);
                }
            }
        }
    // GUI //

    void OnGUI()
    {
        if (!DialogEnabled)
        {
            return;
        }


        GUI.skin = MenuSkin;

        // Position the dialog centrally
        dialogPosition = new Vector2((Screen.width - PanelHeader.width) / 2, (Screen.height - PanelHeight) / 2);
        GUILayout.BeginArea(new Rect(dialogPosition.x, dialogPosition.y, PanelHeader.width, PanelHeight));


        // build dialog panel out of header, middle, and footer
        Util.DrawActualSizeTexture(new Vector2(0, 0), PanelHeader);
        GUI.DrawTexture(new Rect(0, PanelHeader.height, PanelBody.width, PanelHeight - PanelHeader.height - PanelFooter.height), PanelBody);
        Util.DrawActualSizeTexture(new Vector2(0, PanelHeight - PanelFooter.height), PanelFooter);

        // Display current inventory of items
        GUI.Label(BombsRect, string.Format("{0}", mainMenu.NumBombs), MenuSkin.GetStyle("price_item_hover"));
        GUI.Label(LivesRect, string.Format("{0}", mainMenu.NumLives), MenuSkin.GetStyle("price_item_hover"));
        GUI.Label(CoinsRect, string.Format("{0}", mainMenu.CoinBalance), MenuSkin.GetStyle("price_item_hover"));


        // draw tab selector buttons
        if (DrawTabButton(ItemsButtonPos, "Products", tabSelected == TabSelected.PRODUCTS_TAB ? "product_tab_selected" : "product_tab"))
        {
            tabSelected = TabSelected.PRODUCTS_TAB;
        }
        if (DrawTabButton(CoinsButtonPos, "Coins", tabSelected == TabSelected.COINS_TAB ? "coins_tab_selected" : "coins_tab"))
        {
            tabSelected       = TabSelected.COINS_TAB;
            mobilePaymentsTab = false;
        }

        // Draw the currently selected tab
        if (tabSelected == TabSelected.PRODUCTS_TAB)
        {
            DrawProductOptions();
        }
        if (tabSelected == TabSelected.COINS_TAB)
        {
            DrawCoinOptions();
        }

        // Close dialog button
        if (GUI.Button(CloseButtonRect, "", MenuSkin.GetStyle("invisible_button")))
        {
            DialogEnabled = false;
        }

        GUILayout.EndArea();


        // Make call to draw popup messages here to ensure they are drawn on top of the dialog
        mainMenu.DrawPopupMessage();
    }
            public ViewModel(string roleId, string roleName, RoleTypes roleType, TabSelected tabSelected)
            {
                RoleId   = roleId;
                RoleName = roleName;
                RoleType = roleType;

                TabSelected = tabSelected;
            }
示例#5
0
        public void HandleTabSelected(IDMigrationMode newMode)
        {
            if (currentTab != null)
            {
                currentTab.MoveToOffset(new Vector2(0, -10), 500, Easing.OutQuint);
                currentTab.Selected = false;
            }

            (currentTab = this[newMode]).MoveToOffset(new Vector2(0, 10), 500, Easing.InQuint);
            TabSelected?.Invoke(newMode);
        }
        /// <summary>
        /// The constructior of the mainwindow which initiates and creates the necessary objects.
        /// </summary>
        public MainWindow()
        {
            InitializeComponent();
            System.Drawing.Bitmap bitmap = AddressCollectorApplication.Properties.Resources.sweden_map;
            populationenRendering      = new MapRenderingHandler(mapImage, canvas, System.Drawing.Color.Red, bitmap);
            populationenRendering_Copy = new MapRenderingHandler(mapImage_Copy, canvas_Copy, System.Drawing.Color.Blue, bitmap.Width, bitmap.Height);

            this.personListInformationHandler = new PersonListInformationHandler();
            this.siteInformationHandler       = new StaticMapDataHandler();
            this.tabSelected = TabSelected.Webscraping;
        }
示例#7
0
 protected virtual void OnIsSelectedChanged(bool oldValue, bool newValue)
 {
     if (newValue)
     {
         TabSelected?.Invoke(this, new EventArgs());
     }
     else
     {
         TabDeselected?.Invoke(this, new EventArgs());
     }
     NotifyPropertyChanged(nameof(IsSelected));
 }
 /// <summary>
 /// Method fired whene the tab is on focus.
 /// </summary>
 /// <param name="sender">The caller or the sender object which is the object to fire the event.</param>
 /// <param name="e">Arguments sent from the caller.</param>
 private void TabItem_GotFocus(object sender, RoutedEventArgs e)
 {
     if (sender.Equals(searchTab))
     {
         tabSelected = TabSelected.Search;
         populationenRendering.SetCrossHairVisibility(false);
         populationenRendering_Copy.SetCrossHairVisibility(false);
     }
     else if (sender.Equals(webscrapingTab))
     {
         tabSelected = TabSelected.Webscraping;
         populationenRendering.SetCrossHairVisibility(true);
         populationenRendering_Copy.SetCrossHairVisibility(false);
     }
 }
示例#9
0
        /// <summary>
        /// Handler for tab selection.
        /// </summary>
        /// <param name="control">Event source (TabButton).</param>
        internal virtual void OnTabPressed(Control control)
        {
            TabButton button = control as TabButton;

            if (null == button)
            {
                return;
            }

            Control page = button.Page;

            if (null == page)
            {
                return;
            }

            if (m_CurrentButton == button)
            {
                return;
            }

            if (null != m_CurrentButton)
            {
                Control page2 = m_CurrentButton.Page;
                if (page2 != null)
                {
                    page2.IsHidden = true;
                }
                m_CurrentButton.Redraw();
                m_CurrentButton = null;
            }

            m_CurrentButton = button;

            if (TabSelected != null)
            {
                TabSelected.Invoke(m_CurrentButton);
            }

            page.IsHidden = false;

            m_TabStrip.Invalidate();
            Invalidate();
        }
示例#10
0
 private void NotebookSwitchPage(object o, SwitchPageArgs args)
 {
     try
     {
         if (setupComplete && nbook.CurrentPage >= 0)
         {
             string selectedLabel         = nbook.GetTabLabelText(nbook.GetNthPage(nbook.CurrentPage));
             TabChangedEventArgs tabEArgs = new TabChangedEventArgs(selectedLabel);
             if (TabSelected != null)
             {
                 TabSelected.Invoke(this, tabEArgs);
             }
         }
     }
     catch (Exception err)
     {
         ShowError(err);
     }
 }
        private static void DisplayTabButtons()
        {
            GUILayout.BeginHorizontal();
            var attributeStyle = SelectedTab == TabSelected.Attributes ? RMStyle.ButtonToggledStyle : RMStyle.ButtonStyle;

            if (GUILayout.Button("Attributes", attributeStyle, GUILayout.Height(20)))
            {
                SelectedTab = TabSelected.Attributes;
            }
            var trainingStyle = SelectedTab == TabSelected.Training ? RMStyle.ButtonToggledStyle : RMStyle.ButtonStyle;

            if (GUILayout.Button("Training", trainingStyle, GUILayout.Height(20)))
            {
                SelectedTab = TabSelected.Training;
            }
            var medicalStyle = SelectedTab == TabSelected.Medical ? RMStyle.ButtonToggledStyle : RMStyle.ButtonStyle;

            if (GUILayout.Button("Medical", medicalStyle, GUILayout.Height(20)))
            {
                SelectedTab = TabSelected.Medical;
            }
            var professionStyle = SelectedTab == TabSelected.Scheduleing ? RMStyle.ButtonToggledStyle : RMStyle.ButtonStyle;

            if (GUILayout.Button("Scheduling", professionStyle, GUILayout.Height(20)))
            {
                SelectedTab = TabSelected.Scheduleing;
            }
            var historyStyle = SelectedTab == TabSelected.History ? RMStyle.ButtonToggledStyle : RMStyle.ButtonStyle;

            if (GUILayout.Button("History", historyStyle, GUILayout.Height(20)))
            {
                SelectedTab = TabSelected.History;
            }
            var recordStyle = SelectedTab == TabSelected.Records ? RMStyle.ButtonToggledStyle : RMStyle.ButtonStyle;

            if (GUILayout.Button("Records", recordStyle, GUILayout.Height(20)))
            {
                SelectedTab = TabSelected.Records;
            }
            GUILayout.EndHorizontal();
        }
        /// <summary>
        /// Method fired whene the viewed is checked and changed.
        /// </summary>
        /// <param name="sender">The caller or the sender object which is the object to fire the event.</param>
        /// <param name="e">Arguments sent from the caller.</param>
        private void View_Checked(object sender, RoutedEventArgs e)
        {
            if (webscrapingTab == null || webscrapingTab == null)
            {
                return;
            }

            if (sender.Equals(viewWebScraping))
            {
                tabSelected              = TabSelected.Webscraping;
                tabControl.SelectedItem  = webscrapingTab;
                enableUncheckingMenuItem = false;
                viewSearch.IsChecked     = false;
            }

            if (sender.Equals(viewSearch))
            {
                tabSelected               = TabSelected.Search;
                tabControl.SelectedItem   = searchTab;
                enableUncheckingMenuItem  = false;
                viewWebScraping.IsChecked = false;
            }
        }
示例#13
0
 public ViewModel(string userId, TabSelected tabSelected, string userName)
 {
     UserId      = userId;
     TabSelected = tabSelected;
     UserName    = userName;
 }
示例#14
0
	// GUI //
	
	void OnGUI() 
	{
		if (!DialogEnabled)
			return;

		
		GUI.skin = MenuSkin;
		
		// Position the dialog centrally
		dialogPosition = new Vector2((Screen.width - PanelHeader.width)/2,(Screen.height-PanelHeight)/2);
		GUILayout.BeginArea(new Rect(dialogPosition.x,dialogPosition.y,PanelHeader.width,PanelHeight));

		
		// build dialog panel out of header, middle, and footer
		Util.DrawActualSizeTexture(new Vector2(0,0),PanelHeader);
		GUI.DrawTexture(new Rect (0,PanelHeader.height,PanelBody.width,PanelHeight - PanelHeader.height - PanelFooter.height), PanelBody);
		Util.DrawActualSizeTexture(new Vector2(0,PanelHeight-PanelFooter.height),PanelFooter);
		
		// Display current inventory of items
		GUI.Label(BombsRect,string.Format("{0}",mainMenu.NumBombs),MenuSkin.GetStyle("price_item_hover"));
		GUI.Label(LivesRect,string.Format("{0}",mainMenu.NumLives),MenuSkin.GetStyle("price_item_hover"));
		GUI.Label(CoinsRect,string.Format("{0}",mainMenu.CoinBalance),MenuSkin.GetStyle("price_item_hover"));
		

		// draw tab selector buttons
		if (DrawTabButton(ItemsButtonPos,"Products",tabSelected == TabSelected.PRODUCTS_TAB ? "product_tab_selected" : "product_tab"))
			tabSelected = TabSelected.PRODUCTS_TAB;
		if (DrawTabButton(CoinsButtonPos,"Coins",tabSelected == TabSelected.COINS_TAB ? "coins_tab_selected" : "coins_tab"))
		{
			tabSelected = TabSelected.COINS_TAB;
			mobilePaymentsTab = false;
		}
		
		// Draw the currently selected tab
		if (tabSelected == TabSelected.PRODUCTS_TAB)
		{
			DrawProductOptions();
		}
		if (tabSelected == TabSelected.COINS_TAB)
		{
			DrawCoinOptions();
		}
		
		// Close dialog button
		if (GUI.Button (CloseButtonRect,"",MenuSkin.GetStyle("invisible_button")))
			DialogEnabled = false;
		
		GUILayout.EndArea();


		// Make call to draw popup messages here to ensure they are drawn on top of the dialog
		mainMenu.DrawPopupMessage();
		
	}
示例#15
0
 public RoleMenuViewComponent.ViewModel ToComponentViewModel(TabSelected tabSelected)
 {
     return(new ViewModel(RoleId, Name, Type, tabSelected));
 }
示例#16
0
 public ViewModel(string roleId, TabSelected tabSelected, string roleName)
 {
     RoleId      = roleId;
     TabSelected = tabSelected;
     RoleName    = roleName;
 }
示例#17
0
 /// <summary>
 /// Event Handler para a acção Send
 /// </summary>
 /// <remarks>
 /// Permite activar os eventos OnSetComplete, OnTransfer ou OnRequestForComments
 /// consoante a opção seleccionada
 /// </remarks>
 protected void TabClick(object sender, EventArgs e)
 {
     TabSelected.Invoke(this, e);
 }
示例#18
0
 private void tabControl_SelectedIndexChanged(object sender, EventArgs e)
 {
     TabSelected?.Invoke(tabControl.SelectedIndex);
 }
示例#19
0
 public IViewComponentResult Invoke(string roleId, TabSelected tabSelected, string roleName)
 {
     return(View("Default", new ViewModel(roleId, tabSelected, roleName)));
 }
示例#20
0
 public IViewComponentResult Invoke(string userId, TabSelected tabSelected, string userName)
 {
     return(View("Default", new ViewModel(userId, tabSelected, userName)));
 }
示例#21
0
        //private void Grid_PreviewKeyDown(object sender, KeyEventArgs e)
        //{
        //    TabSelected?.Invoke(sender, e);
        //}

        private void Grid_PreviewMouseDown(object sender, MouseButtonEventArgs e)
        {
            TabSelected?.Invoke(sender, e);
        }
示例#22
0
            public ViewModel(string name, TabSelected tabSelected)
            {
                Name = name;

                TabSelected = tabSelected;
            }
示例#23
0
 protected virtual void OnTabSelected(EventArgs e)
 {
     TabSelected?.Invoke(this, e);
 }