Attachment 'sfDoubleTextBox.v1.1.txt'

Download

   1 :Namespace sfDoubleTextBox
   2 
   3 ⍝ === VARIABLES ===
   4 
   5 L←⎕av[3+⎕io]
   6 _←⍬
   7 _,←'<ToolTip x:Name="tooltip" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" HasDropShadow="True" Placement="Top">'
   8 _,←L,'   <Grid SnapsToDevicePixels="True" UseLayoutRounding="True">'
   9 _,←L,'      <Grid.Resources>'
  10 _,←L,'         <SolidColorBrush x:Key="Brush1" Color="#FF010101">'
  11 _,←L,'         </SolidColorBrush>'
  12 _,←L,'         <DrawingBrush x:Key="Warning_Icon" Stretch="Uniform">'
  13 _,←L,'            <DrawingBrush.Drawing>'
  14 _,←L,'               <DrawingGroup>'
  15 _,←L,'                  <DrawingGroup Transform="1,0,0,1,-55.89,-15.18">'
  16 _,←L,'                     <DrawingGroup Transform="1,0,0,1,54.94,205.56">'
  17 _,←L,'                        <DrawingGroup Transform="1,0,0,1,-495.64,-311.92">'
  18 _,←L,'                           <GeometryDrawing Brush="#FFFDEE1C" Geometry="F1M554.72,121.84C552.84,122.13,551.19,123.24,550.24,124.89L497.61,216.07C496.51,217.99 496.49,220.38 497.61,222.30 498.73,224.24 500.81,225.45 503.06,225.44L608.33,225.44C610.58,225.45 612.66,224.24 613.78,222.30 614.89,220.37 614.88,217.99 613.78,216.07L561.14,124.89C559.85,122.63,557.28,121.44,554.72,121.84z">'
  19 _,←L,'                           </GeometryDrawing>'
  20 _,←L,'                           <GeometryDrawing Brush="{StaticResource Brush1}" Geometry="F1M555.21,124.41C554.19,124.57,553.32,125.18,552.83,126.04L499.83,217.85C499.25,218.86 499.25,220.16 499.83,221.16 500.42,222.18 501.52,222.85 502.71,222.85L608.71,222.85C609.90,222.85 610.99,222.18 611.58,221.16 612.16,220.15 612.16,218.86 611.58,217.85L558.58,126.04C557.90,124.85,556.59,124.20,555.21,124.41z M555.71,134.97L600.71,214.22 510.65,214.22 555.71,134.97z">'
  21 _,←L,'                           </GeometryDrawing>'
  22 _,←L,'                        </DrawingGroup>'
  23 _,←L,'                     </DrawingGroup>'
  24 _,←L,'                     <DrawingGroup Transform="0.41,0,0,0.41,310.55,217.85">'
  25 _,←L,'                        <GeometryDrawing Brush="{StaticResource Brush1}" Geometry="F1M-463.54,-288.90C-463.54,-282.61 -468.64,-277.51 -474.94,-277.51 -481.23,-277.51 -486.33,-282.61 -486.33,-288.90 -486.33,-295.20 -481.23,-300.30 -474.94,-300.30 -468.64,-300.30 -463.54,-295.20 -463.54,-288.90z">'
  26 _,←L,'                           <GeometryDrawing.Pen>'
  27 _,←L,'                              <Pen Brush="{StaticResource Brush1}" DashCap="Round" EndLineCap="Round" MiterLimit="4" StartLineCap="Round" Thickness="4">'
  28 _,←L,'                              </Pen>'
  29 _,←L,'                           </GeometryDrawing.Pen>'
  30 _,←L,'                        </GeometryDrawing>'
  31 _,←L,'                        <GeometryDrawing Brush="{StaticResource Brush1}" Geometry="F1M-479.30,-394.85L-470.30,-394.85C-465.74,-394.85,-462.07,-389.29,-462.07,-382.39L-465.91,-325.28C-465.91,-318.38,-469.58,-312.82,-474.15,-312.82L-475.45,-312.82C-480.01,-312.82,-483.69,-318.38,-483.69,-325.28L-487.53,-382.39C-487.53,-389.29,-483.86,-394.85,-479.30,-394.85z">'
  32 _,←L,'                           <GeometryDrawing.Pen>'
  33 _,←L,'                              <Pen Brush="{StaticResource Brush1}" DashCap="Round" EndLineCap="Round" MiterLimit="4" StartLineCap="Round" Thickness="3.79">'
  34 _,←L,'                              </Pen>'
  35 _,←L,'                           </GeometryDrawing.Pen>'
  36 _,←L,'                        </GeometryDrawing>'
  37 _,←L,'                     </DrawingGroup>'
  38 _,←L,'                  </DrawingGroup>'
  39 _,←L,'               </DrawingGroup>'
  40 _,←L,'            </DrawingBrush.Drawing>'
  41 _,←L,'         </DrawingBrush>'
  42 _,←L,'         <DrawingBrush x:Key="IPPC_Logo" Stretch="Uniform">'
  43 _,←L,'            <DrawingBrush.Drawing>'
  44 _,←L,'               <DrawingGroup>'
  45 _,←L,'                  <DrawingGroup.Children>'
  46 _,←L,'                     <GeometryDrawing Brush="#FF000000" Geometry="F1 M 21.89,1.5L 21.89,149.5">'
  47 _,←L,'                        <GeometryDrawing.Pen>'
  48 _,←L,'                           <Pen Brush="#FF000000" LineJoin="Round" Thickness="3">'
  49 _,←L,'                           </Pen>'
  50 _,←L,'                        </GeometryDrawing.Pen>'
  51 _,←L,'                     </GeometryDrawing>'
  52 _,←L,'                     <GeometryDrawing Brush="#FF000000" Geometry="F1 M 1.89,13.5L 1.89,97.5">'
  53 _,←L,'                        <GeometryDrawing.Pen>'
  54 _,←L,'                           <Pen Brush="#FF000000" LineJoin="Round" Thickness="3">'
  55 _,←L,'                           </Pen>'
  56 _,←L,'                        </GeometryDrawing.Pen>'
  57 _,←L,'                     </GeometryDrawing>'
  58 _,←L,'                     <GeometryDrawing Geometry="F1 M 1.89,29.5L 21.89,41.5">'
  59 _,←L,'                        <GeometryDrawing.Pen>'
  60 _,←L,'                           <Pen Brush="#FF000000" LineJoin="Round" Thickness="3">'
  61 _,←L,'                           </Pen>'
  62 _,←L,'                        </GeometryDrawing.Pen>'
  63 _,←L,'                     </GeometryDrawing>'
  64 _,←L,'                     <GeometryDrawing Geometry="F1 M 1.89,46.5L 21.89,58.5">'
  65 _,←L,'                        <GeometryDrawing.Pen>'
  66 _,←L,'                           <Pen Brush="#FF000000" LineJoin="Round" Thickness="3">'
  67 _,←L,'                           </Pen>'
  68 _,←L,'                        </GeometryDrawing.Pen>'
  69 _,←L,'                     </GeometryDrawing>'
  70 _,←L,'                     <GeometryDrawing Geometry="F1 M 1.89,63.5L 21.89,75.5">'
  71 _,←L,'                        <GeometryDrawing.Pen>'
  72 _,←L,'                           <Pen Brush="#FF000000" LineJoin="Round" Thickness="3">'
  73 _,←L,'                           </Pen>'
  74 _,←L,'                        </GeometryDrawing.Pen>'
  75 _,←L,'                     </GeometryDrawing>'
  76 _,←L,'                     <GeometryDrawing Geometry="F1 M 1.89,79.5L 21.89,91.5">'
  77 _,←L,'                        <GeometryDrawing.Pen>'
  78 _,←L,'                           <Pen Brush="#FF000000" LineJoin="Round" Thickness="3">'
  79 _,←L,'                           </Pen>'
  80 _,←L,'                        </GeometryDrawing.Pen>'
  81 _,←L,'                     </GeometryDrawing>'
  82 _,←L,'                     <GeometryDrawing Geometry="F1 M 1.50,96.5L 21.5,108.5">'
  83 _,←L,'                        <GeometryDrawing.Pen>'
  84 _,←L,'                           <Pen Brush="#FF000000" LineJoin="Round" Thickness="3">'
  85 _,←L,'                           </Pen>'
  86 _,←L,'                        </GeometryDrawing.Pen>'
  87 _,←L,'                     </GeometryDrawing>'
  88 _,←L,'                     <GeometryDrawing Geometry="F1 M 42.12,96.83L 22.12,108.83">'
  89 _,←L,'                        <GeometryDrawing.Pen>'
  90 _,←L,'                           <Pen Brush="#FF000000" LineJoin="Round" Thickness="3">'
  91 _,←L,'                           </Pen>'
  92 _,←L,'                        </GeometryDrawing.Pen>'
  93 _,←L,'                     </GeometryDrawing>'
  94 _,←L,'                     <GeometryDrawing Brush="#FF000000" Geometry="F1 M 33.01,19.5L 33.01,7.97L 35.25,7.97L 35.25,19.5L 33.01,19.5 Z '
  95 _,←L,''
  96 _,←L,'">'
  97 _,←L,'                     </GeometryDrawing>'
  98 _,←L,'                     <GeometryDrawing Brush="#FF000000" Geometry="F1 M 31.01,39.5L 31.01,27.98L 34.80,27.98C 36.24,27.98 37.17,28.03 '
  99 _,←L,''
 100 _,←L,'37.61,28.15C 38.28,28.32 38.84,28.70 39.29,29.28C 39.74,29.86 39.97,30.61 39.97,31.53C 39.97,32.24 39.84,32.84 39.57,33.32C '
 101 _,←L,''
 102 _,←L,'39.31,33.81 38.97,34.19 38.56,34.46C 38.15,34.74 37.74,34.92 37.31,35.01C 36.74,35.12 35.91,35.18 34.82,35.18L 33.25,35.18L 33.25,39.5L '
 103 _,←L,''
 104 _,←L,'31.01,39.5 Z M 33.25,29.9L 33.25,33.26L 34.64,33.26C 35.64,33.26 36.31,33.19 36.65,33.07C 36.99,32.94 37.25,32.75 37.44,32.49C '
 105 _,←L,''
 106 _,←L,'37.64,32.22 37.73,31.92 37.73,31.57C 37.73,31.14 37.60,30.78 37.33,30.50C 37.06,30.22 36.72,30.05 36.31,29.98C 36.00,29.92 35.39,29.9 '
 107 _,←L,''
 108 _,←L,'34.48,29.9L 33.25,29.9 Z ">'
 109 _,←L,'                     </GeometryDrawing>'
 110 _,←L,'                     <GeometryDrawing Brush="#FF000000" Geometry="F1 M 31.01,59.5L 31.01,47.98L 34.80,47.98C 36.24,47.98 37.17,48.03 '
 111 _,←L,''
 112 _,←L,'37.61,48.15C 38.28,48.32 38.84,48.70 39.29,49.28C 39.74,49.86 39.97,50.61 39.97,51.53C 39.97,52.24 39.84,52.84 39.57,53.32C '
 113 _,←L,''
 114 _,←L,'39.31,53.81 38.97,54.19 38.56,54.46C 38.15,54.74 37.74,54.92 37.31,55.01C 36.74,55.12 35.91,55.18 34.82,55.18L 33.25,55.18L 33.25,59.5L '
 115 _,←L,''
 116 _,←L,'31.01,59.5 Z M 33.25,49.9L 33.25,53.26L 34.64,53.26C 35.64,53.26 36.31,53.19 36.65,53.07C 36.99,52.94 37.25,52.75 37.44,52.49C '
 117 _,←L,''
 118 _,←L,'37.64,52.22 37.73,51.92 37.73,51.57C 37.73,51.14 37.60,50.78 37.33,50.50C 37.06,50.22 36.72,50.05 36.31,49.98C 36.00,49.92 35.39,49.9 '
 119 _,←L,''
 120 _,←L,'34.48,49.9L 33.25,49.9 Z ">'
 121 _,←L,'                     </GeometryDrawing>'
 122 _,←L,'                     <GeometryDrawing Brush="#FF000000" Geometry="F1 M 38.37,75.18L 40.61,75.82C 40.26,77.06 39.69,77.98 38.88,78.59C '
 123 _,←L,''
 124 _,←L,'38.07,79.19 37.05,79.5 35.80,79.5C 34.27,79.5 33.00,78.98 32.01,77.96C 31.03,76.93 30.53,75.53 30.53,73.76C 30.53,71.88 31.02,70.42 '
 125 _,←L,''
 126 _,←L,'32.00,69.38C 32.99,68.34 34.28,67.82 35.88,67.82C 37.27,67.82 38.41,68.23 39.28,69.06C 39.80,69.55 40.19,70.26 40.45,71.18L 38.21,71.66C '
 127 _,←L,''
 128 _,←L,'38.07,71.06 37.78,70.59 37.34,70.25C 36.89,69.91 36.35,69.74 35.72,69.74C 34.84,69.74 34.13,70.04 33.59,70.64C 33.04,71.25 '
 129 _,←L,''
 130 _,←L,'32.77,72.23 32.77,73.59C 32.77,75.02 33.04,76.05 33.59,76.66C 34.13,77.27 34.84,77.58 35.71,77.58C 36.36,77.58 36.91,77.38 '
 131 _,←L,''
 132 _,←L,'37.37,77.00C 37.84,76.61 38.17,76.00 38.37,75.18 Z ">'
 133 _,←L,'                     </GeometryDrawing>'
 134 _,←L,'                  </DrawingGroup.Children>'
 135 _,←L,'               </DrawingGroup>'
 136 _,←L,'            </DrawingBrush.Drawing>'
 137 _,←L,'         </DrawingBrush>'
 138 _,←L,'      </Grid.Resources>'
 139 _,←L,'      <Grid.RowDefinitions>'
 140 _,←L,'         <RowDefinition Height="23"/>'
 141 _,←L,'         <RowDefinition/>'
 142 _,←L,'      </Grid.RowDefinitions>'
 143 _,←L,'      <Grid.ColumnDefinitions>'
 144 _,←L,'         <ColumnDefinition Width="0.25*"/>'
 145 _,←L,'         <ColumnDefinition Width="0.75*"/>'
 146 _,←L,'      </Grid.ColumnDefinitions>'
 147 _,←L,'      <Label x:Name="header" Grid.ColumnSpan="2" Background="Red" Content="Warning !" FontFamily="Segoe UI" FontSize="12" FontWeight="Bold" Foreground="White" Padding="5,0,0,0" TextOptions.TextFormattingMode="Ideal" VerticalContentAlignment="Center"/>'
 148 _,←L,'      <Label x:Name="warning" Grid.Column="1" Grid.Row="1" Content="TextBlock" FontFamily="Segoe UI" FontSize="12" VerticalContentAlignment="Center"/>'
 149 _,←L,'      <Border Height="33" Width="52" Grid.Row="1" Margin="2" Background="{DynamicResource Warning_Icon}"/>'
 150 _,←L,'   </Grid>'
 151 _,←L,'</ToolTip>'
 152 Warning_ToolTip_xaml←_
 153 
 154 _←⍬
 155 _,←'<Window'
 156 _,←L,'  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"'
 157 _,←L,'  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"'
 158 _,←L,'  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"'
 159 _,←L,'  xmlns:sf="http://schemas.syncfusion.com/wpf"'
 160 _,←L,'  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"'
 161 _,←L,'  Height="390"'
 162 _,←L,'  Width="550"'
 163 _,←L,'  Title="DoubleText Box Demo 1">'
 164 _,←L,'  <Grid x:Name="LayoutRoot">'
 165 _,←L,'    <Grid.RowDefinitions>'
 166 _,←L,'      <RowDefinition Height="0.16*"/>'
 167 _,←L,'      <RowDefinition Height="0.28*"/>'
 168 _,←L,'      <RowDefinition Height="0.28*"/>'
 169 _,←L,'      <RowDefinition Height="0.28*"/>'
 170 _,←L,'    </Grid.RowDefinitions>'
 171 _,←L,'    <Grid.ColumnDefinitions>'
 172 _,←L,'      <ColumnDefinition Width="0.5*"/>'
 173 _,←L,'      <ColumnDefinition Width="0.5*"/>'
 174 _,←L,'    </Grid.ColumnDefinitions>'
 175 _,←L,'    <Label'
 176 _,←L,'      Margin="0,10"'
 177 _,←L,'      Content="Fill the following details:"'
 178 _,←L,'      FontSize="14"'
 179 _,←L,'      FontWeight="Bold"/>'
 180 _,←L,'    <Label'
 181 _,←L,'      Height="24"'
 182 _,←L,'      Grid.Row="1"'
 183 _,←L,'      HorizontalAlignment="Right"'
 184 _,←L,'      Margin="0,0,10,0"'
 185 _,←L,'      VerticalAlignment="Center"'
 186 _,←L,'      Content="Enter your age [1-100]:"'
 187 _,←L,'      HorizontalContentAlignment="Right"'
 188 _,←L,'      VerticalContentAlignment="Center"/>'
 189 _,←L,'    <sf:DoubleTextBox'
 190 _,←L,'      x:Name="doubleTextBox1"'
 191 _,←L,'      Height="24"'
 192 _,←L,'      Width="64"'
 193 _,←L,'      Grid.Column="1"'
 194 _,←L,'      Grid.Row="1"'
 195 _,←L,'      HorizontalAlignment="Left"'
 196 _,←L,'      MaxValidation="OnLostFocus"'
 197 _,←L,'      MaxValue="100"'
 198 _,←L,'      MinValidation="OnLostFocus"'
 199 _,←L,'      MinValue="1"'
 200 _,←L,'      NumberDecimalDigits="0"/>'
 201 _,←L,'    <Label'
 202 _,←L,'      Height="24"'
 203 _,←L,'      Grid.Row="2"'
 204 _,←L,'      HorizontalAlignment="Right"'
 205 _,←L,'      Margin="0,0,10,0"'
 206 _,←L,'      VerticalAlignment="Center"'
 207 _,←L,'      Content="Enter your year of birth [1900-2100]:"'
 208 _,←L,'      HorizontalContentAlignment="Right"'
 209 _,←L,'      VerticalContentAlignment="Center"/>'
 210 _,←L,'    <sf:DoubleTextBox'
 211 _,←L,'      x:Name="doubleTextBox2"'
 212 _,←L,'      Height="24"'
 213 _,←L,'      Width="64"'
 214 _,←L,'      Grid.Column="1"'
 215 _,←L,'      Grid.Row="2"'
 216 _,←L,'      HorizontalAlignment="Left"'
 217 _,←L,'      Margin="0"'
 218 _,←L,'      VerticalAlignment="Center"'
 219 _,←L,'      MaxValidation="OnLostFocus"'
 220 _,←L,'      MaxValue="2100"'
 221 _,←L,'      MinValidation="OnLostFocus"'
 222 _,←L,'      MinValue="1900"'
 223 _,←L,'      NumberDecimalDigits="0"/>'
 224 _,←L,'    <Button'
 225 _,←L,'      x:Name="buttonCancel"'
 226 _,←L,'      Height="35"'
 227 _,←L,'      Width="168"'
 228 _,←L,'      Grid.Row="3"'
 229 _,←L,'      HorizontalAlignment="Center"'
 230 _,←L,'      VerticalAlignment="Center"'
 231 _,←L,'      Content="Cancel"'
 232 _,←L,'      IsCancel="True"/>'
 233 _,←L,'    <Button'
 234 _,←L,'      x:Name="buttonOk"'
 235 _,←L,'      Height="36"'
 236 _,←L,'      Width="168"'
 237 _,←L,'      Grid.Column="1"'
 238 _,←L,'      Grid.Row="3"'
 239 _,←L,'      HorizontalAlignment="Center"'
 240 _,←L,'      Margin="0"'
 241 _,←L,'      Content="OK"'
 242 _,←L,'      HorizontalContentAlignment="Center"'
 243 _,←L,'      IsDefault="True"/>'
 244 _,←L,'  </Grid>'
 245 _,←L,'</Window>'
 246 sfDoubleTextBoxDemo1_xaml←_
 247 
 248 ⎕ex¨ 'L' '_'
 249 
 250 ⍝ === End of variables definition ===
 251 
 252 (⎕IO ⎕ML ⎕WX)←1 3 3
 253 
 254 ∇ DemoDoubleTextBox1;sfDir;⎕USING
 255      ⍝ Demo of DataValidation on Lost Focus for a Syncfusion DoubleTextBox using their MinValue and MaxValue properties.
 256      
 257  sfDir ← 'Syncfusion/4.5/' ⍝ Location of the Syncfusion librairies
 258      
 259  ⎕USING ← 'System.Windows.Controls,WPF/PresentationFramework.dll'
 260  ⎕USING,← ⊂'Syncfusion.Windows.Shared,',sfDir,'Syncfusion.Shared.Wpf.dll'
 261  :Trap 0
 262      {}DoubleTextBox     ⍝ Syncfusion DoubleTextBox object should be available.
 263  :Else
 264      ⎕←'DemoDoubleTextBox: Error loading the assembly Syncfusion.Shared.Wpf.dll.'
 265      →0
 266  :End
 267      
 268      ⍝ Compile the Xaml:
 269  sfDoubleTextBoxDemo_obj←FixSimpleXaml sfDoubleTextBoxDemo1_xaml
 270      
 271      ⍝ Attach manually the events:
 272  sfDoubleTextBoxDemo_obj.doubleTextBox1.onValueChanged ← '_DoubleTextBox_ValueChangedEvent'
 273  sfDoubleTextBoxDemo_obj.doubleTextBox2.onValueChanged ← '_DoubleTextBox_ValueChangedEvent'
 274  sfDoubleTextBoxDemo_obj.buttonCancel.onClick          ← '_ButtonCancel_ClickEvent'
 275  sfDoubleTextBoxDemo_obj.buttonOk.onClick              ← '_ButtonOk_ClickEvent'
 276      
 277      ⍝ Show the window:
 278  sfDoubleTextBoxDemo_obj.Show
 279 
 280 
 281 ∇ rootObject←FixSimpleXaml xaml;names;⎕USING
 282      ⍝ Parse simple Xaml that contains only names to fix.
 283      
 284      ⍝ Parse the simple Xaml and obtain the root object:
 285  ⎕USING     ← 'System.Windows.Markup,WPF/PresentationFramework.dll'
 286  rootObject ← XamlReader.Parse(⊂xaml)
 287      
 288      ⍝ Extract the names beginning with 'x:Name':
 289  names ← {{(,⊃0≠⍴¨⍵)/⍵}{1⊃((⍵[;1]∊⊂'x:Name')/⍵[;2]),⊂''}¨(⎕XML ⍵)[;4]}xaml
 290      
 291      ⍝ Assign the value of each names to the root object:
 292  rootObject {⍎'⍺.',⍵,'←⍺.FindName(⊂⍵)'} ¨names
 293 
 294 
 295 ∇ _ButtonCancel_ClickEvent(sender event)
 296       ⍝ Click Event Handler for the Cancel Button.
 297      
 298      ⍝ Close the Parent Window.
 299  sfDoubleTextBoxDemo_obj.Close
 300 
 301 
 302 ∇ _ButtonOk_ClickEvent(sender event)
 303       ⍝ Click Event Handler for the OK Button.
 304      
 305      ⍝ Show the validated values of the form.
 306  ⎕ ← sfDoubleTextBoxDemo_obj.(doubleTextBox1 doubleTextBox2).Value
 307      
 308      ⍝ Close the Parent Window.
 309  sfDoubleTextBoxDemo_obj.Close
 310 
 311 
 312 ∇ _DoubleTextBox_ValueChangedEvent(sender event);maxValue;message;minValue;value;⎕USING
 313       ⍝ ValueChanged Event Handler OnLostFocus for a Syncfusion DoubleTextBox.
 314       ⍝ It Will Show a ToolTip if the Value of the DoubleTextBox Exceed the Maximum or the Minimum Value Range.
 315 
 316       ⍝ sender = Syncfusion.Windows.Shared.DoubleTextBox
 317       ⍝ event  = System.Windows.DependencyPropertyChangedEventArgs
 318      
 319  (value minValue maxValue) ← sender.(Value MinValue MaxValue)
 320      
 321  :If (value≤maxValue)∧(value≥minValue)
 322          ⍝ The Value is Within the Maximum and Minimum Value Range.
 323          ⍝ Remove Any Visible ToolTip and Reset the Background and Foreground Property to Default Value.
 324      :Trap 0
 325          sender.ToolTip.IsOpen ← 0
 326      
 327              ⍝ Reset the Background, Foreground and ToolTip properties of sender to it's default value.
 328          ⎕USING ← 'System.Windows.Controls,WPF/PresentationFramework.dll'
 329          sender.ClearValue¨TextBox.(BackgroundProperty ForegroundProperty ToolTipProperty)
 330      :Else
 331              ⍝ Error because there is no ToolTip define for the sender. Do nothing.
 332      
 333      :EndTrap
 334      
 335  :Else
 336          ⍝ The Value is Not Within the Maximum and Minimum Value Range.
 337          ⍝ Prepare the Warning Message:
 338      :If value<minValue
 339      
 340          message ← ('¯'⎕R'-')'The Value is Too Small.',(⎕UCS 13),'It Must be Greater Than ',(⍕minValue),'.'
 341      
 342      :ElseIf value>maxValue
 343      
 344          message ← ('¯'⎕R'-')'The Value is Too Large.',(⎕UCS 13),'It Must be Smaller Than ',(⍕maxValue),'.'
 345      
 346      :EndIf
 347      
 348          ⍝ Show a ToolTip with the Warning Message.
 349      :Trap 0
 350              ⍝ Will bug if empty. If there is already a ToolTip, reuse it.
 351          sender.ToolTip.(FindName⊂'warning').Content ← message
 352      
 353      :Else
 354              ⍝ No ToolTip. Create it for the first time.
 355          ⎕USING ← 'System.Windows.Markup,WPF/PresentationFramework.dll'
 356          sender.ToolTip ← XamlReader.Parse(⊂Warning_ToolTip_xaml)
 357          sender.ToolTip.(FindName⊂'tooltip').PlacementTarget ← sender
 358          sender.ToolTip.(FindName⊂'warning').Content         ← message
 359      
 360      :EndTrap
 361      
 362          ⍝ Force the ToolTip to Show and to stay visible.
 363      sender.ToolTip.(IsOpen StaysOpen) ← 1
 364      
 365          ⍝ Change the Foreground and Background color of sender to indicate that there is a warning tooltip.
 366      ⎕USING ← 'System.Windows.Media,WPF/PresentationCore.dll'
 367      sender.(Background Foreground) ← ⎕NEW¨SolidColorBrush,¨(Colors.Red)(Colors.White)
 368  :End
 369 
 370 
 371 :EndNamespace 

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2015-01-27 14:26:37, 28.6 KB) [[attachment:DoubleTextBoxDemo1.png]]
  • [get | view] (2015-03-24 11:55:17, 11.8 KB) [[attachment:DoubleTextBoxDemo1_2.png]]
  • [get | view] (2015-01-27 14:26:37, 12.9 KB) [[attachment:sfDoubleTextBox.v1.0.txt]]
  • [get | view] (2015-03-24 11:55:03, 19.1 KB) [[attachment:sfDoubleTextBox.v1.1.txt]]
 All files | Selected Files: delete move to page

You are not allowed to attach a file to this page.