Skip to content

Commit

Permalink
feat: add MetroRadiance custom control samples in the control sample …
Browse files Browse the repository at this point in the history
…page
  • Loading branch information
nishy2000 committed Dec 18, 2021
1 parent ee62496 commit 95a7c35
Show file tree
Hide file tree
Showing 6 changed files with 135 additions and 33 deletions.
31 changes: 17 additions & 14 deletions samples/MetroRadiance.Showcase/MetroRadiance.Showcase.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<PropertyGroup>
<TargetFrameworks>net452;net462;netcoreapp3.1</TargetFrameworks>
<UseWPF>true</UseWPF>
<AssemblyVersion>3.2.0.8150</AssemblyVersion>
<FileVersion>3.2.0.8150</FileVersion>
<AssemblyVersion>3.2.1.12180</AssemblyVersion>
<FileVersion>3.2.1.12180</FileVersion>

<Version>3.2.0</Version>
<Version>3.2.1-alpha00</Version>
<Company>nishy software</Company>
<Authors>nishy software</Authors>
<PackageTags>WPF Theme Dark Light Managed C# Metro Radiance MetroRadiance</PackageTags>
Expand All @@ -18,18 +18,21 @@
<Copyright>©2020, 2021 nishy software / ©2014-2017 Manato KAMEYA</Copyright>
<PackageId>MetroRadiance.Fork.Showcase</PackageId>
<PackageReleaseNotes>
Changes from 3.1.1
- Add ListBox / ListView samples in the control sample page
- Update MetroRadiance.Fork 3.1.1 to 3.2.0
Changes from 3.1.0
- Update MetroRadiance.Fork 3.1.0 to 3.1.1
Changes from 3.0.0
- Add DataGrid samples in the control sample page
Changes from 3.2.0
- Add MetroRadiance custom control samples in the control sample page
- Update MetroRadiance.Fork 3.2.0 to 3.2.1
Changes from 3.1.1
- Add ListBox / ListView samples in the control sample page
- Update MetroRadiance.Fork 3.1.1 to 3.2.0
Changes from 3.1.0
- Update MetroRadiance.Fork 3.1.0 to 3.1.1
Changes from 3.0.0
- Add DataGrid samples in the control sample page

Limitations from 3.0.0
No changes
- When moving windows using metro:AcrylicBlurWindow, the move process is very slow on Windows 10 1903 (Build 18362, May 2019 Update) or later
</PackageReleaseNotes>
Limitations from 3.0.0
No changes
- When moving windows using metro:AcrylicBlurWindow, the move process is very slow on Windows 10 1903 (Build 18362, May 2019 Update) or later
</PackageReleaseNotes>
<OutputType>WinExe</OutputType>
<ApplicationManifest>app.manifest</ApplicationManifest>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
Expand Down
36 changes: 36 additions & 0 deletions samples/MetroRadiance.Showcase/Properties/Resources.Designer.cs

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

