Пример #1
0
                public EditableHeader(CreateParams parentParams, XmlReader reader) : base(parentParams, reader)
                {
                    ParentEditingCanvas = null;

                    // create our textbox that will display the text being edited.
                    EditMode_TextBox_Title        = new EditModeTextBox( );
                    EditMode_TextBox_Title.KeyUp += EditMode_TextBox_KeyUp;

                    EditMode_TextBox_Speaker        = new EditModeTextBox( );
                    EditMode_TextBox_Speaker.KeyUp += EditMode_TextBox_KeyUp;

                    EditMode_TextBox_Date        = new EditModeTextBox( );
                    EditMode_TextBox_Date.KeyUp += EditMode_TextBox_KeyUp;

                    ParentNote = parentParams.Parent as Note;

                    // take the max width / height we'll be allowed to fit in (and because it's the header, ignore note padding)
                    ParentSize = new SizeF(parentParams.Width, parentParams.Height);

                    // get our margin / padding
                    // note - declare a temp margin on the stack that we'll throw out. We store this in our BaseControl.
                    RectangleF tempMargin;
                    RectangleF tempBounds = new RectangleF( );

                    GetMarginsAndPadding(ref mStyle, ref ParentSize, ref tempBounds, out tempMargin, out Padding);
                    ApplyImmediateMargins(ref tempBounds, ref tempMargin, ref ParentSize);

                    if (mStyle.mBorderWidth.HasValue)
                    {
                        BorderView.BorderWidth = mStyle.mBorderWidth.Value;
                        BorderPaddingPx        = (int)Rock.Mobile.Graphics.Util.UnitToPx(mStyle.mBorderWidth.Value + PrivateNoteConfig.BorderPadding);
                    }

                    OrigBackgroundColor = BorderView.BackgroundColor;
                }
Пример #2
0
                public EditableParagraph(CreateParams parentParams, XmlReader reader) : base(parentParams, reader)
                {
                    ParentEditingCanvas = null;

                    // create our textbox that will display the text being edited.
                    EditMode_TextBox        = new EditModeTextBox( );
                    EditMode_TextBox.KeyUp += EditMode_TextBox_KeyUp;

                    EditMode_TextBox_Url        = new EditModeTextBox( );
                    EditMode_TextBox_Url.KeyUp += EditMode_TextBox_KeyUp;

                    // this will be null if the parent is the actual note
                    ParentNote = parentParams.Parent as Note;

                    // take the max width / height we'll be allowed to fit in (restore the padding, since we actively remove it when dragging / exporting)
                    ParentSize = new SizeF(parentParams.Width + ParentNote.Padding.Left + ParentNote.Padding.Right, parentParams.Height);

                    // get our margin / padding
                    // note - declare a temp margin on the stack that we'll throw out. We store this in our BaseControl.
                    RectangleF tempMargin;
                    RectangleF tempBounds = new RectangleF( );

                    GetMarginsAndPadding(ref mStyle, ref ParentSize, ref tempBounds, out tempMargin, out Padding);
                    ApplyImmediateMargins(ref tempBounds, ref tempMargin, ref ParentSize);

                    OrigBackgroundColor = BorderView.BackgroundColor;
                }
Пример #3
0
                public EditableQuote(CreateParams parentParams, XmlReader reader) : base(parentParams, reader)
                {
                    ParentEditingCanvas = null;

                    // create our textbox that will display the text being edited.
                    EditMode_TextBox_Quote = new EditModeTextBox( );
                    EditMode_TextBox_Quote.TextWrapping = System.Windows.TextWrapping.Wrap;
                    EditMode_TextBox_Quote.KeyUp       += EditMode_TextBox_KeyUp;

                    EditMode_TextBox_Citation        = new EditModeTextBox( );
                    EditMode_TextBox_Citation.KeyUp += EditMode_TextBox_KeyUp;

                    EditMode_TextBox_Url        = new EditModeTextBox( );
                    EditMode_TextBox_Url.KeyUp += EditMode_TextBox_KeyUp;

                    // this will be null if the parent is the actual note
                    ParentNote = parentParams.Parent as Note;

                    // take the max width / height we'll be allowed to fit in (restore the padding, since we actively remove it when dragging / exporting)
                    ParentSize = new SizeF(parentParams.Width + ParentNote.Padding.Left + ParentNote.Padding.Right, parentParams.Height);

                    // get our margin / padding
                    // note - declare a temp margin on the stack that we'll throw out. We store this in our BaseControl.
                    RectangleF tempMargin;
                    RectangleF tempBounds = new RectangleF( );

                    GetMarginsAndPadding(ref mStyle, ref ParentSize, ref tempBounds, out tempMargin, out Padding);
                    ApplyImmediateMargins(ref tempBounds, ref tempMargin, ref ParentSize);

                    if (mStyle.mBorderWidth.HasValue)
                    {
                        BorderView.BorderWidth = mStyle.mBorderWidth.Value;
                        BorderPaddingPx        = (int)Rock.Mobile.Graphics.Util.UnitToPx(mStyle.mBorderWidth.Value + PrivateNoteConfig.BorderPadding);
                    }

                    OrigBackgroundColor = BorderView.BackgroundColor;
                }