/// <summary> /// Called from parent form on activation /// </summary> public void RunOnceOnActivationManual(TFrmGLAccountHierarchy ParentForm) { FParentForm = ParentForm; // AlanP March 2013: Use a try/catch block because nUnit testing on this screen does not support Drag/Drop in multi-threaded model // It is easier to do this than to configure all the different test execution methods to use STA try { trvAccounts.AllowDrop = true; trvAccounts.ItemDrag += new ItemDragEventHandler(treeView_ItemDrag); trvAccounts.DragOver += new DragEventHandler(treeView_DragOver); trvAccounts.DragDrop += new DragEventHandler(treeView_DragDrop); } catch (InvalidOperationException) { // ex.Message is: DragDrop registration did not succeed. // Inner exception is: Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. } }
/// <summary> /// Perform initialisation /// (Actually called earlier than the parent RunOnceOnActivationManual) /// </summary> public void RunOnceOnActivationManual(TFrmGLAccountHierarchy ParentForm) { FParentForm = ParentForm; grdAccounts.Selection.SelectionChanged += Selection_SelectionChanged; grdAccounts.Selection.FocusRowLeaving += new SourceGrid.RowCancelEventHandler(grdAccounts_FocusRowLeaving); }
private void EditAccount(System.Object sender, EventArgs e) { this.Cursor = Cursors.WaitCursor; try { TFrmGLAccountHierarchy GLAccountHierarchy = new TFrmGLAccountHierarchy(this); GLAccountHierarchy.LedgerNumber = FLedgerNumber; GLAccountHierarchy.SetSelectedAccountCode(FPreviouslySelectedDetailRow.AccountCode); GLAccountHierarchy.Show(); } finally { this.Cursor = Cursors.Default; } }
// public ToolStripMenuItemTester mniFile; // public System.Windows.Forms.ToolStripMenuItem mniFileSave; // public System.Windows.Forms.ToolStripSeparator mniSeparator0; // public System.Windows.Forms.ToolStripMenuItem mniFilePrint; // public System.Windows.Forms.ToolStripSeparator mniSeparator1; // public System.Windows.Forms.ToolStripMenuItem mniClose; // public System.Windows.Forms.ToolStripMenuItem mniEdit; // public System.Windows.Forms.ToolStripMenuItem mniEditUndoCurrentField; // public System.Windows.Forms.ToolStripMenuItem mniEditUndoScreen; // public System.Windows.Forms.ToolStripSeparator mniSeparator2; // public System.Windows.Forms.ToolStripMenuItem mniEditFind; // public System.Windows.Forms.ToolStripMenuItem mniAccounts; // public System.Windows.Forms.ToolStripMenuItem mniAddNewAccount; // public System.Windows.Forms.ToolStripMenuItem mniDeleteUnusedAccount; // public System.Windows.Forms.ToolStripSeparator mniSeparator3; // public System.Windows.Forms.ToolStripMenuItem mniExportHierarchy; // public System.Windows.Forms.ToolStripMenuItem mniImportHierarchy; // public System.Windows.Forms.ToolStripMenuItem mniHelp; // public System.Windows.Forms.ToolStripMenuItem mniHelpPetraHelp; // public System.Windows.Forms.ToolStripSeparator mniSeparator4; // public System.Windows.Forms.ToolStripMenuItem mniHelpBugReport; // public System.Windows.Forms.ToolStripSeparator mniSeparator5; // public System.Windows.Forms.ToolStripMenuItem mniHelpAboutPetra; // public System.Windows.Forms.ToolStripMenuItem mniHelpDevelopmentTeam; // Contructor which initializes the acces to all the controls on the // Dialog /// <summary> /// ... /// </summary> public TFrmGLAccountHierarchyTester() { mainForm = new TFrmGLAccountHierarchy(null); trvAccounts = new TTrvTreeViewTester("trvAccounts", mainForm); txtDetailAccountCode = new TextBoxTester("txtDetailAccountCode", mainForm); cmbDetailAccountType = new TCmbAutoCompleteTester("cmbDetailAccountType", mainForm); txtDetailEngAccountCodeLongDesc = new TextBoxTester("txtDetailEngAccountCodeLongDesc", mainForm); txtDetailEngAccountCodeShortDesc = new TextBoxTester("txtDetailEngAccountCodeShortDesc", mainForm); txtDetailAccountCodeLongDesc = new TextBoxTester("txtDetailAccountCodeLongDesc", mainForm); txtDetailAccountCodeShortDesc = new TextBoxTester("txtDetailAccountCodeShortDesc", mainForm); cmbDetailValidCcCombo = new TCmbAutoCompleteTester("cmbDetailValidCcCombo", mainForm); chkDetailBankAccountFlag = new CheckBoxTester("chkDetailBankAccountFlag", mainForm); chkDetailAccountActiveFlag = new CheckBoxTester("chkDetailAccountActiveFlag", mainForm); tbbSave = new ToolStripButtonTester("tbbSave", mainForm); tbbAddNewAccount = new ToolStripButtonTester("tbbAddNewAccount", mainForm); tbbDeleteUnusedAccount = new ToolStripButtonTester("tbbDeleteUnusedAccount", mainForm); tbbExportHierarchy = new ToolStripButtonTester("tbbExportHierarchy", mainForm); tbbImportHierarchy = new ToolStripButtonTester("tbbImportHierarchy", mainForm); chkDetailForeignCurrencyFlag = new CheckBoxTester("chkDetailForeignCurrencyFlag", mainForm); cmbDetailForeignCurrencyCode = new TCmbAutoPopulatedTester("cmbDetailForeignCurrencyCode", mainForm); mniClose = new ToolStripMenuItemTester("mniClose", mainForm); }
/// <summary> /// Perform initialisation /// (Actually called earlier than the parent RunOnceOnActivationManual) /// </summary> public void RunOnceOnActivationManual(TFrmGLAccountHierarchy ParentForm) { FParentForm = ParentForm; grdAccounts.Selection.SelectionChanged += Selection_SelectionChanged; }