ソースを参照

Removed Print Button from PDFViewer control

Frank van den Bos 2 年 前
コミット
7ba88e8267

+ 3 - 1
prs.classes/SecurityDescriptors/Manufacturing_Descriptors.cs

@@ -1,4 +1,5 @@
-using InABox.Core;
+using System;
+using InABox.Core;
 
 namespace Comal.Classes
 {
@@ -53,6 +54,7 @@ namespace Comal.Classes
     }
 
     [Caption("Print Drawings from Factory Floor Screen")]
+    [Obsolete("Direct Printing replaved by Save Function launching external file viewer", true)]
     public class CanPrintFactoryFloorDrawings : EnabledSecurityDescriptor<ManufacturingLicense, ManufacturingPacket>
     {
     }

+ 2 - 2
prs.desktop/Panels/DeliveredOnSite/DeliveredOnSiteGrid.cs

@@ -81,7 +81,7 @@ namespace PRSDesktop
                 var table = new Client<SetoutDocument>().Query(new Filter<SetoutDocument>(x => x.EntityLink.ID).IsEqualTo(setoutid));
                 IEntityDocument[] docs = table.Rows.Select(r => r.ToObject<SetoutDocument>()).ToArray();
                 var viewer = new DocumentEditor(docs);
-                viewer.PrintAllowed = Security.IsAllowed<CanPrintFactoryFloorDrawings>();
+                //viewer.PrintAllowed = Security.IsAllowed<CanPrintFactoryFloorDrawings>();
                 viewer.SaveAllowed = Security.IsAllowed<CanSaveFactoryFloorDrawings>();
                 viewer.Watermark = arg.Get<DeliveryItem, string>(x => x.ManufacturingPacketLink.WaterMark);
                 viewer.ShowDialog();
@@ -109,7 +109,7 @@ namespace PRSDesktop
             if (docs.Any())
             {
                 var editor = new DocumentEditor(docs.ToArray());
-                editor.PrintAllowed = Security.IsAllowed<CanPrintFactoryFloorDrawings>();
+                //editor.PrintAllowed = Security.IsAllowed<CanPrintFactoryFloorDrawings>();
                 editor.SaveAllowed = Security.IsAllowed<CanSaveFactoryFloorDrawings>();
                 editor.ShowDialog();
             }

+ 1 - 1
prs.desktop/Panels/Delivery/DeliveryList.cs

@@ -185,7 +185,7 @@ namespace PRSDesktop
             if (docs.Any())
             {
                 var editor = new DocumentEditor(docs.ToArray());
-                editor.PrintAllowed = Security.IsAllowed<CanPrintFactoryFloorDrawings>();
+                //editor.PrintAllowed = Security.IsAllowed<CanPrintFactoryFloorDrawings>();
                 editor.SaveAllowed = Security.IsAllowed<CanSaveFactoryFloorDrawings>();
                 editor.ShowDialog();
             }

+ 1 - 1
prs.desktop/Panels/DeliveryItems/ReadyToGoGrid.cs

@@ -86,7 +86,7 @@ namespace PRSDesktop
                 var table = new Client<SetoutDocument>().Query(new Filter<SetoutDocument>(x => x.EntityLink.ID).IsEqualTo(setoutid));
                 IEntityDocument[] docs = table.Rows.Select(r => r.ToObject<SetoutDocument>()).ToArray();
                 var viewer = new DocumentEditor(docs);
-                viewer.PrintAllowed = Security.IsAllowed<CanPrintFactoryFloorDrawings>();
+                //viewer.PrintAllowed = Security.IsAllowed<CanPrintFactoryFloorDrawings>();
                 viewer.SaveAllowed = Security.IsAllowed<CanSaveFactoryFloorDrawings>();
                 viewer.Watermark = arg.Get<DeliveryItem, string>(x => x.ManufacturingPacketLink.WaterMark);
                 viewer.ShowDialog();

+ 1 - 1
prs.desktop/Panels/Equipment/EquipmentGrid.cs

@@ -58,7 +58,7 @@ namespace PRSDesktop
             if (docs.Any())
             {
                 var editor = new DocumentEditor(docs.ToArray());
-                editor.PrintAllowed = true;
+                //editor.PrintAllowed = true;
                 editor.SaveAllowed = true;
                 editor.ShowDialog();
             }

