|
@@ -40,15 +40,19 @@ namespace compdfkit_tools.Form.Property
|
|
|
private WidgetTextBoxArgs widgetArgs = null;
|
|
|
private AnnotAttribEvent annotAttribEvent = null;
|
|
|
public ObservableCollection<int> SizeList { get; set; } = new ObservableCollection<int>
|
|
|
- {
|
|
|
+ {
|
|
|
6,8,9,10,12,14,18,20,24,26,28,32,30,32,48,72
|
|
|
};
|
|
|
|
|
|
+ bool IsLoadedData = false;
|
|
|
|
|
|
public TextFieldProperty()
|
|
|
{
|
|
|
InitializeComponent();
|
|
|
}
|
|
|
+
|
|
|
+ #region Loaded
|
|
|
+
|
|
|
public void SetProperty(WidgetArgs Args, AnnotAttribEvent e)
|
|
|
{
|
|
|
widgetArgs = (WidgetTextBoxArgs)Args;
|
|
@@ -62,7 +66,6 @@ namespace compdfkit_tools.Form.Property
|
|
|
SizeListbinding.Path = new System.Windows.PropertyPath("SizeList");
|
|
|
FontSizeCombox.SetBinding(ComboBox.ItemsSourceProperty, SizeListbinding);
|
|
|
|
|
|
-
|
|
|
FieldNameText.Text = widgetArgs.FieldName;
|
|
|
FormFieldCombox.SelectedIndex = (int)widgetArgs.FormField;
|
|
|
SetColor(BorderColorPickerControl, widgetArgs.LineColor);
|
|
@@ -72,9 +75,9 @@ namespace compdfkit_tools.Form.Property
|
|
|
SetFontStyle(widgetArgs.IsItalic, widgetArgs.IsBold);
|
|
|
SetFontSize(widgetArgs.FontSize);
|
|
|
TextAlignmentCombox.SelectedIndex = (int)widgetArgs.Alignment;
|
|
|
- DefaultText.Text=widgetArgs.Text;
|
|
|
+ DefaultText.Text = widgetArgs.Text;
|
|
|
chkMutiline.IsChecked = widgetArgs.IsMultiLine;
|
|
|
-
|
|
|
+ IsLoadedData = true;
|
|
|
}
|
|
|
|
|
|
private void SetFontSize(double size)
|
|
@@ -134,5 +137,20 @@ namespace compdfkit_tools.Form.Property
|
|
|
Control.SetIsChecked(index);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ #endregion
|
|
|
+ private void FieldNameText_TextChanged(object sender, TextChangedEventArgs e)
|
|
|
+ {
|
|
|
+ if (IsLoadedData)
|
|
|
+ {
|
|
|
+ annotAttribEvent.UpdateAttrib(AnnotAttrib.FieldName, (sender as TextBox).Text);
|
|
|
+ annotAttribEvent.UpdateAnnot();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void UserControl_Unloaded(object sender, RoutedEventArgs e)
|
|
|
+ {
|
|
|
+ IsLoadedData = false;
|
|
|
+ }
|
|
|
}
|
|
|
}
|