<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
<Optimize>false</Optimize>
<OutputPath>$(SolutionDir)build\Debug</OutputPath>
- <DefineConstants>DEBUG_LOG;XLIB_BACKEND0;DESIGN_MODE;DEBUG_UPDATE0;DEBUG_FOCUS0;DEBUG_DISPOSE0;TRACE0;DEBUG;MEASURE_TIME;DEBUG_LOAD0;DEBUG_BINDING0;DEBUG_CLIP_RECTANGLE0</DefineConstants>
+ <DefineConstants>DEBUG_DRAGNDROP0;DEBUG_LOG0;XLIB_BACKEND0;DESIGN_MODE;DEBUG_UPDATE0;DEBUG_FOCUS0;DEBUG_DISPOSE0;TRACE0;DEBUG;MEASURE_TIME;DEBUG_LOAD0;DEBUG_BINDING0;DEBUG_CLIP_RECTANGLE0</DefineConstants>
<EnvironmentVariables>
<EnvironmentVariables>
<Variable name="MONO_CAIRO_DEBUG_DISPOSE" value="1" />
//EndDrag="{Background=Jet}";
}
DockWindow {
- Background = "Onyx";
+ //Background = "Onyx";
Focusable = "true";
AllowDrag = "true";
AlwaysOnTop = "true";
Margin="0";
Width="200";
Height="200";
+ //MinimumSize="50,50";
}
FileDialog {
Template = "#Crow.FileDialog.template";
<?xml version="1.0"?>
-<Border BorderWidth="1" Foreground="Black" >
+<Border BorderWidth="1" Foreground="DimGrey" >
<GenericStack Orientation="{./Orientation}" Spacing="0">
<Shape Style="ArrowBut" MouseDown="./onScrollBack" Path="{./ScrollBackShape}"/>
<Slider Name="Slider"
Height="{./HeightPolicy}" Width="{./WidthPolicy}"
LargeIncrement="{./LargeIncrement}"
SmallIncrement="{./SmallIncrement}"
- CursorColor="hgradient|0:Grey|1:Onyx"
+ CursorColor="hgradient|0:Grey|1:DimGrey"
Foreground="DimGrey"
- Background="hgradient|0:Grey|1:White"/>
+ Background="hgradient|0:DimGrey|0.1:Grey|0.95:Grey|1:White"/>
<Shape Style="ArrowBut" MouseDown="./onScrollForth" Path="M 0.5,0.5 L 10.5,0.5 L 5.5,10.5 Z"/>
</GenericStack>
</Border>
\ No newline at end of file
//app.AddWidget (@"Interfaces/Container/0.crow").DataSource = app;
//app.AddWidget (@"Interfaces/Divers/colorPicker.crow").DataSource = app;
//app.AddWidget ("Interfaces/Divers/perfMeasures.crow").DataSource = app;
- app.AddWidget ("#Tests.ui.dbgLog.crow").DataSource = app;
+ //app.AddWidget ("#Tests.ui.dbgLog.crow").DataSource = app;
+ app.AddWidget (@"Interfaces/Experimental/testDock.crow").DataSource = app;
+
+ app.LoadIMLFragment (@"<DockWindow Width='150' Height='150' Name='dock1'/>");
+ app.LoadIMLFragment (@"<DockWindow Width='150' Height='150' Name='dock2'/>");
+ app.LoadIMLFragment (@"<DockWindow Width='150' Height='150' Name='dock3'/>");
+ /*app.LoadIMLFragment (@"<DockWindow Width='150' Height='150'/>");
+ app.LoadIMLFragment (@"<DockWindow Width='150' Height='150'/>");
+ app.LoadIMLFragment (@"<DockWindow Width='150' Height='150'/>");*/
+
while (true) {
#if MEASURE_TIME
{
Console.WriteLine((byte)e.Key);
//#if DEBUG_LOG
- switch (e.Key) {
+ /*switch (e.Key) {
case Key.F2:
DebugLog.save (app);
break;
- }
+ }*/
//#endif
}
}
--- /dev/null
+<?xml version="1.0"?>
+<!--<GraphicObject Background="{./Background}"/>-->
+<Border BorderWidth="1" Foreground="Black" CornerRadius="{./CornerRadius}"
+ Background="{./Background}"
+ MouseEnter="./onBorderMouseEnter"
+ MouseLeave="./onBorderMouseLeave">
+ <VerticalStack Spacing="0">
+ <HorizontalStack Height="Fit">
+ <Label Text="{./Name}" TextAlignment="Left" Width="Fit"
+ Foreground="White" />
+ <Label Text="{./DockingPosition}" TextAlignment="Left" Width="Fit"
+ Foreground="White" />
+ </HorizontalStack>
+ <HorizontalStack Visible="{./IsDocked}" Height="Fit" Margin="1" Background="Grey">
+ <Label Text="{./Caption}" TextAlignment="Left" Width="Stretched"
+ Foreground="Jet" />
+ <Image Width="8" Height="8" Focusable="true" Margin="0" Path="#Crow.Images.Icons.exit2.svg"
+ MouseClick="./butQuitPress"/>
+ </HorizontalStack>
+ <HorizontalStack Background="vgradient|0:0.5,0.6,0.5,0.5|1:0.2,0.3,0.3,0.7"
+ Name="hs" Margin="0" Spacing="0" Height="Fit" Visible="{./IsFloating}">
+ <GraphicObject Width="5"/>
+ <Image Margin="1" Width="10" Height="10" Path="{./Icon}"/>
+ <Label Width="Stretched" Foreground="White" Margin="1" TextAlignment="Left" Text="{./Caption}" />
+ <Border CornerRadius="6" BorderWidth="1" Foreground="Transparent" Height="10" Width="10"
+ MouseEnter="{Foreground=White}" MouseLeave="{Foreground=Transparent}">
+ <Image Focusable="true" Name="Image" Margin="0" Path="#Crow.Images.Icons.exit2.svg"
+ MouseClick="./butQuitPress"/>
+ </Border>
+ <GraphicObject Width="5"/>
+ </HorizontalStack>
+ <Container Name="Content" MinimumSize="50,50"/>
+ </VerticalStack>
+</Border>
<?xml version="1.0"?>
-<Window Height="50%" Width="60%">
- <DockStack Background="#60101050" Margin="10"/>
+<Window Width="Stretched" Height="Stretched">
+ <DockStack Background="#60101050" Margin="20">
+ </DockStack>
</Window>
-<!--- <DockWindow Left="400" Top="400" Width="150" Height="150" Background="MediumSeaGreen"/>
+<!---
<DockWindow Left="450" Top="450" Width="150" Height="150" Background="Maize"/>-->
<LogicalName>Crow.TabItem.template</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="ui\dbgLog.crow" />
+ <EmbeddedResource Include="Interfaces\Experimental\DockWindow.template">
+ <LogicalName>Crow.DockWindow.template</LogicalName>
+ </EmbeddedResource>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Crow.csproj">
// THE SOFTWARE.
using System;
using Crow.IML;
+using System.Linq;
namespace Crow
{
public DockStack (Interface iface) : base (iface) {}
#endregion
+ /*static int color = 10;
+
+ protected override void onInitialized (object sender, EventArgs e)
+ {
+ base.onInitialized (sender, e);
+ Background = Color.ColorDic.Values.ToList()[color++];
+ }*/
public override void AddChild (GraphicObject g)
{
base.AddChild (g);
return false;
}
}
+ childrenRWLock.ExitReadLock ();
}
- childrenRWLock.ExitReadLock ();
+
return Slot.ContainsOrIsEqual(m);
}
protected override void onDragLeave (object sender, DragDropEventArgs e)
{
DockWindow dw = e.DragSource as DockWindow;
- if (dw != null)
- dw.DockingPosition = Alignment.Undefined;
+ //if (dw != null)
+ // dw.DockingPosition = Alignment.Undefined;
base.onDragLeave (sender, e);
RegisterForGraphicUpdate ();
}
break;
}
}
- public void Undock (DockWindow dw){
+ public void Undock (DockWindow dw){
int idx = Children.IndexOf(dw);
+ Console.WriteLine ("undocking child index: {0} ; name={1}; pos:{2} ; childcount:{3}",idx, dw.Name, dw.DockingPosition, Children.Count);
+
RemoveChild(dw);
if (Children.Count == 0)
return;
-
+
if (dw.DockingPosition == Alignment.Left || dw.DockingPosition == Alignment.Top) {
RemoveChild (idx);
if (stretchedChild == dw) {
undockingMousePosOrig = e.Position;
}
public bool CheckUndock (Point mousePos) {
- if (DockingPosition == Alignment.Center)
- return false;
+ //if (DockingPosition == Alignment.Center)
+ // return false;
if (Math.Abs (mousePos.X - undockingMousePosOrig.X) < undockThreshold ||
Math.Abs (mousePos.X - undockingMousePosOrig.X) < undockThreshold)
return false;
}
protected override void onDrop (object sender, DragDropEventArgs e)
{
- if (!isDocked && DockingPosition != Alignment.Undefined)
+ if (!isDocked && DockingPosition != Alignment.Undefined && e.DropTarget is DockStack)
Dock (e.DropTarget as DockStack);
base.onDrop (sender, e);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void RegisterForRedraw ()
{
- //IsDirty = true;
+ IsDirty = true;
if (RegisteredLayoutings == LayoutingType.None)
IFace.EnqueueForRepaint (this);
}
Debug.WriteLine("MOUSE DOWN => " + this.ToString());
#endif
- if (IFace.ActiveWidget == null)
- IFace.ActiveWidget = this;
if (this.Focusable && !Interface.FocusOnHover) {
BubblingMouseButtonEventArg be = e as BubblingMouseButtonEventArg;
if (be.Focused == null) {
#if DEBUG_LAYOUTING
return Name == "unamed" ? tmp + "." + this.GetType ().Name + GraphicObjects.IndexOf(this).ToString(): tmp + "." + Name;
#else
- return Name == "unamed" ? tmp + "." + this.GetType ().Name : tmp + "." + Name;
+ return string.IsNullOrEmpty(Name) ? tmp + "." + this.GetType ().Name : tmp + "." + Name;
#endif
}
/// <summary>
public override void onMouseEnter (object sender, MouseMoveEventArgs e)
{
base.onMouseEnter (sender, e);
- if ((LogicalParent as Menu).AutomaticOpenning && items.Children.Count>0)
+ Menu menu = LogicalParent as Menu;
+ if (menu == null)
+ return;
+ if (menu.AutomaticOpenning && items.Children.Count>0)
IsOpened = true;
}
public override void onMouseLeave (object sender, MouseMoveEventArgs e)
gr.LineWidth = 1;
Foreground.SetAsSource (gr);
gr.StrokePreserve ();
- gr.Clip ();
+ gr.ClipPreserve ();
+
+ Background.SetAsSource (gr);
+ gr.Fill ();
+
base.onDraw (gr);
+
gr.Restore ();
}
int dragThreshold = 16;
int dis = 128;
internal TabView savedParent = null;
-
+ public override Fill Background {
+ get {
+ return base.Background;
+ }
+ set {
+ base.Background = value;
+ }
+ }
void makeFloating (TabView tv) {
lock (IFace.UpdateMutex) {
ImageSurface di = new ImageSurface (Format.Argb32, dis, dis);
if (value == _selectedIndex)
return;
- if (_selectedIndex >= 0 && Items.Count > _selectedIndex) {
+ /*if (_selectedIndex >= 0 && Items.Count > _selectedIndex) {
Items[_selectedIndex].Foreground = Color.Transparent;
Items[_selectedIndex].Background = Color.Transparent;
- }
+ }*/
_selectedIndex = value;
- if (_selectedIndex >= 0 && Items.Count > _selectedIndex) {
+ /*if (_selectedIndex >= 0 && Items.Count > _selectedIndex) {
Items[_selectedIndex].Foreground = SelectionForeground;
Items[_selectedIndex].Background = SelectionBackground;
- }
+ }*/
NotifyValueChanged ("SelectedIndex", _selectedIndex);
NotifyValueChanged ("SelectedItem", SelectedItem);
Keyboard.KeyUp += Keyboard_KeyUp;
Keyboard.KeyPress += Keyboard_KeyPress;
+ initTooltip ();
+ initContextMenus ();
+
Thread t = new Thread (interfaceThread);
t.IsBackground = true;
t.Start ();
// keyboardRepeatThread = new Thread (keyboardRepeatThreadFunc);
// keyboardRepeatThread.IsBackground = true;
// keyboardRepeatThread.Start ();
- }
+ }
void interfaceThread()
{
//loadCursors ();
loadStyling ();
findAvailableTemplates ();
- //initTooltip ();
- //initContextMenus ();
#if MEASURE_TIME
PerfMeasures.Add (updateMeasure);
}
}
/// <summary>
- /// Add the content of the IML fragment to the graphic tree of this interface
+ /// Create an instantiator bound to this interface from the IML fragment
/// </summary>
- /// <returns>return the new instance for convenience, may be ignored</returns>
+ /// <returns>return the new instantiator</returns>
/// <param name="imlFragment">a valid IML string</param>
public Instantiator CreateITorFromIMLFragment (string imlFragment) {
return Instantiator.CreateFromImlFragment (this, imlFragment);
clipping = new Region ();
//}
//surf.WriteToPng (@"/mnt/data/test.png");
- surf.Flush();
+
backend?.Flush ();
}
}
if (FocusedWidget == null)
return true;
+
+ ActiveWidget = FocusedWidget;
+
if (!FocusedWidget.MouseRepeat)
return true;
mouseRepeatThread = new Thread (mouseRepeatThreadFunc);
Marshal.Copy (ptrKeySyms, keySyms, 0, nbKeySyms);
uint utf32 = xkb_state_key_get_utf32 (xkbState, keycode);
+ char c = char.ConvertFromUtf32 ((int)utf32) [0];
- if (utf32 > 0)
- KeyPress.Raise (this, new KeyPressEventArgs (char.ConvertFromUtf32 ((int)utf32) [0]));
+ if (!char.IsControl(c))
+ KeyPress.Raise (this, new KeyPressEventArgs (c));
} else {
keyDir = xkb_key_direction.KEY_UP;
KeyUp.Raise (this, new KeyEventArgs ((Key)ks, false));