/// <summary> /// 绘制背景方法 /// </summary> /// <param name="paint">绘图对象</param> /// <param name="clipRect">裁剪区域</param> public override void onPaintBackground(FCPaint paint, FCRect clipRect) { base.onPaintBackground(paint, clipRect); if (paint.supportTransparent()) { ArrayList <FCView> controls = m_controls; int controlsSize = controls.size(); for (int i = 0; i < controlsSize; i++) { FCWindow window = controls.get(i) as FCWindow; if (window != null) { long shadowColor = window.ShadowColor; int shadowSize = window.ShadowSize; if (shadowColor != FCColor.None && shadowSize > 0 && window.IsDialog && window.Frame == this) { FCRect bounds = window.Bounds; FCRect leftShadow = new FCRect(bounds.left - shadowSize, bounds.top - shadowSize, bounds.left, bounds.bottom + shadowSize); paint.fillRect(shadowColor, leftShadow); FCRect rightShadow = new FCRect(bounds.right, bounds.top - shadowSize, bounds.right + shadowSize, bounds.bottom + shadowSize); paint.fillRect(shadowColor, rightShadow); FCRect topShadow = new FCRect(bounds.left, bounds.top - shadowSize, bounds.right, bounds.top); paint.fillRect(shadowColor, topShadow); FCRect bottomShadow = new FCRect(bounds.left, bounds.bottom, bounds.right, bounds.bottom + shadowSize); paint.fillRect(shadowColor, bottomShadow); break; } } } } }
/// <summary> /// 创建控件 /// </summary> /// <param name="node">节点</param> /// <param name="type">类型</param> /// <returns>控件</returns> public override FCView createControl(XmlNode node, String type) { FCNative native = Native; if (type == "ribbonbutton") { return(new RibbonButton()); } //透明按钮2 else if (type == "ribbonbutton2") { return(new RibbonButton2()); } else if (type == "propertygrid") { PropertyGrid propertyGrid = new PropertyGrid(); return(propertyGrid); } else if (type == "windowex") { FCWindow window = new FCWindow(); window.Native = Native; window.show(); return(window); } else { return(base.createControl(node, type)); } }
/// <summary> /// 重绘方法 /// </summary> public override void invalidate() { if (m_native != null) { ArrayList <FCView> controls = m_controls; int controlsSize = controls.size(); for (int i = 0; i < controlsSize; i++) { FCWindow window = controls.get(i) as FCWindow; if (window != null) { m_native.invalidate(window.getDynamicPaintRect()); break; } } } }
/// <summary> /// 是否包含坐标 /// </summary> /// <param name="point">坐标</param> /// <returns>是否包含</returns> public override bool containsPoint(FCPoint point) { ArrayList <FCView> controls = m_controls; int controlsSize = controls.size(); for (int i = 0; i < controlsSize; i++) { FCWindow window = controls.get(i) as FCWindow; if (window != null && window.Frame == this) { if (window.IsDialog) { return(true); } else { return(window.containsPoint(point)); } } } return(false); }