public bool AddNew() { if (Save()) { if (_record != null) { _priorRecord = _record; } _record = new TRecord(); _suspend = true; foreach (var action in _setDefaults) { action.SetControl.Invoke(); if (action.InvokeSetProperty) { action.SetProperty.Invoke(_record); } } NewRecord?.Invoke(this, new EventArgs()); FirstControl?.Focus(); ValidationPanel?.SetStatus(RecordStatus.Valid, "New record started"); ToolStrip?.OnNew(); _suspend = false; return(true); } return(false); }
// Use this for initialization protected void Start() { sceneController = (FirstControl)Director.getInstance().sceneCtrl; diskFactory = sceneController.factory; scoreRecorder = sceneController.scoreRecorder; sceneController.MyActionManager = this; }
/// <summary> /// 焦点第一个编辑控件 /// </summary> protected void SelectFirstControl() { if (FirstControl != null) { FirstControl.Select(); } }
// Use this for initialization protected void Start() { sceneController = (FirstControl)Director.getInstance().sceneCtrl; diskFactory = sceneController.factory; scoreRecorder = sceneController.scoreRecorder; //sceneController.MyActionManager = this; sceneController.myAdapter.SetNormalAM(this); }
public void SetFormInitialView() { if (FirstControl != null) { FirstControl.Focus(); } InitializeDefaultValues(); }
protected override void OnShown(EventArgs e) { base.OnShown(e); Application.DoEvents(); if (FirstControl != null) { FirstControl.Focus(); } }
protected void Start() { FirstControl scene = (FirstControl)Director.getInstance().sceneCtrl; scene.gameModel = this; Debug.Log("in GameModel start"); loadHero(); loadPatrols(); }
public void Start() { sceneControler = (FirstControl)Director.getInstance().sceneCtrl; Debug.Log(sceneControler); //Debug.Log(this); //Debug.Log(_instance); sceneControler.factory = _instance; Debug.Log("DiskFactory: factory"); //Debug.Log(sceneControler.factory); }
protected override void OnLoad(EventArgs e) { if (FirstControl != null) { FirstControl.Focus(); } base.OnLoad(e); backgroundWorkerLoadInitialValues.RunWorkerAsync(); }
public void ResetFormView() { ClearValues(); this.ErrorProvider.Clear(); if (FirstControl != null) { FirstControl.Focus(); } }
public void Edit(Entity entity) { infoformentity = entity; ShowEntityData(); if (FirstControl != null) { FirstControl.Focus(); this.ActiveControl = FirstControl; } }
public void SetFocusOnFirstControl() { if (FirstControl != null) { FirstControl.Focus(); } else { panelContent.Focus(); SendKeys.SendWait("{Tab}"); } }
private async void btnSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (!ProcessValidationFormControls()) { if (FirstControl != null && FirstControl.CanFocus) { FirstControl.Focus(); } return; } if (!ValidateBeforeSave()) { // it's implementing class responsibiliy to set focus on appropriate control. return; } SavingParemeter savingParas = new SavingParemeter(); savingParas.SavingInterface = SavingParemeter.eSavingInterface.AddNew; // ShowWaitForm(); beiProgressbar.Visibility = DevExpress.XtraBars.BarItemVisibility.Always; ProgressBarSavingProcess.Stopped = false; //try //{ await Task.Run(() => SaveRecord(savingParas)); //} //catch (Exception ex) //{ // beiProgressbar.Visibility = DevExpress.XtraBars.BarItemVisibility.Never; // CloseWaitForm(); // throw ex; //} ProgressBarSavingProcess.Stopped = true; beiProgressbar.Visibility = DevExpress.XtraBars.BarItemVisibility.Never; CloseWaitForm(); // //-- AfterSaving(savingParas); //-- if (savingParas.SavingResult != null && savingParas.SavingResult.ExecutionResult == eExecutionResult.CommitedSucessfuly) { ResetFormView(); } FirstControl.Focus(); }
void Start() { scene = (FirstControl)Director.getInstance().sceneCtrl; scene.gameEventManager = this; }
public void Start() { sceneControler = (FirstControl)Director.getInstance().sceneCtrl; sceneControler.factory = _instance; }
public void InitializeComponent() { SampleControl.ScopeAttribute scopeAttribute1 = new SampleControl.ScopeAttribute(); this.thermoMeterControl1 = new SampleControl.ThermoMeterControl(); this.myClock1 = new SampleControl.MyClock(); this.myLabel1 = new SampleControl.MyLabel(); this.myControl = new SampleControl.FirstControl(); this.myTrackBar = new SampleControl.FlashTrackBar(); this.myButton = new SampleControl.MyButton(); this.myListControl = new SampleControl.MyListControl(); this.SuspendLayout(); // // thermoMeterControl1 // this.thermoMeterControl1.BigScale = 5; this.thermoMeterControl1.BigScaleColor = System.Drawing.Color.MediumBlue; this.thermoMeterControl1.DialBackColor = System.Drawing.Color.Gray; this.thermoMeterControl1.DialOutLineColor = System.Drawing.Color.Gray; this.thermoMeterControl1.DrawColor = System.Drawing.Color.Black; this.thermoMeterControl1.DrawFont = new System.Drawing.Font("Microsoft Sans Serif", 9F); this.thermoMeterControl1.HighTemperature = 100F; this.thermoMeterControl1.Location = new System.Drawing.Point(346, 211); this.thermoMeterControl1.LowTemperature = 0F; this.thermoMeterControl1.MercuryBackColor = System.Drawing.Color.LightGray; this.thermoMeterControl1.MercuryColor = System.Drawing.Color.Red; this.thermoMeterControl1.Name = "thermoMeterControl1"; this.thermoMeterControl1.Size = new System.Drawing.Size(58, 200); this.thermoMeterControl1.SmallScale = 5; this.thermoMeterControl1.SmallScaleColor = System.Drawing.Color.DarkOrange; this.thermoMeterControl1.TabIndex = 5; this.thermoMeterControl1.TempColor = System.Drawing.Color.Black; this.thermoMeterControl1.Temperature = 0F; this.thermoMeterControl1.TempFont = new System.Drawing.Font("宋体", 12F); // // myClock1 // this.myClock1.ClockForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(64)))), ((int)(((byte)(0))))); this.myClock1.HourColor = System.Drawing.Color.Lime; this.myClock1.Location = new System.Drawing.Point(246, 12); this.myClock1.MinuteColor = System.Drawing.Color.Blue; this.myClock1.Name = "myClock1"; this.myClock1.SecondColor = System.Drawing.Color.Red; this.myClock1.Size = new System.Drawing.Size(200, 200); this.myClock1.TabIndex = 4; this.myClock1.Text = "myClock1"; this.myClock1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.mouseDownEvent); this.myClock1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.mouseMoveEvent); this.myClock1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.mouseUpEvent); // // myLabel1 // this.myLabel1.AutoSize = true; this.myLabel1.ClockBackColor = System.Drawing.Color.DarkSlateGray; this.myLabel1.ClockForeColor = System.Drawing.Color.LavenderBlush; this.myLabel1.Location = new System.Drawing.Point(27, 127); this.myLabel1.Margin = new System.Windows.Forms.Padding(0); this.myLabel1.Name = "myLabel1"; this.myLabel1.Size = new System.Drawing.Size(97, 20); this.myLabel1.TabIndex = 2; // // myControl // this.myControl.BackColor = System.Drawing.Color.Cornsilk; this.myControl.Location = new System.Drawing.Point(75, 82); this.myControl.Name = "myControl"; this.myControl.Size = new System.Drawing.Size(98, 28); this.myControl.TabIndex = 0; this.myControl.Text = "Hello,I am the firstControl!"; this.myControl.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter; this.myControl.MouseDown += new System.Windows.Forms.MouseEventHandler(this.mouseDownEvent); this.myControl.MouseMove += new System.Windows.Forms.MouseEventHandler(this.mouseMoveEvent); this.myControl.MouseUp += new System.Windows.Forms.MouseEventHandler(this.mouseUpEvent); // // myTrackBar // this.myTrackBar.AllowDrop = true; this.myTrackBar.AllowUserEdit = false; this.myTrackBar.BackColor = System.Drawing.Color.Black; this.myTrackBar.DarkenBy = ((byte)(255)); this.myTrackBar.ForeColor = System.Drawing.Color.White; this.myTrackBar.Location = new System.Drawing.Point(27, 43); this.myTrackBar.Name = "myTrackBar"; this.myTrackBar.ShowPercentage = true; this.myTrackBar.Size = new System.Drawing.Size(146, 20); this.myTrackBar.TabIndex = 1; this.myTrackBar.Text = "程序进度条"; // // myButton // this.myButton.BackColor = System.Drawing.Color.SandyBrown; this.myButton.ButtonBorder = 1; this.myButton.ButtonBorderColor = System.Drawing.Color.Sienna; this.myButton.Cursor = System.Windows.Forms.Cursors.Default; this.myButton.Location = new System.Drawing.Point(-3, 178); this.myButton.Name = "myButton"; this.myButton.Size = new System.Drawing.Size(107, 51); this.myButton.TabIndex = 3; this.myButton.Text = "I am a button"; this.myButton.UseVisualStyleBackColor = false; // // myListControl // this.myListControl.BackColor = System.Drawing.SystemColors.Control; this.myListControl.Cursor = System.Windows.Forms.Cursors.Default; this.myListControl.ForeColor = System.Drawing.Color.Cornsilk; this.myListControl.Location = new System.Drawing.Point(195, 237); this.myListControl.Name = "myListControl"; scopeAttribute1.Max = 100; scopeAttribute1.Min = 3; this.myListControl.Scope = scopeAttribute1; this.myListControl.Size = new System.Drawing.Size(30, 100); this.myListControl.TabIndex = 6; // // MyForm // this.ClientSize = new System.Drawing.Size(448, 423); this.Controls.Add(this.thermoMeterControl1); this.Controls.Add(this.myClock1); this.Controls.Add(this.myLabel1); this.Controls.Add(this.myControl); this.Controls.Add(this.myTrackBar); this.Controls.Add(this.myButton); this.Controls.Add(this.myListControl); this.Location = new System.Drawing.Point(300, 100); this.Name = "MyForm"; this.Text = "控件窗口"; this.ResumeLayout(false); this.PerformLayout(); }
public void ExecuteGenerateReport() { if (!ValidateBeforeSave()) { if (FirstControl != null && FirstControl.CanFocus) { FirstControl.Focus(); } return; } GenerateReportParameter ReportParas = new GenerateReportParameter(); XtraReport ReportSource = null; GenerateReport(ReportParas, ref ReportSource); if (UseGeneralizeHeader && ReportSource != null) { float FullPageWidth = ReportSource.PageWidth - (ReportSource.Margins.Left + ReportSource.Margins.Right);//(ReportSource.PaperKind == PaperKind.A5 ? (ReportSource.Landscape ? 0f : 533f) : (ReportSource.Landscape ? 0f : 777f)); ///-- Designing generalize header and footer /// ReportHeader = ReportSource.Bands.OfType <DevExpress.XtraReports.UI.ReportHeaderBand>().FirstOrDefault(); if (ReportHeader == null) { ReportHeader = new DevExpress.XtraReports.UI.ReportHeaderBand(); ReportSource.Bands.Add(ReportHeader); } PageHeader = ReportSource.Bands.OfType <DevExpress.XtraReports.UI.PageHeaderBand>().FirstOrDefault(); if (PageHeader == null) { PageHeader = new DevExpress.XtraReports.UI.PageHeaderBand(); ReportSource.Bands.Add(PageHeader); } var ReportFooterBand = ReportSource.Bands.OfType <DevExpress.XtraReports.UI.ReportFooterBand>().FirstOrDefault(); if (ReportFooterBand == null) { ReportFooterBand = new ReportFooterBand();//new DevExpress.XtraReports.UI.PageFooterBand(); ReportSource.Bands.Add(ReportFooterBand); } ReportFooterBand.PrintAtBottom = true; var xrlpfTopLine = new DevExpress.XtraReports.UI.XRLine(); var xrpipfPrintDateTime = new DevExpress.XtraReports.UI.XRPageInfo(); var xrpipfPageNo = new DevExpress.XtraReports.UI.XRPageInfo(); var xrlrhCompanyName = new DevExpress.XtraReports.UI.XRLabel(); var xrlrhCompanyAddress = new DevExpress.XtraReports.UI.XRLabel(); var xrlrhCompanyContactDetails = new DevExpress.XtraReports.UI.XRLabel(); xrlrhReportTitle1 = new DevExpress.XtraReports.UI.XRLabel(); xrlrhReportTitle2 = new DevExpress.XtraReports.UI.XRLabel(); xrlphReportTitle1 = new DevExpress.XtraReports.UI.XRLabel(); xrlphReportTitle2 = new DevExpress.XtraReports.UI.XRLabel(); ((System.ComponentModel.ISupportInitialize)(ReportSource)).BeginInit(); // // xrlpfTopLine // xrlpfTopLine.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F); xrlpfTopLine.Name = "xrlpfTopLine"; xrlpfTopLine.SizeF = new System.Drawing.SizeF(FullPageWidth, 5F); // // pageFooterBand1 // ReportFooterBand.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { xrpipfPrintDateTime, xrpipfPageNo, xrlpfTopLine }); ReportFooterBand.HeightF = 29F; ReportFooterBand.Name = "pageFooterBand1"; // // xrpipfPrintDateTime // //xrpipfPrintDateTime.Borders = DevExpress.XtraPrinting.BorderSide.All; xrpipfPrintDateTime.Font = new System.Drawing.Font("Arial", 10F); xrpipfPrintDateTime.LocationFloat = new DevExpress.Utils.PointFloat(0F, 7F); xrpipfPrintDateTime.Name = "xrpipfPrintDateTime"; xrpipfPrintDateTime.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); xrpipfPrintDateTime.PageInfo = DevExpress.XtraPrinting.PageInfo.DateTime; xrpipfPrintDateTime.SizeF = new System.Drawing.SizeF(200F, 20F); xrpipfPrintDateTime.StyleName = "PageInfo"; // // xrpipfPageNo // //xrpipfPageNo.Borders = DevExpress.XtraPrinting.BorderSide.All; xrpipfPageNo.Font = new System.Drawing.Font("Arial", 10F); xrpipfPageNo.Format = "Page {0} of {1}"; xrpipfPageNo.LocationFloat = new DevExpress.Utils.PointFloat(FullPageWidth - 150, 7F); xrpipfPageNo.Name = "xrpipfPageNo"; xrpipfPageNo.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); xrpipfPageNo.SizeF = new System.Drawing.SizeF(150F, 20F); xrpipfPageNo.StyleName = "PageInfo"; xrpipfPageNo.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight; // //Page Header // PageHeader.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { xrlphReportTitle1, xrlphReportTitle2 }); // // PageHeader // PageHeader.Borders = DevExpress.XtraPrinting.BorderSide.Bottom; PageHeader.HeightF = 55F; PageHeader.Name = "PageHeader"; PageHeader.PrintOn = DevExpress.XtraReports.UI.PrintOnPages.NotWithReportHeader; PageHeader.StylePriority.UseBorders = false; // // xrlphReportTitle // xrlphReportTitle1.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Bold); xrlphReportTitle1.CanShrink = true; xrlphReportTitle1.ProcessNullValues = ValueSuppressType.SuppressAndShrink; xrlphReportTitle1.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F); xrlphReportTitle1.Name = "xrlphReportTitle1"; xrlphReportTitle1.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 10, 10, 100F); xrlphReportTitle1.SizeF = new System.Drawing.SizeF(FullPageWidth, 30F); xrlphReportTitle1.StylePriority.UseFont = false; xrlphReportTitle1.StylePriority.UseTextAlignment = false; xrlphReportTitle1.Text = ReportTitle1; xrlphReportTitle1.TextAlignment = DevExpress.XtraPrinting.TextAlignment.BottomCenter; // // xrlphReportTitle // xrlphReportTitle2.Font = new System.Drawing.Font("Arial", 11F, System.Drawing.FontStyle.Bold); xrlphReportTitle2.CanShrink = true; xrlphReportTitle2.ProcessNullValues = ValueSuppressType.SuppressAndShrink; xrlphReportTitle2.LocationFloat = new DevExpress.Utils.PointFloat(0F, 30F); xrlphReportTitle2.Name = "xrlphReportTitle2"; xrlphReportTitle2.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 2, 2, 100F); xrlphReportTitle2.SizeF = new System.Drawing.SizeF(FullPageWidth, 25F); xrlphReportTitle2.StylePriority.UseFont = false; xrlphReportTitle2.StylePriority.UseTextAlignment = false; xrlphReportTitle2.Text = ReportTitle2; xrlphReportTitle2.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopCenter; // // ReportHeader // ReportHeader.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { xrlrhCompanyName, xrlrhCompanyAddress, xrlrhCompanyContactDetails, xrlrhReportTitle1, xrlrhReportTitle2 }); ReportHeader.HeightF = 120f; ReportHeader.Name = "ReportHeader"; // // xrlrhCompanyName // xrlrhCompanyName.CanGrow = false; xrlrhCompanyName.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Bold); xrlrhCompanyName.ForeColor = System.Drawing.Color.Black; xrlrhCompanyName.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F); xrlrhCompanyName.Name = "xrlrhCompanyName"; xrlrhCompanyName.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); xrlrhCompanyName.SizeF = new System.Drawing.SizeF(FullPageWidth, 25F); xrlrhCompanyName.StyleName = "Title"; xrlrhCompanyName.StylePriority.UseFont = false; xrlrhCompanyName.StylePriority.UseForeColor = false; xrlrhCompanyName.StylePriority.UseTextAlignment = false; xrlrhCompanyName.TextAlignment = DevExpress.XtraPrinting.TextAlignment.BottomCenter; xrlrhCompanyName.Text = CommonProperties.LoginInfo.LoggedInCompanyReportModel.CompanyName; // // xrlrhCompanyAddress // xrlrhCompanyAddress.Font = new System.Drawing.Font("Arial", 10F); xrlrhCompanyAddress.LocationFloat = new DevExpress.Utils.PointFloat(0F, 25F); xrlrhCompanyAddress.Name = "xrlrhCompanyAddress"; xrlrhCompanyAddress.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); xrlrhCompanyAddress.SizeF = new System.Drawing.SizeF(FullPageWidth, 20F); xrlrhCompanyAddress.StylePriority.UseFont = false; xrlrhCompanyAddress.StylePriority.UseTextAlignment = false; xrlrhCompanyAddress.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter; xrlrhCompanyAddress.Text = CommonProperties.LoginInfo.LoggedInCompanyReportModel.AddressWithCity; // // xrlrhCompanyContactDetails // //xrlrhCompanyContactDetails.Borders = DevExpress.XtraPrinting.BorderSide.Bottom; xrlrhCompanyContactDetails.Font = new System.Drawing.Font("Arial", 10F); xrlrhCompanyContactDetails.LocationFloat = new DevExpress.Utils.PointFloat(0F, 45F); xrlrhCompanyContactDetails.Name = "xrlrhCompanyContactDetails"; xrlrhCompanyContactDetails.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); xrlrhCompanyContactDetails.SizeF = new System.Drawing.SizeF(FullPageWidth, 20F); xrlrhCompanyContactDetails.StylePriority.UseBorders = false; xrlrhCompanyContactDetails.StylePriority.UseFont = false; xrlrhCompanyContactDetails.StylePriority.UseTextAlignment = false; xrlrhCompanyContactDetails.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter; xrlrhCompanyContactDetails.Text = CommonProperties.LoginInfo.LoggedInCompanyReportModel.ContactDetails; // // xrlrhReportTitle // //xrlrhReportTitle1.Borders = DevExpress.XtraPrinting.BorderSide.Bottom; xrlrhReportTitle1.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Bold); xrlrhReportTitle1.LocationFloat = new DevExpress.Utils.PointFloat(0F, 65F); xrlrhReportTitle1.Name = "xrlrhReportTitle1"; xrlrhReportTitle1.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 2, 2, 100F); xrlrhReportTitle1.SizeF = new System.Drawing.SizeF(FullPageWidth, 30F); xrlrhReportTitle1.StylePriority.UseBorders = false; xrlrhReportTitle1.StylePriority.UseFont = false; xrlrhReportTitle1.StylePriority.UseTextAlignment = false; xrlrhReportTitle1.Text = ReportTitle1; xrlrhReportTitle1.TextAlignment = DevExpress.XtraPrinting.TextAlignment.BottomCenter; // // xrlrhReportTitle // xrlrhReportTitle2.Borders = DevExpress.XtraPrinting.BorderSide.Bottom; xrlrhReportTitle2.Font = new System.Drawing.Font("Arial", 11F, System.Drawing.FontStyle.Bold); xrlrhReportTitle2.LocationFloat = new DevExpress.Utils.PointFloat(0F, 95F); xrlrhReportTitle2.Name = "xrlrhReportTitle2"; xrlrhReportTitle2.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 2, 2, 100F); xrlrhReportTitle2.SizeF = new System.Drawing.SizeF(FullPageWidth, 25F); xrlrhReportTitle2.StylePriority.UseBorders = false; xrlrhReportTitle2.StylePriority.UseFont = false; xrlrhReportTitle2.StylePriority.UseTextAlignment = false; xrlrhReportTitle2.Text = ReportTitle2; xrlrhReportTitle2.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopCenter; ((System.ComponentModel.ISupportInitialize)(ReportSource)).EndInit(); } ///-- DocViwer.DocumentSource = ReportSource; if (ReportSource != null) { ReportSource.CreateDocument(true); } ///- AfterGenerateReport(ReportParas); //-- //if (ReportParas.GenerateReportResult != null && ReportParas.GenerateReportResult.ExecutionResult == eExecutionResult.CommitedSucessfuly) //{ // ResetFormView(); //} //FirstControl.Focus(); DocViwer.Focus(); //-- Application.DoEvents(); }
// Use this for initialization void Start() { sceneControler = (FirstControl)Director.getInstance().sceneCtrl; sceneControler.scoreRecorder = this; }