예제 #1
0
        Func <PixelFarm.Drawing.GLES2.MyGLDrawBoard> _getDrawboard; //

        public MyRootGraphic(
            int width, int height)
            : base(width, height)
        {
            _gfxTimerTaskMx      = new GraphicsTimerTaskManager(this);
            _defaultTextEditFont = MyFontSettings.DefaultRootGraphicsFont;


#if DEBUG
            dbugCurrentGlobalVRoot = this;
            dbug_Init(null, null, null);
#endif

            //create default render box***
            _topWindowRenderBox = new TopWindowRenderBox(this, width, height);
            _topWindowEventRoot = new TopWindowEventRoot(this, _topWindowRenderBox);
            _gfxTimerTask       = this.SubscribeGraphicsIntervalTask(_normalUpdateTask,
                                                                     TaskIntervalPlan.Animation,
                                                                     20,
                                                                     (s, e) =>
            {
                this.PrepareRender();
                this.FlushAccumGraphics();
            });

            _primaryContainerElement = _topWindowRenderBox;
        }
예제 #2
0
        public MyRootGraphic(
            int width, int height,
            ITextService ifonts)
            : base(width, height)
        {
            this._ifonts             = ifonts;
            this.graphicTimerTaskMan = new GraphicsTimerTaskManager(this);
            _defaultTextEditFont     = new RequestFont("tahoma", 10);

#if DEBUG
            dbugCurrentGlobalVRoot = this;
            dbug_Init(null, null, null);
#endif

            //create default render box***
            this.topWindowRenderBox = new TopWindowRenderBox(this, width, height);
            this.topWindowEventRoot = new TopWindowEventRoot(this.topWindowRenderBox);
            this.SubscribeGraphicsIntervalTask(normalUpdateTask,
                                               TaskIntervalPlan.Animation,
                                               20,
                                               (s, e) =>
            {
                this.PrepareRender();
                this.FlushAccumGraphics();
            });
        }
예제 #3
0
        public MyRootGraphic(UIPlatform uiPlatform,
                             GraphicsPlatform gfxPlatform,
                             int width, int height)
            : base(width, height)
        {
            this.uiPlatform          = uiPlatform;
            this.graphicsPlatform    = gfxPlatform;
            this.graphicTimerTaskMan = new GraphicsTimerTaskManager(this, uiPlatform);
#if DEBUG
            dbugCurrentGlobalVRoot = this;
            dbug_Init();
#endif

            //create default render box***
            this.topWindowRenderBox = new TopWindowRenderBox(this, width, height);
            this.topWindowEventRoot = new TopWindowEventRoot(this.topWindowRenderBox);


            this.SubscribeGraphicsIntervalTask(normalUpdateTask,
                                               TaskIntervalPlan.Animation,
                                               20,
                                               (s, e) =>
            {
                this.PrepareRender();
                this.FlushAccumGraphics();
            });
        }
예제 #4
0
        public MyRootGraphic(UIPlatform uiPlatform, 
            int width, int height)
            : base(width, height)
        {
            this.uiPlatform = uiPlatform;
            
            this.graphicTimerTaskMan = new GraphicsTimerTaskManager(this, uiPlatform);
            _defaultTextEditFont = new RequestFont("tahoma", 10);

#if DEBUG
            dbugCurrentGlobalVRoot = this;
            dbug_Init(null, null, null);
#endif

            //create default render box***
            this.topWindowRenderBox = new TopWindowRenderBox(this, width, height);
            this.topWindowEventRoot = new TopWindowEventRoot(this.topWindowRenderBox);
            this.SubscribeGraphicsIntervalTask(normalUpdateTask,
                TaskIntervalPlan.Animation,
                20,
                (s, e) =>
                {
                    this.PrepareRender();
                    this.FlushAccumGraphics();
                });
        }
        void debug_RecordLineInfo(RenderBoxBase owner, EditableTextLine line)
        {
            RootGraphic visualroot = this.dbugVRoot;

            if (visualroot.dbug_RecordDrawingChain)
            {
            }
        }
예제 #6
0
 public void ShowMenu(RootGraphic rootgfx)
 {
     //add to topmost box
     if (!showing)
     {
         this.topWindow = rootgfx.TopWindowRenderBox;
         if (topWindow != null)
         {
             topWindow.AddChild(this.myRenderE = this.GetPrimaryRenderElement(topWindow.Root));
         }
         showing = true;
     }
 }
