Skip to content

Commit

Permalink
Refactoring "Screenshot", "zoom in", "zoom out" buttons to StripPanel.
Browse files Browse the repository at this point in the history
  • Loading branch information
Am6er committed Mar 7, 2024
1 parent 4f3b89b commit d8a096d
Show file tree
Hide file tree
Showing 11 changed files with 142 additions and 376 deletions.
3 changes: 2 additions & 1 deletion BecquerelMonitor/BecquerelMonitor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>index.html</WebPage>
<ApplicationRevision>1</ApplicationRevision>
<ApplicationVersion>2024.03.4.1</ApplicationVersion>
<ApplicationVersion>2024.03.7.1</ApplicationVersion>
<UseApplicationTrust>true</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
Expand Down Expand Up @@ -1074,6 +1074,7 @@
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="Resources\screenshot.bmp" />
<None Include="Resources\pow.bmp" />
<None Include="Resources\scale.bmp" />
<None Include="Resources\CONT.bmp" />
Expand Down
38 changes: 32 additions & 6 deletions BecquerelMonitor/DocEnergySpectrum.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions BecquerelMonitor/DocEnergySpectrum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ public DocEnergySpectrum()
this.view.DrawingMode = globalConfig.ChartViewConfig.DefaultDrawingMode;
this.view.PeakMode = globalConfig.ChartViewConfig.DefaultPeakMode;
this.view.HorizontalMagnification = globalConfig.ChartViewConfig.DefaultHorizontalMagnification;
this.view.ActionEvent += View_ActionEvent;
this.SetToolStripIcons();
this.toolStripNumericUpdown.NumericUpDownControl.Value = (decimal)globalConfig.ChartViewConfig.PowNum;
toolStripContainer1.BottomToolStripPanel.SuspendLayout();
Expand All @@ -311,6 +312,11 @@ public DocEnergySpectrum()
toolStripContainer1.BottomToolStripPanel.ResumeLayout();
}

private void View_ActionEvent(object sender, EnergySpectrumActionEventArgs e)
{
if (e.NeedUpdateScale) this.toolStripNumUpDownScale.NumericUpDownControl.Value = e.NewScaleValue;
}

public void RefreshDocEnergySpectrum()
{
GlobalConfigInfo globalConfig = GlobalConfigManager.GetInstance().GlobalConfig;
Expand All @@ -325,6 +331,7 @@ public void RefreshDocEnergySpectrum()
this.view.DrawingMode = globalConfig.ChartViewConfig.DefaultDrawingMode;
this.view.PeakMode = globalConfig.ChartViewConfig.DefaultPeakMode;
this.view.HorizontalMagnification = globalConfig.ChartViewConfig.DefaultHorizontalMagnification;
this.view.ActionEvent += View_ActionEvent;
this.SetToolStripIcons();
this.toolStripNumericUpdown.NumericUpDownControl.Value = (decimal)globalConfig.ChartViewConfig.PowNum;
}
Expand Down Expand Up @@ -1244,6 +1251,25 @@ void 下限閾値に設定LToolStripMenuItem_Click(object sender, EventArgs e)
}
}

void toolStripScreenShotButton_Click(object sender, EventArgs e)
{
this.view.takeScreenshot();
}

void toolStripNumUpDownScale_ValueChanged(object sender, EventArgs e)
{
this.view.zoom(this.toolStripNumUpDownScale.NumericUpDownControl.Value);
}

void toolStripNumUpDownScale_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
this.view.zoom(this.toolStripNumUpDownScale.NumericUpDownControl.Value);
e.SuppressKeyPress = true;
}
}

// Token: 0x0600036A RID: 874 RVA: 0x00010C8C File Offset: 0x0000EE8C
void 上限閾値に設定HToolStripMenuItem_Click(object sender, EventArgs e)
{
Expand Down
6 changes: 6 additions & 0 deletions BecquerelMonitor/DocEnergySpectrum.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1090,4 +1090,10 @@
<data name="powToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>180, 22</value>
</data>
<data name="toolStripScreenShotButton.ToolTipText" xml:space="preserve">
<value>Take Screenshot to file</value>
</data>
<data name="toolStripNumUpDownScale.ToolTipText" xml:space="preserve">
<value>Change X scale</value>
</data>
</root>
6 changes: 6 additions & 0 deletions BecquerelMonitor/DocEnergySpectrum.ru.resx
Original file line number Diff line number Diff line change
Expand Up @@ -780,4 +780,10 @@
<data name="toolStripNumericUpdown.ToolTipText" xml:space="preserve">
<value>Степень корня POW. Нажмите кнопку е для вовода константы Эйлера.</value>
</data>
<data name="toolStripScreenShotButton.ToolTipText" xml:space="preserve">
<value>Снять скрин спектра в файл</value>
</data>
<data name="toolStripNumUpDownScale.ToolTipText" xml:space="preserve">
<value>Изменить масштаб по оси X</value>
</data>
</root>
Loading

0 comments on commit d8a096d

Please sign in to comment.