Esempio n. 1
0
        public frmLegendsViewer(string file = "")
        {
            InitializeComponent();

            System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();
            FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(assembly.Location);
            version = fvi.FileVersion;

            Text = "Legends Viewer";
            lblVersion.Text = "v" + version;
            FileLoader = new FileLoader(this, btnXML, txtXML, btnHistory, txtHistory, btnSitePops, txtSitePops, btnMap, txtMap, lblStatus, txtLog);
            EventTabs = new TabPage[] { tpHFEvents, tpSiteEvents, tpRegionEvents, tpURegionEvents, tpCivEvents, tpWarEvents, tpBattlesEvents, tpConqueringsEvents, tpEraEvents, tpBeastAttackEvents, tpArtifactsEvents };
            tcWorld.Height = ClientSize.Height;
            btnBack.Location = new Point(tcWorld.Right + 3, 3);
            btnForward.Location = new Point(btnBack.Right + 3, 3);
            Browser = new DwarfTabControl(world);
            Browser.Location = new Point(tcWorld.Right, btnBack.Bottom + 3);
            Browser.Size = new Size(ClientSize.Width - Browser.Left , ClientSize.Height - Browser.Top);
            Browser.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Right);
            Controls.Add(Browser);
            foreach (TabPage tp in tcWorld.TabPages)
                foreach (TabControl tabControl in tp.Controls.OfType<TabControl>())
                    HideTabControlBorder(tabControl);
            if (file != "")
                CommandFile = file;

            hint.SetToolTip(chkFilterWarfare, "Unnotable Battle = Attackers outnumber defenders 10 to 1 and win and suffer < 10% losses. \nUnnotable Conquering = All Pillagings.");
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="TaskPropertiesControl"/> class.
        /// </summary>
        public TaskPropertiesControl()
        {
            InitializeComponent();

            // Push all tab pages into a list so they don't get garbage collected while not displayed
            tabPages = new TabPage[tabControl.TabPages.Count];
            for (int i = 0; i < tabControl.TabPages.Count; i++)
                tabPages[i] = tabControl.TabPages[i];

            // Try to get the system help topic from the registry
            try
            {
                using (Microsoft.Win32.RegistryKey key = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\MMC\SnapIns\FX:{c7b8fb06-bfe1-4c2e-9217-7a69a95bbac4}"))
                    helpProvider.HelpNamespace = key.GetValue("HelpTopic", string.Empty).ToString();
            }
            catch { }

            // Settings for conditionsTab
            long allVal;
            taskIdleDurationCombo.Items.AddRange(new TimeSpan2[] { TimeSpan2.FromMinutes(1), TimeSpan2.FromMinutes(5), TimeSpan2.FromMinutes(10), TimeSpan2.FromMinutes(15), TimeSpan2.FromMinutes(30), TimeSpan2.FromMinutes(60) });
            taskIdleWaitTimeoutCombo.FormattedZero = EditorProperties.Resources.TimeSpanDoNotWait;
            taskIdleWaitTimeoutCombo.Items.AddRange(new TimeSpan2[] { TimeSpan2.Zero, TimeSpan2.FromMinutes(1), TimeSpan2.FromMinutes(5), TimeSpan2.FromMinutes(10), TimeSpan2.FromMinutes(15), TimeSpan2.FromMinutes(30), TimeSpan2.FromHours(1), TimeSpan2.FromHours(2) });

            // Settings for settingsTab
            taskRestartIntervalCombo.Items.AddRange(new TimeSpan2[] { TimeSpan2.FromMinutes(1), TimeSpan2.FromMinutes(5), TimeSpan2.FromMinutes(10), TimeSpan2.FromMinutes(15), TimeSpan2.FromMinutes(30), TimeSpan2.FromHours(1), TimeSpan2.FromHours(2) });
            taskExecutionTimeLimitCombo.Items.AddRange(new TimeSpan2[] { TimeSpan2.FromHours(1), TimeSpan2.FromHours(2), TimeSpan2.FromHours(4), TimeSpan2.FromHours(8), TimeSpan2.FromHours(12), TimeSpan2.FromDays(1), TimeSpan2.FromDays(3) });
            taskDeleteAfterCombo.FormattedZero = EditorProperties.Resources.TimeSpanImmediately;
            taskDeleteAfterCombo.Items.AddRange(new TimeSpan2[] { TimeSpan2.Zero, TimeSpan2.FromDays(30), TimeSpan2.FromDays(90), TimeSpan2.FromDays(180), TimeSpan2.FromDays(365) });
            ComboBoxExtension.InitializeFromEnum(taskMultInstCombo.Items, typeof(TaskInstancesPolicy), EditorProperties.Resources.ResourceManager, "TaskInstances", out allVal);

            // Settings for addPropTab
            ComboBoxExtension.InitializeFromEnum(principalSIDTypeCombo.Items, typeof(TaskProcessTokenSidType), EditorProperties.Resources.ResourceManager, "SIDType", out allVal);
            ComboBoxExtension.InitializeFromEnum(taskPriorityCombo.Items, typeof(System.Diagnostics.ProcessPriorityClass), EditorProperties.Resources.ResourceManager, "ProcessPriority", out allVal);
            principalReqPrivilegesDropDown.Sorted = true;
            principalReqPrivilegesDropDown.InitializeFromEnum(typeof(TaskPrincipalPrivilege), EditorProperties.Resources.ResourceManager, "");
            taskMaintenanceDeadlineCombo.Items.AddRange(new TimeSpan2[] { TimeSpan.Zero, TimeSpan2.FromDays(1), TimeSpan2.FromDays(2), TimeSpan2.FromDays(7), TimeSpan2.FromDays(14), TimeSpan2.FromDays(30) });
            taskMaintenanceDeadlineCombo.FormattedZero = EditorProperties.Resources.TimeSpanNotStarted;
            taskMaintenancePeriodCombo.Items.AddRange(new TimeSpan2[] { TimeSpan2.Zero, TimeSpan2.FromMinutes(1), TimeSpan2.FromMinutes(15), TimeSpan2.FromHours(1), TimeSpan2.FromHours(12), TimeSpan2.FromDays(1), TimeSpan2.FromDays(7) });
            taskMaintenancePeriodCombo.FormattedZero = EditorProperties.Resources.TimeSpanImmediately;

            // Settings for shown tabs
            AvailableTabs = AvailableTaskTabs.Default;

            // Initialize all the controls as not editable
            InitControls(false);
        }
Esempio n. 3
0
        public frmLegendsViewer(string file = "")
        {
            InitializeComponent();
            EventTabs = new TabPage[] { tpHFEvents, tpSiteEvents, tpRegionEvents, tpURegionEvents, tpCivEvents, tpWarEvents, tpBattlesEvents, tpConqueringsEvents, tpEraEvents, tpBeastAttackEvents };
            tcWorld.Height = ClientSize.Height;
            btnBack.Location = new Point(tcWorld.Right + 3, 3);
            btnForward.Location = new Point(btnBack.Right + 3, 3);
            Browser = new DwarfTabControl(world);
            Browser.Location = new Point(tcWorld.Right, btnBack.Bottom + 3);
            Browser.Size = new Size(ClientSize.Width - Browser.Left , ClientSize.Height - Browser.Top);
            Browser.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Right);
            Controls.Add(Browser);
            foreach (TabPage tp in tcWorld.TabPages)
                foreach (TabControl tabControl in tp.Controls.OfType<TabControl>())
                    HideTabControlBorder(tabControl);
            CommandFile = file;
            if (CommandFile != "") openFiles(null, null);

            hint.SetToolTip(chkFilterWarfare, "Unnotable Battle = Attackers outnumber defenders 10 to 1 and win and suffer < 10% losses. \nUnnotable Conquering = All Pillagings.");
        }
    private void ExternalChannels_Load(object sender, EventArgs e)
    {
      ArrayList cards = new ArrayList();
      TVDatabase.GetCards(ref cards);

      if (cards.Count == 0)
        cards.Add(0);

      _tvCardTabs = new TabPage[cards.Count];
      _tvCardStbSetups = new StbSetup[cards.Count];

      comboBoxCopyFrom.Items.Clear();

      int index = 0;
      foreach (int cardId in cards)
      {
        string cardName = String.Format("TV Card {0}", cardId);

        comboBoxCopyFrom.Items.Add(cardName);

        _tvCardStbSetups[index] = new StbSetup(cardId);
        _tvCardStbSetups[index].Name = "StbSetup" + index;
        _tvCardStbSetups[index].Dock = DockStyle.Fill;

        _tvCardTabs[index] = new TabPage(cardName);
        _tvCardTabs[index].Controls.Add(_tvCardStbSetups[index]);

        tabControlTVCards.TabPages.Add(_tvCardTabs[index]);

        index++;
      }

      comboBoxCopyFrom.SelectedIndex = 0;

      // Setup quick setup combo box
      string[] quickSetupFiles = Directory.GetFiles(Common.FolderSTB, "*.xml", SearchOption.TopDirectoryOnly);
      foreach (string file in quickSetupFiles)
        comboBoxQuickSetup.Items.Add(Path.GetFileNameWithoutExtension(file));

      comboBoxQuickSetup.Items.Add("Clear all");
    }
 protected void RemoveAll()
 {
     base.Controls.Clear();
     base.SendMessage(0x1309, 0, 0);
     this.tabPages = null;
     this.tabPageCount = 0;
 }
 internal override void RecreateHandleCore()
 {
     TabPage[] tabPages = this.GetTabPages();
     int num = ((tabPages.Length > 0) && (this.SelectedIndex == -1)) ? 0 : this.SelectedIndex;
     if (base.IsHandleCreated)
     {
         base.SendMessage(0x1309, 0, 0);
     }
     this.tabPages = null;
     this.tabPageCount = 0;
     base.RecreateHandleCore();
     for (int i = 0; i < tabPages.Length; i++)
     {
         this.TabPages.Add(tabPages[i]);
     }
     try
     {
         this.tabControlState[0x10] = true;
         this.SelectedIndex = num;
     }
     finally
     {
         this.tabControlState[0x10] = false;
     }
     this.UpdateSize();
 }
 internal void Insert(int index, TabPage tabPage)
 {
     if (this.tabPages == null)
     {
         this.tabPages = new TabPage[4];
     }
     else if (this.tabPages.Length == this.tabPageCount)
     {
         TabPage[] destinationArray = new TabPage[this.tabPageCount * 2];
         Array.Copy(this.tabPages, 0, destinationArray, 0, this.tabPageCount);
         this.tabPages = destinationArray;
     }
     if (index < this.tabPageCount)
     {
         Array.Copy(this.tabPages, index, this.tabPages, index + 1, this.tabPageCount - index);
     }
     this.tabPages[index] = tabPage;
     this.tabPageCount++;
     this.cachedDisplayRect = Rectangle.Empty;
     this.ApplyItemSize();
     if (this.Appearance == TabAppearance.FlatButtons)
     {
         base.Invalidate();
     }
 }
