Beispiel #1
0
        public override void ConfigureEditor(IEditor editor)
        {
            var facade = MemopadApplication.Instance;

            var editorHandle = new DefaultEditorHandle();

            editorHandle.KeyMap = facade.KeySchema.MemoContentEditorKeyMap;
            editor.InstallEditorHandle(editorHandle);

            editor.InstallHandle(
                new MemoTableRuledLineHandle(() => Figure),
                HandleStickyKind.Always
                );
            editor.InstallHandle(
                new MemoTableFrameHandle(),
                HandleStickyKind.SelectedIncludingChildren
                );

            editor.InstallRole(new ContainerRole());
            editor.InstallRole(new ResizeRole());
            editor.InstallRole(new RemoveRole());
            editor.InstallRole(new CopyRole());
            editor.InstallRole(new ChangeRowHeightRole());
            editor.InstallRole(new ChangeColumnWidthRole());

            var export = new ExportRole();

            export.RegisterExporter("Csv", ExportCsvFile);
            editor.InstallRole(export);
        }
        public override void ConfigureEditor(IEditor editor)
        {
            var editorHandle = new MemoTextEditorHandle();
            var app          = MemopadApplication.Instance;

            editorHandle.KeyMap = app.KeySchema.MemoContentEditorKeyMap;
            editor.InstallEditorHandle(editorHandle);

            //var brush = new SolidBrushDescription(Color.WhiteSmoke);
            var brush = new GradientBrushDescription(Color.FromArgb(250, 250, 250), Color.FromArgb(235, 235, 235), 90);
            var color = Color.FromArgb(200, 200, 200); /// SilverとGainsboroの間
            var frame = new MemoTextFrameHandle(0, 1, new Size(8, 9), color, color, brush);

            editor.InstallHandle(frame, GetHandleStickyKindSetting());

            editor.InstallRole(new SelectRole());
            editor.InstallRole(new FocusRole(InitFocus, CommitFocus));
            editor.InstallRole(new MemoTextResizeRole());
            editor.InstallRole(new RemoveRole());
            editor.InstallRole(new CopyRole());
            editor.InstallRole(new ReorderRole());
            editor.InstallRole(new DropTextRole());
            editor.InstallRole(new SetStyledTextFontRole(() => Model.StyledText, FontModificationKinds.All));
            editor.InstallRole(new SetStyledTextColorRole(() => Model.StyledText));
            editor.InstallRole(new SetStyledTextAlignmentRole(() => Model.StyledText, AlignmentModificationKinds.Horizontal));
            editor.InstallRole(new SetStyledTextListKindRole(() => Model.StyledText));
            editor.InstallRole(new CombineRole(CanCombine, Combine));

            var export = new ExportRole();

            export.RegisterExporter("Html", ExportHtmlFile);
            export.RegisterExporter("Text", ExportTextFile);
            editor.InstallRole(export);

            InitEditorFocus(editor);

            Figure.ShowLineBreak  = app.WindowSettings.ShowLineBreak;
            Figure.ShowBlockBreak = app.WindowSettings.ShowBlockBreak;
        }
Beispiel #3
0
        // ========================================
        // method
        // ========================================
        public override void ConfigureEditor(IEditor editor)
        {
            var editorHandle = new MemoFileEditorHandle()
            {
                Cursor = Cursors.SizeAll
            };
            var facade = MemopadApplication.Instance;

            editorHandle.KeyMap = facade.KeySchema.MemoContentEditorKeyMap;
            editor.InstallEditorHandle(editorHandle);

            editor.InstallHandle(new SelectionIndicatingHandle());

            editor.InstallRole(new SelectRole());
            editor.InstallRole(new MoveRole());
            editor.InstallRole(new RemoveRole());
            editor.InstallRole(new ReorderRole());
            editor.InstallRole(new CopyRole());

            var export = new ExportRole();

            export.RegisterExporter("File", ExportFile);
            editor.InstallRole(export);
        }
Beispiel #4
0
        // ========================================
        // method
        // ========================================
        public override void ConfigureEditor(IEditor editor)
        {
            var editorHandle = new MoveEditorHandle()
            {
                Cursor = Cursors.SizeAll
            };
            var facade = MemopadApplication.Instance;

            editorHandle.KeyMap = facade.KeySchema.MemoContentEditorKeyMap;
            editor.InstallEditorHandle(editorHandle);

            editor.InstallHandle(
                new ResizeHandle(Directions.Left)
            {
                Cursor = Cursors.SizeWE
            }
                );
            editor.InstallHandle(
                new ResizeHandle(Directions.Up)
            {
                Cursor = Cursors.SizeNS
            }
                );
            editor.InstallHandle(
                new ResizeHandle(Directions.Right)
            {
                Cursor = Cursors.SizeWE
            }
                );
            editor.InstallHandle(
                new ResizeHandle(Directions.Down)
            {
                Cursor = Cursors.SizeNS
            }
                );
            editor.InstallHandle(
                new ResizeHandle(Directions.UpLeft)
            {
                Cursor = Cursors.SizeNWSE
            }
                );
            editor.InstallHandle(
                new ResizeHandle(Directions.UpRight)
            {
                Cursor = Cursors.SizeNESW
            }
                );
            editor.InstallHandle(
                new ResizeHandle(Directions.DownLeft)
            {
                Cursor = Cursors.SizeNESW
            }
                );
            editor.InstallHandle(
                new ResizeHandle(Directions.DownRight)
            {
                Cursor = Cursors.SizeNWSE
            }
                );

            editor.InstallRole(new SelectRole());
            editor.InstallRole(new ResizeRole());
            editor.InstallRole(new RemoveRole());
            editor.InstallRole(new CopyRole());
            editor.InstallRole(new ReorderRole());

            var export = new ExportRole();

            export.RegisterExporter("PNG", ExportPngFile);
            export.RegisterExporter("JPEG", ExportJpegFile);
            editor.InstallRole(export);
        }