12 changes: 12 additions & 0 deletions samples/MetroRadiance.Showcase/Properties/Resources.ja.resx
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@
<data name="ControlSample_IsEnabledUIControls" xml:space="preserve">
<value>UI コントロールを有効化する (IsEnabled = True)</value>
</data>
<data name="ControlSample_TextCaptionIcon" xml:space="preserve">
<value>キャプション アイコン</value>
</data>
<data name="ControlSample_TextCheckBox" xml:space="preserve">
<value>チェックボックス</value>
</data>
Expand All @@ -168,6 +171,15 @@
<data name="ControlSample_TextComboBoxItem3" xml:space="preserve">
<value>コンボボックス 項目 3</value>
</data>
<data name="ControlSample_TextExpanderButtonLeft" xml:space="preserve">
<value>エキスパンダー ボタン (左側にコンテンツ)</value>
</data>
<data name="ControlSample_TextExpanderButtonRight" xml:space="preserve">
<value>エキスパンダー ボタン (右側にコンテンツ)</value>
</data>
<data name="ControlSample_TextLinkButton" xml:space="preserve">
<value>リンク ボタン</value>
</data>
<data name="ControlSample_TextRadioButtonItem1" xml:space="preserve">
<value>ラジオ ボタン 項目 1</value>
</data>
Expand Down
12 changes: 12 additions & 0 deletions samples/MetroRadiance.Showcase/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@
<data name="ControlSample_IsEnabledUIControls" xml:space="preserve">
<value>Enable UI controls (IsEnabled = True)</value>
</data>
<data name="ControlSample_TextCaptionIcon" xml:space="preserve">
<value>Caption icon</value>
</data>
<data name="ControlSample_TextCheckBox" xml:space="preserve">
<value>Check box</value>
</data>
Expand All @@ -168,6 +171,15 @@
<data name="ControlSample_TextComboBoxItem3" xml:space="preserve">
<value>ComboBox item 3</value>
</data>
<data name="ControlSample_TextExpanderButtonLeft" xml:space="preserve">
<value>Expander button (Content on the left)</value>
</data>
<data name="ControlSample_TextExpanderButtonRight" xml:space="preserve">
<value>Expander button (Content on the right)</value>
</data>
<data name="ControlSample_TextLinkButton" xml:space="preserve">
<value>Link button</value>
</data>
<data name="ControlSample_TextRadioButtonItem1" xml:space="preserve">
<value>Radio button item 1</value>
</data>
Expand Down
53 changes: 42 additions & 11 deletions samples/MetroRadiance.Showcase/UI/ControlSamples.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
xmlns:ui="clr-namespace:MetroRadiance.Showcase.UI"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
mc:Ignorable="d"
d:DesignWidth="500"
d:DesignHeight="1200">
d:DesignWidth="720"
d:DesignHeight="1400">
<UserControl.Resources>
<x:Array x:Key="DataItems" Type="{x:Type ui:SampleDataItem}">
<ui:SampleDataItem Id="1" Name="Name a" Description="AAAA" Active="True" Selected="Name c" />
Expand Down Expand Up @@ -189,8 +189,12 @@
<TextBlock Grid.Row="0" Grid.Column="0" Margin="0,2" Text="TextBox: "/>
<TextBox Grid.Row="0" Grid.Column="1" Margin="0,2" Text="TextBox" />

<TextBlock Grid.Row="1" Grid.Column="0" Margin="0,2" Text="TextBox with UInt16Rule: "/>
<TextBox Grid.Row="1" Grid.Column="1" Margin="0,2">
<TextBlock Grid.Row="1" Grid.Column="0" Margin="0,2" Text="PasswordBox: "/>
<PasswordBox Grid.Row="1" Grid.Column="1"
Margin="0,2"/>

<TextBlock Grid.Row="3" Grid.Column="0" Margin="0,2" Text="TextBox with UInt16Rule: "/>
<TextBox Grid.Row="3" Grid.Column="1" Margin="0,2">
<TextBox.Text>
<Binding Path="UInt16"
UpdateSourceTrigger="PropertyChanged">
Expand Down Expand Up @@ -245,17 +249,17 @@
</metro:PromptTextBox.Text>
</metro:PromptTextBox>

<TextBlock Grid.Row="8" Grid.Column="0" Margin="0,2" Text="metro:PromptComboBox: "/>
<metro:PromptComboBox Grid.Row="8" Grid.Column="1"
<TextBlock Grid.Row="7" Grid.Column="0" Margin="0,2" Text="metro:PromptComboBox: "/>
<metro:PromptComboBox Grid.Row="7" Grid.Column="1"
Margin="0,2"
IsEditable="True">
<ComboBoxItem>2.2</ComboBoxItem>
<ComboBoxItem>1</ComboBoxItem>
<ComboBoxItem>-10</ComboBoxItem>
<ComboBoxItem>-1</ComboBoxItem>
</metro:PromptComboBox>
<TextBlock Grid.Row="9" Grid.Column="0" Margin="0,2" Text="metro:PromptComboBox with Int32Rule: "/>
<metro:PromptComboBox Grid.Row="9" Grid.Column="1"
<TextBlock Grid.Row="8" Grid.Column="0" Margin="0,2" Text="metro:PromptComboBox with Int32Rule: "/>
<metro:PromptComboBox Grid.Row="8" Grid.Column="1"
Margin="0,2"
IsEditable="True">
<metro:PromptComboBox.Text>
Expand All @@ -272,10 +276,37 @@
<ComboBoxItem>-10</ComboBoxItem>
<ComboBoxItem>-1</ComboBoxItem>
</metro:PromptComboBox>