Esempio n. 8
0
 void LoadForm()
 {
     formLoaded = true;
     detector = new DeviceDetector(false);
     detector.DeviceChanged += new DeviceDetector.DeviceDetectorEventHandler(detector_DeviceChanged);
     BusyLoadingCircle.Visible = false;
     BusyLoadingCircle.Top = HeaderPictureBox.Top;
     BusyLoadingCircle.Left = HeaderPictureBox.Left;
     defaultBody = HelpBodyLabel.Text;
     //if (DesignMode) return;
     OptionsPanel.InitOptions();
     // Set status.
     StatusSaveLabel.Visible = false;
     StatusEventsLabel.Visible = false;
     // Load Tab pages.
     ControlPages = new TabPage[4];
     ControlPages[0] = Pad1TabPage;
     ControlPages[1] = Pad2TabPage;
     ControlPages[2] = Pad3TabPage;
     ControlPages[3] = Pad4TabPage;
     //BuletImageList.Images.Add("bullet_square_glass_blue.png", new Bitmap(Helper.GetResource("Images.bullet_square_glass_blue.png")));
     //BuletImageList.Images.Add("bullet_square_glass_green.png", new Bitmap(Helper.GetResource("Images.bullet_square_glass_green.png")));
     //BuletImageList.Images.Add("bullet_square_glass_grey.png", new Bitmap(Helper.GetResource("Images.bullet_square_glass_grey.png")));
     //BuletImageList.Images.Add("bullet_square_glass_red.png", new Bitmap(Helper.GetResource("Images.bullet_square_glass_red.png")));
     //BuletImageList.Images.Add("bullet_square_glass_yellow.png", new Bitmap(Helper.GetResource("Images.bullet_square_glass_yellow.png")));
     foreach (var item in ControlPages) item.ImageKey = "bullet_square_glass_grey.png";
     // Hide status values.
     StatusDllLabel.Text = "";
     MainStatusStrip.Visible = false;
     // Check if INI and DLL is on disk.
     WarningsForm.CheckAndOpen();
     if (!CheckFiles(true)) return;
     CheckEncoding(SettingManager.TmpFileName);
     CheckEncoding(SettingManager.IniFileName);
     // Show status values.
     MainStatusStrip.Visible = true;
     // Load PAD controls.
     ControlPads = new Controls.PadControl[4];
     for (int i = 0; i < ControlPads.Length; i++)
     {
         ControlPads[i] = new Controls.PadControl(i);
         ControlPads[i].Name = string.Format("ControlPad{0}", i + 1);
         ControlPads[i].Dock = DockStyle.Fill;
         ControlPages[i].Controls.Add(ControlPads[i]);
         ControlPads[i].InitPadControl();
     }
     // Initialize presets. Execute only after name of cIniFile is set.
     SettingsDatabasePanel.InitPresets();
     // Allow events after PAD control are loaded.
     MainTabControl.SelectedIndexChanged += new System.EventHandler(this.MainTabControl_SelectedIndexChanged);
     // Load about control.
     ControlAbout = new Controls.AboutControl();
     ControlAbout.Dock = DockStyle.Fill;
     AboutTabPage.Controls.Add(ControlAbout);
     // Update settings map.
     UpdateSettingsMap();
     ReloadXinputSettings();
     ////InitDirectInputTab();
     //// Timer will execute ReloadXInputLibrary();
     ////XInput.ReLoadLibrary(cXinput3File);
     ////XInput.ReLoadLibrary(cXinput3File);
     //// start capture events.
     if (WinAPI.IsVista && WinAPI.IsElevated() && WinAPI.IsInAdministratorRole) this.Text += " (Administrator)";
     ////ReloadXInputLibrary();
 }
