Пример #1
0
        public static ItemCanvas CreateItemCanvas(this WindowScreenContent ScreenContent,
                                                  ItemCanvas ParentItemCanvas, MasterThread MasterThread,
                                                  PaintThread PaintThread)
        {
            // create the canvas to drawn upon.
            var rv = ScreenContent.CreateWindowedItemCanvas(
                ParentItemCanvas, ParentItemCanvas.CanvasDefn.FontDefn.PointSize,
                MasterThread, PaintThread, ScreenContent.ContentNum);
            var border     = rv.Item1;
            var itemCanvas = rv.Item2;

            itemCanvas.ContentStart = ScreenContent.StartCharPoint;

            // add the canvas control ( actually the border control that contains the
            // canvas ) to the parent canvas.
            var canvasPos = ParentItemCanvas.AddItemToCanvas(
                ScreenContent.StartRowCol, itemCanvas.BorderControl);

            ScreenContent.WindowPos = canvasPos;

            ParentItemCanvas.RemoveCaret();
            itemCanvas.SetFocus();
            itemCanvas.HookBorderDrag();

            return(itemCanvas);
        }