From 32fcae1bd45651ec5ae093ecbb5cfd718d67ee16 Mon Sep 17 00:00:00 2001 From: fyf Date: Sat, 24 Sep 2022 14:19:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BPASmartClient.SCADAControl.csproj | 16 ++ .../CustomerControls/TheTextBlock.cs | 14 +- .../CustomerControls/TheTextBox.cs | 17 +- .../Images/Scroll_←.png | Bin 0 -> 164 bytes .../Images/Scroll_↑.png | Bin 0 -> 161 bytes .../Images/Scroll_→.png | Bin 0 -> 167 bytes .../Images/Scroll_↓.png | Bin 0 -> 153 bytes .../Themes/Generic.xaml | 249 ++++++++++++++++++ BeDesignerSCADA/Controls/MainCanvasPanel.xaml | 2 +- BeDesignerSCADA/MainWindow.xaml | 10 - 10 files changed, 292 insertions(+), 16 deletions(-) create mode 100644 BPASmartClient.SCADAControl/Images/Scroll_←.png create mode 100644 BPASmartClient.SCADAControl/Images/Scroll_↑.png create mode 100644 BPASmartClient.SCADAControl/Images/Scroll_→.png create mode 100644 BPASmartClient.SCADAControl/Images/Scroll_↓.png diff --git a/BPASmartClient.SCADAControl/BPASmartClient.SCADAControl.csproj b/BPASmartClient.SCADAControl/BPASmartClient.SCADAControl.csproj index cb2e73f8..d9582a0a 100644 --- a/BPASmartClient.SCADAControl/BPASmartClient.SCADAControl.csproj +++ b/BPASmartClient.SCADAControl/BPASmartClient.SCADAControl.csproj @@ -26,6 +26,10 @@ + + + + @@ -110,6 +114,18 @@ Always + + Always + + + Always + + + Always + + + Always + Always diff --git a/BPASmartClient.SCADAControl/CustomerControls/TheTextBlock.cs b/BPASmartClient.SCADAControl/CustomerControls/TheTextBlock.cs index 6466347b..6fb14d28 100644 --- a/BPASmartClient.SCADAControl/CustomerControls/TheTextBlock.cs +++ b/BPASmartClient.SCADAControl/CustomerControls/TheTextBlock.cs @@ -33,8 +33,18 @@ namespace BPASmartClient.SCADAControl.CustomerControls ResourceDictionary languageResDic = new ResourceDictionary(); languageResDic.Source = new Uri(@"/BPASmartClient.SCADAControl;component/Themes/Generic.xaml", UriKind.RelativeOrAbsolute); this.Resources.MergedDictionaries.Add(languageResDic); - Height = 30; - Width = 80; + this.Loaded += TheTextBlock_Loaded; + } + + private void TheTextBlock_Loaded(object sender, RoutedEventArgs e) + { + if (this.ActualWidth <= 0) + { + Text = "文本"; + Height = 30; + Width = 80; + FontSize = 16; + } } public string ControlType => "控件"; diff --git a/BPASmartClient.SCADAControl/CustomerControls/TheTextBox.cs b/BPASmartClient.SCADAControl/CustomerControls/TheTextBox.cs index b32269a4..52b64ed5 100644 --- a/BPASmartClient.SCADAControl/CustomerControls/TheTextBox.cs +++ b/BPASmartClient.SCADAControl/CustomerControls/TheTextBox.cs @@ -37,12 +37,23 @@ namespace BPASmartClient.SCADAControl.CustomerControls ResourceDictionary languageResDic = new ResourceDictionary(); languageResDic.Source = new Uri(@"/BPASmartClient.SCADAControl;component/Themes/Generic.xaml",UriKind.RelativeOrAbsolute); this.Resources.MergedDictionaries.Add(languageResDic); - Height = 30; - Width = 80; - FontSize = 16; + this.KeyDown += TheTextBox_KeyDown; this.TextChanged += TheTextBox_TextChanged; + this.Loaded += TheTextBox_Loaded; } + + private void TheTextBox_Loaded(object sender, RoutedEventArgs e) + { + if (this.ActualWidth <= 10) + { + Text = "文本框"; + Height = 30; + Width = 80; + FontSize = 16; + } + } + bool isRun=false; private void TheTextBox_KeyDown(object sender,KeyEventArgs e) { diff --git a/BPASmartClient.SCADAControl/Images/Scroll_←.png b/BPASmartClient.SCADAControl/Images/Scroll_←.png new file mode 100644 index 0000000000000000000000000000000000000000..1c6e2793106e7d9b4d21d02d3ad11d53fa2f1782 GIT binary patch literal 164 zcmeAS@N?(olHy`uVBq!ia0vp^Y(UJ-0U~39{!9Z>*`6+rArezd&+GCXN)TYVaDDy~ zw$SU&A<3T2PG1CUBlsJbFR}#3bGIK@_`$W-bF-%Qb6>TaI`!)giAtOn2-~sf{vk&5 zk_iirwIpXv&G_K3`|cUTV+IEsuFLHyJS4d7dtgArezl&nfa93J_qqa6R8Z zLq`3eP?M8_1;ZlqW@ZI}C5tk%Ha-=w5Mgt)E8E;tJM(VlsSy8+kD@^ZM_4!WY&g#Q znP-Dzzbjir;*m|7!E66re#&NZA#F!;Z+Z)3^qxnbwaY4w?@X8Z&}m-pcTZ%wjiW8d ONerH@elF{r5}E*D^*S>E literal 0 HcmV?d00001 diff --git a/BPASmartClient.SCADAControl/Images/Scroll_↓.png b/BPASmartClient.SCADAControl/Images/Scroll_↓.png new file mode 100644 index 0000000000000000000000000000000000000000..6e975baf9b61bf64cf9bedf1d11e1e20bdb4a43b GIT binary patch literal 153 zcmeAS@N?(olHy`uVBq!ia0vp^+(696!3HEnjZ%I9sRU0K#}J9Bt)~?Engc{!E*`!u z!?}#FGa)^dbA^_T*tf<*3Lb{*Px=cVnsM^X-cX(U=2qt=nQV`-7rMw>Tuj;}xco`_ zlfnnBKmF%?wpZZVu=wDt>a% + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BeDesignerSCADA/Controls/MainCanvasPanel.xaml b/BeDesignerSCADA/Controls/MainCanvasPanel.xaml index 952ee3d4..78bc1612 100644 --- a/BeDesignerSCADA/Controls/MainCanvasPanel.xaml +++ b/BeDesignerSCADA/Controls/MainCanvasPanel.xaml @@ -30,7 +30,7 @@ - + diff --git a/BeDesignerSCADA/MainWindow.xaml b/BeDesignerSCADA/MainWindow.xaml index 7301a858..2db56d8c 100644 --- a/BeDesignerSCADA/MainWindow.xaml +++ b/BeDesignerSCADA/MainWindow.xaml @@ -12,16 +12,6 @@ mc:Ignorable="d" WindowStartupLocation="CenterScreen" Title="黑菠萝科技-[组态软件1.0]" Height="900" Width="1400" Icon="/Images/ico.ico" > - - - - - - - - - -