Esempio n. 9
0
        internal override void RecreateHandleCore() {
            // 
            TabPage[] tabPages = GetTabPages();

            int index = ((tabPages.Length > 0) && (SelectedIndex == -1)) ? 0: SelectedIndex;

            // We don't actually want to remove the windows forms Tabpages - we only
            // want to remove the corresponding TCITEM structs.
            // So, no RemoveAll()
            if (IsHandleCreated) {
                SendMessage(NativeMethods.TCM_DELETEALLITEMS, 0, 0);
            }
            this.tabPages = null;
            tabPageCount = 0;

            base.RecreateHandleCore();

            for (int i = 0; i < tabPages.Length; i++) {
                TabPages.Add(tabPages[i]);
            }
            try {
                tabControlState[TABCONTROLSTATE_fromCreateHandles] = true;
                SelectedIndex = index;
            }
            finally {
                tabControlState[TABCONTROLSTATE_fromCreateHandles] = false;
            }

            // The comctl32 TabControl seems to have some painting glitches. Briefly
            // resizing the control seems to fix these.
            //
            UpdateSize();
        }
Esempio n. 10
0
        /// <summary>
        /// The control must be initialized by calling this method during the host's OnLoad event.
        /// </summary>
        /// <param name="hostInstance">
        /// Interface implemented by the host object.
        /// </param>
        /// <param name="propertyPages">
        /// The array of pages to display on the tab control.
        /// </param>
        /// <param name="settings">
        /// The settings to read from and write to.
        /// </param>
        /// <param name="coreInstance">
        /// The StyleCop core instance.
        /// </param>
        /// <param name="contextItem">
        /// The context for the property control.
        /// </param>
        internal void Initialize(
            IPropertyControlHost hostInstance, 
            IList<IPropertyControlPage> propertyPages, 
            WritableSettings settings, 
            StyleCopCore coreInstance, 
            params object[] contextItem)
        {
            Param.AssertNotNull(hostInstance, "hostInstance");
            Param.Assert(propertyPages != null && propertyPages.Count > 0, "propertyPages", "Cannot be null or empty");
            Param.AssertNotNull(settings, "settings");
            Param.AssertNotNull(coreInstance, "coreInstance");
            Param.Ignore(contextItem);

            // Make sure we haven't already been intialized.
            if (this.host != null)
            {
                throw new StyleCopException(Strings.PropertyControlAlreadyInitialized);
            }

            this.host = hostInstance;
            this.pageInterfaces = propertyPages;
            this.localSettings = settings;
            this.core = coreInstance;
            this.context = contextItem;

            // Set the contents of the parent settings file.
            SettingsMerger merger = new SettingsMerger(this.localSettings, this.core.Environment);
            this.parentSettings = merger.ParentMergedSettings;
            this.mergedSettings = merger.MergedSettings;

            // Set up the settings comparer.
            this.settingsComparer = new SettingsComparer(this.localSettings, this.parentSettings);

            // Make sure the context is non-null.
            if (this.context == null)
            {
                this.context = new object[] { };
            }

            this.tabPages = new TabPage[propertyPages.Count];
            this.pages = new UserControl[propertyPages.Count];

            // Add each of the property pages.
            int pageCount = 0;

            // Initialize the settings pages.
            for (int i = 0; i < propertyPages.Count; ++i)
            {
                this.pages[pageCount] = (UserControl)this.pageInterfaces[i];
                TabPage tabPage = new TabPage(this.pageInterfaces[i].TabName);

                this.tabPages[pageCount] = tabPage;
                tabPage.Controls.Add(this.pages[i]);
                this.Controls.Add(tabPage);

                this.pages[i].Dock = DockStyle.Fill;
                this.SizePage(i);

                // The first page has already been initialized.
                this.pageInterfaces[i].Initialize(this);

                ++pageCount;
            }

            // Activate the first page.
            if (this.TabPages[0] != null)
            {
                this.SelectedTab = this.tabPages[0];
                this.pageInterfaces[0].Activate(true);
            }

            this.SizeChanged += this.OnSizeChanged;
        }
Esempio n. 11
0
 void UpdateForm1()
 {
     InitDevices();
     //if (DesignMode) return;
     OptionsPanel.InitOptions();
     // Set status.
     StatusSaveLabel.Visible = false;
     StatusEventsLabel.Visible = false;
     // Load Tab pages.
     ControlPages = new TabPage[4];
     ControlPages[0] = Pad1TabPage;
     ControlPages[1] = Pad2TabPage;
     ControlPages[2] = Pad3TabPage;
     ControlPages[3] = Pad4TabPage;
     //BuletImageList.Images.Add("bullet_square_glass_blue.png", new Bitmap(Helper.GetResource("Images.bullet_square_glass_blue.png")));
     //BuletImageList.Images.Add("bullet_square_glass_green.png", new Bitmap(Helper.GetResource("Images.bullet_square_glass_green.png")));
     //BuletImageList.Images.Add("bullet_square_glass_grey.png", new Bitmap(Helper.GetResource("Images.bullet_square_glass_grey.png")));
     //BuletImageList.Images.Add("bullet_square_glass_red.png", new Bitmap(Helper.GetResource("Images.bullet_square_glass_red.png")));
     //BuletImageList.Images.Add("bullet_square_glass_yellow.png", new Bitmap(Helper.GetResource("Images.bullet_square_glass_yellow.png")));
     foreach (var item in ControlPages) item.ImageKey = "bullet_square_glass_grey.png";
     // Hide status values.
     StatusDllLabel.Text = "";
     MainStatusStrip.Visible = false;
     // Check for various issues.
     InitWarnigForm();
     InitDeviceForm();
 }
