public FileLogSettingsDlg( ) { // // Required for Windows Form Designer support // InitializeComponent( ); // initialize the grid ColumnHeader headerBehaviour = new ColumnHeader( false ); FlatHeader headerVisual = new FlatHeader( true ); EditorTextBoxButton textEditor = new EditorTextBoxButton( typeof ( String ) ); EditorNumericUpDown numEditor = new EditorNumericUpDown( ); grid.Redim( 3, 2 ); grid[ 0, 0 ] = new SourceGrid2.Cells.Real.ColumnHeader( "Name", headerVisual, headerBehaviour ); grid[ 0, 1 ] = new SourceGrid2.Cells.Real.ColumnHeader( "Value", headerVisual, headerBehaviour ); grid[ 1, 0 ] = new Cell( "File", textEditor, headerVisual ); grid[ 1, 0 ].ToolTipText = "The path and file name to log to"; grid[ 1, 0 ].Invalidate( ); // TODO: place the old file name here grid[ 1, 1 ] = new Link( @"c:\", new PositionEventHandler( this.OpenFile ) ); grid[ 2, 0 ] = new Cell( "Size (Kb)", textEditor, headerVisual ); grid[ 2, 0 ].ToolTipText = "The maximum size of the log file."; grid[ 2, 0 ].Invalidate( ); grid[ 2, 1 ] = new Cell( 1024 * 100, numEditor ); numEditor.Maximum = new decimal( 1024 * 1024 ); numEditor.Minimum = new decimal( 0 ); grid.AutoStretchColumnsToFitWidth = true; grid.StretchColumnsToFitWidth( ); }
public EvLogSettingsDlg( ) { // // Required for Windows Form Designer support // InitializeComponent( ); ColumnHeader headerBehaviour = new ColumnHeader( false ); FlatHeader headerVisual = new FlatHeader( true ); EditorTextBoxButton textEditor = new EditorTextBoxButton( typeof ( String ) ); EditorNumericUpDown numEditor = new EditorNumericUpDown( ); grid.Redim( 3, 2 ); grid[ 0, 0 ] = new SourceGrid2.Cells.Real.ColumnHeader( "Name", headerVisual, headerBehaviour ); grid[ 0, 1 ] = new SourceGrid2.Cells.Real.ColumnHeader( "Value", headerVisual, headerBehaviour ); grid[ 1, 0 ] = new Cell( "EventSource Name", textEditor, headerVisual ); grid[ 1, 0 ].ToolTipText = "The path and file name to log to"; grid[ 1, 0 ].Invalidate( ); // TODO: place the old event source here grid[ 1, 1 ] = new Cell( "ShareIndex", textEditor ); grid.AutoStretchColumnsToFitWidth = true; grid.StretchColumnsToFitWidth( ); }
/// <summary> /// /// </summary> private void InitializeComponent() { filterLayout = new Panel(); formPanel = new TableLayoutPanel(); filterTitleLabel = new FlatLabel(); filterTitle = new ComboBox(); filterDateFrom = new FlatLabel(); filterDateUntil = new FlatLabel(); dateFromPicker = new DateTimePicker(); dateUntilPicker = new DateTimePicker(); filterPanel = new Panel(); filterLabel = new FlatHeader(); transactionsLayout = new Panel(); listView = new ListView(); columnDate = new ColumnHeader(); columnIdentifier = new ColumnHeader(); columnTitle = new ColumnHeader(); columnQuantity = new ColumnHeader(); columnTotal = new ColumnHeader(); transactionsPanel = new Panel(); transactionsLabel = new FlatHeader(); buttonPanel = new Panel(); buttonRefresh = new FlatButton(); buttonLogout = new FlatButton(); buttonSatisfy = new FlatButton(); filterLayout.SuspendLayout(); formPanel.SuspendLayout(); filterPanel.SuspendLayout(); transactionsLayout.SuspendLayout(); transactionsPanel.SuspendLayout(); buttonPanel.SuspendLayout(); SuspendLayout(); // // filterLayout // filterLayout.BackColor = SystemColors.ControlDark; filterLayout.Controls.Add(formPanel); filterLayout.Controls.Add(filterPanel); filterLayout.Dock = DockStyle.Top; filterLayout.Location = new Point(0, 0); filterLayout.Name = "filterLayout"; filterLayout.Padding = new Padding(4, 4, 4, 0); filterLayout.Size = new Size(704, 96); // // formPanel // formPanel.BackColor = Color.Silver; formPanel.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single; formPanel.ColumnCount = 4; formPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 50F)); formPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F)); formPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 50F)); formPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 320F)); formPanel.Controls.Add(filterTitleLabel, 0, 0); formPanel.Controls.Add(filterTitle, 1, 0); formPanel.Controls.Add(filterDateFrom, 2, 0); formPanel.Controls.Add(filterDateUntil, 2, 1); formPanel.Controls.Add(dateFromPicker, 3, 0); formPanel.Controls.Add(dateUntilPicker, 3, 1); formPanel.Dock = DockStyle.Fill; formPanel.Location = new Point(4, 28); formPanel.Name = "formPanel"; formPanel.RowCount = 2; formPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 50F)); formPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 50F)); formPanel.Size = new Size(696, 68); // // filterTitleLabel // filterTitleLabel.Font = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Bold, GraphicsUnit.Point, 0); filterTitleLabel.ForeColor = SystemColors.ControlLightLight; filterTitleLabel.Location = new Point(1, 1); filterTitleLabel.Name = "filterTitleLabel"; filterTitleLabel.Size = new Size(50, 32); filterTitleLabel.Text = "Title"; // // filterTitle // filterTitle.Dock = DockStyle.Fill; filterTitle.DropDownStyle = ComboBoxStyle.DropDownList; filterTitle.Location = new Point(58, 7); filterTitle.Margin = new Padding(6); filterTitle.Name = "filterTitle"; filterTitle.Size = new Size(259, 21); filterTitle.TabIndex = 3; filterTitle.SelectedIndexChanged += new EventHandler(ComboCustomer_SelectedIndexChanged); // // filterDateFrom // filterDateFrom.Font = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Bold, GraphicsUnit.Point, 0); filterDateFrom.ForeColor = SystemColors.ControlLightLight; filterDateFrom.Location = new Point(324, 1); filterDateFrom.Name = "filterDateFrom"; filterDateFrom.Size = new Size(50, 32); filterDateFrom.Text = "From"; // // filterDateUntil // filterDateUntil.Font = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Bold, GraphicsUnit.Point, 0); filterDateUntil.ForeColor = SystemColors.ControlLightLight; filterDateUntil.Location = new Point(324, 34); filterDateUntil.Name = "filterDateUntil"; filterDateUntil.Size = new Size(50, 33); filterDateUntil.Text = "Until"; // // dateFromPicker // dateFromPicker.Dock = DockStyle.Fill; dateFromPicker.Location = new Point(381, 7); dateFromPicker.Margin = new Padding(6); dateFromPicker.Name = "dateFromPicker"; dateFromPicker.ShowCheckBox = true; dateFromPicker.Size = new Size(308, 20); dateFromPicker.TabIndex = 5; dateFromPicker.ValueChanged += new EventHandler(DateFromPicker_ValueChanged); // // dateUntilPicker // dateUntilPicker.Dock = DockStyle.Fill; dateUntilPicker.Location = new Point(381, 40); dateUntilPicker.Margin = new Padding(6); dateUntilPicker.Name = "dateUntilPicker"; dateUntilPicker.ShowCheckBox = true; dateUntilPicker.Size = new Size(308, 20); dateUntilPicker.TabIndex = 6; dateUntilPicker.ValueChanged += new EventHandler(DateToPicker_ValueChanged); // // filterPanel // filterPanel.BackColor = SystemColors.ControlDarkDark; filterPanel.Controls.Add(filterLabel); filterPanel.Dock = DockStyle.Top; filterPanel.Location = new Point(4, 4); filterPanel.Name = "filterPanel"; filterPanel.Size = new Size(696, 24); // // filterLabel // filterLabel.Dock = DockStyle.None; filterLabel.Location = new Point(4, 5); filterLabel.Name = "filterLabel"; filterLabel.Size = new Size(35, 13); filterLabel.Text = "Filter"; // // transactionsLayout // transactionsLayout.BackColor = SystemColors.ControlDark; transactionsLayout.Controls.Add(listView); transactionsLayout.Controls.Add(transactionsPanel); transactionsLayout.Dock = DockStyle.Fill; transactionsLayout.Location = new Point(0, 96); transactionsLayout.Name = "transactionsLayout"; transactionsLayout.Padding = new Padding(4); transactionsLayout.Size = new Size(704, 427); // // listView // listView.BackColor = SystemColors.ControlLight; listView.Columns.AddRange(new ColumnHeader[] { columnDate, columnIdentifier, columnTitle, columnQuantity, columnTotal }); listView.Dock = DockStyle.Fill; listView.FullRowSelect = true; listView.GridLines = true; listView.Location = new Point(4, 28); listView.MultiSelect = false; listView.Name = "listView"; listView.Size = new Size(696, 395); listView.TabIndex = 4; listView.View = View.Details; listView.SelectedIndexChanged += new EventHandler(ListView_SelectedIndexChanged); listView.MouseDoubleClick += new MouseEventHandler(ListView_DoubleClicked); // // columnDate // columnDate.Text = "Date Issued"; columnDate.TextAlign = HorizontalAlignment.Center; columnDate.Width = 100; columnIdentifier.Text = "Identifier"; columnIdentifier.Width = 240; columnTitle.Text = "Title"; columnTitle.Width = 168; columnQuantity.Text = "Quantity"; columnQuantity.TextAlign = HorizontalAlignment.Center; columnQuantity.Width = 64; columnTotal.Text = "Total"; columnTotal.TextAlign = HorizontalAlignment.Center; columnTotal.Width = 80; // // transactionsPanel // transactionsPanel.BackColor = SystemColors.ControlDarkDark; transactionsPanel.Controls.Add(transactionsLabel); transactionsPanel.Dock = DockStyle.Top; transactionsPanel.Location = new Point(4, 4); transactionsPanel.Name = "transactionsPanel"; transactionsPanel.Size = new Size(696, 24); // // transactionsLabel // transactionsLabel.Dock = DockStyle.None; transactionsLabel.Location = new Point(4, 5); transactionsLabel.Name = "transactionsLabel"; transactionsLabel.Size = new Size(44, 13); transactionsLabel.Text = "Orders"; // // buttonPanel // buttonPanel.BackColor = Color.DarkGray; buttonPanel.Controls.Add(buttonRefresh); buttonPanel.Controls.Add(buttonLogout); buttonPanel.Controls.Add(buttonSatisfy); buttonPanel.Dock = DockStyle.Bottom; buttonPanel.Location = new Point(0, 523); buttonPanel.Name = "buttonPanel"; buttonPanel.Padding = new Padding(4, 0, 4, 4); buttonPanel.Size = new Size(704, 36); // // buttonRefresh // buttonRefresh.Location = new Point(144, 0); buttonRefresh.Margin = new Padding(2, 3, 2, 3); buttonRefresh.Name = "buttonRefresh"; buttonRefresh.Size = new Size(416, 32); buttonRefresh.TabIndex = 2; buttonRefresh.Text = "Refresh"; buttonRefresh.Click += new EventHandler(ButtonRefresh_Click); // // buttonLogout // buttonLogout.DialogResult = DialogResult.Cancel; buttonLogout.Font = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Bold, GraphicsUnit.Point, 0); buttonLogout.Location = new Point(560, 0); buttonLogout.Margin = new Padding(2, 3, 0, 3); buttonLogout.Name = "buttonLogout"; buttonLogout.Size = new Size(140, 32); buttonLogout.TabIndex = 3; buttonLogout.Text = "Exit"; buttonLogout.Click += new EventHandler(ButtonLogout_Click); // // buttonSatisfy // buttonSatisfy.Font = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Bold, GraphicsUnit.Point, 0); buttonSatisfy.Location = new Point(4, 0); buttonSatisfy.Margin = new Padding(0, 3, 2, 3); buttonSatisfy.Name = "buttonSatisfy"; buttonSatisfy.Size = new Size(140, 32); buttonSatisfy.TabIndex = 1; buttonSatisfy.Text = "Satisfy Order"; buttonSatisfy.Click += new EventHandler(ButtonSatisfy_Click); // // WarehouseClient // AcceptButton = buttonSatisfy; CancelButton = buttonLogout; ClientSize = new Size(704, 559); Controls.Add(transactionsLayout); Controls.Add(filterLayout); Controls.Add(buttonPanel); FormBorderStyle = FormBorderStyle.FixedSingle; Icon = Resources.librettoIcon; MaximizeBox = false; Name = "WarehouseClient"; StartPosition = FormStartPosition.CenterScreen; Text = "Libretto Warehouse"; FormClosing += new FormClosingEventHandler(WarehouseForm_FormClosing); Load += new EventHandler(WarehouseClient_Load); filterLayout.ResumeLayout(false); formPanel.ResumeLayout(false); formPanel.PerformLayout(); filterPanel.ResumeLayout(false); filterPanel.PerformLayout(); transactionsLayout.ResumeLayout(false); transactionsPanel.ResumeLayout(false); transactionsPanel.PerformLayout(); buttonPanel.ResumeLayout(false); buttonPanel.PerformLayout(); ResumeLayout(false); }
private void LoadProjectInfo() { try { hshProjects = syncMgr.GetProjects(false); gridProjects.FixedRows = 1; gridProjects.AutoStretchColumnsToFitWidth = true; // create a visual model for right-aligned text with trimming SourceGrid2.VisualModels.Common vmEllipsePath = new SourceGrid2.VisualModels.Common(); vmEllipsePath.StringFormat.Trimming = StringTrimming.EllipsisPath; // create a visual model for flat headers SourceGrid2.VisualModels.Common vmHeader = new SourceGrid2.VisualModels.FlatHeader(); vmHeader.BackColor = Color.FromArgb(228, 229, 237); SourceGrid2.BehaviorModels.Header bmHeader = new SourceGrid2.BehaviorModels.Header(); // set up the header row gridProjects.Rows.Insert(0); // set up the columns gridProjects.Columns.Insert(0); // hidden sync project full path gridProjects[0, 0] = new SourceGrid2.Cells.Real.ColumnHeader("", vmHeader, bmHeader); gridProjects.Columns.Insert(1); // check box column gridProjects[0, 1] = new SourceGrid2.Cells.Real.ColumnHeader("Sync?", vmHeader, bmHeader); gridProjects.Columns.Insert(2); // project name gridProjects[0, 2] = new SourceGrid2.Cells.Real.ColumnHeader("Project Name", vmHeader, bmHeader); gridProjects.Columns.Insert(3); // sync folder short for display gridProjects[0, 3] = new SourceGrid2.Cells.Real.ColumnHeader("Outlook Sync Folder", vmHeader, bmHeader); gridProjects.Columns.Insert(4); // browse button gridProjects[0, 4] = new SourceGrid2.Cells.Real.ColumnHeader("", vmHeader, bmHeader); SizeColumns(); if (hshProjects == null) { return; } // add rows for projects int iRow = 0; foreach (ProjectInfo projInfo in hshProjects.Values) { iRow++; gridProjects.Rows.Insert(iRow); // add row if (!hshProjRows.Contains(projInfo.ProjID)) { hshProjRows.Add(projInfo.ProjID, iRow); } // add each cell individually // sync folder path gridProjects[iRow, col_SyncFolderFull] = new SourceGrid2.Cells.Real.Cell(projInfo.SyncFolder); // checkbox for sync enabled gridProjects[iRow, col_SyncEnabled] = new SourceGrid2.Cells.Real.CheckBox(projInfo.SyncEnabled); // project name gridProjects[iRow, col_ProjName] = new SourceGrid2.Cells.Real.Cell(projInfo.ProjectName); // sync folder short gridProjects[iRow, col_SyncFolder] = new SourceGrid2.Cells.Real.Cell(projInfo.SyncFolderShort); gridProjects[iRow, col_SyncFolder].VisualModel = vmEllipsePath; // browse button gridProjects[iRow, col_BrowseButton] = new SourceGrid2.Cells.Real.Button("...", new SourceGrid2.PositionEventHandler(BrowseOutlookFolders_Click)); FlatHeader vm = new FlatHeader(); vm.BackColor = Color.FromArgb(228, 229, 237); gridProjects[iRow, col_BrowseButton].VisualModel = vm; // TODO: NEXT VERSION ... add a hidden row for additional project settings that displays when // the main project row is selected } } catch (System.Exception ex) { ErrorHandler.PublishError(ex, syncMgr.Logger); } }