+ 48 - 1
prs.desktop/Panels/Factory/FactoryPanel.xaml

@@ -4,8 +4,55 @@
              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
              xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
              mc:Ignorable="d"
-             d:DesignHeight="800" d:DesignWidth="1200">
+             d:DesignHeight="800" d:DesignWidth="1200"
+             xmlns:themes="clr-namespace:InABox.WPF.Themes;assembly=InABox.Wpf">
     <UserControl.Resources>
+        <Style x:Key="UnselectedButton" TargetType="Button">
+            <Setter Property="Margin" Value="0,0,2,0"/>
+            <Setter Property="Padding" Value="10,0,10,0"/>
+            <Setter Property="Background" Value="Gainsboro"/>
+            <Setter Property="TextBlock.TextAlignment" Value="Center" />
+            <Setter Property="Template">
+                <Setter.Value>
+                    <ControlTemplate TargetType="Button">
+                        <Border CornerRadius="5,5,0,0" 
+                                Background="Gainsboro" 
+                                BorderBrush="Black" 
+                                BorderThickness="0.75" >
+                            <ContentPresenter x:Name="contentPresenter" 
+                                              ContentTemplate="{TemplateBinding ContentTemplate}" 
+                                              Content="{TemplateBinding Content}" 
+                                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                                              Margin="{TemplateBinding Padding}" 
+                                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
+                        </Border>
+                    </ControlTemplate>
+                </Setter.Value>
+            </Setter>
+        </Style>
+        <Style x:Key="SelectedButton" TargetType="Button">
+            <Setter Property="Margin" Value="0,0,2,0"/>
+            <Setter Property="Padding" Value="10,0,10,0"/>
+            <Setter Property="Background" Value="{Binding Path=(themes:ThemeManager.SelectedTabItemBackgroundBrush)}"/>
+            <Setter Property="TextBlock.TextAlignment" Value="Center" />
+            <Setter Property="Template">
+                <Setter.Value>
+                    <ControlTemplate TargetType="Button">
+                        <Border CornerRadius="5,5,0,0" 
+                                Background="{Binding Path=(themes:ThemeManager.SelectedTabItemBackgroundBrush)}" 
+                                BorderBrush="Black" 
+                                BorderThickness="0.75" >
+                            <ContentPresenter x:Name="contentPresenter" 
+                                              ContentTemplate="{TemplateBinding ContentTemplate}" 
+                                              Content="{TemplateBinding Content}" 
+                                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                                              Margin="{TemplateBinding Padding}" 
+                                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
+                        </Border>
+                    </ControlTemplate>
+                </Setter.Value>
+            </Setter>
+        </Style>
     </UserControl.Resources>
 
     <Grid>

+ 1 - 1
prs.desktop/Panels/Factory/FactoryPanel.xaml.cs

@@ -561,7 +561,7 @@ namespace PRSDesktop
                     PDFEditor = new PDFEditorControl();
                     PDFEditor.LineColor = settings.LineColor;
                     PDFEditor.TextSize = settings.FontSize;
-                    PDFEditor.PrintAllowed = Security.IsAllowed<CanPrintFactoryFloorDrawings>();
+                    //PDFEditor.PrintAllowed = Security.IsAllowed<CanPrintFactoryFloorDrawings>();
                     PDFEditor.SaveAllowed = Security.IsAllowed<CanSaveFactoryFloorDrawings>();
                     var document = documents.FirstOrDefault(x => x.DocumentLink.ID.Equals(id));
                     PDFEditor.Watermark = packet.WaterMark;

+ 1 - 1
prs.desktop/Panels/Jobs/JobDesignDocumentGrid.cs