<TextBlock Grid.Row="9" Grid.Column="0" Margin="0,2" Text="metro:ExpanderButton: "/>
<StackPanel Grid.Row="9" Grid.Column="1"
Orientation="Horizontal"
Margin="0,2"
HorizontalAlignment="Left">
<metro:ExpanderButton Direction="Left" Margin="0"
Content="{x:Static prop:Resources.ControlSample_TextExpanderButtonLeft}"/>
<metro:ExpanderButton Direction="Right" Margin="12,0,0,0"
Content="{x:Static prop:Resources.ControlSample_TextExpanderButtonRight}"/>
</StackPanel>

<TextBlock Grid.Row="12" Grid.Column="0" Margin="0,2" Text="PasswordBox: "/>
<PasswordBox Grid.Row="12" Grid.Column="1"
Margin="0,2"/>
<TextBlock Grid.Row="10" Grid.Column="0" Margin="0,2" Text="metro:LinkButton: "/>
<metro:LinkButton Grid.Row="10" Grid.Column="1"
Margin="0,2"
Text="{x:Static prop:Resources.ControlSample_TextLinkButton}"/>

<TextBlock Grid.Row="11" Grid.Column="0" Margin="0,2" Text="metro:ProgressRing: "/>
<metro:ProgressRing Grid.Row="11" Grid.Column="1"
Margin="0,2"
HorizontalAlignment="Left"/>

<TextBlock Grid.Row="12" Grid.Column="0" Margin="0,2" Text="metro custom controls for Window: "/>
<StackPanel Grid.Row="12" Grid.Column="1"
Orientation="Horizontal"
Margin="-6,2,0,2"
HorizontalAlignment="Left">
<metro:CaptionIcon Margin="6,0" Content="{x:Static prop:Resources.ControlSample_TextCaptionIcon}"/>
<metro:SystemButtons Margin="6,0"/>
<metro:ResizeGrip Margin="6,0"/>
</StackPanel>

<TextBlock Grid.Row="14" Grid.Column="0" Margin="0,2" Text="CheckBox: "/>
<CheckBox Grid.Row="14" Grid.Column="1" Content="{x:Static prop:Resources.ControlSample_TextCheckBox}"
Expand Down
24 changes: 16 additions & 8 deletions source/MetroRadiance/UI/Controls/ResizeGrip.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,24 @@ private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref b
{
if (msg == (int)WindowsMessages.WM_NCHITTEST && this._canResize)
{
var ptScreen = lParam.ToPoint();
var ptClient = this.PointFromScreen(ptScreen);
try
{
var ptScreen = lParam.ToPoint();
var ptClient = this.PointFromScreen(ptScreen);

var rectTarget = new Rect(0, 0, this.ActualWidth, this.ActualHeight);
var rectTarget = new Rect(0, 0, this.ActualWidth, this.ActualHeight);

if (rectTarget.Contains(ptClient))
{
handled = true;
return (IntPtr)HitTestValues.HTBOTTOMRIGHT;
}
if (rectTarget.Contains(ptClient))
{
handled = true;
return (IntPtr)HitTestValues.HTBOTTOMRIGHT;
}
}
catch
{
handled = false;
return (IntPtr)HitTestValues.HTCLIENT;
}
}

return IntPtr.Zero;
Expand Down

0 comments on commit 95a7c35

Please sign in to comment.