Пример #1
0
        public MainForm()
        {
            InitializeComponent();

            #region [ Ajout des composants ]

            ControlesGroupBox = new CtrlsGroupBox();
            Controls.Add(ControlesGroupBox);

            MainTabControl = new MainTabControl();
            Controls.Add(MainTabControl);

            AllCtrlsGroupBox = new AllCtrlsGroupBox();
            Controls.Add(AllCtrlsGroupBox);

            Controls.Add(_pdfButton);

            VehiculesGroupBox = new VehiculesGroupBox();
            Controls.Add(VehiculesGroupBox);

            AllVehiculesGroupBox = new AllVehiculesGroupBox();
            Controls.Add(AllVehiculesGroupBox);

            #endregion

            InitializeForm();
        }
Пример #2
0
        private void ProcessListView_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            Int32.TryParse(DataBox.Text, out _dataSize);
            if (_dataSize == 0)
            {
                _dataSize = 4;
            }
            if (hasValue)
            {
                if (!Int32.TryParse(StartValueBox.Text, out _searchValue))
                {
                    MessageBox.Show("Failed to Parse Search Value");
                    return;
                }
            }
            else
            {
                _searchValue = 0;
            }
            this.Cursor = Cursors.WaitCursor;
            PID         = (int)ProcessListView.SelectedItems[0].Tag;

            if (hasValue)
            {
                MemoryScan.ConditionalScan((ulong)PID, _dataSize, (UInt32)_searchValue);
            }
            else
            {
                MemoryScan.UnconditionalScan((ulong)PID, _dataSize);
            }
            MainTabControl.SelectTab(1);
            SearchInitialized = true;
            PopulateMatches();
            this.Cursor = Cursors.Default;
        }
Пример #3
0
        public override bool ValidateChildren()
        {
            if (string.IsNullOrWhiteSpace(DataTypeEdit.Text))
            {
                Resources.SelectDataType.ShowError();
                MainTabControl.SelectTab(GeneralTabPage);
                DataTypeEdit.Focus();
                return(false);
            }

            if (NameEdit.Text.IsValidName() == false)
            {
                Resources.EnterValidName.ShowError();
                MainTabControl.SelectTab(GeneralTabPage);
                NameEdit.Focus();
                return(false);
            }

            if (AvailableValuesEdit.ValidateChildren() == false)
            {
                MainTabControl.SelectTab(AvailableValuesTabPage);
                AvailableValuesEdit.Focus();
                return(false);
            }

            if (DefaultValuesEdit.ValidateChildren() == false)
            {
                MainTabControl.SelectTab(DefaultValuesTabPage);
                DefaultValuesEdit.Focus();
                return(false);
            }

            return(true);
        }
        private void AsynchSocketSeverUIFormBaseFrame_Shown(object sender, EventArgs e)
        {
            if (nSocketServiceTypeID == SocketServiceTypeID.lockServer)
            {
                FormateCheckBox.Checked = true;
                FormateCheckBox.Enabled = false;
            }
            else
            {
                FormateCheckBox.Enabled = false;
            }

            //AutoRepairGroupBox.Enabled = false;

            MainTabControl.SelectTab(2);
            AlgorithmcomboBox.SelectedIndex = 0;

            if (LocalIPAdressSelectIndex > -1)
            {
                LocalHostIPListcomboBox.SelectedIndex = LocalIPAdressSelectIndex;
                buttonServerStart_Click(null, null);
            }
            //---------------------
            ShownFinallyInit();
        }
        public override bool ValidateChildren()
        {
            if (NameEdit.Text.IsValidName() == false)
            {
                Resources.EnterValidName.ShowError();
                MainTabControl.SelectTab(GeneralTabPage);
                NameEdit.Focus();
                return(false);
            }

            if (string.IsNullOrWhiteSpace(ConnectionStringEdit.Text))
            {
                Resources.ConnectionStringCannotBeNullOrWhiteSpace.ShowError();
                MainTabControl.SelectTab(GeneralTabPage);
                ConnectionStringEdit.Focus();
                return(false);
            }

            if (string.IsNullOrWhiteSpace(SelectCommandEdit.Text))
            {
                Resources.SelectCommandCannotBeNullOrWhiteSpace.ShowError();
                MainTabControl.SelectTab(GeneralTabPage);
                SelectCommandEdit.Focus();
                return(false);
            }

            if (DataSchemaEdit.ValidateChildren() == false)
            {
                MainTabControl.SelectTab(DataSchemaTabPage);
                DataSchemaEdit.Focus();
                return(false);
            }

            return(true);
        }
