//============================================================ // <T>开始绘制处理。</T> // // @param args 参数 //============================================================ public void Draw(SUiDrawArgs args) { FDxContext2d context = _context.Context; context.TransformIdentity(); // 计算坐标 _location.Assign(_control.CalculateDisplayPosition()); _size.Assign(_control.CalculateDisplaySize()); // 绘制选择区域 if (_designSelect) { // 绘制底版 context.FillRectangle(_selectBackColor.brush, _location.X, _location.Y, _size.Width, _size.Height); // 绘制边线 context.DrawRectangle(_selectForeColor.brush, _location.X, _location.Y, _size.Width, _size.Height); } // 绘制辅助点区域 if (_designFocus) { CalculatePoints(); foreach (SUiControlPoint point in _points) { DrawPoint(point); } } }
//============================================================ // <T>开始绘制处理。</T> // // @param args 参数 //============================================================ public override void OnDrawBegin(SUiDrawArgs args) { base.OnDrawBegin(args); // 绘制处理 if (TestVisible()) { // 绘制背景资源 DrawResource(_groundResource); } }
//============================================================ // <T>绘制处理。</T> // // @param sender 发送者 // @param e:event 事件 //============================================================ public void Paint() { // 检查设置 if (!_setuped) { return; } // 获得设备 FDxDevice2d device = _context.Device; FDxContext2d context = _context.Context; context.TransformIdentity(); // 开始绘制 device.BeginDraw(); // 清空目标 context.Clear(); // 填充背景 if (_designBack) { context.FillRectangle(_designBackBrush.brush, 0, 0, _size.Width, _size.Height); } else { context.FillRectangle(_backBrush, 0, 0, _size.Width, _size.Height); } // 绘制预览层 DrawPreviewLayers(); // 绘制表单 SUiDrawArgs args = new SUiDrawArgs(); args.Context = context; if (_designFrame.DesignVisible) { // 绘制表单 context.TransformIdentity(); _designFrame.Draw(args); // 绘制下拉部分 if (args.DropControl != null) { context.TransformIdentity(); args.DropControl.Draw(args); } } // 绘制辅助器 if (_selection.HasFocusControl()) { // 绘制辅助线 DrawAidLines(); // 绘制辅助器 _designFrame.DrawDesign(args); } // 结束绘制 device.EndDraw(); }
//============================================================ // <T>绘制处理。</T> // // @param args 参数 //============================================================ public override void Draw(SUiDrawArgs args) { // 设置数据 bool visible = TestVisible(); SIntPoint2 position = CalculatePosition(); args.Position.Assign(position); // 计算数据 _designLocation.Assign(CalculateDisplayPosition()); _designSize.Assign(CalculateDisplaySize()); // 开始层处理 _deviceLayer.Begin(_designLocation.X, _designLocation.Y, _designSize.Width, _designSize.Height); // 检查可见性 if (visible) { OnDrawBegin(args); } //............................................................ // 子控件测试 if (_activePage != null) { // 绘制分页 _activePage.Draw(args); // 绘制节点 if (_components != null) { foreach (FUiComponent componment in _components) { FUiControl control = componment as FUiControl; if (control == null) { continue; } if (control is FUiPage) { continue; } control.Draw(args); } } } //............................................................ // 结束绘制 if (visible) { _context.Context.TransformLocation(_designLocation.X, _designLocation.Y); OnDrawAfter(args); } // 结束层处理 _deviceLayer.End(); }
//============================================================ // <T>开始绘制处理。</T> // // @param args 参数 //============================================================ public override void OnDrawBegin(SUiDrawArgs args) { base.OnDrawBegin(args); // 绘制文本 string label = ControlResource.Label; SIntSize2 size = ControlResource.Size; if (!RString.IsEmpty(label)) { FDxTextFormat labelFormat = _context.DefaultTextFormat; labelFormat.AlignmentCd = EDxTextAlignment.Leading; labelFormat.ParagraphAlignmentCd = EDxParagraphAlignment.Center; _context.Context.DrawText(label, _context.DefaultTextFormat, EditResource.Font.Color, new SIntRectangle(0, 0, size.Width, size.Height)); } }
//============================================================ // <T>开始绘制处理。</T> // // @param args 参数 //============================================================ public override void OnDrawBegin(SUiDrawArgs args) { base.OnDrawBegin(args); // 绘制处理 if (TestVisible()) { // 绘制背景资源 DrawResource(_groundResource); } // 绘制文本 FRcButton resource = ButtonResource; string text = resource.FormatDisplay(); if (!RString.IsEmpty(text)) { SIntSize2 size = resource.Size; FDxTextFormat labelFormat = _context.DefaultTextFormat; labelFormat.AlignmentCd = EDxTextAlignment.Center; labelFormat.ParagraphAlignmentCd = EDxParagraphAlignment.Center; _context.Context.DrawText(text, _context.DefaultTextFormat, resource.Font.Color, new SIntRectangle(0, 0, size.Width, size.Height)); } }
//============================================================ // <T>开始绘制处理。</T> // // @param args 参数 //============================================================ public override void OnDrawBegin(SUiDrawArgs args) { base.OnDrawBegin(args); // 绘制处理 if (TestVisible()) { // 绘制背景资源 DrawResource(_groundResource); } _context.Context.FillRectangle(0x7F888800, 2, 2, _designSize.Width - 4, 24); // 绘制文本 FRcWindow resource = WindowResource; string text = resource.Label; if (!RString.IsEmpty(text)) { SIntSize2 size = resource.Size; FDxTextFormat labelFormat = _context.DefaultTextFormat; labelFormat.AlignmentCd = EDxTextAlignment.Center; labelFormat.ParagraphAlignmentCd = EDxParagraphAlignment.Center; _context.Context.DrawText(text, _context.DefaultTextFormat, 0, new SIntRectangle(0, 0, size.Width, size.Height)); } }
//============================================================ // <T>开始绘制处理。</T> // // @param args 参数 //============================================================ public override void OnDrawBegin(SUiDrawArgs args) { base.OnDrawBegin(args); }
//============================================================ // <T>结束绘制处理。</T> // // @param args 参数 //============================================================ public override void OnDrawAfter(SUiDrawArgs args) { base.OnDrawAfter(args); }
//============================================================ // <T>开始绘制处理。</T> // // @param args 参数 //============================================================ public override void OnDrawBegin(SUiDrawArgs args) { base.OnDrawBegin(args); // 绘制背景 //DrawResource(_groundResource); }