aboutsummaryrefslogtreecommitdiffstatsci
path: root/Samples
diff options
context:
space:
mode:
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>2020-05-13 10:35:36 +0200
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>2020-05-13 10:35:36 +0200
commite6945d8495adfa3d33d33c2e49916be79993698d (patch)
tree968a1cca224db50bc14cd351960e37e6fd5cd206 /Samples
parent74d1288c9990bb251b7097b225891bafdc6758af (diff)
embedded mouse cursors
Diffstat (limited to 'Samples')
-rw-r--r--Samples/BasicTests/BasicTests.cs2
-rw-r--r--Samples/HelloWorld/main.cs36
-rw-r--r--Samples/HelloWorld/ui/helloworld.crow4
-rw-r--r--Samples/ShowCase/main.cs4
4 files changed, 9 insertions, 37 deletions
diff --git a/Samples/BasicTests/BasicTests.cs b/Samples/BasicTests/BasicTests.cs
index 4e89ca79..05bc0435 100644
--- a/Samples/BasicTests/BasicTests.cs
+++ b/Samples/BasicTests/BasicTests.cs
@@ -18,7 +18,7 @@ namespace tests
}
}
- protected override void Startup ()
+ protected override void OnInitialized ()
{
Commands = new List<Crow.Command> (new Crow.Command [] {
new Crow.Command(new Action(() => command1())) { Caption = "command1"},
diff --git a/Samples/HelloWorld/main.cs b/Samples/HelloWorld/main.cs
index 0089943e..44ec3fb8 100644
--- a/Samples/HelloWorld/main.cs
+++ b/Samples/HelloWorld/main.cs
@@ -3,40 +3,12 @@ using Crow;
namespace HelloWorld
{
- class Program : Interface {
- Command CMDQuit;
+ class Program {
static void Main (string[] args) {
- using (Program vke = new Program ()) {
- vke.Run ();
+ using (Interface app = new Interface ()) {
+ app.Initialized += (sender, e) => (sender as Interface).Load ("#HelloWorld.helloworld.crow");
+ app.Run ();
}
}
- protected override void Startup ()
- {
- CMDQuit = new Command (new Action (Quit)) { Caption = "Quit", Icon = new SvgPicture ("#Crow.Icons.exit-symbol.svg") };
-
- Widget w = Load ("#HelloWorld.helloworld.crow");
- w.KeyPress += W_KeyPress;
- w.DataSource = this;
- }
-
- Color [] colors = { Color.Blue, Color.DarkGoldenRod, Color.Red, Color.Azure, Color.Brown, Color.Black, Color.White, Color.Pink };
- int ptr = 0;
-
- void W_KeyPress (object sender, KeyPressEventArgs e)
- {
- switch (e.KeyChar) {
- case 'w':
- LoadIMLFragment ($"<DockWindow Name='win{ptr}' Left='450' Top='450' Width='150' Height='150' Background='{colors [ptr]}'/>");
- break;
- case 'x':
- LoadIMLFragment ($"<Window Name='win{ptr}' Left='450' Top='450' Width='150' Height='150' Background='{colors [ptr]}'/>");
- break;
- }
-
- ptr++;
- if (ptr == colors.Length)
- ptr = 0;
- }
-
}
}
diff --git a/Samples/HelloWorld/ui/helloworld.crow b/Samples/HelloWorld/ui/helloworld.crow
index cb1b8887..2d7a3176 100644
--- a/Samples/HelloWorld/ui/helloworld.crow
+++ b/Samples/HelloWorld/ui/helloworld.crow
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<Window>
- <Label Text="Hello World"/>
+<Window Width="200" Height="200">
+ <TextBox Text="Hello World" Background="Blue"/>
</Window>
diff --git a/Samples/ShowCase/main.cs b/Samples/ShowCase/main.cs
index ac103290..8a91a894 100644
--- a/Samples/ShowCase/main.cs
+++ b/Samples/ShowCase/main.cs
@@ -28,7 +28,7 @@ namespace tests
}
}
- protected override void Startup ()
+ protected override void OnInitialized ()
{
Widget g = Load ("#ShowCase.showcase.crow");
g.DataSource = this;
@@ -86,7 +86,7 @@ namespace tests
void showError (Exception ex)
{
- NotifyValueChanged ("ErrorMessage", ex.ToString());
+ NotifyValueChanged ("ErrorMessage", ex.Message);
NotifyValueChanged ("ShowError", true);
}
void hideError ()