Esempio n. 12
0
        private void initDisplayTabs()
        {
            //primary tab
            primWidth.Text = display[0].getWidth().ToString();
            primHeight.Text = display[0].getHeight().ToString();
            primPosX.Text = display[0].getxCoord().ToString();
            primPosY.Text = display[0].getyCoord().ToString();

            //the rest
            int length=display.Length - 1;
            headTab = new TabPage[length];

            headPosX = new TextBox[length];
            headPosY = new TextBox[length];
            headHeight = new TextBox[length];
            headWidth = new TextBox[length];
            borderLeft = new TextBox[length];
            borderTop = new TextBox[length];
            FPSText = new TextBox[length];

            resText = new Label[length];
            resMul = new Label[length];
            xText = new Label[length];
            yText = new Label[length];
            topT = new Label[length];
            leftT = new Label[length];
            borderT= new Label[length];
            transpT = new Label[length];

            checkOnOff = new CheckBox[length];
            checkLocal = new CheckBox[length];
            noSync = new CheckBox[length];
            FPSlimit = new CheckBox[length];

            transpBox = new ComboBox[length];

            Font myFont=new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            for (int i = 0; i < length; i++)
            {
                //make the tab
                headTab[i] = new TabPage();

                displayRelated.Controls.Add(headTab[i]);
                headTab[i].Location = new System.Drawing.Point(4, 22);
                headTab[i].Name = "Head" + (i+1);
                headTab[i].Padding = new System.Windows.Forms.Padding(3);
                headTab[i].Size = new System.Drawing.Size(254, 281);
                //headTab[i].TabIndex = 0;
                headTab[i].Text = "Head" + (i+1);
                headTab[i].UseVisualStyleBackColor = true;

                //make the controls
                headPosX[i] = new TextBox();
                headPosY[i] = new TextBox();
                headHeight[i] = new TextBox();
                headWidth[i] = new TextBox();
                borderLeft[i] = new TextBox();
                borderTop[i] = new TextBox();
                FPSText[i] = new TextBox();

                resText[i] = new Label();
                resMul[i] = new Label();
                xText[i] = new Label();
                yText[i] = new Label();
                topT[i] = new Label();
                leftT[i] = new Label();
                borderT[i] = new Label();
                transpT[i] = new Label();

                checkOnOff[i] = new CheckBox();
                checkLocal[i] = new CheckBox();
                noSync[i] = new CheckBox();
                FPSlimit[i] = new CheckBox();

                transpBox[i] = new ComboBox();

                //Textboxes
                headPosX[i].Font = myFont;
                headPosX[i].Location = new System.Drawing.Point(106, 95);
                headPosX[i].Name = "headPosX" + (i + 1);
                headPosX[i].Size = new System.Drawing.Size(40, 22);
                headPosX[i].Leave += new System.EventHandler(this.headPosX_Leave);
                headPosX[i].Text = display[i+1].getxCoord().ToString();

                headPosY[i].Font = myFont;
                headPosY[i].Location = new System.Drawing.Point(170, 95);
                headPosY[i].Name = "headPosY" + (i + 1);
                headPosY[i].Size = new System.Drawing.Size(40, 22);
                headPosY[i].Leave += new System.EventHandler(this.headPosY_Leave);
                headPosY[i].Text = display[i + 1].getyCoord().ToString();

                headHeight[i].Font = myFont;
                headHeight[i].Location = new System.Drawing.Point(170, 60);
                headHeight[i].Name = "headHeight" + (i + 1);
                headHeight[i].Size = new System.Drawing.Size(40, 22);
                headHeight[i].Leave += new System.EventHandler(this.headHeight_Leave);
                headHeight[i].Text = display[i + 1].getHeight().ToString();

                headWidth[i].Font = myFont;
                headWidth[i].Location = new System.Drawing.Point(106, 60);
                headWidth[i].Name = "headWidth" + (i + 1);
                headWidth[i].Size = new System.Drawing.Size(40, 22);
                headWidth[i].Leave += new System.EventHandler(this.headWidth_Leave);
                headWidth[i].Text = display[i + 1].getWidth().ToString();

                FPSText[i].Enabled = false;
                FPSText[i].Font = myFont;
                FPSText[i].Location = new System.Drawing.Point(125, 180);
                FPSText[i].Size = new System.Drawing.Size(19, 22);
                FPSText[i].Text = "0";
                FPSText[i].Leave += new EventHandler(FPSlimit_changed);

                borderTop[i].Font = myFont;
                borderTop[i].Location = new System.Drawing.Point(214, 141);
                borderTop[i].Name = "Btop"+(i+1);
                borderTop[i].Size = new System.Drawing.Size(38, 22);
                borderTop[i].Text = "0";
                borderTop[i].Leave += new System.EventHandler(this.topBorder_Leave);
                GlobalTip.SetToolTip(borderTop[i], "Use this to compensate for monitor bezels.");

                borderLeft[i].Font = myFont;
                borderLeft[i].Location = new System.Drawing.Point(126, 141);
                borderLeft[i].Name = " Bleft"+(i+1);
                borderLeft[i].Size = new System.Drawing.Size(38, 22);
                borderLeft[i].Text = "0";
                borderLeft[i].Leave += new System.EventHandler(this.leftBorder_Leave);
                GlobalTip.SetToolTip(borderLeft[i], "Use this to compensate for monitor bezels.");

                //labels
                resText[i].AutoSize = true;
                resText[i].Font = myFont;
                resText[i].Location = new System.Drawing.Point(19, 63);
                resText[i].Name = "resText"+(i+1);
                resText[i].Text = "Resolution :";

                resMul[i].AutoSize = true;
                resMul[i].Font = myFont;
                resMul[i].Location = new System.Drawing.Point(150, 61);
                resMul[i].Name = "resMul" + (i + 1);
                resMul[i].Text = "x";

                xText[i].AutoSize = true;
                xText[i].Font = myFont;
                xText[i].Location = new System.Drawing.Point(19, 98);
                xText[i].Name = "xText" + (i + 1);
                xText[i].Text = "Position :   X:";

                yText[i].AutoSize = true;
                yText[i].Font = myFont;
                yText[i].Location = new System.Drawing.Point(150, 98);
                yText[i].Name = "yText" + (i + 1);
                yText[i].Text = "Y:";

                topT[i].AutoSize = true;
                topT[i].Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                topT[i].Location = new System.Drawing.Point(164, 144);
                topT[i].Text = "On top:";
                GlobalTip.SetToolTip(topT[i], "Use this to compensate for monitor bezels.");

                leftT[i].AutoSize = true;
                leftT[i].Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                leftT[i].Location = new System.Drawing.Point(91, 144);
                leftT[i].Text = "Left :";
                GlobalTip.SetToolTip(leftT[i], "Use this to compensate for monitor bezels.");

                borderT[i].AutoSize = true;
                borderT[i].Font = myFont;
                borderT[i].Location = new System.Drawing.Point(19, 141);
                borderT[i].Text = "Borders :";
                GlobalTip.SetToolTip(borderT[i], "Use this to compensate for monitor bezels.");

                transpT[i].AutoSize = true;
                transpT[i].Font = myFont;
                transpT[i].Location = new System.Drawing.Point(25, 218); ;
                transpT[i].Text = "Nonlocal transport :";
                GlobalTip.SetToolTip(transpT[i], "Choose transport format to heads which are not local.\r\nQuality should be enough f" +
            "or most(but reduces color depth to 16bit). ");

                //checkBoxes
                checkOnOff[i].AutoSize = true;
                checkOnOff[i].Checked = true;
                checkOnOff[i].CheckState = System.Windows.Forms.CheckState.Checked;
                checkOnOff[i].Font = myFont;
                checkOnOff[i].Location = new System.Drawing.Point(22, 23);
                checkOnOff[i].Name = "checkOnOff" +(i+1);
                checkOnOff[i].Size = new System.Drawing.Size(74, 20);
                checkOnOff[i].Text = "Use";
                checkOnOff[i].CheckedChanged += new EventHandler(this.checkOnOff_CheckedChanged);

                checkLocal[i].AutoSize = true;

                checkLocal[i].Font = myFont;
                checkLocal[i].Location = new System.Drawing.Point(80, 23);
                checkLocal[i].Name = "checkLocal" + (i + 1);
                checkLocal[i].Size = new System.Drawing.Size(94, 20);
                checkLocal[i].TabIndex = 10;
                checkLocal[i].Text = "Local head";
                checkLocal[i].CheckedChanged += new EventHandler(this.checkLocal_CheckedChanged);
                GlobalTip.SetToolTip(checkLocal[i], "Disable if the corresponding screen is not connected to the primary graphicscard.");

                noSync[i].AutoSize = true;
                noSync[i].Font = myFont;
                noSync[i].Location = new System.Drawing.Point(180, 23);
                noSync[i].Name = "NoSync Head"+(i+1);
                noSync[i].Size = new System.Drawing.Size(118, 20);
                noSync[i].Text = "Don\'t sync FPS";
                noSync[i].CheckedChanged += new EventHandler(noSync_CheckedChanged);
                GlobalTip.SetToolTip(noSync[i], "Use this for slow monitors (e.g. USB).");

                FPSlimit[i].AutoSize = true;
                FPSlimit[i].Font = myFont;
                FPSlimit[i].Location = new System.Drawing.Point(22, 182);
                FPSlimit[i].Text = "Limit FPS to";
                FPSlimit[i].CheckedChanged += new EventHandler(FPSLimit_CheckedChanged);
                GlobalTip.SetToolTip(FPSlimit[i], "Use this for slow monitors (e.g. USB).");

                transpBox[i].DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
                transpBox[i].FlatStyle = System.Windows.Forms.FlatStyle.System;
                transpBox[i].Font = myFont;
                transpBox[i].Items.AddRange(new object[] {
            "Use global setting",
            "High Quality",
            "Quality",
            "Performance"});
                transpBox[i].Location = new System.Drawing.Point(151, 217);
                transpBox[i].Size = new System.Drawing.Size(135, 24);
                GlobalTip.SetToolTip(transpBox[i], "Choose transport format to heads which are not local.\r\nQuality should be enough f" +
            "or most(but reduces color depth to 16bit). ");
                transpBox[i].SelectedIndexChanged += new System.EventHandler(this.primTranspBox_SelectedIndexChanged);
                transpBox[i].SelectedIndex = 0;

                if (display[i + 1].getlocal())
                {
                    checkLocal[i].Checked = true;
                    noSync[i].Enabled = false;
                    FPSlimit[i].Enabled = false;
                    transpT[i].Enabled = false;
                    transpBox[i].Enabled = false;
                }
                else
                {
                    checkLocal[i].Checked = false;
                    noSync[i].Enabled = true;
                    FPSlimit[i].Enabled = true;
                    transpT[i].Enabled = true;
                    transpBox[i].Enabled = true;
                }

                //add the controls
                headTab[i].Controls.Add(headPosX[i]);
                headTab[i].Controls.Add(headPosY[i]);
                headTab[i].Controls.Add(headHeight[i]);
                headTab[i].Controls.Add(headWidth[i]);
                headTab[i].Controls.Add(borderLeft[i]);
                headTab[i].Controls.Add(borderTop[i]);
                headTab[i].Controls.Add(FPSText[i]);

                headTab[i].Controls.Add(resText[i]);
                headTab[i].Controls.Add(resMul[i]);
                headTab[i].Controls.Add(xText[i]);
                headTab[i].Controls.Add(yText[i]);
                headTab[i].Controls.Add(topT[i]);
                headTab[i].Controls.Add(leftT[i]);
                headTab[i].Controls.Add(borderT[i]);
                headTab[i].Controls.Add(transpT[i]);

                headTab[i].Controls.Add(checkOnOff[i]);
                headTab[i].Controls.Add(checkLocal[i]);
                headTab[i].Controls.Add(noSync[i]);
                headTab[i].Controls.Add(FPSlimit[i]);
                headTab[i].Controls.Add(transpBox[i]);

                dropCentered.Items.Add("Head "+(i+1));

            }
        }
