You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+
using System;
using System.Text;
using System.ComponentModel;
{
EditView View;
Controller _Controller;
+#if !DUMMY_RENDER
D2DRender Render;
+#else
+ DummyRender Render;
+#endif
ScrollBar horizontalScrollBar, verticalScrollBar;
Windows.UI.Xaml.Shapes.Rectangle rectangle;
GestureRecognizer gestureRecongnizer = new GestureRecognizer();
this.rectangle = new Windows.UI.Xaml.Shapes.Rectangle();
this.rectangle.Margin = this.Padding;
+#if !DUMMY_RENDER
this.Render = new D2DRender(this,this.rectangle);
+#else
+ this.Render = new DummyRender();
+#endif
this.Document = new Document();
/// <inheritdoc/>
public static void OnPropertyChanged(object sender, DependencyPropertyChangedEventArgs e)
{
-#if !DUMMY_RENDER
FooTextBox source = (FooTextBox)sender;
if(e.Property.Equals(SelectedTextProperty) && !source.nowCaretMove)
source._Controller.SelectedText = source.SelectedText;
source.SetDocument(source.Document);
if(e.Property.Equals(HilighterProperty))
source.View.Hilighter = source.Hilighter;
- if (e.Property.Equals(TextAntialiasModeProperty))
- source.Render.TextAntialiasMode = source.TextAntialiasMode;
if (e.Property.Equals(FoldingStrategyProperty))
source.View.LayoutLines.FoldingStrategy = source.FoldingStrategy;
if (e.Property.Equals(IndentModeProperty))
source.View.HideLineMarker = !source.DrawCaretLine;
if (e.Property.Equals(DrawLineNumberProperty))
source.Document.DrawLineNumber = source.DrawLineNumber;
+ if (e.Property.Equals(MarkURLProperty))
+ source.Document.UrlMark = source.MarkURL;
+ if (e.Property.Equals(LineBreakProperty))
+ source.Document.LineBreak = source.LineBreakMethod;
+ if (e.Property.Equals(LineBreakCharCountProperty))
+ source.Document.LineBreakCharCount = source.LineBreakCharCount;
+ if (e.Property.Equals(FlowDirectionProperty))
+ {
+ source.Document.RightToLeft = source.FlowDirection == Windows.UI.Xaml.FlowDirection.RightToLeft;
+ if (source.horizontalScrollBar != null)
+ source.horizontalScrollBar.FlowDirection = source.FlowDirection;
+ }
+ if (e.Property.Equals(DrawRulerProperty))
+ {
+ source.Document.HideRuler = !source.DrawRuler;
+ source._Controller.JumpCaret(source.Document.CaretPostion.row, source.Document.CaretPostion.col);
+ }
+#if !DUMMY_RENDER
+ if (e.Property.Equals(TextAntialiasModeProperty))
+ source.Render.TextAntialiasMode = source.TextAntialiasMode;
if(e.Property.Equals(MagnificationPowerPropertyKey))
source.Render.FontSize = source.FontSize * source.MagnificationPower;
if (e.Property.Equals(FontFamilyProperty))
source.View.Padding = new Padding((int)source.Padding.Left, (int)source.Padding.Top, (int)source.Padding.Right, (int)source.Padding.Bottom);
if (e.Property.Equals(LineMarkerProperty))
source.Render.LineMarker = D2DRenderBase.ToColor4(source.LineMarker);
- if (e.Property.Equals(MarkURLProperty))
- source.Document.UrlMark = source.MarkURL;
if (e.Property.Equals(ShowFullSpaceProperty))
source.Render.ShowFullSpace = source.ShowFullSpace;
if (e.Property.Equals(ShowHalfSpaceProperty))
source.Render.ShowTab = source.ShowTab;
if (e.Property.Equals(ShowLineBreakProperty))
source.Render.ShowLineBreak = source.ShowLineBreak;
- if (e.Property.Equals(LineBreakProperty))
- source.Document.LineBreak = source.LineBreakMethod;
- if (e.Property.Equals(LineBreakCharCountProperty))
- source.Document.LineBreakCharCount = source.LineBreakCharCount;
if (e.Property.Equals(UpdateAreaProperty))
source.Render.UpdateArea = D2DRenderBase.ToColor4(source.UpdateArea);
if (e.Property.Equals(LineNumberProperty))
source.Render.LineNumber = D2DRenderBase.ToColor4(source.LineNumber);
- if (e.Property.Equals(FlowDirectionProperty))
- {
- source.Document.RightToLeft = source.FlowDirection == Windows.UI.Xaml.FlowDirection.RightToLeft;
- if(source.horizontalScrollBar != null)
- source.horizontalScrollBar.FlowDirection = source.FlowDirection;
- }
- if (e.Property.Equals(DrawRulerProperty))
- {
- source.Document.HideRuler = !source.DrawRuler;
- source._Controller.JumpCaret(source.Document.CaretPostion.row, source.Document.CaretPostion.col);
- }
#endif
}
-#endregion
+ #endregion
-#region event
+ #region event
/// <summary>
/// コンテキストメニューが表示されるときに呼び出されます