diff --git a/src/PolyTrader.Modules.CopyTrading/Ui/AccountSettingsView.Designer.cs b/src/PolyTrader.Modules.CopyTrading/Ui/AccountSettingsView.Designer.cs index d7ac45d..8ab0981 100644 --- a/src/PolyTrader.Modules.CopyTrading/Ui/AccountSettingsView.Designer.cs +++ b/src/PolyTrader.Modules.CopyTrading/Ui/AccountSettingsView.Designer.cs @@ -17,118 +17,110 @@ namespace PolyTrader.Modules.CopyTrading.Ui private void InitializeComponent() { - pnlTop = new Panel(); - cmbAccounts = new ComboBox(); - lblAccount = new Label(); - pgSettings = new PropertyGrid(); - pnlBottom = new Panel(); - lblHint = new Label(); - btnSave = new Button(); - pnlTop.SuspendLayout(); - pnlBottom.SuspendLayout(); - SuspendLayout(); - // - // pnlTop - // - pnlTop.Controls.Add(cmbAccounts); - pnlTop.Controls.Add(lblAccount); - pnlTop.Dock = DockStyle.Top; - pnlTop.Location = new Point(0, 0); - pnlTop.Margin = new Padding(4, 5, 4, 5); - pnlTop.Name = "pnlTop"; - pnlTop.Padding = new Padding(11, 13, 11, 10); - pnlTop.Size = new Size(800, 73); - pnlTop.TabIndex = 0; - // - // cmbAccounts - // - cmbAccounts.Dock = DockStyle.Fill; - cmbAccounts.DropDownStyle = ComboBoxStyle.DropDownList; - cmbAccounts.Location = new Point(97, 13); - cmbAccounts.Margin = new Padding(4, 5, 4, 5); - cmbAccounts.Name = "cmbAccounts"; - cmbAccounts.Size = new Size(692, 33); - cmbAccounts.TabIndex = 1; - // - // lblAccount - // - lblAccount.Dock = DockStyle.Left; - lblAccount.Location = new Point(11, 13); - lblAccount.Margin = new Padding(4, 0, 4, 0); - lblAccount.Name = "lblAccount"; - lblAccount.Size = new Size(86, 50); - lblAccount.TabIndex = 0; - lblAccount.Text = "Account:"; - lblAccount.TextAlign = ContentAlignment.MiddleLeft; - // + this.toolbar = new System.Windows.Forms.ToolStrip(); + this.tsAccountLabel = new System.Windows.Forms.ToolStripLabel(); + this.tsAccounts = new System.Windows.Forms.ToolStripComboBox(); + this.tsSep = new System.Windows.Forms.ToolStripSeparator(); + this.tsSave = new System.Windows.Forms.ToolStripButton(); + this.pgSettings = new System.Windows.Forms.PropertyGrid(); + this.statusPanel = new System.Windows.Forms.Panel(); + this.lblHint = new System.Windows.Forms.Label(); + this.toolbar.SuspendLayout(); + this.statusPanel.SuspendLayout(); + this.SuspendLayout(); + // + // toolbar + // + this.toolbar.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; + this.toolbar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.tsAccountLabel, + this.tsAccounts, + this.tsSep, + this.tsSave}); + this.toolbar.Location = new System.Drawing.Point(0, 0); + this.toolbar.Name = "toolbar"; + this.toolbar.Size = new System.Drawing.Size(560, 25); + this.toolbar.TabIndex = 0; + // + // tsAccountLabel + // + this.tsAccountLabel.Name = "tsAccountLabel"; + this.tsAccountLabel.Size = new System.Drawing.Size(56, 22); + this.tsAccountLabel.Text = "Account:"; + // + // tsAccounts + // + this.tsAccounts.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.tsAccounts.Name = "tsAccounts"; + this.tsAccounts.Size = new System.Drawing.Size(320, 25); + // + // tsSep + // + this.tsSep.Name = "tsSep"; + this.tsSep.Size = new System.Drawing.Size(6, 25); + // + // tsSave + // + this.tsSave.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + this.tsSave.Name = "tsSave"; + this.tsSave.Size = new System.Drawing.Size(69, 22); + this.tsSave.Text = "Speichern"; + // // pgSettings - // - pgSettings.Dock = DockStyle.Fill; - pgSettings.Location = new Point(0, 73); - pgSettings.Margin = new Padding(4, 5, 4, 5); - pgSettings.Name = "pgSettings"; - pgSettings.PropertySort = PropertySort.Categorized; - pgSettings.Size = new Size(800, 847); - pgSettings.TabIndex = 1; - pgSettings.ToolbarVisible = false; - // - // pnlBottom - // - pnlBottom.Controls.Add(lblHint); - pnlBottom.Controls.Add(btnSave); - pnlBottom.Dock = DockStyle.Bottom; - pnlBottom.Location = new Point(0, 920); - pnlBottom.Margin = new Padding(4, 5, 4, 5); - pnlBottom.Name = "pnlBottom"; - pnlBottom.Padding = new Padding(11, 13, 11, 13); - pnlBottom.Size = new Size(800, 80); - pnlBottom.TabIndex = 2; - // + // + this.pgSettings.Dock = System.Windows.Forms.DockStyle.Fill; + this.pgSettings.Location = new System.Drawing.Point(0, 25); + this.pgSettings.Name = "pgSettings"; + this.pgSettings.PropertySort = System.Windows.Forms.PropertySort.Categorized; + this.pgSettings.Size = new System.Drawing.Size(560, 549); + this.pgSettings.TabIndex = 1; + this.pgSettings.ToolbarVisible = false; + // + // statusPanel + // + this.statusPanel.Controls.Add(this.lblHint); + this.statusPanel.Dock = System.Windows.Forms.DockStyle.Bottom; + this.statusPanel.Location = new System.Drawing.Point(0, 574); + this.statusPanel.Name = "statusPanel"; + this.statusPanel.Size = new System.Drawing.Size(560, 26); + this.statusPanel.TabIndex = 2; + // // lblHint - // - lblHint.Dock = DockStyle.Fill; - lblHint.ForeColor = Color.DimGray; - lblHint.Location = new Point(11, 13); - lblHint.Margin = new Padding(4, 0, 4, 0); - lblHint.Name = "lblHint"; - lblHint.Size = new Size(607, 54); - lblHint.TabIndex = 1; - lblHint.TextAlign = ContentAlignment.MiddleLeft; - // - // btnSave - // - btnSave.Dock = DockStyle.Right; - btnSave.Location = new Point(618, 13); - btnSave.Margin = new Padding(4, 5, 4, 5); - btnSave.Name = "btnSave"; - btnSave.Size = new Size(171, 54); - btnSave.TabIndex = 0; - btnSave.Text = "Speichern"; - btnSave.UseVisualStyleBackColor = true; - // + // + this.lblHint.Dock = System.Windows.Forms.DockStyle.Fill; + this.lblHint.ForeColor = System.Drawing.Color.DimGray; + this.lblHint.Location = new System.Drawing.Point(0, 0); + this.lblHint.Name = "lblHint"; + this.lblHint.Padding = new System.Windows.Forms.Padding(8, 0, 0, 0); + this.lblHint.Size = new System.Drawing.Size(560, 26); + this.lblHint.TabIndex = 0; + this.lblHint.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // // AccountSettingsView - // - AutoScaleDimensions = new SizeF(10F, 25F); - AutoScaleMode = AutoScaleMode.Font; - Controls.Add(pgSettings); - Controls.Add(pnlBottom); - Controls.Add(pnlTop); - Margin = new Padding(4, 5, 4, 5); - Name = "AccountSettingsView"; - Size = new Size(800, 1000); - pnlTop.ResumeLayout(false); - pnlBottom.ResumeLayout(false); - ResumeLayout(false); + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.pgSettings); + this.Controls.Add(this.statusPanel); + this.Controls.Add(this.toolbar); + this.Name = "AccountSettingsView"; + this.Size = new System.Drawing.Size(560, 600); + this.toolbar.ResumeLayout(false); + this.toolbar.PerformLayout(); + this.statusPanel.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); } #endregion - private System.Windows.Forms.Panel pnlTop; - private System.Windows.Forms.ComboBox cmbAccounts; - private System.Windows.Forms.Label lblAccount; + private System.Windows.Forms.ToolStrip toolbar; + private System.Windows.Forms.ToolStripLabel tsAccountLabel; + private System.Windows.Forms.ToolStripComboBox tsAccounts; + private System.Windows.Forms.ToolStripSeparator tsSep; + private System.Windows.Forms.ToolStripButton tsSave; private System.Windows.Forms.PropertyGrid pgSettings; - private System.Windows.Forms.Panel pnlBottom; + private System.Windows.Forms.Panel statusPanel; private System.Windows.Forms.Label lblHint; - private System.Windows.Forms.Button btnSave; } } diff --git a/src/PolyTrader.Modules.CopyTrading/Ui/AccountSettingsView.cs b/src/PolyTrader.Modules.CopyTrading/Ui/AccountSettingsView.cs index 13e8dae..c99b5ac 100644 --- a/src/PolyTrader.Modules.CopyTrading/Ui/AccountSettingsView.cs +++ b/src/PolyTrader.Modules.CopyTrading/Ui/AccountSettingsView.cs @@ -26,8 +26,8 @@ namespace PolyTrader.Modules.CopyTrading.Ui { InitializeComponent(); - cmbAccounts.SelectedIndexChanged += (_, _) => LoadSelected(); - btnSave.Click += (_, _) => Save(); + tsAccounts.SelectedIndexChanged += (_, _) => LoadSelected(); + tsSave.Click += (_, _) => Save(); } /// Injiziert die Abhängigkeiten (nach der DI-Auflösung) und füllt die Auswahl. @@ -48,9 +48,9 @@ namespace PolyTrader.Modules.CopyTrading.Ui .Select(a => new AccountItem(a.AccountId, string.IsNullOrEmpty(a.Name) ? $"#{a.AccountId}" : $"{a.Name} (#{a.AccountId}){(a.IsDemo ? " · Demo" : "")}")) .ToList(); - cmbAccounts.DisplayMember = nameof(AccountItem.Label); - cmbAccounts.ValueMember = nameof(AccountItem.Id); - cmbAccounts.DataSource = items; + tsAccounts.ComboBox.DisplayMember = nameof(AccountItem.Label); + tsAccounts.ComboBox.ValueMember = nameof(AccountItem.Id); + tsAccounts.ComboBox.DataSource = items; if (items.Count > 0) LoadSelected(); else lblHint.Text = "Keine Accounts vorhanden."; @@ -58,7 +58,7 @@ namespace PolyTrader.Modules.CopyTrading.Ui private void LoadSelected() { - if (_repo == null || cmbAccounts.SelectedItem is not AccountItem item) return; + if (_repo == null || tsAccounts.SelectedItem is not AccountItem item) return; _current = _repo.Get(item.Id) ?? new CopyTradingAccountSettings { AccountId = item.Id }; pgSettings.SelectedObject = _current; lblHint.Text = $"Einstellungen für Account #{item.Id}."; diff --git a/src/PolyTrader.Modules.CopyTrading/Ui/ClosedTradesView.Designer.cs b/src/PolyTrader.Modules.CopyTrading/Ui/ClosedTradesView.Designer.cs index 6f1d5d7..85ce0aa 100644 --- a/src/PolyTrader.Modules.CopyTrading/Ui/ClosedTradesView.Designer.cs +++ b/src/PolyTrader.Modules.CopyTrading/Ui/ClosedTradesView.Designer.cs @@ -17,9 +17,8 @@ namespace PolyTrader.Modules.CopyTrading.Ui private void InitializeComponent() { - this.pnlTop = new System.Windows.Forms.Panel(); - this.lblSummary = new System.Windows.Forms.Label(); - this.btnRefresh = new System.Windows.Forms.Button(); + this.toolbar = new System.Windows.Forms.ToolStrip(); + this.tsRefresh = new System.Windows.Forms.ToolStripButton(); this.dgvTrades = new System.Windows.Forms.DataGridView(); this.colTradeId = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colAccount = new System.Windows.Forms.DataGridViewTextBoxColumn(); @@ -34,37 +33,29 @@ namespace PolyTrader.Modules.CopyTrading.Ui this.colPnlPct = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colOpenedAt = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colClosedAt = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.pnlTop.SuspendLayout(); + this.statusPanel = new System.Windows.Forms.Panel(); + this.lblSummary = new System.Windows.Forms.Label(); + this.toolbar.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dgvTrades)).BeginInit(); + this.statusPanel.SuspendLayout(); this.SuspendLayout(); // - // pnlTop + // toolbar // - this.pnlTop.Controls.Add(this.lblSummary); - this.pnlTop.Controls.Add(this.btnRefresh); - this.pnlTop.Dock = System.Windows.Forms.DockStyle.Top; - this.pnlTop.Location = new System.Drawing.Point(0, 0); - this.pnlTop.Name = "pnlTop"; - this.pnlTop.Size = new System.Drawing.Size(1100, 40); - this.pnlTop.TabIndex = 0; + this.toolbar.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; + this.toolbar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.tsRefresh}); + this.toolbar.Location = new System.Drawing.Point(0, 0); + this.toolbar.Name = "toolbar"; + this.toolbar.Size = new System.Drawing.Size(1100, 25); + this.toolbar.TabIndex = 0; // - // lblSummary + // tsRefresh // - this.lblSummary.AutoSize = true; - this.lblSummary.Location = new System.Drawing.Point(148, 12); - this.lblSummary.Name = "lblSummary"; - this.lblSummary.Size = new System.Drawing.Size(16, 15); - this.lblSummary.TabIndex = 1; - this.lblSummary.Text = "—"; - // - // btnRefresh - // - this.btnRefresh.Location = new System.Drawing.Point(8, 6); - this.btnRefresh.Name = "btnRefresh"; - this.btnRefresh.Size = new System.Drawing.Size(130, 28); - this.btnRefresh.TabIndex = 0; - this.btnRefresh.Text = "Aktualisieren"; - this.btnRefresh.UseVisualStyleBackColor = true; + this.tsRefresh.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + this.tsRefresh.Name = "tsRefresh"; + this.tsRefresh.Size = new System.Drawing.Size(90, 22); + this.tsRefresh.Text = "Aktualisieren"; // // dgvTrades // @@ -87,12 +78,12 @@ namespace PolyTrader.Modules.CopyTrading.Ui this.colOpenedAt, this.colClosedAt}); this.dgvTrades.Dock = System.Windows.Forms.DockStyle.Fill; - this.dgvTrades.Location = new System.Drawing.Point(0, 40); + this.dgvTrades.Location = new System.Drawing.Point(0, 25); this.dgvTrades.Name = "dgvTrades"; this.dgvTrades.ReadOnly = true; this.dgvTrades.RowHeadersVisible = false; this.dgvTrades.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.dgvTrades.Size = new System.Drawing.Size(1100, 560); + this.dgvTrades.Size = new System.Drawing.Size(1100, 549); this.dgvTrades.TabIndex = 1; // // colTradeId @@ -199,25 +190,47 @@ namespace PolyTrader.Modules.CopyTrading.Ui this.colClosedAt.ReadOnly = true; this.colClosedAt.Width = 130; // + // statusPanel + // + this.statusPanel.Controls.Add(this.lblSummary); + this.statusPanel.Dock = System.Windows.Forms.DockStyle.Bottom; + this.statusPanel.Location = new System.Drawing.Point(0, 574); + this.statusPanel.Name = "statusPanel"; + this.statusPanel.Size = new System.Drawing.Size(1100, 26); + this.statusPanel.TabIndex = 2; + // + // lblSummary + // + this.lblSummary.Dock = System.Windows.Forms.DockStyle.Fill; + this.lblSummary.Location = new System.Drawing.Point(0, 0); + this.lblSummary.Name = "lblSummary"; + this.lblSummary.Padding = new System.Windows.Forms.Padding(8, 0, 0, 0); + this.lblSummary.Size = new System.Drawing.Size(1100, 26); + this.lblSummary.TabIndex = 0; + this.lblSummary.Text = "—"; + this.lblSummary.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // // ClosedTradesView // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.dgvTrades); - this.Controls.Add(this.pnlTop); + this.Controls.Add(this.statusPanel); + this.Controls.Add(this.toolbar); this.Name = "ClosedTradesView"; this.Size = new System.Drawing.Size(1100, 600); - this.pnlTop.ResumeLayout(false); - this.pnlTop.PerformLayout(); + this.toolbar.ResumeLayout(false); + this.toolbar.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.dgvTrades)).EndInit(); + this.statusPanel.ResumeLayout(false); this.ResumeLayout(false); + this.PerformLayout(); } #endregion - private System.Windows.Forms.Panel pnlTop; - private System.Windows.Forms.Button btnRefresh; - private System.Windows.Forms.Label lblSummary; + private System.Windows.Forms.ToolStrip toolbar; + private System.Windows.Forms.ToolStripButton tsRefresh; private System.Windows.Forms.DataGridView dgvTrades; private System.Windows.Forms.DataGridViewTextBoxColumn colTradeId; private System.Windows.Forms.DataGridViewTextBoxColumn colAccount; @@ -232,5 +245,7 @@ namespace PolyTrader.Modules.CopyTrading.Ui private System.Windows.Forms.DataGridViewTextBoxColumn colPnlPct; private System.Windows.Forms.DataGridViewTextBoxColumn colOpenedAt; private System.Windows.Forms.DataGridViewTextBoxColumn colClosedAt; + private System.Windows.Forms.Panel statusPanel; + private System.Windows.Forms.Label lblSummary; } } diff --git a/src/PolyTrader.Modules.CopyTrading/Ui/ClosedTradesView.cs b/src/PolyTrader.Modules.CopyTrading/Ui/ClosedTradesView.cs index 61cdc00..8b98021 100644 --- a/src/PolyTrader.Modules.CopyTrading/Ui/ClosedTradesView.cs +++ b/src/PolyTrader.Modules.CopyTrading/Ui/ClosedTradesView.cs @@ -32,7 +32,7 @@ namespace PolyTrader.Modules.CopyTrading.Ui colOpenedAt.DefaultCellStyle.Format = "dd.MM.yyyy HH:mm"; colClosedAt.DefaultCellStyle.Format = "dd.MM.yyyy HH:mm"; - btnRefresh.Click += (_, _) => LoadData(); + tsRefresh.Click += (_, _) => LoadData(); } /// Injiziert die Abhängigkeiten (nach der DI-Auflösung) und lädt die Daten. diff --git a/src/PolyTrader.Modules.CopyTrading/Ui/CopyTradingMainForm.resx b/src/PolyTrader.Modules.CopyTrading/Ui/CopyTradingMainForm.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/src/PolyTrader.Modules.CopyTrading/Ui/CopyTradingMainForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file