public void B_SELECTING_HOST() { decision = 2; ClientPanel_2.transform.parent.GetComponent <Image>().color = ClientPanel_2.transform.parent.GetComponent <Button>().colors.highlightedColor; ClientPanel_2.transform.parent.GetComponent <Button>().enabled = false; isMakingServer = false; isSelectingHost = true; HostPanel.SetActive(false); HostPanel_2.SetActive(false); ClientPanel.SetActive(false); ClientPanel_2.SetActive(true); }
private void Start() { done = false; isMakingServer = false; isSelectingHost = false; HostPanel.SetActive(true); ClientPanel.SetActive(true); HostPanel_2.SetActive(false); ClientPanel_2.SetActive(false); decision = 0; lm = GameObject.Find("LevelManager").GetComponent <LevelManager>(); }
public void ReturnToDecision() { if (decision == 1) { HostPanel_2.transform.parent.GetComponent <Button>().enabled = true; } if (decision == 2) { ClientPanel_2.transform.parent.GetComponent <Button>().enabled = true; } decision = 0; isMakingServer = false; isSelectingHost = false; ClientPanel_2.SetActive(false); HostPanel_2.SetActive(false); ClientPanel.SetActive(true); HostPanel.SetActive(true); }
public TabControl() { // Prevent flicker with double buffering and all painting inside WM_PAINT SetStyle(ControlStyles.DoubleBuffer, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); SetStyle(ControlStyles.UserPaint, true); // Create collections _tabRects = new ArrayList(); _tabPages = new TabPageCollection(); // Hookup to collection events _tabPages.Clearing += new CollectionClear(OnClearingPages); _tabPages.Cleared += new CollectionClear(OnClearedPages); _tabPages.Inserting += new CollectionChange(OnInsertingPage); _tabPages.Inserted += new CollectionChange(OnInsertedPage); _tabPages.Removing += new CollectionChange(OnRemovingPage); _tabPages.Removed += new CollectionChange(OnRemovedPage); // Define the default state of the control _startPage = -1; _pageSelected = -1; _hotTrackPage = -1; _imageList = null; _insetPlain = true; _multiline = false; _multilineFullWidth = false; _dragFromControl = true; _mouseOver = false; _leftScroll = false; _defaultFont = true; _defaultColor = true; _rightScroll = false; _hoverSelect = false; _leftMouseDown = false; _ignoreDownDrag = true; _selectedTextOnly = false; _leftMouseDownDrag = false; _insetBorderPagesOnly = false; _hideTabsMode = HideTabsModes.ShowAlways; _recordFocus = true; _styleIndex = 1; _leaveTimeout = 200; _ctrlTopOffset = 0; _ctrlLeftOffset = 0; _ctrlRightOffset = 0; _ctrlBottomOffset = 0; _style = VisualStyle.IDE; _buttonActiveColor = Color.FromArgb(128, this.ForeColor); _buttonInactiveColor = _buttonActiveColor; _textColor = TabControl.DefaultForeColor; _textInactiveColor = Color.FromArgb(128, _textColor); _hotTextColor = SystemColors.ActiveCaption; // Create the panel that hosts each page control. This is done to prevent the problem where a // hosted Control/Form has 'AutoScaleBaseSize' defined. In which case our attempt to size it the // first time is ignored and the control sizes itself to big and would overlap the tabs area. _hostPanel = new HostPanel(); _hostPanel.Location = new Point(-1,-1); _hostPanel.Size = new Size(0,0); _hostPanel.MouseEnter += new EventHandler(OnPageMouseEnter); _hostPanel.MouseLeave += new EventHandler(OnPageMouseLeave); // Create hover buttons _closeButton = new InertButton(_internalImages, (int)ImageStrip.Close); _leftArrow = new InertButton(_internalImages, (int)ImageStrip.LeftEnabled, (int)ImageStrip.LeftDisabled); _rightArrow = new InertButton(_internalImages, (int)ImageStrip.RightEnabled, (int)ImageStrip.RightDisabled); // We want our buttons to have very thin borders _closeButton.BorderWidth = _leftArrow.BorderWidth = _rightArrow.BorderWidth = 1; // Hookup to the button events _closeButton.Click += new EventHandler(OnCloseButton); _leftArrow.Click += new EventHandler(OnLeftArrow); _rightArrow.Click += new EventHandler(OnRightArrow); // Set their fixed sizes _leftArrow.Size = _rightArrow.Size = _closeButton.Size = new Size(_buttonWidth, _buttonHeight); // Add child controls Controls.AddRange(new Control[]{_closeButton, _leftArrow, _rightArrow, _hostPanel}); // Grab some contant values _imageWidth = 16; _imageHeight = 16; // Default to having a MultiForm usage SetAppearance(VisualAppearance.MultiForm); // Need a timer so that when the mouse leaves, a fractionaly delay occurs before // noticing and hiding the tabs area when the appropriate style is set _overTimer = new Timer(); _overTimer.Interval = _leaveTimeout; _overTimer.Tick += new EventHandler(OnMouseTick); // Need notification when the MenuFont is changed Microsoft.Win32.SystemEvents.UserPreferenceChanged += new UserPreferenceChangedEventHandler(OnPreferenceChanged); // Define the default Font, BackColor and Button images DefineFont(SystemInformation.MenuFont); DefineBackColor(SystemColors.Control); DefineButtonImages(); Recalculate(); }
public ControlPanelItem() { this.m_HostPanel = new HostPanel(this); }