]> O.S.I.I.S - jp/crow.git/commitdiff
restore update and polling intervals to normal value for showcase
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Mon, 1 Nov 2021 16:41:21 +0000 (17:41 +0100)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Mon, 1 Nov 2021 16:41:21 +0000 (17:41 +0100)
Samples/ShowCase/ShowCase.cs
Samples/ShowCase/ui/Button.template
Samples/ShowCase/ui/showcase.crow
Samples/common/ui/Interfaces/Experimental/updateIntervals.crow [new file with mode: 0644]
Samples/common/ui/templates/slider.tmp [new file with mode: 0644]

index 6774314af3881557e176e9104a171e15e1b388c3..7b25d718cd663d992113a9db587894a15f5a2a0c 100644 (file)
@@ -37,8 +37,8 @@ namespace ShowCase
                                app.SetWindowIcon ("#Crow.Icons.crow.png");
                                //app.Theme = @"C:\Users\Jean-Philippe\source\Crow\Themes\TestTheme";
                                CurrentProgramInstance = app;
-                               Interface.UPDATE_INTERVAL = 50;
-                               Interface.POLLING_INTERVAL = 5;
+                               //Interface.UPDATE_INTERVAL = 50;
+                               //Interface.POLLING_INTERVAL = 5;
 
                                app.Run ();
                        }
@@ -169,5 +169,24 @@ namespace ShowCase
             }
             return base.OnKeyDown (e);
         }
+
+               public int CrowUpdateInterval {
+                       get => Crow.Interface.UPDATE_INTERVAL;
+                       set {
+                               if (Crow.Interface.UPDATE_INTERVAL == value)
+                                       return;
+                               Crow.Interface.UPDATE_INTERVAL = value;
+                               NotifyValueChanged (Crow.Interface.UPDATE_INTERVAL);
+                       }
+               }
+               public int CrowPollingInterval {
+                       get => Crow.Interface.POLLING_INTERVAL;
+                       set {
+                               if (Crow.Interface.POLLING_INTERVAL == value)
+                                       return;
+                               Crow.Interface.POLLING_INTERVAL = value;
+                               NotifyValueChanged (Crow.Interface.POLLING_INTERVAL);
+                       }
+               }
     }
 }
\ No newline at end of file
index 9ef1001d91dd0db098ab617f84614a76b8939293..b05567ac1b15413451eba670ec42980d768c1746 100644 (file)
@@ -5,8 +5,8 @@
                                                        MouseLeave="{Foreground=Transparent};{caption.Foreground=LightGrey}"
                                                        MouseDown="{Foreground=vgradient|0:Black|0.05:Grey|0.85:Grey|1:White}"
                                                        MouseUp="{Foreground=vgradient|0:White|0.2:Grey|0.9:Grey|1:Black}">
-       <HorizontalStack Margin="2">
+       <HorizontalStack Margin="1">
                <Image Style="Icon" Path="{./Icon}"/>
-               <Label Font="{./Font}" Name="caption" Margin="3" Foreground="LightGrey" Text="{./Caption}"/>
+               <Label Font="{./Font}" Name="caption" Margin="2" Foreground="LightGrey" Text="{./Caption}"/>
        </HorizontalStack>
 </Border>
\ No newline at end of file
index 692ce88e249ea21554894446a237546848453991..c5b683dabbef087c2b0a11edb64b0ce4a94b7f24 100644 (file)
                                </Popper>
                                <Popper Caption="Template" Width="Fit" Background="Onyx">
                                        <Template>
-                                               <Border Background="{./Background}" MinimumSize="50,20" Name="Content" Width="Stretched" Margin="3"
+                                               <Border Background="{./Background}" MinimumSize="50,20" Name="Content" Width="Stretched" Margin="0"
                                                                                                        Foreground="Transparent" CornerRadius="{../CornerRadius}" BorderWidth="1"
                                                                                                        MouseEnter="{Foreground=vgradient|0:White|0.2:Grey|0.9:Grey|1:Black};{caption.Foreground=White}"
                                                                                                        MouseLeave="{Foreground=Transparent};{caption.Foreground=LightGrey}"
                                                                                                        MouseDown="{Foreground=vgradient|0:Black|0.05:Grey|0.85:Grey|1:White}"
                                                                                                        MouseUp="{Foreground=vgradient|0:White|0.2:Grey|0.9:Grey|1:Black}">
-                                                       <Label Font="{./Font}" Name="caption" Margin="3" Foreground="LightGrey" Text="{./Caption}"/>
+                                                       <Label Font="{./Font}" Name="caption" Margin="2" Foreground="LightGrey" Text="{./Caption}"/>
                                                </Border>
                                        </Template>
                                        <VerticalStack Width="200" Height="200" Background="Jet" Margin="5">
diff --git a/Samples/common/ui/Interfaces/Experimental/updateIntervals.crow b/Samples/common/ui/Interfaces/Experimental/updateIntervals.crow
new file mode 100644 (file)
index 0000000..39261a1
--- /dev/null
@@ -0,0 +1,8 @@
+<VerticalStack Margin="20">
+       <Slider Template="#ui.slider.tmp" Height="Fit" Background="0.1,0.1,0.2,0.8"
+                       Minimum="1" Maximum="50" SmallIncrement="1" LargeIncrement="10"
+                       Caption="Crow Update Interval (ms)" Value="{²CrowUpdateInterval}" />
+       <Slider Template="#ui.slider.tmp" Height="Fit" Background="0.1,0.1,0.2,0.8"
+                       Minimum="1" Maximum="50" SmallIncrement="1" LargeIncrement="10"
+                       Caption="GLFW polling Interval (ms)" Value="{²CrowPollingInterval}" />
+</VerticalStack>
\ No newline at end of file
diff --git a/Samples/common/ui/templates/slider.tmp b/Samples/common/ui/templates/slider.tmp
new file mode 100644 (file)
index 0000000..d60e66c
--- /dev/null
@@ -0,0 +1,11 @@
+<VerticalStack Background="{./Background}" Margin="5">
+       <Label Text="{./Caption}"/>
+       <Group Height="20">
+               <Gauge Height="50%" Foreground="${ControlHighlight}" Background="Onyx" Value="{./Value}" Maximum="{./Maximum}" Minimum="{Minimum}" Orientation="{./Orientation}"/>
+               <Border Name="Cursor" Background="White" BorderWidth="2" Foreground="Grey"
+                               MouseEnter="{Foreground=${ControlHighlight}}"
+                               MouseLeave="{Foreground=Grey}" >
+                       <Label Text="{./Value}" Foreground="Black"/>
+               </Border>
+       </Group>
+</VerticalStack>