-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
changbowen
committed
Mar 5, 2016
1 parent
5c29da5
commit 0a01d8f
Showing
6 changed files
with
167 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<Window x:Class="ControlWindow" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
Title="{Binding Mode=OneTime, Source={StaticResource control}, StringFormat='\{0} (F1)'}" Height="140" Width="355.786" ResizeMode="CanMinimize" Closing="Window_Closing" Icon="KenBurns.ico" PreviewKeyDown="Window_PreviewKeyDown"> | ||
<Canvas> | ||
<Button x:Name="Btn_SwitchImage" Canvas.Left="10" Canvas.Top="10" Width="196" Height="24"> | ||
<Button.Content> | ||
<Run Text="{Binding Mode=OneTime, Source={StaticResource switch_image}, StringFormat='\{0} (Ctrl+P)'}"></Run> | ||
</Button.Content> | ||
</Button> | ||
<Button x:Name="Btn_SwitchAudio" Canvas.Left="10" Canvas.Top="39" Width="196" Height="24"> | ||
<Button.Content> | ||
<Run Text="{Binding Mode=OneTime, Source={StaticResource switch_music}, StringFormat='\{0} (Shift+P)'}"></Run> | ||
</Button.Content> | ||
</Button> | ||
<Button x:Name="Btn_Restart" Canvas.Left="10" Canvas.Top="68" Width="196" Height="24"> | ||
<Button.Content> | ||
<Run Text="{Binding Mode=OneTime, Source={StaticResource restart}, StringFormat='\{0} (Ctrl+R)'}"></Run> | ||
</Button.Content> | ||
</Button> | ||
<Button x:Name="Btn_Options" Canvas.Left="211" Canvas.Top="10" Width="118" Height="24"> | ||
<Button.Content> | ||
<Run Text="{Binding Mode=OneTime, Source={StaticResource options}, StringFormat='\{0} (F12)'}"></Run> | ||
</Button.Content> | ||
</Button> | ||
<Button x:Name="Btn_EditSlide" Canvas.Left="211" Canvas.Top="39" Width="118" Height="24"> | ||
<Button.Content> | ||
<Run Text="{Binding Mode=OneTime, Source={StaticResource edit slides}, StringFormat='\{0} (F11)'}"></Run> | ||
</Button.Content> | ||
</Button> | ||
<Button x:Name="Btn_Exit" Content="{StaticResource exit}" Canvas.Left="211" Canvas.Top="68" Width="118" Height="24"/> | ||
</Canvas> | ||
</Window> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
Public Class ControlWindow | ||
Public Shared reallyclose As Boolean = False | ||
|
||
Private Sub Window_Closing(sender As Object, e As ComponentModel.CancelEventArgs) | ||
If Not reallyclose Then | ||
e.Cancel = True | ||
Me.Hide() | ||
End If | ||
End Sub | ||
|
||
Private Sub Btn_SwitchImage_Click(sender As Object, e As RoutedEventArgs) Handles Btn_SwitchImage.Click | ||
Task.Run(Sub() | ||
Dispatcher.Invoke(Sub() Btn_SwitchImage.IsEnabled = False) | ||
Dispatcher.Invoke(Sub() Btn_Restart.IsEnabled = False) | ||
System.Threading.Thread.Sleep(3000) | ||
Dispatcher.Invoke(Sub() Btn_SwitchImage.IsEnabled = True) | ||
Dispatcher.Invoke(Sub() Btn_Restart.IsEnabled = True) | ||
End Sub) | ||
Dim mainwin As MainWindow = Me.Owner | ||
mainwin.SwitchImage() | ||
End Sub | ||
|
||
Private Sub Btn_SwitchAudio_Click(sender As Object, e As RoutedEventArgs) Handles Btn_SwitchAudio.Click | ||
Task.Run(Sub() | ||
Dispatcher.Invoke(Sub() Btn_SwitchAudio.IsEnabled = False) | ||
Dispatcher.Invoke(Sub() Btn_Restart.IsEnabled = False) | ||
System.Threading.Thread.Sleep(3000) | ||
Dispatcher.Invoke(Sub() Btn_SwitchAudio.IsEnabled = True) | ||
Dispatcher.Invoke(Sub() Btn_Restart.IsEnabled = True) | ||
End Sub) | ||
Dim mainwin As MainWindow = Me.Owner | ||
mainwin.SwitchAudio() | ||
End Sub | ||
|
||
Private Sub Btn_Restart_Click(sender As Object, e As RoutedEventArgs) Handles Btn_Restart.Click | ||
Task.Run(Sub() | ||
Dispatcher.Invoke(Sub() Btn_SwitchImage.IsEnabled = False) | ||
Dispatcher.Invoke(Sub() Btn_SwitchAudio.IsEnabled = False) | ||
Dispatcher.Invoke(Sub() Btn_Restart.IsEnabled = False) | ||
System.Threading.Thread.Sleep(3000) | ||
Dispatcher.Invoke(Sub() Btn_SwitchImage.IsEnabled = True) | ||
Dispatcher.Invoke(Sub() Btn_SwitchAudio.IsEnabled = True) | ||
Dispatcher.Invoke(Sub() Btn_Restart.IsEnabled = True) | ||
End Sub) | ||
Dim mainwin As MainWindow = Me.Owner | ||
mainwin.RestartAll() | ||
End Sub | ||
|
||
Private Sub Btn_Options_Click(sender As Object, e As RoutedEventArgs) Handles Btn_Options.Click | ||
Dim optwin As New OptWindow | ||
optwin.ShowDialog() | ||
optwin.Close() | ||
End Sub | ||
|
||
Private Sub Btn_EditSlide_Click(sender As Object, e As RoutedEventArgs) Handles Btn_EditSlide.Click | ||
Dim editwin As New EditWindow | ||
editwin.ShowDialog() | ||
editwin.Close() | ||
End Sub | ||
|
||
Private Sub Btn_Exit_Click(sender As Object, e As RoutedEventArgs) Handles Btn_Exit.Click | ||
Dim mainwin As MainWindow = Me.Owner | ||
mainwin.Close() | ||
End Sub | ||
|
||
Private Sub Window_PreviewKeyDown(sender As Object, e As KeyEventArgs) | ||
If e.Key = Key.Escape Then | ||
Me.Hide() | ||
End If | ||
End Sub | ||
End Class |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.