]> O.S.I.I.S - jp/crow.git/commitdiff
various fixes
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Fri, 30 Nov 2018 20:47:39 +0000 (21:47 +0100)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Fri, 30 Nov 2018 20:47:39 +0000 (21:47 +0100)
24 files changed:
Crow.csproj
CrowIDE/src/CrowIDE.cs
CrowIDE/src/DesignInterface.cs
CrowIDE/src/Editors/CodeBuffer/TextEditor.cs
CrowIDE/src/Editors/ImlVisualEditor.cs
CrowIDE/src/Editors/SourceEditor.cs
CrowIDE/ui/IDE.style
CrowIDE/ui/TabItem.template
CrowIDE/ui/editors/EditPane.template
CrowIDE/ui/editors/IMLEdit.itemp
Default.style
Templates/ScrollBar.template
Tests/BasicTests.cs
Tests/Interfaces/Experimental/DockWindow.template [new file with mode: 0755]
Tests/Interfaces/Experimental/testDock.crow
Tests/Tests.csproj
src/GraphicObjects/DockStack.cs
src/GraphicObjects/DockWindow.cs
src/GraphicObjects/GraphicObject.cs
src/GraphicObjects/MenuItem.cs
src/GraphicObjects/TabItem.cs
src/GraphicObjects/TemplatedGroup.cs
src/Interface.cs
src/backends/xcb/XCBKeyboard.cs

index 6ad0c309f7a20d0b65aedc365dc7a78aaccbce6d..0afb1db900e6b5fa566f8d405fa2333f94f3eee7 100644 (file)
@@ -32,7 +32,7 @@
     <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" />
index 89bcdcabd0010db77072df41cea06f56e05ac62f..235b077f3b63887938dbf311493c913b35286547 100644 (file)
@@ -122,11 +122,11 @@ namespace Crow.Coding
                {
                        Console.WriteLine((byte)e.Key);
                        //#if DEBUG_LOG
-                       switch (e.Key) {
+                       /*switch (e.Key) {
                        case Key.F2:                            
                                DebugLog.save (app);
                                break;
-                       }
+                       }*/
                        //#endif
                }
 
index d5ac7664685e0a1422a14efab21fe0df66a2314d..5f979782a3f49b04a7cb69e7a2fb382e082cfc85 100644 (file)
@@ -53,7 +53,7 @@ namespace Crow.Coding
                }
                #endregion
 
-               public DesignInterface ()
+               public DesignInterface () : base()
                {
                }
 