Пример #6
0
        /// <summary>
        /// Triggers when a checkbox is toggled
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ConsoleCheckboxToggle(object sender, EventArgs e)
        {
            CustomCheckBox box = (sender as CustomCheckBox);

            box.StartRotate();

            if (box.Checked)
            {
                ConsoleTab.Enabled = false;
                console.Show();
            }
            else
            {
                ConsoleTab.Enabled = true;
                console.Hide();
            }

            MainTabControl.Refresh();

            Data.Save(new SaveData()
            {
                ConsolePopOut = box.Checked,
                SmallBlind    = smallBlind,
                StartingChips = startingChips,
                Players       = players
            });
        }
Пример #7
0
 // IWorkspacePersistence member. Required for saving window to workspace
 public void Save(XDocument document, XElement element)
 {
     if (MainTabControl != null)
     {
         MainTabControl.SaveToXElement(element);
     }
 }
Пример #8
0
 // IWorkspacePersistence member. Required for restoring window from workspace
 public void Restore(XDocument document, XElement element)
 {
     if (MainTabControl != null)
     {
         MainTabControl.RestoreFromXElement(element);
     }
 }
Пример #9
0
 /// <summary>
 /// When window got maximized while a movie is playing : collapse menu bar, header tab and let tabcontrol takes up all the place available.
 /// Rollback when window go back to normal.
 /// </summary>
 /// <param name="sender">Sender object</param>
 /// <param name="e">EventArgs</param>
 private void OnWindowStateChanged(object sender, WindowStateChangedEventArgs e)
 {
     if (e.IsMoviePlaying)
     {
         SearchBar.Visibility = Visibility.Collapsed;
         MenuBar.Visibility   = Visibility.Collapsed;
         Grid.SetRow(MainTabControl, 0);
         Grid.SetRowSpan(MainTabControl, 4);
         Grid.SetColumn(MainTabControl, 0);
         Grid.SetColumnSpan(MainTabControl, 3);
         var headerPanelScroll = MainTabControl.FindChild <ScrollViewer>("HeaderPanelScroll");
         headerPanelScroll.Visibility = Visibility.Collapsed;
     }
     else
     {
         SearchBar.Visibility = Visibility.Visible;
         MenuBar.Visibility   = Visibility.Visible;
         Grid.SetRow(MainTabControl, 1);
         Grid.SetRowSpan(MainTabControl, 3);
         Grid.SetColumn(MainTabControl, 1);
         Grid.SetColumnSpan(MainTabControl, 1);
         var headerPanelScroll = MainTabControl.FindChild <ScrollViewer>("HeaderPanelScroll");
         headerPanelScroll.Visibility = Visibility.Visible;
     }
 }
Пример #10
0
        private void NetworkDefinitionView_MouseUp(object sender,MouseEventArgs e)
        {
            CanTreeTag canTreeTag = (CanTreeTag)NetworkDefinitionView.SelectedNode.Tag;

            if (e.Button == MouseButtons.Left)
            {
                switch (canTreeTag.NodeType)
                {
                case CanTreeTag.BUS:
                case CanTreeTag.NODE: MainTabControl.SelectTab(1); break;

                case CanTreeTag.MESSAGE: MainTabControl.SelectTab(0); break;

                case CanTreeTag.SIGNAL: MainTabControl.SelectTab(0); break;

                default: break;
                }
            }

            if (e.Button == MouseButtons.Right)
            {
                switch (canTreeTag.NodeType)
                {
                case CanTreeTag.BUS: BusMenuStrip.Show(NetworkDefinitionView,e.Location); break;

                case CanTreeTag.NODE: NodeMenuStrip.Show(NetworkDefinitionView,e.Location); break;

                case CanTreeTag.MESSAGE: MessageMenuStrip.Show(NetworkDefinitionView,e.Location); break;

                case CanTreeTag.SIGNAL: SignalMenuStrip.Show(NetworkDefinitionView,e.Location); break;

                default: break;
                }
            }
        }
