Height = Fit;
Width = Fit;
Background = Transparent;
- MouseEnter = {Background = Mantis;Foreground=Jet;}
- MouseLeave = {Background=Transparent;Foreground=LightGray;};
+ Foreground = LightGray;
}
MessageBox {
Width=200;
<?xml version="1.0"?>
<Popper Caption="{./Caption}" Background="{./Background}" PopDirection="{./PopDirection}"
Foreground = "{./Foreground}" CanPop="{./HasChildren}" MouseClick="./onMI_Click"
- Unpop = "{Foreground=LightGray;Background=Transparent}">
+ Unpop = "{Foreground=LightGray;Background=Transparent}"
+ Pop = "{Background = Mantis;Foreground=Jet}"
+ >
<Template>
- <Label Text="{./Caption}"
- MinimumSize = "120,0"
- Margin="3" TextAlignment="Left"
- Height="{./HeightPolicy}" Width="{./WidthPolicy}"
- Font="{./Font}"
- Background="{./Background}"
- Foreground="{./Foreground}"/>
+ <Border Name="border1"
+ MouseEnter="{Foreground=vgradient|0:White|0.2:Gray|0.9:Gray|1:Black}"
+ MouseLeave="{Foreground=Transparent}"
+ MouseDown="{Foreground=vgradient|0:Black|0.05:Gray|0.85:Gray|1:White}"
+ MouseUp="{Foreground=vgradient|0:White|0.2:Gray|0.9:Gray|1:Black}"
+ Height="{./HeightPolicy}" Width="{./WidthPolicy}"
+ MinimumSize = "60,0"
+ Foreground="Transparent"
+ Background="{./Background}">
+ <Label Text="{./Caption}"
+ Foreground="{./Foreground}"
+ Margin="3" HorizontalAlignment="Left"
+ Font="{./Font}" />
+ </Border>
</Template>
<Border Foreground="DimGray" Fit="true">
<VerticalStack Name="ItemsContainer" Margin="2" Fit="true" Background="Onyx"/>
/// This size is computed on each child' layout changes.
/// In stacking widget, it is used to compute the remaining space for the stretched
/// widget inside the stack, which is never added to the contentSize, instead, its size
- /// is deducted from (parent.ClientRectangle - contentSize)
+ /// is deducted from (parent.ClientRectangle - contentSize)
/// </summary>
internal Size contentSize;
#endregion
if (string.IsNullOrEmpty (styleKey))
styleKey = thisType.FullName;
-
+
//Reflexion being very slow compared to dyn method or delegates,
//I compile the initial values coded in the CustomAttribs of the class,
//all other instance of this type would not longer use reflexion to init properly
if (Interface.clickTimer.ElapsedMilliseconds > 0 &&
Interface.clickTimer.ElapsedMilliseconds < Interface.DoubleClick) {
Interface.clickTimer.Reset ();
- Debug.WriteLine ("double click");
onMouseDoubleClick (this, e);
return;
} else
Interface.clickTimer.Restart ();
-
+
GraphicObject p = Parent as GraphicObject;
if (p != null)
p.onMouseClick(sender,e);
public virtual void onMouseWheel(object sender, MouseWheelEventArgs e){
GraphicObject p = Parent as GraphicObject;
if (p != null)
- p.onMouseWheel(this,e);
+ p.onMouseWheel(sender,e);
MouseWheelChanged.Raise (this, e);
}
Debug.WriteLine("MouseLeave => " + this.ToString());
#endif
MouseLeave.Raise (this, e);
+
+ GraphicObject p = Parent as GraphicObject;
+ CurrentInterface.HoverWidget = p;
+
+ if (p == null)
+ return;
+
+ if (p.MouseIsIn (e.Position)&&e!=null)
+ p.checkHoverWidget (e);
+ else
+ p.onMouseLeave (sender, e);
}
#endregion
}
public virtual void ReadXml (System.Xml.XmlReader reader)
{
- if (reader.HasAttributes) {
+ if (reader.HasAttributes) {
style = reader.GetAttribute ("Style");
public virtual void AddItem(GraphicObject g){
items.AddChild (g);
NotifyValueChanged ("HasChildren", true);
- //g.LogicalParent = this;
}
public virtual void RemoveItem(GraphicObject g)
{
int i = 0;
while (i < idxhw) {
if (GraphicTree [i].MouseIsIn (e.Position)) {
- HoverWidget.onMouseLeave (HoverWidget, e);
+ //set evtarg to null to force mouseLeave without checking mouse pos
+ HoverWidget.onMouseLeave (HoverWidget, null);
GraphicTree [i].checkHoverWidget (e);
return true;
}
return true;
} else {
HoverWidget.onMouseLeave (HoverWidget, e);
- //seek upward from last focused graph obj's
- while (HoverWidget.Parent as GraphicObject != null) {
- HoverWidget = HoverWidget.Parent as GraphicObject;
- if (HoverWidget.MouseIsIn (e.Position)) {
- HoverWidget.checkHoverWidget (e);
- return true;
- } else
- HoverWidget.onMouseLeave (HoverWidget, e);
- }
+ if (HoverWidget != null)
+ return true;
}
}
//top level graphic obj's parsing
- for (int i = 0; i < GraphicTree.Count; i++) {
- GraphicObject g = GraphicTree[i];
- if (g.MouseIsIn (e.Position)) {
- g.checkHoverWidget (e);
- if (g is Window)
- PutOnTop (g);
- return true;
+ lock (GraphicTree) {
+ for (int i = 0; i < GraphicTree.Count; i++) {
+ GraphicObject g = GraphicTree [i];
+ if (g.MouseIsIn (e.Position)) {
+ g.checkHoverWidget (e);
+ if (g is Window)
+ PutOnTop (g);
+ return true;
+ }
}
}
HoverWidget = null;