Esempio n. 13
0
        private void FormLoad(object sender, EventArgs e)
        {
            // setup log file
            log = new StreamWriter("AIGgen_log.txt");
            Console.SetOut(log);

            // initialize dumb tab workaround and turn off all but first tab
            tab = new TabPage[(int)Consts.Tab.num_tabs];
            tabVisible = new bool[(int)Consts.Tab.num_tabs];
            for (int i = 0; i < (int)Consts.Tab.num_tabs; i++)
            {
                tab[i] = (TabPage)tabControlConfig.GetControl(i);
                tabVisible[i] = true;
            }
            for (int i = 1; i < (int)Consts.Tab.num_tabs; i++)
                UTIL_tabHide(i);

            // setup pinmux control arrays
            UTIL_setupPinmuxArrays();

            // create error icons
            error = new ParamError(this);

            // initialize boot options and apply to forms
            options = new BootOptions();

            UTIL_refreshFields();
        }
Esempio n. 14
0
        /// <include file='doc\TabControl.uex' path='docs/doc[@for="TabControl.RemoveAll"]/*' />
        /// <devdoc>
        ///    <para>[To be supplied.]</para>
        /// </devdoc>
        protected void RemoveAll() {
            this.Controls.Clear();

            SendMessage(NativeMethods.TCM_DELETEALLITEMS, 0, 0);
            tabPages = null;
            tabPageCount = 0;
        }