예제 #7
0
        internal override void UpdateCpuBlitSurface(Rectangle updateArea)
        {
            //_gdiDrawBoard.RenderSurface.Win32DC.SetClipRect(updateArea.X, updateArea.Y, updateArea.Width, updateArea.Height);
            //_gdiDrawBoard.RenderSurface.Win32DC.PatBlt(Win32.NativeWin32MemoryDC.PatBltColor.White);
            //_gdiDrawBoard.RenderSurface.Win32DC.ClearClipRect();
            //------------
            //update software part content
            RenderBoxBase primElem = base.CpuBlitCanvasRenderElement;

            if (HasCpuBlitUpdateSurfaceDel)
            {
                RaiseUpdateCpuBlitSurface(updateArea);
            }
        }
예제 #8
0
        void SetupHorizontalScrollButtonProperties(RenderBoxBase container)
        {
            var scroll_button = new ScrollBarButton(10, this.Height, this); //create with default value

            scroll_button.BackColor = KnownColors.FromKnownColor(KnownColor.DarkBlue);
            int thumbPosX = CalculateThumbPosition() + _minmax_boxHeight;

            scroll_button.SetLocation(thumbPosX, 0);
            container.AddChild(scroll_button);
            _scrollButton = scroll_button;
            //----------------------------

            EvaluateHorizontalScrollBarProperties();
            //----------------------------
            //3. drag


            scroll_button.MouseDrag += (s, e) =>
            {
                //dragging ...
                //find x-diff

                Point pos = scroll_button.Position;
                //if vscroll bar then move only y axis
                int newXPos = (int)(pos.X + e.DiffCapturedX);
                //clamp!
                if (newXPos >= this.Width - (_minmax_boxHeight + _scrollButton.Width))
                {
                    newXPos = this.Width - (_minmax_boxHeight + _scrollButton.Width);
                }
                else if (newXPos < _minmax_boxHeight)
                {
                    newXPos = _minmax_boxHeight;
                }

                //calculate value from position

                int currentMarkAt = (newXPos - _minmax_boxHeight);
                _scrollValue = (float)(_onePixelFor * currentMarkAt);
                newXPos      = CalculateThumbPosition() + _minmax_boxHeight;
                scroll_button.SetLocation(newXPos, pos.Y);
                //
                this.UserScroll?.Invoke(this, EventArgs.Empty);
                //
                e.StopPropagation();
            };
        }
예제 #9
0
        //
        void SetupMinButtonProperties(RenderBoxBase container)
        {
            ScrollBarButton min_button;

            if (this.ScrollBarType == ScrollBarType.Horizontal)
            {
                min_button = new ScrollBarButton(_minmax_boxHeight, this.Height, this);
            }
            else
            {
                min_button = new ScrollBarButton(this.Width, _minmax_boxHeight, this);
            }
            min_button.BackColor = KnownColors.FromKnownColor(KnownColor.DarkGray);
            min_button.MouseUp  += (s, e) => this.StepSmallToMin();
            container.AddChild(min_button);
            _minButton = min_button;
        }
        public override void TopDownReArrangeContent()
        {
            //vinv_IsInTopDownReArrangePhase = true;
#if DEBUG
            vinv_dbug_EnterLayerReArrangeContent(this);
#endif
            //this.BeginLayerLayoutUpdate();

            RenderBoxBase container = this.OwnerRenderElement as RenderBoxBase;
            if (container != null)
            {
                PerformHorizontalFlowArrange(0, container.Width, 0);
            }

            if (Reflow != null)
            {
                Reflow(this, EventArgs.Empty);
            }

            //this.EndLayerLayoutUpdate();
#if DEBUG
            vinv_dbug_ExitLayerReArrangeContent();
#endif
        }
 protected static void SetCalculatedSize(RenderBoxBase v, int w, int h)
 {
     v.b_width  = w;
     v.b_height = h;
     v.MarkHasValidCalculateSize();
 }
 void debug_RecordLineInfo(RenderBoxBase owner, EditableTextLine line)
 {
     RootGraphic visualroot = this.dbugVRoot;
     if (visualroot.dbug_RecordDrawingChain)
     {
     }
 }
예제 #13
0
 public void ShowMenu(RootGraphic rootgfx)
 {
     //add to topmost box 
     if (!showing)
     {
         this.topWindow = rootgfx.TopWindowRenderBox;
         if (topWindow != null)
         {
             topWindow.AddChild(this.myRenderE = this.GetPrimaryRenderElement(topWindow.Root));
         }
         showing = true;
     }
 }
예제 #14
0
 public static void AddChild(this RenderBoxBase renderBox, UIElement ui)
 {
     renderBox.AddChild(ui.GetPrimaryRenderElement());
 }
 protected static void SetCalculatedSize(RenderBoxBase v, int w, int h)
 {
     v.b_width = w;
     v.b_height = h;
     v.MarkHasValidCalculateSize();
 }