From 7e67f84aaa159a5e4fe8f736975ffef33e7efa40 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Fri, 17 Jun 2016 06:44:16 +0000 Subject: [PATCH] OmagView : - primo commit. --- AboutBoxWD.xaml | 59 + AboutBoxWD.xaml.vb | 44 + Application.xaml | 10 + Application.xaml.vb | 6 + ConstGen.vb | 42 + ConstIni.vb | 71 + ConstMsg.vb | 33 + EgtDictionary.xaml | 436 +++++ EgtDictionary.xaml.vb | 373 +++++ MainWindow.xaml | 74 + MainWindow.xaml.vb | 417 +++++ My Project/AssemblyInfo.vb | 59 + My Project/MyExtensions/MyWpfExtension.vb | 121 ++ My Project/Resources.Designer.vb | 63 + My Project/Resources.resx | 117 ++ My Project/Settings.Designer.vb | 71 + My Project/Settings.settings | 7 + OmagVIEW.sln | 22 + OmagVIEW.vbproj | 215 +++ OmagVIEWDictionary.xaml | 1769 +++++++++++++++++++++ OmagVIEWDictionary.xaml.vb | 322 ++++ OptionsPageUC.xaml | 76 + OptionsPageUC.xaml.vb | 40 + Resources/GenericView.png | Bin 0 -> 1820 bytes Resources/LogoOmag.jpg | Bin 0 -> 10449 bytes Resources/LookFromTOP.png | Bin 0 -> 693 bytes Resources/Options.png | Bin 0 -> 2381 bytes Resources/Pan.png | Bin 0 -> 1660 bytes Resources/V.png | Bin 0 -> 652 bytes Resources/X.png | Bin 0 -> 548 bytes Resources/ZoomAll.png | Bin 0 -> 1339 bytes Resources/ZoomIn.png | Bin 0 -> 662 bytes Resources/ZoomOut.png | Bin 0 -> 658 bytes Resources/ZoomWin.png | Bin 0 -> 1132 bytes SceneButtonsUC.xaml | 50 + SceneButtonsUC.xaml.vb | 52 + Utility.vb | 102 ++ app.config | 23 + 38 files changed, 4674 insertions(+) create mode 100644 AboutBoxWD.xaml create mode 100644 AboutBoxWD.xaml.vb create mode 100644 Application.xaml create mode 100644 Application.xaml.vb create mode 100644 ConstGen.vb create mode 100644 ConstIni.vb create mode 100644 ConstMsg.vb create mode 100644 EgtDictionary.xaml create mode 100644 EgtDictionary.xaml.vb create mode 100644 MainWindow.xaml create mode 100644 MainWindow.xaml.vb create mode 100644 My Project/AssemblyInfo.vb create mode 100644 My Project/MyExtensions/MyWpfExtension.vb create mode 100644 My Project/Resources.Designer.vb create mode 100644 My Project/Resources.resx create mode 100644 My Project/Settings.Designer.vb create mode 100644 My Project/Settings.settings create mode 100644 OmagVIEW.sln create mode 100644 OmagVIEW.vbproj create mode 100644 OmagVIEWDictionary.xaml create mode 100644 OmagVIEWDictionary.xaml.vb create mode 100644 OptionsPageUC.xaml create mode 100644 OptionsPageUC.xaml.vb create mode 100644 Resources/GenericView.png create mode 100644 Resources/LogoOmag.jpg create mode 100644 Resources/LookFromTOP.png create mode 100644 Resources/Options.png create mode 100644 Resources/Pan.png create mode 100644 Resources/V.png create mode 100644 Resources/X.png create mode 100644 Resources/ZoomAll.png create mode 100644 Resources/ZoomIn.png create mode 100644 Resources/ZoomOut.png create mode 100644 Resources/ZoomWin.png create mode 100644 SceneButtonsUC.xaml create mode 100644 SceneButtonsUC.xaml.vb create mode 100644 Utility.vb create mode 100644 app.config diff --git a/AboutBoxWD.xaml b/AboutBoxWD.xaml new file mode 100644 index 0000000..535472e --- /dev/null +++ b/AboutBoxWD.xaml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SceneButtonsUC.xaml.vb b/SceneButtonsUC.xaml.vb new file mode 100644 index 0000000..8028a6c --- /dev/null +++ b/SceneButtonsUC.xaml.vb @@ -0,0 +1,52 @@ +Imports EgtUILib + +Public Class SceneButtonsUC + + 'Riferimento alla MainWindow + Dim m_MainWindow As MainWindow = Application.Current.MainWindow + + Private Sub ZoomAllBtn_Click(sender As Object, e As RoutedEventArgs) Handles ZoomAllBtn.Click + EgtZoom(ZM.ALL) + End Sub + + Private Sub ZoomInBtn_Click(sender As Object, e As RoutedEventArgs) Handles ZoomInBtn.Click + EgtZoom(ZM.IN_) + End Sub + + Private Sub ZoomOutBtn_Click(sender As Object, e As RoutedEventArgs) Handles ZoomOutBtn.Click + EgtZoom(ZM.OUT) + End Sub + + Private Sub ZoomWinBtn_Click(sender As Object, e As RoutedEventArgs) Handles ZoomWinBtn.Click + GetCurrScene.SetStatusZoomWin() + End Sub + + Private Sub PanBtn_Click(sender As Object, e As RoutedEventArgs) Handles PanBtn.Click + GetCurrScene.SetStatusPan() + End Sub + + Private Sub GenericViewBtn_Click(sender As Object, e As RoutedEventArgs) Handles GenericViewBtn.Click + If Keyboard.IsKeyDown(Key.T) Then + EgtSetView(VT.TOP) + ElseIf Keyboard.IsKeyDown(Key.F) Then + EgtSetView(VT.FRONT) + ElseIf Keyboard.IsKeyDown(Key.B) Then + EgtSetView(VT.BACK) + ElseIf Keyboard.IsKeyDown(Key.L) Then + EgtSetView(VT.LEFT) + ElseIf Keyboard.IsKeyDown(Key.R) Then + EgtSetView(VT.RIGHT) + Else + GetCurrScene.SetStatusRot() + End If + End Sub + + Private Sub TopViewBtn_Click(sender As Object, e As RoutedEventArgs) Handles TopViewBtn.Click + EgtSetView(VT.TOP) + End Sub + + Private Function GetCurrScene() As EgtUILib.Scene + Return m_MainWindow.CurrentProjectScene + End Function + +End Class diff --git a/Utility.vb b/Utility.vb new file mode 100644 index 0000000..a26afdc --- /dev/null +++ b/Utility.vb @@ -0,0 +1,102 @@ +Imports System.Globalization +Imports EgtUILib + +Module Utility + + '-------------------------------------------------------------------------------------------------- + Friend Sub UpdateUI() + ' Costringo ad aggiornare UI + Dim nDummy As Integer + Application.Current.Dispatcher.Invoke(Windows.Threading.DispatcherPriority.Background, _ + New Action(Function() nDummy = 0)) + End Sub + + '-------------------------------------------------------------------------------------------------- + Friend Function DoubleToString(ByVal dVal As Double, ByVal nNumDec As Integer) As String + Dim sFormat As String = "F" + Math.Abs(nNumDec).ToString() + Dim sVal As String = dVal.ToString(sFormat, CultureInfo.InvariantCulture) + If nNumDec > 0 Then + Return sVal.TrimEnd("0".ToCharArray()).TrimEnd(".".ToCharArray) + Else + Return sVal + End If + End Function + + Friend Function StringToDouble(ByVal sVal As String, ByRef dVal As Double) As Boolean + Return EgtLuaEvalNumExpr(sVal, dVal) + End Function + + Friend Function LenToString(ByVal dVal As Double, ByVal nNumDec As Integer) As String + Return DoubleToString(EgtToUiUnits(dVal), nNumDec) + End Function + + Friend Function StringToLen(ByVal sVal As String, ByRef dVal As Double) As Boolean + If EgtLuaEvalNumExpr(sVal, dVal) Then + dVal = EgtFromUiUnits(dVal) + Return True + Else + Return False + End If + End Function + + Friend Function UIExprToExpr(ByVal sUIExpr) As String + If String.IsNullOrWhiteSpace(sUIExpr) Then + Return "" + End If + Return sUIExpr.Replace("""", "*GEO.ONE_INCH") + End Function + + Friend Function ExprToUIExpr(ByVal sExpr) As String + If String.IsNullOrWhiteSpace(sExpr) Then + Return "" + End If + Return sExpr.Replace("*GEO.ONE_INCH", """") + End Function + + '-------------------------------------------------------------------------------------------------- + Public Class Language + + Private m_sLanguageName As String + Private m_sFileName As String + + Public Property LanguageName As String + Get + Return m_sLanguageName + End Get + Set(value As String) + m_sLanguageName = value + End Set + End Property + + Public Property FileName As String + Get + Return m_sFileName + End Get + Set(value As String) + m_sFileName = value + End Set + End Property + + Sub New(LanguageName As String, FileName As String) + Me.LanguageName = LanguageName + Me.FileName = FileName + End Sub + + End Class + + Public Function GetPrivateProfileLanguage( + ByVal lpAppName As String, + ByVal lpKeyName As String, + ByVal lpFileName As String) As Language + + Dim sVal As String = String.Empty + GetPrivateProfileString(lpAppName, lpKeyName, "", sVal, lpFileName) + Dim sItems() As String = sVal.Split(",".ToCharArray) + If sItems.Count() = 2 Then + Return New Language(sItems(0), sItems(1)) + End If + Return Nothing + + End Function + +End Module diff --git a/app.config b/app.config new file mode 100644 index 0000000..843d111 --- /dev/null +++ b/app.config @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + +