private void AddTabs() { Panel pnlFindOptions = new Panel(); Button btnFindNext = new Button(); GroupBox grpFindDirection = new GroupBox(); RadioButton rbtFindDirUp = new RadioButton(); RadioButton rbtFindDirDown = new RadioButton(); TSingleLineFlow LayoutManagerFindControls; TSingleLineFlow LayoutManagerFilterTab; TSingleLineFlow LayoutManagerFindTab; this.SuspendLayout(); grpFindDirection.SuspendLayout(); pnlFindOptions.SuspendLayout(); FTabFilterAndFind.SuspendLayout(); FPnlFindControls = new Owf.Controls.A1Panel(); FPnlFindControls.SuspendLayout(); FPnlFindControls.Name = "FPnlFindControls"; FPnlFindControls.Left = 7; FPnlFindControls.Top = 8; FPnlFindControls.Width = FInitialWidth - 5; FPnlFindControls.Height = 174; FPnlFindControls.BorderColor = System.Drawing.Color.CadetBlue; FPnlFindControls.ShadowOffSet = 4; FPnlFindControls.RoundCornerRadius = 4; FPnlFindControls.GradientDirection = LinearGradientMode.Horizontal; // Layout Manager for the 'Find' Panel. // This will arrange 'Argument Panels' that will be added later to the 'Find' Panel. LayoutManagerFindControls = new TSingleLineFlow(FPnlFindControls, 4, 3); LayoutManagerFindControls.TopMargin = 5; LayoutManagerFindControls.RightMargin = 9; LayoutManagerFindControls.SpacerDistance = 3; btnFindNext.Top = 2; btnFindNext.Left = 1; btnFindNext.Text = "Find Ne&xt"; btnFindNext.Name = "btnFindNext"; btnFindNext.BackColor = System.Drawing.SystemColors.ButtonFace; btnFindNext.ImageList = imlButtonIcons; btnFindNext.ImageIndex = 4; btnFindNext.ImageAlign = ContentAlignment.MiddleRight; btnFindNext.Click += delegate(object sender, EventArgs e) { OnFindNextClicked(sender, e); }; tipGeneral.SetToolTip(btnFindNext, "Click to find the next occurance\r\nin the search direction"); rbtFindDirUp.Top = 14; rbtFindDirUp.Left = 10; rbtFindDirUp.AutoSize = true; rbtFindDirUp.Name = "rbtFindDirUp"; rbtFindDirUp.Text = Catalog.GetString("&Up"); rbtFindDirUp.Tag = CommonTagString.SUPPRESS_CHANGE_DETECTION; rbtFindDirDown.Top = 14; rbtFindDirDown.Left = 60; rbtFindDirDown.AutoSize = true; rbtFindDirDown.Checked = true; rbtFindDirDown.Name = "rbtFindDirDown"; rbtFindDirDown.Text = Catalog.GetString("D&own"); rbtFindDirDown.Tag = CommonTagString.SUPPRESS_CHANGE_DETECTION; grpFindDirection.Top = 30; grpFindDirection.Left = 3; grpFindDirection.Height = 38; grpFindDirection.BackColor = System.Drawing.Color.Transparent; grpFindDirection.Name = "grpFindDirection"; grpFindDirection.Text = "Direction"; grpFindDirection.Controls.Add(rbtFindDirUp); grpFindDirection.Controls.Add(rbtFindDirDown); pnlFindOptions.Name = "pnlFindOptions"; pnlFindOptions.Left = 0; pnlFindOptions.Width = FTabFilterAndFind.Width; pnlFindOptions.Height = 72; pnlFindOptions.BackColor = System.Drawing.Color.Transparent; pnlFindOptions.Tag = TSingleLineFlow.BeginGroupIndicator; pnlFindOptions.Controls.Add(btnFindNext); pnlFindOptions.Controls.Add(grpFindDirection); pnlFindOptions.SetDoubleBuffered(true); FPnlFindControls.Controls.Add(pnlFindOptions); // // FTabFilterAndFind // FTabFilterAndFind.BackColor = System.Drawing.Color.LightSteelBlue; FTabFilterAndFind.Alignment = System.Windows.Forms.TabAlignment.Bottom; FTabFilterAndFind.Controls.Add(FTbpFilter); FTabFilterAndFind.Controls.Add(FTbpFind); FTabFilterAndFind.Dock = System.Windows.Forms.DockStyle.Fill; FTabFilterAndFind.DrawMode = System.Windows.Forms.TabDrawMode.OwnerDrawFixed; FTabFilterAndFind.Font = new System.Drawing.Font("Verdana", 7F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); FTabFilterAndFind.Location = new System.Drawing.Point(0, 0); FTabFilterAndFind.Name = "tabFilterAndFind"; FTabFilterAndFind.SelectedIndex = 0; FTabFilterAndFind.ShowToolTips = true; FTabFilterAndFind.TabIndex = 10; FTabFilterAndFind.SelectedIndexChanged += delegate(object sender, EventArgs e) { FTabFilterAndFind_SelectedIndexChanged(sender, e); }; FTabFilterAndFind.GotFocus += delegate(object sender, EventArgs e) { OnFilterFindTabFocused(); }; // // FTbpFilter // FTbpFilter.BackColor = System.Drawing.Color.LightSteelBlue; FTbpFilter.Font = new System.Drawing.Font("Verdana", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); FTbpFilter.Location = new System.Drawing.Point(4, 4); FTbpFilter.Name = "tbpFilter"; FTbpFilter.Padding = new System.Windows.Forms.Padding(6, 3, 2, 3); FTbpFilter.Size = new System.Drawing.Size(553, 157); FTbpFilter.TabIndex = 0; FTbpFilter.Text = "Filter"; FTbpFilter.ToolTipText = Catalog.GetString("Filter the rows shown in the list"); FTbpFilter.AutoScroll = true; FTbpFilter.SetAutoScrollMargin(3, 3); LayoutManagerFilterTab = new TSingleLineFlow(FTbpFilter, 4, 3); LayoutManagerFilterTab.SpacerDistance = 5; FTbpFilter.Controls.Add(pnlFilterControls); if (IsExtraFilterShown) { FTbpFilter.Controls.Add(pnlExtraFilterControls); } // // FTbpFind // FTbpFind.BackColor = System.Drawing.Color.LightSteelBlue; FTbpFind.Controls.Add(FPnlFindControls); FTbpFind.Font = new System.Drawing.Font("Verdana", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); FTbpFind.Location = new System.Drawing.Point(4, 4); FTbpFind.Name = "tbpFind"; FTbpFind.Padding = new System.Windows.Forms.Padding(6, 3, 2, 3); FTbpFind.Size = new System.Drawing.Size(553, 157); FTbpFind.TabIndex = 0; FTbpFind.Text = "Find"; FTbpFind.ToolTipText = Catalog.GetString("Find within the rows shown in the list"); FTbpFind.AutoScroll = true; FTbpFind.SetAutoScrollMargin(3, 3); LayoutManagerFindTab = new TSingleLineFlow(FTbpFind, 4, 3); LayoutManagerFindTab.SpacerDistance = 5; FTabFilterAndFind.Dock = DockStyle.Fill; this.Controls.Clear(); pnlTitle.Dock = DockStyle.Top; this.Controls.Add(pnlTitle); this.Controls.Add(FTabFilterAndFind); FTabFilterAndFind.BringToFront(); FPnlFindControls.Top = pnlFilterControls.Top - 22; // Add individual 'Argument Panels' Panels to the 'Find' Panel (on 'Find' Tab) // Layout is taken care of automatically due to a TSingleLineFlow Layout Manager! foreach (Panel ArgumentPanel in FFindControls) { ProcessArgumentPanel(ArgumentPanel, FPnlFindControls.Width, true); FPnlFindControls.Controls.Add(ArgumentPanel); if (FFindPanelFirstArgumentControl == null) { FFindPanelFirstArgumentControl = DetermineFirstArgumentControl(ArgumentPanel); } } btnFindNext.Width = FInitialWidth - 31; grpFindDirection.Width = FInitialWidth - 34; // Ensure that pnlFindOptions is always the bottommost of the Controls in the Panel FPnlFindControls.Controls.SetChildIndex(pnlFindOptions, FPnlFindControls.Controls.Count); FTabFilterAndFind.ResumeLayout(); FPnlFindControls.ResumeLayout(); pnlFindOptions.ResumeLayout(); grpFindDirection.ResumeLayout(); this.ResumeLayout(); }
private void InitUserControlInternal() { TSingleLineFlow LayoutManagerUserControl; TSingleLineFlow LayoutManagerExtraFilterControls; // // Set up Layout Managers (Note: Layout Managers for TabPages are set up dynamically in Method 'AddTabs'!) // // Layout Manager for the 'Standard' Filter Panel // This will arrange 'Argument Panels' that will be added later to the 'Standard' Filter Panel. FLayoutManagerFilterControls = new TSingleLineFlow(pnlFilterControls, 4, 3); FLayoutManagerFilterControls.TopMargin = 5; FLayoutManagerFilterControls.RightMargin = 9; FLayoutManagerFilterControls.SpacerDistance = 5; if ((FExtraFilterControls != null) && (FExtraFilterControls.Count > 0)) { FShowExtraFilter = true; } if (FShowExtraFilter) { // Layout Manager for the 'Extra' Filter Panel. // This will arrange 'Argument Panels' that will be added later to the 'Extra' Filter Panel. LayoutManagerExtraFilterControls = new TSingleLineFlow(pnlExtraFilterControls, 4, 3); LayoutManagerExtraFilterControls.TopMargin = 5; LayoutManagerExtraFilterControls.RightMargin = 9; LayoutManagerExtraFilterControls.SpacerDistance = 5; // Set off the 'Extra' Filter Panel from the 'Standard' Filter Panel once the Layout Manager is applied to the containing Panel/TabPage pnlExtraFilterControls.Tag = TSingleLineFlow.BeginGroupIndicator; } else { pnlExtraFilterControls.Visible = false; } // Use a Layout Manager for the whole UserControl only if we don't display a Tab Control (it would be useless then). // This will arrange the 'Standard' and 'Extra' Filter Panel that are already shown on the UserControl. if (!FShowFindPanel) { LayoutManagerUserControl = new TSingleLineFlow(this, 5, 2); LayoutManagerUserControl.SpacerDistance = 5; } // Add individual 'Argument Panels' to the 'Standard Filter' Panel (topmost on 'Filter' Tab) // Layout is taken care of automatically due to a TSingleLineFlow Layout Manager! if (FFilterControls != null) { foreach (Panel ArgumentPanel in FFilterControls) { ProcessArgumentPanel(ArgumentPanel, pnlFilterControls.Width, false); pnlFilterControls.Controls.Add(ArgumentPanel); if (FFilterPanelFirstArgumentControl == null) { FFilterPanelFirstArgumentControl = DetermineFirstArgumentControl(ArgumentPanel); } } } // Add individual 'Argument Panels' to the 'Extra Filter' Panel (below 'Standard Filter' Panel on 'Filter' Tab) // Layout is taken care of automatically due to a TSingleLineFlow Layout Manager! if (FExtraFilterControls != null) { foreach (Panel ArgumentPanel in FExtraFilterControls) { ProcessArgumentPanel(ArgumentPanel, pnlExtraFilterControls.Width, false); pnlExtraFilterControls.Controls.Add(ArgumentPanel); if (FExtraFilterPanelFirstArgumentControl == null) { FExtraFilterPanelFirstArgumentControl = DetermineFirstArgumentControl(ArgumentPanel); } } } UpdateKeepFilterTurnedOnButtons(false); UpdateFilterIsAlwaysTurnedOnLabels(false); UpdateFilterApplyButtons(false); UpdateExtraFilterDisplay(); SetupTitleText(); pnlTitle.SetDoubleBuffered(true); if ((FFindControls != null) && (FFindControls.Count > 0)) { ShowFindTab(); } // Reverse the Z-Order of the Panels so they 'stack up' correctly pnlFilterControls.SendToBack(); pnlExtraFilterControls.SendToBack(); this.Invalidate(); AutoSizeFilterPanelsHeights(); // set the panel colours SetPanelColours(); }
/// <summary> /// todoComment /// </summary> public void InitUserControl() { TSingleLineFlow LayoutManagerLeftColumn; TSingleLineFlow LayoutManagerRightColumn; LayoutManagerLeftColumn = new TSingleLineFlow(pnlLeftColumn, 1, 1); // 22 LayoutManagerLeftColumn.SpacerDistance = 7; LayoutManagerRightColumn = new TSingleLineFlow(pnlRightColumn, 1, 1); // 22 LayoutManagerRightColumn.SpacerDistance = 7; FWorkerFamOnly = false; FDefaultPartnerClass = "*"; if (!DesignMode) { ResetSearchCriteriaValuesToDefault(); } ucoPartnerFind_PersonnelCriteria_CollapsiblePart.InitialiseUserControl(); FCriteriaFieldsLeft = new ArrayList(); FCriteriaFieldsRight = new ArrayList(); // FFindCriteriaDataTable := new DataTable('FindCriteria'); FFindCriteriaDataTable.ColumnChanging += new DataColumnChangeEventHandler(this.OnCriteriaChanging); // Set status bar texts FPetraUtilsObject.SetStatusBarText(txtPartnerName, StrPartnerNameFindHelptext); FPetraUtilsObject.SetStatusBarText(txtPersonalName, StrPersonalNameFindHelpText); FPetraUtilsObject.SetStatusBarText(txtPreviousName, StrPreviousNameFindHelpText); FPetraUtilsObject.SetStatusBarText(txtEmail, MPartnerResourcestrings.StrEmailAddressHelpText); FPetraUtilsObject.SetStatusBarText(txtAddress1, MPartnerResourcestrings.StrAddress1Helptext); FPetraUtilsObject.SetStatusBarText(txtAddress2, MPartnerResourcestrings.StrAddress2Helptext); FPetraUtilsObject.SetStatusBarText(txtAddress3, MPartnerResourcestrings.StrAddress3Helptext); FPetraUtilsObject.SetStatusBarText(txtCity, MPartnerResourcestrings.StrCityHelptext); FPetraUtilsObject.SetStatusBarText(txtPostCode, MPartnerResourcestrings.StrPostCodeHelpText); FPetraUtilsObject.SetStatusBarText(txtCounty, MPartnerResourcestrings.StrCountyHelpText); FPetraUtilsObject.SetStatusBarText(txtAccountName, StrAccountNameFindHelpText); FPetraUtilsObject.SetStatusBarText(txtAccountNumber, StrAccountNumberFindHelpText); FPetraUtilsObject.SetStatusBarText(txtIban, StrIBANFindHelpText); FPetraUtilsObject.SetStatusBarText(txtBankKey, StrBankKeyFindHelpText); FPetraUtilsObject.SetStatusBarText(cmbBankName, StrBankNameFindHelpText); FPetraUtilsObject.SetStatusBarText(cmbBankCode, StrBankCodeFindHelpText); FPetraUtilsObject.SetStatusBarText(txtBic, StrBICCodeFindHelpText); FPetraUtilsObject.SetStatusBarText(cmbPartnerClass, StrPartnerClassFindHelpText); FPetraUtilsObject.SetStatusBarText(txtLocationKey, MPartnerResourcestrings.StrLocationKeyHelpText + MPartnerResourcestrings.StrLocationKeyExtraHelpText); FPetraUtilsObject.SetStatusBarText(btnLocationKey, MPartnerResourcestrings.StrLocationKeyButtonFindHelpText); FPetraUtilsObject.SetStatusBarText(chkWorkerFamOnly, StrWorkerFamilyOnlyFindHelpText); FPetraUtilsObject.SetStatusBarText(rbtStatusActive, StrActivePartnersFindHelpText); FPetraUtilsObject.SetStatusBarText(rbtStatusAll, StrAllPartnersFindHelpText); FPetraUtilsObject.SetStatusBarText(chkMailingAddressOnly, MPartnerResourcestrings.StrMailingOnlyFindHelpText); FPetraUtilsObject.SetStatusBarText(txtPhoneNumber, MPartnerResourcestrings.StrPhoneNumberFindHelpText); FPetraUtilsObject.SetStatusBarText(txtPartnerKey, StrPartnerKeyFindHelpText); FPetraUtilsObject.SetStatusBarText(ucoCountryComboBox, MPartnerResourcestrings.StrCountryHelpText); this.chkWorkerFamOnly.CheckedChanged += new System.EventHandler(this.ChkWorkerFamOnly_CheckedChanged); }