Esempio n. 15
0
	void CreateControls(System.Drawing.Color color)
	{
			tabctrl = new TabControl();
			tabctrl.Dock = DockStyle.Fill;
			tabctrl.Parent = panel2;
			tabctrl.Show();

		using (StreamReader sReader = new StreamReader(playlist_dir+"list.txt"))
        {
			int length = File.ReadAllLines(playlist_dir+"list.txt").Length;
				
			tabpage = new TabPage[length];
			ListView[] listview = new ListView[length];
			ListViewItem[] listviewitem = new ListViewItem[length];
			
          string line;
          int i = 0;
          
          while ((line = sReader.ReadLine()) != null)
                {
          	string[] values = line.Split('|');
          	
          	tabpage[i] = new TabPage(values[0]);
          	tabpage[i].Name = i.ToString();
          	tabpage[i].Parent = tabctrl;
          	tabpage[i].BackColor = color;

          	listview[i] = new ListView();
          	listview[i].Name = "listview"+i.ToString();
          	listview[i].DoubleClick += (lv_DoubleClick);
          	listview[i].Dock = DockStyle.Fill;
          	listview[i].GridLines = true;
          	listview[i].View = View.Details;
          	listview[i].Parent = tabpage[i];
          	listview[i].BackColor = color;
          	listview[i].Columns.Add("Станция",175);
          	LoadLlaylist(values[1],listview[i]);
          	 i = i+1;
             	}
         
           }		
	}
Esempio n. 16
0
        /// <summary>
        /// Initialize the controls and other data structures
        /// </summary>
        private void InitializeFormDataAndControls()
        {
            visibleTab = configurationFileTab;

            // copy the tabs from the original location into our own array

            allTabs = new TabPage[tabs.TabPages.Count];
            for(int index=0; index < tabs.TabPages.Count; index++)
            {
                allTabs[index] = tabs.TabPages[index];
            }

            // initialize the storage types dropdown
            managerStorageTypes.DropDownStyle = ComboBoxStyle.DropDownList;

            managerStorageTypes.Items.Clear();

            foreach(ManagerStorageEnum storageType in Enum.GetValues(typeof(ManagerStorageEnum)))
            {

                switch(storageType)
                {
                    case ManagerStorageEnum.InMemory:
                        managerStorageTypes.Items.Add(new ManagerStorageTypeDropdownItem("In Memory", storageType));
                        break;
                    case ManagerStorageEnum.SqlServer:
                        managerStorageTypes.Items.Add(new ManagerStorageTypeDropdownItem("Microsoft SQL Server", storageType));
                        break;
                    case ManagerStorageEnum.MySql:
                        managerStorageTypes.Items.Add(new ManagerStorageTypeDropdownItem("mySQL", storageType));
                        break;
                    default:
            #if DEBUG
                        throw new Exception(String.Format("Undefined storage format found in installer: {0}", storageType));
            #endif
                        managerStorageTypes.Items.Add(new ManagerStorageTypeDropdownItem(storageType.ToString(), storageType));
                        break;
                }

            }

            // set initial manager location
            managerLocation.Text = initialManagerLocation;
        }
