internal static ulong currentUid = 0;
internal ulong uid = 0;
+ internal bool isPopup = false;
+ internal GraphicObject focusParent {
+ get { return (isPopup ? LogicalParent : parent) as GraphicObject; }
+ }
+
/// <summary>
/// interface this widget is bound to, this should not be changed once the instance is created
/// </summary>
IsDragged = true;
//bubble event to the top
- GraphicObject p = Parent as GraphicObject;
+ GraphicObject p = focusParent;
if (p != null)
p.onMouseMove(sender,e);
}
}
//bubble event to the top
- GraphicObject p = Parent as GraphicObject;
+ GraphicObject p = focusParent;
if (p != null)
p.onMouseDown(sender,e);
}
//bubble event to the top
- GraphicObject p = Parent as GraphicObject;
+ GraphicObject p = focusParent;
if (p != null)
p.onMouseUp(sender,e);
}
}
public virtual void onMouseClick(object sender, MouseButtonEventArgs e){
- GraphicObject p = Parent as GraphicObject;
+ GraphicObject p = focusParent;
if (p != null)
p.onMouseClick(sender,e);
MouseClick.Raise (this, e);
}
public virtual void onMouseDoubleClick(object sender, MouseButtonEventArgs e){
- GraphicObject p = Parent as GraphicObject;
+ GraphicObject p = focusParent;
if (p != null)
p.onMouseDoubleClick(sender,e);
MouseDoubleClick.Raise (this, e);
}
public virtual void onMouseWheel(object sender, MouseWheelEventArgs e){
- GraphicObject p = Parent as GraphicObject;
+ GraphicObject p = focusParent;
if (p != null)
p.onMouseWheel(sender,e);
get { return _isPopped; }
set
{
+ if (!_canPop & value)
+ return;
+
if (value == _isPopped)
return;
_isPopped = value;
+
NotifyValueChanged ("IsPopped", _isPopped);
if (_isPopped)
set {
if (_content != null) {
_content.LogicalParent = null;
+ _content.isPopup = false;
_content.LayoutChanged -= _content_LayoutChanged;
}
return;
_content.LogicalParent = this;
+ _content.isPopup = true;
_content.HorizontalAlignment = HorizontalAlignment.Left;
_content.VerticalAlignment = VerticalAlignment.Top;
_content.LayoutChanged += _content_LayoutChanged;
}
#region GraphicObject overrides
- public override void onMouseClick (object sender, MouseButtonEventArgs e)
- {
- if (_canPop)
- IsPopped = !IsPopped;
- base.onMouseClick (this, e);
- }
public override void onMouseLeave (object sender, MouseMoveEventArgs e)
{
base.onMouseLeave (this, e);
FontRenderingOptions = new FontOptions ();
FontRenderingOptions.Antialias = Antialias.Subpixel;
FontRenderingOptions.HintMetrics = HintMetrics.On;
- FontRenderingOptions.HintStyle = HintStyle.Medium;
+ FontRenderingOptions.HintStyle = HintStyle.Full;
FontRenderingOptions.SubpixelOrder = SubpixelOrder.Rgb;
}
public Interface(){
if (idxhw != 0) {
int i = 0;
while (i < idxhw) {
- if (GraphicTree [i].localLogicalParentIsNull) {
+ if (!GraphicTree [i].isPopup) {
if (GraphicTree [i].MouseIsIn (e.Position)) {
while (HoverWidget != null) {
HoverWidget.onMouseLeave (HoverWidget, e);
- HoverWidget = HoverWidget.LogicalParent as GraphicObject;
+ HoverWidget = HoverWidget.focusParent;
}
GraphicTree [i].checkHoverWidget (e);
} else {
HoverWidget.onMouseLeave (HoverWidget, e);
//seek upward from last focused graph obj's
- while (HoverWidget.LogicalParent as GraphicObject != null) {
- HoverWidget = HoverWidget.LogicalParent as GraphicObject;
+ while (HoverWidget.focusParent != null) {
+ HoverWidget = HoverWidget.focusParent;
if (HoverWidget.MouseIsIn (e.Position)) {
HoverWidget.checkHoverWidget (e);
HoverWidget.onMouseMove (this, e);
this.AddWidget (ctxMenuContainer);
else
ctxMenuContainer.IsOpened = true;
-
+
+ ctxMenuContainer.isPopup = true;
ctxMenuContainer.LogicalParent = go;
ctxMenuContainer.DataSource = go;