Пример #11
0
        /// <summary>
        /// TabControl点击关闭
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void MainTabControl_MouseDown(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)//鼠标左键点击事件
            {
                int       x       = e.X;
                int       y       = e.Y;
                Rectangle tabRect = this.MainTabControl.GetTabRect(this.MainTabControl.SelectedIndex);
                tabRect.Offset(tabRect.Width - 0x12, 2);
                tabRect.Width  = 15;
                tabRect.Height = 15;
                if ((((x > tabRect.X) && (x < tabRect.Right)) && (y > tabRect.Y)) && (y < tabRect.Bottom))
                {
                    this.MainTabControl.TabPages.Remove(this.MainTabControl.SelectedTab);
                }
            }


            if (e.Button == MouseButtons.Right) //实现右键选中选项卡
            {
                for (int i = 0; i < MainTabControl.TabPages.Count; i++)
                {
                    TabPage tp = MainTabControl.TabPages[i];
                    if (MainTabControl.GetTabRect(i).Contains(new Point(e.X, e.Y)))
                    {
                        MainTabControl.SelectedTab = tp;
                        break;
                    }
                }
                this.MainTabControl.ContextMenuStrip = this.contextMenuTabPage;  //弹出菜单
            }
        }
        public override bool ValidateChildren()
        {
            if (NameEdit.Text.IsValidName() == false)
            {
                Resources.EnterValidName.ShowError();
                MainTabControl.SelectTab(GeneralTabPage);
                NameEdit.Focus();
                return(false);
            }

            if (string.IsNullOrWhiteSpace(RequestUriEdit.Text))
            {
                Resources.RequestUriCannotBeNullOrWhiteSpace.ShowError();
                MainTabControl.SelectTab(GeneralTabPage);
                RequestUriEdit.Focus();
                return(false);
            }

            if (string.IsNullOrWhiteSpace(MethodEdit.Text))
            {
                Resources.SelectMethod.ShowError();
                MainTabControl.SelectTab(GeneralTabPage);
                MethodEdit.Focus();
                return(false);
            }

            if (DataSchemaEdit.ValidateChildren() == false)
            {
                MainTabControl.SelectTab(DataSchemaTabPage);
                DataSchemaEdit.Focus();
                return(false);
            }

            return(true);
        }
Пример #13
0
        public void CreateTabOpenFile(string fileToOpen)
        {
            var fileParts = fileToOpen.Split('\\');
            var tabText   = fileParts[fileParts.Count() - 1];

            MainTabControl.TabPages.Add(new TabPage(tabText)
            {
                Name = fileToOpen
            });
            MainTabControl.SuspendLayout();
            MainTabControl.TabPages[fileToOpen].Controls.Add(DashGlobal.EditorHelper.CreateEditor(fileToOpen));
            MainTabControl.ResumeLayout();
            MainTabControl.SelectTab(fileToOpen);

            DashGlobal.SetWindowTitle(fileToOpen);
            Main.Lang = DashGlobal.FilesHelper.GetLangFromFile(fileToOpen);

            DashGlobal.EditorHelper.ActiveEditor.OpenFile(fileToOpen);
            MainTabControl.TabPages[fileToOpen].Tag = new FileInfo()
            {
                Dirty = false, CrcHash = "TODO"
            };

            DashGlobal.EditorHelper.PerformSyntaxHighlighting(null, Main.Lang, true);
        }
