Beispiel #1
0
        private void InitializeComponent()
        {
            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject1 = new DevExpress.Utils.SerializableAppearanceObject();
            this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl();
            this.simpleButtonCancel = new DevExpress.XtraEditors.SimpleButton();
            this.simpleButtonSave = new DevExpress.XtraEditors.SimpleButton();
            this.gridControlHistory = new DevExpress.XtraGrid.GridControl();
            this.gridViewHistory = new DevExpress.XtraGrid.Views.Grid.GridView();
            this.gridColumnId = new DevExpress.XtraGrid.Columns.GridColumn();
            this.gridColumnComment = new DevExpress.XtraGrid.Columns.GridColumn();
            this.repositoryItemMemoEdit1 = new DevExpress.XtraEditors.Repository.RepositoryItemMemoEdit();
            this.repositoryItemMemoEdit2 = new DevExpress.XtraEditors.Repository.RepositoryItemMemoEdit();
            this.gridColumnCreationDate = new DevExpress.XtraGrid.Columns.GridColumn();
            this.gridColumnUser = new DevExpress.XtraGrid.Columns.GridColumn();
            this.gridColumnCustomerContact = new DevExpress.XtraGrid.Columns.GridColumn();
            this.gridColumnDelete = new DevExpress.XtraGrid.Columns.GridColumn();
            this.repositoryItemButtonEdit1 = new DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit();
            this.repositoryItemButtonEdit2 = new DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit();
            this.memoEdit1 = new DevExpress.XtraEditors.MemoEdit();
            this.layoutControlGroupQuestion1 = new DevExpress.XtraLayout.LayoutControlGroup();
            this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem();
            this.layoutControlItem3 = new DevExpress.XtraLayout.LayoutControlItem();
            this.layoutControlItem4 = new DevExpress.XtraLayout.LayoutControlItem();
            this.layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem();
            this.layoutControlItemHeader = new DevExpress.XtraLayout.LayoutControlItem();
            this.layoutControlItemHeader.Name = "layoutControlItemHeader"+Guid.NewGuid().ToString();
            this.layoutControlItemPrefix = new DevExpress.XtraLayout.LayoutControlItem();
            this.emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem();

            //
            // layoutControlGroupQuestion1
            //
            this.layoutControlGroupQuestion1.CustomizationFormText = "Root";
            this.layoutControlGroupQuestion1.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
            this.layoutControlGroupQuestion1.AppearanceGroup.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
            this.layoutControlGroupQuestion1.AppearanceGroup.GradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical;
            this.layoutControlGroupQuestion1.AppearanceGroup.Options.UseFont = true;
            this.layoutControlGroupQuestion1.ExpandButtonVisible = false;
            this.layoutControlGroupQuestion1.GroupBordersVisible = true;
            this.layoutControlGroupQuestion1.TextVisible = false;
            //this.layoutControlGroupQuestion1.Location = new System.Drawing.Point(0, 0);
            this.layoutControlGroupQuestion1.Padding = new DevExpress.XtraLayout.Utils.Padding(1, 1, 1, 1);
            this.layoutControlGroupQuestion1.ShowInCustomizationForm = false;
            //this.layoutControlGroupQuestion1.Text = oSettings.Label + " " + oSettings.QuestionText;
            this.layoutControlGroupQuestion1.BeginUpdate();

            #region Prefix
            lprefix = new Label();
            lprefix.Name = "lprefix";
            lprefix.Text = "";
            lprefix.Visible = false;
            this.layoutControlItemPrefix.Location = new System.Drawing.Point(0, 0);
            this.layoutControlItemPrefix.Name = "layoutControlItemPrefix1";
            this.layoutControlItemPrefix.Control = lprefix;
            this.layoutControlItemPrefix.ShowInCustomizationForm = false;
            this.layoutControlItemPrefix.TextVisible = false;
            this.layoutControlItemPrefix.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
            this.layoutControlItemPrefix.MinSize = new Size(0, 10);
            this.layoutControlItemPrefix.MaxSize = new Size(0, 10);
            this.layoutControlItemPrefix.SizeConstraintsType = SizeConstraintsType.Custom;
            this.layoutControlItemPrefix.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
            #endregion

            #region Footer
               //bool isCustomerOwned = false;
            //bool isBrightvisionOwned = false;
            //if (oSettings.CustomerOwnership && oSettings.BVOwnership)
            //    isCustomerOwnershipOnly = true;

            //ctlFooter = new Footer() {
            //    IsAccountLevel = oSettings.DataBindings.account_level,
            //    IsCustomerOwnershipOnly = isCustomerOwnershipOnly,
            //    HelpText = oSettings.QuestionHelp,
            //    LanguageCode = oSettings.DataBindings.language_code
            //};
            Settings oSettings = Questionnaire.Form.Settings;
            ctlFooter = new Footer() {
                IsAccountLevel = oSettings.DataBindings.account_level,
                IsCustomerOwned = oSettings.CustomerOwnership,
                IsBrightvisionOwned = oSettings.BVOwnership,
                HelpText = oSettings.QuestionHelp,
                LanguageCode = oSettings.DataBindings.language_code,
                QuestionText = oSettings.Label + " " + oSettings.QuestionText
            };

            ctlFooter.InitializeFooter();
            ctlFooter.Dock = DockStyle.Fill;
            ctlFooter.Height = 20;
            this.layoutControlItemHeader.Control = ctlFooter;
            this.layoutControlItemHeader.ShowInCustomizationForm = false;
            this.layoutControlItemHeader.TextVisible = false;
            this.layoutControlItemHeader.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
            this.layoutControlItemHeader.MinSize = new Size(0, 24);
            this.layoutControlItemHeader.MaxSize = new Size(0, 24);
            this.layoutControlItemHeader.Click += new EventHandler(layoutControlGroupQuestion1_Click);
            this.layoutControlItemHeader.SizeConstraintsType = SizeConstraintsType.Default;
               #endregion
             //
            // layoutControl1
            //

            this.layoutControl1.Controls.Add(this.ctlFooter);
            this.layoutControl1.Controls.Add(this.simpleButtonCancel);
            this.layoutControl1.Controls.Add(this.simpleButtonSave);
            this.layoutControl1.Controls.Add(this.gridControlHistory);
            this.layoutControl1.Controls.Add(this.memoEdit1);
            this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.layoutControl1.Location = new System.Drawing.Point(0, 0);
            this.layoutControl1.Name = "layoutControl1";
            this.layoutControl1.Root = this.layoutControlGroupQuestion1;
            //this.layoutControl1.Size = new System.Drawing.Size(539, 216);
            this.layoutControl1.TabIndex = 2;
            this.layoutControl1.Text = "layoutControl1";
            //
            // simpleButtonCancel
            //
            this.simpleButtonCancel.Image = global::BrightVision.DQControl.Properties.Resources.cancel_16x16;
            this.simpleButtonCancel.Location = new System.Drawing.Point(498, 41);
            this.simpleButtonCancel.Margin = new System.Windows.Forms.Padding(1);
            this.simpleButtonCancel.Name = "simpleButtonCancel";
            this.simpleButtonCancel.MinimumSize = new System.Drawing.Size(22, 22);
            this.simpleButtonCancel.MaximumSize = new System.Drawing.Size(22, 22);
            this.simpleButtonCancel.ImageLocation = ImageLocation.MiddleCenter;
            this.simpleButtonCancel.StyleController = this.layoutControl1;
            this.simpleButtonCancel.TabIndex = 7;
            this.simpleButtonCancel.ToolTip = "Cancel";
            this.simpleButtonCancel.Click += new EventHandler(simpleButtonCancel_Click);
            //
            // simpleButtonSave
            //
            this.simpleButtonSave.Image = global::BrightVision.DQControl.Properties.Resources.save_16x16;
            this.simpleButtonSave.Location = new System.Drawing.Point(498, 7);
            this.simpleButtonSave.Margin = new System.Windows.Forms.Padding(1);
            this.simpleButtonSave.Name = "simpleButtonSave";
            this.simpleButtonSave.MinimumSize = new System.Drawing.Size(22, 22);
            this.simpleButtonSave.MaximumSize = new System.Drawing.Size(22, 22);
            this.simpleButtonSave.ImageLocation = ImageLocation.MiddleCenter;
            this.simpleButtonSave.StyleController = this.layoutControl1;

            this.simpleButtonSave.TabIndex = 6;
            this.simpleButtonSave.Click += new EventHandler(simpleButtonSave_Click);
            this.simpleButtonSave.ToolTip = "Save";
            //
            // gridControl1
            //
            this.gridControlHistory.Location = new System.Drawing.Point(7, 75);
            this.gridControlHistory.MainView = this.gridViewHistory;
            this.gridControlHistory.Name = "gridControlHistory";
            this.gridControlHistory.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] {
            this.repositoryItemButtonEdit1,
            this.repositoryItemMemoEdit1,
            this.repositoryItemMemoEdit2,
            this.repositoryItemButtonEdit2});
            this.gridControlHistory.MinimumSize = new System.Drawing.Size(0, 150);
            this.gridControlHistory.MaximumSize = new System.Drawing.Size(0, 150);
            this.gridControlHistory.Size = new Size(0, 150);

            this.gridControlHistory.TabIndex = 4;
            this.gridControlHistory.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
            this.gridViewHistory});

            //
            // gridView1
            //
            this.gridViewHistory.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
            this.gridColumnId,
            this.gridColumnComment,
            this.gridColumnCreationDate,
            this.gridColumnUser,
            this.gridColumnCustomerContact,
            this.gridColumnDelete});
            this.gridViewHistory.GridControl = this.gridControlHistory;
            this.gridViewHistory.Name = "gridViewHistory";
            this.gridViewHistory.OptionsSelection.EnableAppearanceFocusedCell = false;
            this.gridViewHistory.OptionsView.RowAutoHeight = true;
            this.gridViewHistory.OptionsView.ShowGroupPanel = false;
            this.gridViewHistory.OptionsBehavior.ReadOnly = true;

            //this.gridViewHistory.VertScrollVisibility = DevExpress.XtraGrid.Views.Base.ScrollVisibility.Always;
            this.gridViewHistory.CustomRowCellEdit += new DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventHandler(gridViewHistory_CustomRowCellEdit);
            //
            //gridcolumn id
            //
            this.gridColumnId.Caption = "Id";
            this.gridColumnId.FieldName = "id";
            this.gridColumnId.Name = "gridColumnId";
            this.gridColumnId.Visible = false;

            //
            // gridColumn1
            //
            this.gridColumnComment.Caption = "Comment";
            this.gridColumnComment.ColumnEdit = this.repositoryItemMemoEdit1;
            this.gridColumnComment.FieldName = "Comment";
            this.gridColumnComment.Name = "gridColumnComment";
            this.gridColumnComment.Visible = true;
            this.gridColumnComment.VisibleIndex = 0;
            this.gridColumnComment.Width = 200;
            this.gridColumnComment.MaxWidth = 0;
            this.gridColumnComment.MinWidth = 0;
            this.gridColumnComment.ColumnEdit.EditValueChanged += new EventHandler(ColumnEdit_EditValueChanged);
            //
            // repositoryItemMemoEdit1
            //
            this.repositoryItemMemoEdit1.Name = "repositoryItemMemoEdit1";
            this.repositoryItemMemoEdit1.ReadOnly = false;
            this.repositoryItemMemoEdit2.Name = "repositoryItemMemoEdit2";
            this.repositoryItemMemoEdit2.ReadOnly = true;
            //
            // gridColumn2
            //
            this.gridColumnCreationDate.Caption = "Date";
            this.gridColumnCreationDate.FieldName = "CreationDate";
            this.gridColumnCreationDate.Name = "gridColumnCreationDate";
            this.gridColumnCreationDate.Visible = true;
            this.gridColumnCreationDate.VisibleIndex = 1;
            this.gridColumnCreationDate.Width = 50;
            this.gridColumnCreationDate.MaxWidth = 0;
            this.gridColumnCreationDate.MinWidth = 0;
            this.gridColumnCreationDate.DisplayFormat.FormatType = FormatType.Custom;
            this.gridColumnCreationDate.DisplayFormat.Format = new DateCustomFormatter();
            this.gridColumnCreationDate.DisplayFormat.FormatString = "yyyy-MM-dd HH:mm";
            this.gridColumnCreationDate.OptionsColumn.ReadOnly = true;
            //
            // gridColumn3
            //
            this.gridColumnUser.Caption = "User";
            this.gridColumnUser.FieldName = "User";
            this.gridColumnUser.Name = "gridColumnUser";
            this.gridColumnUser.Visible = true;
            this.gridColumnUser.VisibleIndex = 2;
            this.gridColumnUser.Width = 70;
            this.gridColumnUser.MaxWidth = 0;
            this.gridColumnUser.MinWidth = 0;
            this.gridColumnUser.OptionsColumn.ReadOnly = true;
            //
            // gridColumn4
            //
            this.gridColumnCustomerContact.Caption = "Contact";
            this.gridColumnCustomerContact.FieldName = "CustomerContact";
            this.gridColumnCustomerContact.Name = "gridColumnCustomerContact";
            this.gridColumnCustomerContact.Visible = true;
            this.gridColumnCustomerContact.VisibleIndex = 3;
            this.gridColumnCustomerContact.Width = 70;
            this.gridColumnCustomerContact.MaxWidth = 0;
            this.gridColumnCustomerContact.MinWidth = 0;

            this.gridColumnCustomerContact.OptionsColumn.ReadOnly = true;
            //
            // gridColumn5
            //
            this.gridColumnDelete.Caption = "";
            this.gridColumnDelete.ColumnEdit = this.repositoryItemButtonEdit1;
            this.gridColumnDelete.FieldName = "";
            this.gridColumnDelete.MaxWidth = 30;
            this.gridColumnDelete.Name = "gridColumnDelete";
            this.gridColumnDelete.Visible = true;
            this.gridColumnDelete.VisibleIndex = 4;
            this.gridColumnDelete.Width = 30;

            this.gridColumnDelete.OptionsColumn.ReadOnly = true;
            //
            // repositoryItemButtonEdit1
            //
            Image img = ((System.Drawing.Image)(global::BrightVision.DQControl.Properties.Resources.cancel_16x16));
            var btn = new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "", -1, true, true, false, DevExpress.XtraEditors.ImageLocation.MiddleCenter, img, null, null, "Delete");

            this.repositoryItemButtonEdit1.Buttons.Add(btn);
            this.repositoryItemButtonEdit1.Name = "repositoryItemButtonEdit1";
            this.repositoryItemButtonEdit1.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.HideTextEditor;
            //this.repositoryItemButtonEdit1.ButtonClick += new DevExpress.XtraEditors.Controls.ButtonPressedEventHandler(repositoryItemButtonDelete_ButtonClick);
            this.repositoryItemButtonEdit1.Click += new EventHandler(repositoryItemButtonDelete_Click);
            //btn.Appearance.Image = img;

            this.repositoryItemButtonEdit2.Buttons.Add(btn);
            this.repositoryItemButtonEdit2.Name = "repositoryItemButtonEdit1";
            this.repositoryItemButtonEdit2.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.HideTextEditor;
            this.repositoryItemButtonEdit2.ReadOnly = true;
            //
            // memoEdit1
            //
            this.memoEdit1.Location = new System.Drawing.Point(7, 7);
            this.memoEdit1.Name = "memoEdit1";
            //this.memoEdit1.MinimumSize = new Size(100, 52);
            //this.memoEdit1.MaximumSize = new Size(0,0);
            this.memoEdit1.StyleController = this.layoutControl1;
            this.memoEdit1.TabIndex = 8;
            this.memoEdit1.Properties.ScrollBars = ScrollBars.None;
            this.memoEdit1.TextChanged += new EventHandler(memoEdit1_TextChanged);

            //
            // emptySpaceItem1
            //
            this.emptySpaceItem1.AllowHotTrack = false;
            this.emptySpaceItem1.CustomizationFormText = "emptySpaceItem1";
            this.emptySpaceItem1.Location = new System.Drawing.Point(383, 52);
            this.emptySpaceItem1.Name = "emptySpaceItem1";
            this.emptySpaceItem1.Size = new System.Drawing.Size(22, 212);
            this.emptySpaceItem1.Text = "emptySpaceItem1";
            this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);
            //
            //gridControl
            //
            this.layoutControlItem1.Control = this.gridControlHistory;
            this.layoutControlItem1.CustomizationFormText = "layoutControlItem1";
            this.layoutControlItem1.Location = new System.Drawing.Point(0, 68);
            //this.layoutControlItem1.MinSize = new System.Drawing.Size(0, 100);
            //this.layoutControlItem1.MaxSize = new System.Drawing.Size(0, 200);
            this.Size = new Size(0, 150);
            this.layoutControlItem1.Name = "layoutControlItem1";
            this.layoutControlItem1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.SupportHorzAlignment;
            this.layoutControlItem1.ControlAlignment = ContentAlignment.BottomCenter;
            //this.layoutControlItem1.Size = new Size(0, 150);
            this.layoutControlItem1.Text = "layoutControlItem1";
            this.layoutControlItem1.TextSize = new System.Drawing.Size(0, 0);
            this.layoutControlItem1.TextToControlDistance = 0;
            this.layoutControlItem1.TextVisible = false;
             //
            // layoutControlItem3
            //
            this.layoutControlItem3.Control = this.simpleButtonSave;
            this.layoutControlItem3.CustomizationFormText = "layoutControlItem3";
            this.layoutControlItem3.Location = new System.Drawing.Point(491, 0);
            this.layoutControlItem3.MaxSize = new System.Drawing.Size(22, 22);
            this.layoutControlItem3.MinSize = new System.Drawing.Size(22, 22);
            this.layoutControlItem3.Padding = new DevExpress.XtraLayout.Utils.Padding(1);
            this.layoutControlItem3.Name = "layoutControlItem3";
            this.layoutControlItem3.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Default;
            this.layoutControlItem3.Text = "layoutControlItem3";
            this.layoutControlItem3.TextSize = new System.Drawing.Size(0, 0);
            this.layoutControlItem3.TextToControlDistance = 0;
            this.layoutControlItem3.TextVisible = false;
            //
            // layoutControlItem4
            //
            this.layoutControlItem4.Control = this.simpleButtonCancel;
            this.layoutControlItem4.CustomizationFormText = "layoutControlItem4";
            this.layoutControlItem4.Location = new System.Drawing.Point(491, 34);
            this.layoutControlItem4.MaxSize = new System.Drawing.Size(22, 102);
            this.layoutControlItem4.MinSize = new System.Drawing.Size(22, 22);
            this.layoutControlItem4.Size = new Size(22, 102);
            this.layoutControlItem4.Padding = new DevExpress.XtraLayout.Utils.Padding(1);

            this.layoutControlItem4.Name = "layoutControlItem4";
            this.layoutControlItem4.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Default;
            this.layoutControlItem4.Text = "layoutControlItem4";
            this.layoutControlItem4.TextSize = new System.Drawing.Size(0, 0);
            this.layoutControlItem4.TextToControlDistance = 0;
            this.layoutControlItem4.TextVisible = false;
            //
            // layoutControlItem2
            //
            this.layoutControlItem2.Control = this.memoEdit1;
            this.layoutControlItem2.CustomizationFormText = "layoutControlItem2";
            this.layoutControlItem2.Location = new System.Drawing.Point(0, 0);
            this.layoutControlItem2.Name = "layoutControlItem2";
            this.layoutControlItem2.Text = "layoutControlItem2";
            this.layoutControlItem2.TextSize = new System.Drawing.Size(0, 0);
            this.layoutControlItem1.MinSize = new Size(0, 24);
            this.layoutControlItem1.MaxSize = new Size(0, 24);
            this.layoutControlItem2.TextToControlDistance = 0;
            this.layoutControlItem2.TextVisible = false;
            this.layoutControlItem2.SizeConstraintsType = SizeConstraintsType.SupportHorzAlignment;
            //
            // testinglayout
            //
            this.layoutControlGroupQuestion1.AddItem(this.layoutControlItemHeader);
            this.layoutControlGroupQuestion1.AddItem(this.layoutControlItemPrefix);
            this.layoutControlGroupQuestion1.AddItem(this.layoutControlItem2);
            this.layoutControlGroupQuestion1.AddItem(this.layoutControlItem3, this.layoutControlItem2, DevExpress.XtraLayout.Utils.InsertType.Right);
            this.layoutControlGroupQuestion1.AddItem(this.layoutControlItem4, this.layoutControlItem3, DevExpress.XtraLayout.Utils.InsertType.Bottom);
            this.layoutControlGroupQuestion1.AddItem(this.layoutControlItem1);

            this.layoutControlGroupQuestion1.Click += new EventHandler(layoutControlGroupQuestion1_Click);

            this.layoutControlGroupQuestion1.EndUpdate();
        }