@@ -52,7 +52,7 @@ namespace PRSDesktop
         {
             var doc = row.ToObject<SetoutDocument>();
             var viewer = new DocumentEditor(doc);
-            viewer.PrintAllowed = Security.IsAllowed<CanPrintFactoryFloorDrawings>();
+            //viewer.PrintAllowed = Security.IsAllowed<CanPrintFactoryFloorDrawings>();
             viewer.SaveAllowed = Security.IsAllowed<CanSaveFactoryFloorDrawings>();
             viewer.ShowDialog();
             return false;

+ 1 - 1
prs.desktop/Panels/Manufacturing/ManufacturingPanelColumn.xaml.cs

@@ -222,7 +222,7 @@ namespace PRSDesktop
                 var table = new Client<SetoutDocument>().Query(new Filter<SetoutDocument>(x => x.EntityLink.ID).IsEqualTo(setoutid));
                 IEntityDocument[] docs = table.Rows.Select(r => r.ToObject<SetoutDocument>()).ToArray();
                 var viewer = new DocumentEditor(docs);
-                viewer.PrintAllowed = Security.IsAllowed<CanPrintFactoryFloorDrawings>();
+                //viewer.PrintAllowed = Security.IsAllowed<CanPrintFactoryFloorDrawings>();
                 viewer.SaveAllowed = Security.IsAllowed<CanSaveFactoryFloorDrawings>();
                 viewer.Watermark = row.Get<ManufacturingPacket, string>(x => x.WaterMark);
                 viewer.ShowDialog();

+ 1 - 1
prs.desktop/Panels/Products/Cost Sheets/CostSheetGrid.cs

@@ -62,7 +62,7 @@ internal class CostSheetGrid : DynamicDataGrid<CostSheet>
         if (docs.Any())
         {
             var editor = new DocumentEditor(docs.ToArray());
-            editor.PrintAllowed = Security.IsAllowed<CanPrintFactoryFloorDrawings>();
+            //editor.PrintAllowed = Security.IsAllowed<CanPrintFactoryFloorDrawings>();
             editor.SaveAllowed = Security.IsAllowed<CanSaveFactoryFloorDrawings>();
             editor.ShowDialog();
         }

+ 1 - 1
prs.desktop/Panels/Products/Locations/StockMovementGrid.cs

@@ -97,7 +97,7 @@ namespace PRSDesktop
             if (docs.Any())
             {
                 var editor = new DocumentEditor(docs.ToArray());
-                editor.PrintAllowed = Security.IsAllowed<CanPrintFactoryFloorDrawings>();
+                //editor.PrintAllowed = Security.IsAllowed<CanPrintFactoryFloorDrawings>();
                 editor.SaveAllowed = Security.IsAllowed<CanSaveFactoryFloorDrawings>();
                 editor.ShowDialog();
             }

+ 1 - 1
prs.desktop/Panels/Products/Master List/ProductDocumentGrid.cs

@@ -52,7 +52,7 @@ namespace PRSDesktop
         {
             var doc = row.ToObject<ProductDocument>();
             var viewer = new DocumentEditor(doc);
-            viewer.PrintAllowed = Security.IsAllowed<CanPrintFactoryFloorDrawings>();
+            //viewer.PrintAllowed = Security.IsAllowed<CanPrintFactoryFloorDrawings>();
             viewer.SaveAllowed = Security.IsAllowed<CanSaveFactoryFloorDrawings>();
             viewer.ShowDialog();
             return false;

+ 1 - 1
prs.desktop/Panels/Quotes/QuoteDocuments.cs

@@ -73,7 +73,7 @@ namespace PRSDesktop
             if (Path.GetExtension(filename).ToUpper().Equals(".PDF"))
             {
                 var viewer = new DocumentEditor(row.ToObject<QuoteDocument>());
-                viewer.PrintAllowed = true;
+                //viewer.PrintAllowed = true;
                 viewer.SaveAllowed = true;
                 viewer.ShowDialog();
             }

+ 1 - 1
prs.desktop/Panels/Requisitions/RequisitionGrid.cs

@@ -196,7 +196,7 @@ namespace PRSDesktop
             if (docs.Any())
             {
                 var editor = new DocumentEditor(docs.ToArray());
-                editor.PrintAllowed = Security.IsAllowed<CanPrintFactoryFloorDrawings>();
+                //editor.PrintAllowed = Security.IsAllowed<CanPrintFactoryFloorDrawings>();
                 editor.SaveAllowed = Security.IsAllowed<CanSaveFactoryFloorDrawings>();
                 editor.ShowDialog();
             }