Пример #14
0
        private void MainTabControl_DragDrop(object sender, DragEventArgs e)
        {
            TabPage source = (TabPage)e.Data.GetData(typeof(TabPage));

            SetCurrStatus($"MainTabControl_DragDrop:{source}");
            if (source != null)
            {
                for (int i = 0; i < MainTabControl.TabPages.Count; i++)
                {
                    if (MainTabControl.GetTabRect(i).Contains(e.X, e.Y))
                    {
                        //var tab = MainTabControl.TabPages[i];
                        //SetCurrStatus($"拖动开始:{MainTabControl.TabPages[i].Text},AlowDrop:{tab.AllowDrop}");
                        //tab.DoDragDrop(e, DragDropEffects.Move);
                        if (MainTabControl.TabPages.IndexOf(source) != i)
                        {
                            e.Effect = DragDropEffects.Move;
                            TabAdapter.Swap(MainTabControl.TabPages.IndexOf(source), i);
                            SetCurrStatus($"拖动结束:{e.Data}");
                            return;
                        }
                    }
                }
            }
            e.Effect = DragDropEffects.None;
        }
Пример #15
0
 private void MainTabControl_MouseDown(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Right)
     {
         for (int i = 0; i < MainTabControl.TabPages.Count; i++)
         {
             if (MainTabControl.GetTabRect(i).Contains(new Point(e.X, e.Y)))
             {
                 MainTabControl.SelectedIndex = i;
                 //var node = MainTabControl.TabPages[i].Tag as ITabPageNode;
                 //if(node != null)
                 //{
                 //    SetCurrStatus($"Tab Page Data: {JsonConvert.SerializeObject(node)}");
                 //}
                 SetCurrStatus($"右键打开并操作:{MainTabControl.TabPages[i].Text}");
             }
         }
     }
     if (e.Button == MouseButtons.Left)
     {
         for (int i = 0; i < MainTabControl.TabPages.Count; i++)
         {
             if (MainTabControl.GetTabRect(i).Contains(e.Location))
             {
                 var tab = MainTabControl.TabPages[i];
                 SetCurrStatus($"拖动开始:{tab.Text}");
                 tab.DoDragDrop(tab, DragDropEffects.All);
             }
         }
     }
 }
Пример #16
0
        public void CreateNewTab(string FileName, ProjectFile projectFile = null, bool PopulateTreeView = false)
        {
            if (!MainTabControl.TabPages.ContainsKey(FileName))
            {
                MainTabControl.TabPages.Add(new TabPage(FileName)
                {
                    Name = FileName, Tag = projectFile
                });
                MainTabControl.SuspendLayout();

                bool add = true;
                FastColoredTextBox workspace = FrostbyteCore.Workspace.CreateWorkspace();

                if (projectFile != null)
                {
                    try
                    {
                        workspace.Text = File.ReadAllText(projectFile.GetLocation(FrostbyteCore.MainForm.project));
                        add            = workspace.Text.Length == 0;

                        new Syntax(workspace, projectFile.getFileType());
                    }
                    catch { }
                }
                else
                {
                    new Syntax(workspace, FileType.UNKNOWN);
                }

                if (add && Properties.Settings.Default.TopFileComment.Length > 0)
                {
                    string      comment = Properties.Settings.Default.TopFileComment;
                    ProjectMeta meta    = new ProjectMeta(FrostbyteCore.MainForm.project, FileName);

                    foreach (string replace in meta.variables.Keys)
                    {
                        comment = comment.Replace(replace, meta.variables[replace]);
                    }

                    workspace.Text = comment + '\n' + workspace.Text;
                }

                MainTabControl.TabPages[FileName].Controls.Add(workspace);
                MainTabControl.ResumeLayout();
                MainTabControl.SelectTab(FileName);
            }
            else
            {
                MainTabControl.SelectedTab = MainTabControl.TabPages[FileName];
            }

            FrostbyteCore.MainForm.toolStripStatusLabel1.Text = FrostbyteCore.Tabs.MainTabControl.SelectedTab.Name;
            FrostbyteCore.MainForm.toolStripStatusLabel2.Text = "Current Length: " + FrostbyteCore.Workspace.GetActiveWorkspace().Text.Length.ToString();

            if (PopulateTreeView)
            {
                FrostbyteCore.TreeViewer.PopulateTreeView();
            }
        }
Пример #17
0
 public UIHeaderMainFrame()
 {
     InitializeComponent();
     Controls.SetChildIndex(MainTabControl, 0);
     Header.Parent         = this;
     MainTabControl.Parent = this;
     MainTabControl.BringToFront();
 }
Пример #18
0
        private void ShowRegionDetails(AwsRegionLocations region)
        {
            currentRegionBeingViewed = region;
            MainTabControl.SelectTab(1);
            RegionNameLabel.Text = controlRegionDictionary[region].RegionDetails.Name;

            RefreshWorkers(region);
        }
Пример #19
0
 // IWorkspacePersistence member. Required for saving window to workspace
 public void Save(XDocument document, XElement element)
 {
     // This is used for saving the elements of the document with the workspace.
     if (MainTabControl != null)
     {
         MainTabControl.SaveToXElement(element);
     }
 }
Пример #20
0
 // IWorkspacePersistence member. Required for restoring window from workspace
 public void Restore(XDocument document, XElement element)
 {
     // This is used for restoring the elements of the document with the workspace.
     if (MainTabControl != null)
     {
         MainTabControl.RestoreFromXElement(element);
     }
 }
Пример #21
0
 public UIAsideMainFrame()
 {
     InitializeComponent();
     Controls.SetChildIndex(MainTabControl, 0);
     Aside.Parent          = this;
     MainTabControl.Parent = this;
     MainTabControl.BringToFront();
     Aside.TabControl = MainTabControl;
 }
Пример #22
0
    protected override void OnPreRender(EventArgs e)
    {
        var chart = (PXSerialChart)MainTabControl.FindControl("SerialChartCPU");

        chart.ValueAxis[0].Minimum   = 0;
        chart.ValueAxis[0].Maximum   = 100;
        chart.ValueAxis[0].GridCount = 100;

        base.OnPreRender(e);
    }
 public UIAsideHeaderMainFooterFrame()
 {
     InitializeComponent();
     Controls.SetChildIndex(MainTabControl, 0);
     Header.Parent         = this;
     Aside.Parent          = this;
     MainTabControl.Parent = this;
     Footer.Parent         = this;
     Header.BringToFront();
     Footer.BringToFront();
     MainTabControl.BringToFront();
     Aside.TabControl = MainTabControl;
 }
Пример #24
0
        // 打开左侧抽屉
        private void CloseLeftDrawer()
        {
            if (leftDrawer.Visibility == Visibility.Collapsed)
            {
                return;
            }
            leftDrawer.Visibility = Visibility.Collapsed;
            this.ShowLeftDrawerGrid();
            PinRotateTransform.Angle = 90;

            mainLayer.ColumnDefinitions.Remove(MinerProfileColumn);
            MainTabControl.SetValue(Grid.ColumnProperty, mainLayer.ColumnDefinitions.Count - 1);
        }
Пример #25
0
 public TicketEditorView(TicketEditorViewModel viewModel)
 {
     InitializeComponent();
     DataContext = viewModel;
     EventServiceFactory.EventService.GetEvent <GenericEvent <TicketEditorViewModel> >().Subscribe(
         x =>
     {
         if (x.Topic == EventTopicNames.FocusTicketScreen)
         {
             MainTabControl.BackgroundFocus();
         }
     });
 }