@@ -63,7 +63,6 @@ namespace Crow.Coding
                protected override void InitBackend ()
                {
                        surf = CrowIDE.MainIFace.surf.CreateSimilar (Cairo.Content.ColorAlpha, 100, 100);
-                       //base.initX ();
                }
                public override void ProcessResize (Rectangle bounds)
                {
index 8067ffed3e74d5c84fc593619d526e495efeff94..d5d9240a78c745214df9a14922af27d50f9f4bb7 100644 (file)
@@ -530,14 +530,14 @@ namespace Crow.Text
 
                        Key key = e.Key;
 
-                       if (e.Control) {
+                       if (IFace.Keyboard.Ctrl) {
                                switch (key) {
                                case Key.S:
                                        projFile.Save ();
                                        break;
                                case Key.W:
                                        editorMutex.EnterWriteLock ();
-                                       if (e.Shift)
+                                       if (IFace.Keyboard.Shift)
                                                projFile.Redo (null);
                                        else
                                                projFile.Undo (null);
@@ -551,7 +551,7 @@ namespace Crow.Text
 
                        switch (key)
                        {
-                       case Key.Back:
+                       case Key.BackSpace:
                                buffer.Delete ();
                                break;
                        case Key.Clear:
@@ -563,8 +563,8 @@ namespace Crow.Text
 //                                     IFace.Clipboard = buffer.SelectedText;
                                buffer.Delete ();
                                break;
-                       case Key.Enter:
-                       case Key.KeypadEnter:
+                       case Key.ISO_Enter:
+                       case Key.KP_Enter:
                                if (!buffer.SelectionIsEmpty)
                                        buffer.Delete ();
                                buffer.InsertLineBreak ();
@@ -573,46 +573,46 @@ namespace Crow.Text
                                buffer.ResetSelection ();
                                break;
                        case Key.Home:
-                               if (e.Shift) {
+                               if (IFace.Keyboard.Shift) {
                                        if (buffer.SelectionIsEmpty)
                                                buffer.SetSelStartPos ();
-                                       if (e.Control)
+                                       if (IFace.Keyboard.Ctrl)
                                                buffer.CurrentLine = 0;
                                        buffer.CurrentColumn = 0;
                                        buffer.SetSelEndPos ();
                                        break;
                                }
                                buffer.ResetSelection ();
-                               if (e.Control)
+                               if (IFace.Keyboard.Ctrl)
                                        buffer.CurrentLine = 0;
                                buffer.CurrentColumn = 0;
                                break;
                        case Key.End:
-                               if (e.Shift) {
+                               if (IFace.Keyboard.Shift) {
                                        if (buffer.SelectionIsEmpty)
                                                buffer.SetSelStartPos ();
-                                       if (e.Control)
+                                       if (IFace.Keyboard.Ctrl)
                                                buffer.CurrentLine = int.MaxValue;
                                        buffer.CurrentColumn = int.MaxValue;
                                        buffer.SetSelEndPos ();
                                        break;
                                }
                                buffer.ResetSelection ();
-                               if (e.Control)
+                               if (IFace.Keyboard.Ctrl)
                                        buffer.CurrentLine = int.MaxValue;
                                buffer.CurrentColumn = int.MaxValue;
                                break;
                        case Key.Insert:
-                               if (e.Shift)
+                               if (IFace.Keyboard.Shift)
                                        buffer.InsertAt (IFace.Clipboard);
-                               else if (e.Control && !buffer.SelectionIsEmpty)
+                               else if (IFace.Keyboard.Ctrl && !buffer.SelectionIsEmpty)
                                        IFace.Clipboard = buffer.SelectedText;
                                break;
                        case Key.Left:
-                               if (e.Shift) {
+                               if (IFace.Keyboard.Shift) {
                                        if (buffer.SelectionIsEmpty)
                                                buffer.SetSelStartPos ();
-                                       if (e.Control)
+                                       if (IFace.Keyboard.Ctrl)
                                                buffer.GotoWordStart ();
                                        else
                                                buffer.MoveLeft ();
@@ -620,16 +620,16 @@ namespace Crow.Text
                                        break;
                                }
                                buffer.ResetSelection ();
-                               if (e.Control)
+                               if (IFace.Keyboard.Ctrl)
                                        buffer.GotoWordStart ();
                                else
                                        buffer.MoveLeft();
                                break;
                        case Key.Right:
-                               if (e.Shift) {
+                               if (IFace.Keyboard.Shift) {
                                        if (buffer.SelectionIsEmpty)
                                                buffer.SetSelStartPos ();
-                                       if (e.Control)
+                                       if (IFace.Keyboard.Ctrl)
                                                buffer.GotoWordEnd ();
                                        else
                                                buffer.MoveRight ();
@@ -637,13 +637,13 @@ namespace Crow.Text
                                        break;
                                }
                                buffer.ResetSelection ();
-                               if (e.Control)
+                               if (IFace.Keyboard.Ctrl)
                                        buffer.GotoWordEnd ();
                                else
                                        buffer.MoveRight ();
                                break;
                        case Key.Up:
-                               if (e.Shift) {
+                               if (IFace.Keyboard.Shift) {
                                        if (buffer.SelectionIsEmpty)
                                                buffer.SetSelStartPos ();
                                        CurrentLine--;
@@ -654,7 +654,7 @@ namespace Crow.Text
                                CurrentLine--;
                                break;
                        case Key.Down:
-                               if (e.Shift) {
+                               if (IFace.Keyboard.Shift) {
                                        if (buffer.SelectionIsEmpty)
                                                buffer.SetSelStartPos ();
                                        CurrentLine++;
@@ -666,10 +666,10 @@ namespace Crow.Text
                                break;
                        case Key.Menu:
                                break;
-                       case Key.NumLock:
+                       case Key.Num_Lock:
                                break;
-                       case Key.PageDown:
-                               if (e.Shift) {
+                       case Key.Page_Down:
+                               if (IFace.Keyboard.Shift) {
                                        if (buffer.SelectionIsEmpty)
                                                buffer.SetSelStartPos ();
                                        CurrentLine += visibleLines;
@@ -679,8 +679,8 @@ namespace Crow.Text
                                buffer.ResetSelection ();
                                CurrentLine += visibleLines;
                                break;
-                       case Key.PageUp:
-                               if (e.Shift) {
+                       case Key.Page_Up:
+                               if (IFace.Keyboard.Shift) {
                                        if (buffer.SelectionIsEmpty)
                                                buffer.SetSelStartPos ();
                                        CurrentLine -= visibleLines;
@@ -690,8 +690,6 @@ namespace Crow.Text
                                buffer.ResetSelection ();
                                CurrentLine -= visibleLines;
                                break;
-                       case Key.RWin:
-                               break;
                        case Key.Tab:
                                buffer.InsertAt ("\t");
                                break;
index a7b59c39dc542ccddf80da3aed7bef846ef0bf9e..3cb4f86628655b44dd4e4bf93e9c68dffbbd8eef 100644 (file)
@@ -279,6 +279,7 @@ namespace Crow.Coding
                                SelectedItem = go;
                        } catch (Exception ex) {
                                Error = ex;
+                               Debug.WriteLine ("Error Loading ui in Design iface\n" + ex.ToString ());
                                if (Monitor.IsEntered(imlVE.UpdateMutex))
                                        Monitor.Exit (imlVE.UpdateMutex);
                        }
@@ -295,9 +296,9 @@ namespace Crow.Coding
                        lock (imlVE.RenderMutex)
                                isDirty = imlVE.IsDirty;
 
-                       if (isDirty) {
+                       if (isDirty) {                          
                                lock (IFace.UpdateMutex)
-                                       RegisterForRedraw ();
+                                       RegisterForRedraw ();                           
                        }
                }
                #endregion
index 586c5f9f9e6ecb50cccb0085472667425e030a1f..3cf422b9b88eeb07b811eda08360b8637858708e 100644 (file)
@@ -1008,14 +1008,14 @@ namespace Crow.Coding
 
                        Key key = e.Key;
 
-                       if (e.Control) {
+                       if (IFace.Keyboard.Ctrl) {
                                switch (key) {
                                case Key.S:
                                        projFile.Save ();
                                        break;
                                case Key.W:
                                        editorMutex.EnterWriteLock ();
-                                       if (e.Shift)
+                                       if (IFace.Keyboard.Shift)
                                                projFile.Redo (null);
                                        else
                                                projFile.Undo (null);
@@ -1029,7 +1029,7 @@ namespace Crow.Coding
 
                        switch (key)
                        {
-                       case Key.Back:
+                       case Key.BackSpace:
                                buffer.DeleteChar ();
                                break;
                        case Key.Clear:
@@ -1037,12 +1037,12 @@ namespace Crow.Coding
                        case Key.Delete:
                                if (buffer.SelectionIsEmpty)
                                        MoveRight ();
-                               else if (e.Shift)
+                               else if (IFace.Keyboard.Shift)
                                        IFace.Clipboard = buffer.SelectedText;
                                buffer.DeleteChar ();
                                break;
-                       case Key.Enter:
-                       case Key.KeypadEnter:
+                       case Key.Return:
+                       case Key.KP_Enter:
                                if (!buffer.SelectionIsEmpty)
                                        buffer.DeleteChar ();
                                buffer.InsertLineBreak ();
@@ -1051,46 +1051,46 @@ namespace Crow.Coding
                                buffer.ResetSelection ();
                                break;
                        case Key.Home:
-                               if (e.Shift) {
+                               if (IFace.Keyboard.Shift) {
                                        if (buffer.SelectionIsEmpty)
                                                buffer.SetSelStartPos ();
-                                       if (e.Control)
+                                       if (IFace.Keyboard.Ctrl)
                                                buffer.CurrentLine = 0;
                                        buffer.CurrentColumn = 0;
                                        buffer.SetSelEndPos ();
                                        break;
                                }
                                buffer.ResetSelection ();
-                               if (e.Control)
+                               if (IFace.Keyboard.Ctrl)
                                        buffer.CurrentLine = 0;
                                buffer.CurrentColumn = 0;
                                break;
                        case Key.End:
-                               if (e.Shift) {
+                               if (IFace.Keyboard.Shift) {
                                        if (buffer.SelectionIsEmpty)
                                                buffer.SetSelStartPos ();
-                                       if (e.Control)
+                                       if (IFace.Keyboard.Ctrl)
                                                buffer.CurrentLine = int.MaxValue;
                                        buffer.CurrentColumn = int.MaxValue;
                                        buffer.SetSelEndPos ();
                                        break;
                                }
                                buffer.ResetSelection ();
-                               if (e.Control)
+                               if (IFace.Keyboard.Ctrl)
                                        buffer.CurrentLine = int.MaxValue;
                                buffer.CurrentColumn = int.MaxValue;
                                break;
                        case Key.Insert:
-                               if (e.Shift)
+                               if (IFace.Keyboard.Shift)
                                        buffer.Insert (IFace.Clipboard);
-                               else if (e.Control && !buffer.SelectionIsEmpty)
+                               else if (IFace.Keyboard.Ctrl && !buffer.SelectionIsEmpty)
                                        IFace.Clipboard = buffer.SelectedText;
                                break;
                        case Key.Left:
-                               if (e.Shift) {
+                               if (IFace.Keyboard.Shift) {
                                        if (buffer.SelectionIsEmpty)
                                                buffer.SetSelStartPos ();
-                                       if (e.Control)
+                                       if (IFace.Keyboard.Ctrl)
                                                buffer.GotoWordStart ();
                                        else
                                                MoveLeft ();
@@ -1098,16 +1098,16 @@ namespace Crow.Coding
                                        break;
                                }
                                buffer.ResetSelection ();
-                               if (e.Control)
+                               if (IFace.Keyboard.Ctrl)
                                        buffer.GotoWordStart ();
                                else
                                        MoveLeft();
                                break;
                        case Key.Right:
-                               if (e.Shift) {
+                               if (IFace.Keyboard.Shift) {
                                        if (buffer.SelectionIsEmpty)
                                                buffer.SetSelStartPos ();
-                                       if (e.Control)
+                                       if (IFace.Keyboard.Ctrl)
                                                buffer.GotoWordEnd ();
                                        else
                                                MoveRight ();
@@ -1115,13 +1115,13 @@ namespace Crow.Coding
                                        break;
                                }
                                buffer.ResetSelection ();
-                               if (e.Control)
+                               if (IFace.Keyboard.Ctrl)
                                        buffer.GotoWordEnd ();
                                else
                                        MoveRight ();
                                break;
                        case Key.Up:
-                               if (e.Shift) {
+                               if (IFace.Keyboard.Shift) {
                                        if (buffer.SelectionIsEmpty)
                                                buffer.SetSelStartPos ();
                                        PrintedCurrentLine--;
@@ -1132,7 +1132,7 @@ namespace Crow.Coding
                                PrintedCurrentLine--;
                                break;
                        case Key.Down:
-                               if (e.Shift) {
+                               if (IFace.Keyboard.Shift) {
                                        if (buffer.SelectionIsEmpty)
                                                buffer.SetSelStartPos ();
                                        PrintedCurrentLine++;
@@ -1144,10 +1144,10 @@ namespace Crow.Coding
                                break;
                        case Key.Menu:
                                break;
-                       case Key.NumLock:
+                       case Key.Num_Lock:
                                break;
-                       case Key.PageDown:
-                               if (e.Shift) {
+                       case Key.Page_Down:
+                               if (IFace.Keyboard.Shift) {
                                        if (buffer.SelectionIsEmpty)
                                                buffer.SetSelStartPos ();
                                        PrintedCurrentLine += visibleLines;
@@ -1157,8 +1157,8 @@ namespace Crow.Coding
                                buffer.ResetSelection ();
                                PrintedCurrentLine += visibleLines;
                                break;
-                       case Key.PageUp:
-                               if (e.Shift) {
+                       case Key.Page_Up:
+                               if (IFace.Keyboard.Shift) {
                                        if (buffer.SelectionIsEmpty)
                                                buffer.SetSelStartPos ();
                                        PrintedCurrentLine -= visibleLines;
@@ -1168,10 +1168,8 @@ namespace Crow.Coding
                                buffer.ResetSelection ();
                                PrintedCurrentLine -= visibleLines;
                                break;
-                       case Key.RWin:
-                               break;
                        case Key.Tab:
-                               if (e.Shift) {
+                               if (IFace.Keyboard.Shift) {
                                        if (buffer.SelectionIsEmpty ||
                                                (buffer.SelectionStart.Y == buffer.SelectionEnd.Y)) {
                                                //TODO
index 5afbaf7d8eb2ac439cfcaa3bef45ce4a52ec2125..506bb9e90e4d0c0ae5aa1a2870a612900182c513 100644 (file)
@@ -33,7 +33,6 @@ WinSchema {
 }
 TabItem {
        AllowDrag="false";
-       Background="Jet";
 }
 TreeItemBorder {
        CornerRadius="2";
index 66caeb0ca9fc85f0bfc39be76831e727dd2803ed..42530597432256d81031482f9d333031bc12c482 100644 (file)
@@ -1,6 +1,5 @@
 <?xml version="1.0"?>
-<GenericStack Orientation="Vertical" Spacing="0"
-               Background="Onyx"
+<GenericStack Orientation="Vertical" Spacing="0"               
                MouseEnter="{caption.Foreground=White}"
                MouseLeave="{caption.Foreground=Grey}">
        <HorizontalStack Margin="2" Left="{./TabOffset}"
index 43be10d61488a29e88e2abde1fe3eeba6a4e6ac2..f6eb0f812f29f44e785ab2a467d140e81e236193 100644 (file)
@@ -1,2 +1,2 @@
 <?xml version="1.0" encoding="UTF-8" ?>
-<TabView SelectedTab="{²./SelectedIndex}" Name="ItemsContainer" Orientation="Horizontal" />
+<TabView SelectedTab="{²./SelectedIndex}" Name="ItemsContainer" Orientation="Horizontal"/>
index 290a9c6f214250d435dff7df9e0bb2b425fc7d26..d0dae076bad554457c74a0a58704695fa259667d 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" ?>
-<TabItem Caption="{DisplayName}" QueryClose="OnQueryClose">
+<TabItem Caption="{DisplayName}" QueryClose="OnQueryClose" Background="DimGrey">
        <VerticalStack>
-               <HorizontalStack Height="Fit" Margin="2" Background="DimGrey" Spacing="5">
+               <HorizontalStack Height="Fit" Margin="2" Spacing="5">
                        <HorizontalStack Width="Fit" Spacing="1">
                                <Label Text="Design Size:"/>
                                <TextBox Text="{²../../../editor.DesignWidth}" Width="40" TextAlignment="Right"/>
@@ -44,9 +44,9 @@
                </VerticalStack>
                <Splitter/>
                <IMLContainer Path="#Crow.Coding.ui.SourceEditor.crow"/>
-<!--           <Label DataSource="{../editor.Error}" Text="{}"
+               <Label DataSource="{../editor.Error}" Text="{}"
                        Visible="{../editor.HasError}"
                        Height="Fit" Width="Stretched" Background="DarkRed" Foreground="White"
-                       TextAlignment="TopLeft" Multiline="true"/>-->
+                       TextAlignment="TopLeft" Multiline="true"/>
        </VerticalStack>
 </TabItem>
index 29b5edeaa653e5a6b56f0ceea41d66d2d83b10c4..9709eef9864fa73c23be0b31cb6d0725a12f8fb0 100644 (file)
@@ -128,13 +128,14 @@ DockStack {
        //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";
index c19b5680fb0e2f333c367563f71fc167b8c4db78..de1eaf3bb17903d9855ffc78aa73a3f072ee29c1 100755 (executable)
@@ -1,5 +1,5 @@
 <?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"                   
@@ -10,9 +10,9 @@
                        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
index 4f9fd128f09b515439c687b67609945873614e6d..c3d3a78112f82cd6ac1da332058f4129b05d2f7e 100644 (file)
@@ -23,7 +23,16 @@ namespace tests
                                //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
@@ -55,11 +64,11 @@ namespace tests
                {
                        Console.WriteLine((byte)e.Key);
                        //#if DEBUG_LOG
-                       switch (e.Key) {
+                       /*switch (e.Key) {
                        case Key.F2:                            
                                DebugLog.save (app);
                                break;
-                       }
+                       }*/
                        //#endif
                }
        }
diff --git a/Tests/Interfaces/Experimental/DockWindow.template b/Tests/Interfaces/Experimental/DockWindow.template
new file mode 100755 (executable)
index 0000000..2d39bd4
--- /dev/null
@@ -0,0 +1,34 @@
+<?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>
index 0b05e76d139f3ecb4e8e4242b82320c301848441..62a5203c83624b024f1b29471ee14c3f2bfea592 100644 (file)
@@ -1,8 +1,9 @@
 <?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"/>-->
        
 
index 0aef448b586cc2458feb7a98f97978e5c0f7aadd..049ab6f91557fe5222b3645327a9ca3fe13486f8 100644 (file)
       <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">
index ae8b9c89093a9fec17bba8be91606f602c2726e7..f217402480f81dda039698eff3f42a0883645e3b 100644 (file)
@@ -25,6 +25,7 @@
 // THE SOFTWARE.
 using System;
 using Crow.IML;
+using System.Linq;
 
 namespace Crow
 {
@@ -36,6 +37,13 @@ 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);
@@ -68,8 +76,9 @@ namespace Crow
                                                return false;
                                        }
                                }
+                               childrenRWLock.ExitReadLock ();
                        }
-                       childrenRWLock.ExitReadLock ();
+
                        return Slot.ContainsOrIsEqual(m);
                }
 
@@ -172,8 +181,8 @@ namespace Crow
                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 ();
                }
@@ -307,14 +316,16 @@ namespace Crow
                                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) {
index ca4b93f4bbc006946e2c7edf5f28fdf685184201..1ae3b0b450eb3947e3bda6fd95017851429c9133 100644 (file)
@@ -109,8 +109,8 @@ namespace Crow
                                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;
@@ -126,7 +126,7 @@ namespace Crow
                }
                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);
                }
index e67b3523002101386f1c7a9e8f4a67ca38a3e93d..2bf20f27bf2e517b4c0653d3f94b21ddded97307 100644 (file)
@@ -1386,7 +1386,7 @@ namespace Crow
                [MethodImpl(MethodImplOptions.AggressiveInlining)]
                public void RegisterForRedraw ()
                {
-                       //IsDirty = true;
+                       IsDirty = true;
                        if (RegisteredLayoutings == LayoutingType.None)
                                IFace.EnqueueForRepaint (this);
                }
@@ -1789,8 +1789,6 @@ namespace Crow
                        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) {
@@ -1956,7 +1954,7 @@ namespace Crow
                        #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>
index 5c9665fb4ae9784d31d4749af625387cdf8057e1..47bd978f03c3ff34e5d45c77894e8aec19b97a08 100644 (file)
@@ -164,7 +164,10 @@ namespace Crow
                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)
index 473fc313e4c11dd59c0fb37313a914e7745ca218..8ddd7a8ecf3b6388b1d70fa46f96db7b5f798b9b 100644 (file)
@@ -148,8 +148,13 @@ namespace Crow
                        gr.LineWidth = 1;
                        Foreground.SetAsSource (gr);
                        gr.StrokePreserve ();
-                       gr.Clip ();
+                       gr.ClipPreserve ();
+
+                       Background.SetAsSource (gr);
+                       gr.Fill ();
+
                        base.onDraw (gr);
+
                        gr.Restore ();
                }
 
@@ -157,7 +162,14 @@ namespace Crow
                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);
index f7c937638bb2c2e4ea6259625d6d41e6c0bdaa98..73681b9de7fe0c3f12d930157c6ed2f18c22465a 100644 (file)
@@ -154,17 +154,17 @@ namespace Crow
                                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);
index 743bbb0f5142937ad74565139f4e0e660cd7e46d..771377619d15c9effe8bb744a10f0633f3e9eb65 100644 (file)
@@ -128,6 +128,9 @@ namespace Crow
                        Keyboard.KeyUp += Keyboard_KeyUp;
                        Keyboard.KeyPress += Keyboard_KeyPress;
 
+                       initTooltip ();
+                       initContextMenus ();
+
                        Thread t = new Thread (interfaceThread);
                        t.IsBackground = true;
                        t.Start ();
@@ -161,7 +164,7 @@ namespace Crow
                        //                      keyboardRepeatThread = new Thread (keyboardRepeatThreadFunc);
                        //                      keyboardRepeatThread.IsBackground = true;
                        //                      keyboardRepeatThread.Start ();
-               }
+               }
 
                void interfaceThread()
                {                       
@@ -212,8 +215,6 @@ namespace Crow
                        //loadCursors ();
                        loadStyling ();
                        findAvailableTemplates ();
-                       //initTooltip ();
-                       //initContextMenus ();
 
                        #if MEASURE_TIME
                        PerfMeasures.Add (updateMeasure);
@@ -500,9 +501,9 @@ namespace Crow
                        }
                }
                /// <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);
@@ -816,7 +817,7 @@ namespace Crow
                                        clipping = new Region ();
                                        //}
                                        //surf.WriteToPng (@"/mnt/data/test.png");
-                                       surf.Flush();
+
                                        backend?.Flush ();
                                }
                        }
@@ -1125,6 +1126,9 @@ namespace Crow
 
                        if (FocusedWidget == null)
                                return true;
+
+                       ActiveWidget = FocusedWidget;
+
                        if (!FocusedWidget.MouseRepeat)
                                return true;
                        mouseRepeatThread = new Thread (mouseRepeatThreadFunc);
index c5e6865456f966cd5293657af8476deceb917ca7..c7484f50ea327d187dd93dd370cce1697b43ac5d 100644 (file)
@@ -2548,9 +2548,10 @@ namespace Crow.XKB
                                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));