Esempio n. 17
0
        private StatusMessage status; // Status Message

        #endregion Fields

        #region Constructors

        public Archive_Create()
        {
            /* Set up the form */
            FormContent.Create(this, "Archive - Create", new Size(680, 400));
            PanelContent = new Panel()
            {
                Location = new Point(0, 0),
                Width = this.ClientSize.Width,
                Height = this.ClientSize.Height,
            };
            this.Controls.Add(PanelContent);

            /* Fill the archive & compression formats */
            InitalizeArchiveFormats();
            InitalizeCompressionFormats();

            /* Create the combobox that contains the archive formats */
            archiveFormatList               = new ToolStripComboBox();
            archiveFormatList.DropDownStyle = ComboBoxStyle.DropDownList;
            archiveFormatList.Items.AddRange(ArchiveNames.ToArray());

            archiveFormatList.SelectedIndex         = 0;
            archiveFormatList.MaxDropDownItems      = archiveFormatList.Items.Count;
            archiveFormatList.SelectedIndexChanged += new EventHandler(changeArchiveFormat);

            /* Create the combobox that contains the compression formats */
            compressionFormatList               = new ToolStripComboBox();
            compressionFormatList.DropDownStyle = ComboBoxStyle.DropDownList;
            compressionFormatList.Items.Add("Do Not Compress");
            compressionFormatList.Items.AddRange(CompressionNames.ToArray());

            compressionFormatList.SelectedIndex    = 0;
            compressionFormatList.MaxDropDownItems = compressionFormatList.Items.Count;

            renameAllFiles = new ToolStripButton("Rename All", null, rename);

            /* Create the toolstrip */
            ToolStrip toolStrip = new ToolStrip(new ToolStripItem[] {
                new ToolStripButton("Add", (Bitmap)new ComponentResourceManager(typeof(icons)).GetObject("new_file"), addFiles),
                new ToolStripSeparator(),
                new ToolStripLabel("Archive:"),
                archiveFormatList,
                new ToolStripSeparator(),
                new ToolStripLabel("Compression:"),
                compressionFormatList,
                new ToolStripSeparator(),
                renameAllFiles,
            });
            PanelContent.Controls.Add(toolStrip);

            /* Create the right click menu */
            ContextMenuStrip contextMenu = new ContextMenuStrip();
            contextMenu.Items.AddRange(new ToolStripItem[] {
                new ToolStripMenuItem("Rename", null, rename),
                new ToolStripMenuItem("Delete", null, delete),
                new ToolStripSeparator(),
                new ToolStripMenuItem("Move Up", null, moveUp),
                new ToolStripMenuItem("Move Down", null, moveDown),
            });
            archiveFileList.ContextMenuStrip = contextMenu;

            /* Archive Contents */
            FormContent.Add(PanelContent, archiveFileList,
                new string[] { "#", "Source Filename", "Filename in the Archive" },
                new int[] { 48, 170, 170 },
                new Point(8, 32),
                new Size(420, 328));

            /* Quick hack for setting height of list view items */
            archiveFileList.SmallImageList = new ImageList() {
                ImageSize = new Size(1, 16),
            };

            /* Settings Box */
            settingsBox = new TabControl() {
                Location = new Point(436, 32),
                Size     = new Size(236, 328),
            };

            /* Set up the settings */
            settingsPages = new TabPage[ArchiveNames.Count];
            blockSizes    = new ComboBox[ArchiveBlockSizes.Count];
            for (int i = 0; i < ArchiveNames.Count; i++)
            {
                settingsPages[i] = new TabPage(ArchiveNames[i] + " Settings") {
                    UseVisualStyleBackColor = true,
                };

                /* Add block size */
                settingsPages[i].Controls.Add(new Label() {
                    Text     = "Block Size",
                    Location = new Point(8, 8),
                    Size     = new Size(64, 16),
                });

                /* Now add the entries */
                blockSizes[i] = new ComboBox() {
                    Location      = new Point(72, 4),
                    Size          = new Size(64, 16),
                    DropDownStyle = ComboBoxStyle.DropDown,
                    MaxLength     = 4,
                };
                blockSizes[i].KeyPress += CheckBlockSizeText;

                for (int j = 0; j < ArchiveBlockSizes[i].Length; j++)
                {
                    /* If the last element is -1, we aren't allowed to edit it */
                    if (ArchiveBlockSizes[i][j] == -1)
                    {
                        blockSizes[i].Enabled = false;
                        break;
                    }
                    blockSizes[i].Items.Add(ArchiveBlockSizes[i][j].ToString());
                }

                blockSizes[i].SelectedIndex    = 0;
                blockSizes[i].MaxDropDownItems = blockSizes[i].Items.Count;
                settingsPages[i].Controls.Add(blockSizes[i]);

                int yPos = 0;
                for (int j = 0; j < ArchiveSettings[i].Count; j++)
                {
                    // See if this is a panel, which can contain multiple items
                    // so we can set the space between everything properly
                    int ItemsInOption = 1;
                    if (ArchiveSettings[i][j] is Panel)
                    {
                        ItemsInOption = ArchiveSettings[i][j].Controls.Count;
                        for (int k = 0; k < ItemsInOption; k++)
                        {
                            ArchiveSettings[i][j].Controls[k].Location = new Point(0, k * 20);
                            ArchiveSettings[i][j].Controls[k].Size     = new Size(settingsBox.Size.Width - 16, 16);
                        }
                    }

                    ArchiveSettings[i][j].Location = new Point(8, 32 + yPos);
                    ArchiveSettings[i][j].Size     = new Size(settingsBox.Size.Width - 16, 16 * ItemsInOption + ((ItemsInOption - 1) * 8));
                    settingsPages[i].Controls.Add(ArchiveSettings[i][j]);

                    yPos += (ItemsInOption * 20) + 4;
                }
            }

            PanelContent.Controls.Add(settingsBox);
            settingsBox.TabPages.Add(settingsPages[0]);

            /* Create Archive */
            FormContent.Add(PanelContent, startWorkButton,
                "Create Archive",
                new Point((PanelContent.Width / 2) - 60, 368),
                new Size(120, 24),
                startWork);

            this.ShowDialog();
        }
Esempio n. 18
0
 void UpdateForm1()
 {
     detector = new DeviceDetector(false);
     detector.DeviceChanged += new DeviceDetector.DeviceDetectorEventHandler(detector_DeviceChanged);
     BusyLoadingCircle.Visible = false;
     BusyLoadingCircle.Top = HeaderPictureBox.Top;
     BusyLoadingCircle.Left = HeaderPictureBox.Left;
     defaultBody = HelpBodyLabel.Text;
     //if (DesignMode) return;
     OptionsPanel.InitOptions();
     // Set status.
     StatusSaveLabel.Visible = false;
     StatusEventsLabel.Visible = false;
     // Load Tab pages.
     ControlPages = new TabPage[4];
     ControlPages[0] = Pad1TabPage;
     ControlPages[1] = Pad2TabPage;
     ControlPages[2] = Pad3TabPage;
     ControlPages[3] = Pad4TabPage;
     //BuletImageList.Images.Add("bullet_square_glass_blue.png", new Bitmap(Helper.GetResource("Images.bullet_square_glass_blue.png")));
     //BuletImageList.Images.Add("bullet_square_glass_green.png", new Bitmap(Helper.GetResource("Images.bullet_square_glass_green.png")));
     //BuletImageList.Images.Add("bullet_square_glass_grey.png", new Bitmap(Helper.GetResource("Images.bullet_square_glass_grey.png")));
     //BuletImageList.Images.Add("bullet_square_glass_red.png", new Bitmap(Helper.GetResource("Images.bullet_square_glass_red.png")));
     //BuletImageList.Images.Add("bullet_square_glass_yellow.png", new Bitmap(Helper.GetResource("Images.bullet_square_glass_yellow.png")));
     foreach (var item in ControlPages) item.ImageKey = "bullet_square_glass_grey.png";
     // Hide status values.
     StatusDllLabel.Text = "";
     MainStatusStrip.Visible = false;
     // Check if INI and DLL is on disk.
     WarningsForm.CheckAndOpen();
 }