Пример #26
0
 private void Window_CR(object sender, EventArgs e)
 {
     MainTabControl.AddHandler(TabControl.SelectionChangedEvent, new RoutedEventHandler(TabControl_SelectionChanged));
     try
     {
         BuildDataGrid.ItemsSource = null;
         BuildDataGrid.ItemsSource = loadAndDisplayCsvFile(UniversalConstants.CurrentDirectory + "ShipBuildLog.csv").DefaultView;
     }
     catch (FileNotFoundException)
     {
         MessageBox.Show("没有对应的记录!");
     }
     catch { }
 }
 public void Add(CslaObjectInfo mainObject, CslaObjectInfo secondaryObject)
 {
     try
     {
         _associativeEntities.Add(mainObject, secondaryObject);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Object Relations Builder", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
     MainTabControl.SelectTab(2);
     listEntities3.SelectedItems.Clear();
     listEntities3.SelectedItem = listEntities3.Items[listEntities3.Items.Count - 1];
 }
Пример #28
0
        /// <summary>
        /// enter one of these package, product, supplier, customer, sale, setting
        /// </summary>
        /// <param name="inputIndicate"> </param>
        private void PageSectionIndicate(string inputIndicate)
        {
            // set everything to false then regulate
            PackageSection                     =
                ProductSection                 =
                    SupplierSection            =
                        CustomerSection        =
                            SalesSection       =
                                SettingSection = false;
            // setting all btnIndicator to invinsible
            uxBtnIndicatorCus.Visible                     =
                uxBtnIndicatorPac.Visible                 =
                    uxBtnIndicatorPro.Visible             =
                        uxBtnIndicatorSup.Visible         =
                            uxBtnIndicatorSal.Visible     =
                                uxBtnIndicatorSet.Visible = false;
            switch (inputIndicate.ToLower())
            {
            case "package":
                uxBtnIndicatorPac.Visible = PackageSection = true;
                MainTabControl.SelectTab(PackageTab);
                break;

            case "product":
                uxBtnIndicatorPro.Visible = ProductSection = true;
                MainTabControl.SelectTab(ProductTab);
                break;

            case "supplier":
                uxBtnIndicatorSup.Visible = SupplierSection = true;
                MainTabControl.SelectTab(SuppliersTab);
                break;

            case "customer":
                uxBtnIndicatorCus.Visible = CustomerSection = true;
                MainTabControl.SelectTab(CustomersTab);
                break;

            case "sale":
                uxBtnIndicatorSal.Visible = SalesSection = true;
                MainTabControl.SelectTab(SalesTab);
                break;

            case "setting":
                uxBtnIndicatorSet.Visible = SettingSection = true;
                MainTabControl.SelectTab(SettingsTab);
                break;
            }
        }
Пример #29
0
        // 关闭左侧抽屉
        private void OpenLeftDrawer()
        {
            if (LeftDrawerGrip.Width != _leftDrawerGripWidth)
            {
                return;
            }
            leftDrawer.Visibility = Visibility.Visible;
            this.HideLeftDrawerGrid();
            PinRotateTransform.Angle = 0;

            if (!mainLayer.ColumnDefinitions.Contains(MinerProfileColumn))
            {
                mainLayer.ColumnDefinitions.Insert(0, MinerProfileColumn);
            }
            MainTabControl.SetValue(Grid.ColumnProperty, mainLayer.ColumnDefinitions.Count - 1);
        }
Пример #30
0
        private void tabControlMain_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                Point     p = e.Location;
                Rectangle r = MainTabControl.GetTabRect(this.MainTabControl.SelectedIndex);
                r.Offset(r.Width - iconWidth, 4);
                r.Width  = iconWidth;
                r.Height = iconHeight;
                if (this.MainTabControl.SelectedTab.Text == nodeMonitorView.Text)
                {
                    return;
                }
                string tabText = this.MainTabControl.SelectedTab.Text;

                if (r.Contains(p))
                {
                    this.childList.Remove(tabText);
                    this.MainTabControl.TabPages.RemoveAt(this.MainTabControl.SelectedIndex);
                }

                //int x = e.X, y = e.Y;

                ////计算关闭区域
                //Rectangle myTabRect = this.MainTabControl.GetTabRect(this.MainTabControl.SelectedIndex);

                //myTabRect.Offset(myTabRect.Width - (CLOSE_SIZE + 3), 2);
                //myTabRect.Width = CLOSE_SIZE;
                //myTabRect.Height = CLOSE_SIZE;

                ////如果鼠标在区域内就关闭选项卡
                //bool isClose = x > myTabRect.X && x < myTabRect.Right
                // && y > myTabRect.Y && y < myTabRect.Bottom;

                //if (isClose == true)
                //{
                //    if (this.MainTabControl.SelectedTab.Text == nodeMonitorView.Text)
                //    {
                //        return;
                //    }
                //    string tabText = this.MainTabControl.SelectedTab.Text;
                //    this.childList.Remove(tabText);
                //    this.MainTabControl.TabPages.Remove(this.MainTabControl.SelectedTab);

                //}
            }
        }