Esempio n. 19
0
 void LoadForm()
 {
     formLoaded = true;
     detector = new DeviceDetector(false);
     detector.DeviceChanged += new DeviceDetector.DeviceDetectorEventHandler(detector_DeviceChanged);
     BusyLoadingCircle.Visible = false;
     BusyLoadingCircle.Top = HeaderPictureBox.Top;
     BusyLoadingCircle.Left = HeaderPictureBox.Left;
     defaultBody = HelpBodyLabel.Text;
     //if (DesignMode) return;
     // init default
     OptionsPanel.InitOptions();
     // Set status.
     StatusSaveLabel.Visible = false;
     StatusEventsLabel.Visible = false;
     // Load Tab pages.
     ControlPages = new TabPage[4];
     ControlPages[0] = Pad1TabPage;
     ControlPages[1] = Pad2TabPage;
     ControlPages[2] = Pad3TabPage;
     ControlPages[3] = Pad4TabPage;
     BuletImageList.Images.Add("bullet_square_glass_blue.png", new Bitmap(Helper.GetResource("Images.bullet_square_glass_blue.png")));
     BuletImageList.Images.Add("bullet_square_glass_green.png", new Bitmap(Helper.GetResource("Images.bullet_square_glass_green.png")));
     BuletImageList.Images.Add("bullet_square_glass_grey.png", new Bitmap(Helper.GetResource("Images.bullet_square_glass_grey.png")));
     BuletImageList.Images.Add("bullet_square_glass_red.png", new Bitmap(Helper.GetResource("Images.bullet_square_glass_red.png")));
     BuletImageList.Images.Add("bullet_square_glass_yellow.png", new Bitmap(Helper.GetResource("Images.bullet_square_glass_yellow.png")));
     foreach (var item in ControlPages) item.ImageKey = "bullet_square_glass_grey.png";
     // Hide status values.
     StatusDllLabel.Text = "";
     MainStatusStrip.Visible = false;
     // Check if ini and dll is on disk.
     if (!CheckFiles(true)) return;
     CheckEncoding(SettingManager.TmpFileName);
     CheckEncoding(SettingManager.IniFileName);
     // Show status values.
     MainStatusStrip.Visible = true;
     // Load PAD controls.
     ControlPads = new Controls.PadControl[4];
     for (int i = 0; i < ControlPads.Length; i++)
     {
         ControlPads[i] = new Controls.PadControl(i);
         ControlPads[i].Name = string.Format("ControlPad{0}", i + 1);
         ControlPads[i].Dock = DockStyle.Fill;
         ControlPages[i].Controls.Add(ControlPads[i]);
         ControlPads[i].InitPadControl();
         // Init presets. Execute only after name of cIniFile is set.
         ControlPads[i].InitPresets();
     }
     // Allow events after PAD control are loaded.
     MainTabControl.SelectedIndexChanged += new System.EventHandler(this.MainTabControl_SelectedIndexChanged);
     // Load about control.
     ControlAbout = new Controls.AboutControl();
     ControlAbout.Dock = DockStyle.Fill;
     AboutTabPage.Controls.Add(ControlAbout);
     // Update settings map.
     UpdateSettingsMap();
     ReloadXinputSettings();
     Version v = new Version(Application.ProductVersion);
     this.Text += " " + Application.ProductVersion;
     // Version = major.minor.build.revision
     switch (v.Build)
     {
         case 0: this.Text += " Alpha"; break;  // Alpha Release (AR)
         case 1: this.Text += " Beta 1"; break; // Master Beta (MB)
         case 2: this.Text += " Beta 2"; break; // Feature Complete (FC)
         case 3: this.Text += " Beta 3"; break; // Technical Preview (TP)
         case 4: this.Text += " RC"; break;     // Release Candidate (RC)
         // case 5: this.Text += " RTM"; break; // Release to Manufacturing (RTM)
         // case 6: this.Text += " GM"; break;  // General Availability (GA) / Gold
     }
     ////InitDirectInputTab();
     //// Timer will execute ReloadXInputLibrary();
     ////XInput.ReLoadLibrary(cXinput3File);
     ////XInput.ReLoadLibrary(cXinput3File);
     //// start capture events.
     if (Win32.WinAPI.IsVista && Win32.WinAPI.IsElevated() && Win32.WinAPI.IsInAdministratorRole) this.Text += " (Administrator)";
     ////ReloadXInputLibrary();
 }
Esempio n. 20
0
        private void OnEditorUpdate()
        {
            if (IsDestroyed())
            {
                EditorUpdate.onEditorUpdate -= OnEditorUpdate;
                return;
            }

            if (m_AutoTrackPages)
            {
                TabPage[] tempPages = GetComponentsInChildren<TabPage>(true);

                List<TabPage> ownedTempPages = new List<TabPage>();

                for (int i = 0; i < tempPages.Length; i++)
                {
                    if (tempPages[i].transform.parent.parent.parent == transform)
                    {
                        ownedTempPages.Add(tempPages[i]);
                    }
                }

                m_Pages = new TabPage[ownedTempPages.Count];

                for (int i = 0; i < ownedTempPages.Count; i++)
                {
                    m_Pages[i] = ownedTempPages[i];
                }
            }

            if (m_OldSelectionObjects != Selection.activeGameObject)
            {
                m_OldSelectionObjects = Selection.activeGameObject;
                m_PagesDirty = true;
            }

            if (m_Pages.Length > 0 && m_PagesDirty)
            {
                m_PagesDirty = false;

                bool pageSelected = false;

                if (m_OnlyShowSelectedPage)
                {
                    for (int i = 0; i < m_Pages.Length; i++)
                    {
                        RectTransform[] children = m_Pages[i].GetComponentsInChildren<RectTransform>(true);

                        bool objectSelected = false;

                        for (int j = 0; j < children.Length; j++)
                        {
                            if (Selection.Contains(children[j].gameObject))
                            {
                                if (!m_Pages[i].gameObject.activeSelf)
                                {
                                    m_Pages[i].gameObject.SetActive(true);
                                }
                                pageSelected = true;
                                objectSelected = true;
                            }
                        }
                        if (!objectSelected)
                        {
                            if (m_Pages[i].gameObject.activeSelf)
                            {
                                m_Pages[i].gameObject.SetActive(false);
                            }
                        }
                    }

                    if (!pageSelected && !m_Pages[m_CurrentPage].gameObject.activeSelf)
                    {
                        if (!m_Pages[m_CurrentPage].gameObject.activeSelf)
                        {
                            m_Pages[m_CurrentPage].gameObject.SetActive(true);
                        }
                    }
                }
            }
        }
Esempio n. 21
0
 /// <include file='doc\TabControl.uex' path='docs/doc[@for="TabControl.Insert"]/*' />
 /// <devdoc>
 /// </devdoc>
 /// <internalonly/>
 internal void Insert(int index, TabPage tabPage) {
     if (tabPages == null) {
         tabPages = new TabPage[4];
     }
     else if (tabPages.Length == tabPageCount) {
         TabPage[] newTabPages = new TabPage[tabPageCount * 2];
         Array.Copy(tabPages, 0, newTabPages, 0, tabPageCount);
         tabPages = newTabPages;
     }
     if (index < tabPageCount) {
         Array.Copy(tabPages, index, tabPages, index + 1, tabPageCount - index);
     }
     tabPages[index] = tabPage;
     tabPageCount++;
     cachedDisplayRect = Rectangle.Empty;
     ApplyItemSize();
     if (Appearance == TabAppearance.FlatButtons) {
         Invalidate();
     }
 }