]> O.S.I.I.S - jp/crow.git/commitdiff
MessageBox styling and events
authorjpbruyere <jp.bruyere@hotmail.com>
Mon, 29 Feb 2016 07:53:57 +0000 (08:53 +0100)
committerjpbruyere <jp.bruyere@hotmail.com>
Mon, 29 Feb 2016 07:53:57 +0000 (08:53 +0100)
Styles/MessageBox.style
Templates/MessageBox.goml
Tests/GOLIBTests.cs
Tests/Interfaces/testMsgBox.goml
src/GraphicObjects/MessageBox.cs

index 046db0e0f48b751954948f0795f1efd67ade1548..294a996b2a1b9ecc0717ec5a025810bf2342c2e6 100644 (file)
@@ -1,4 +1,5 @@
-Width=260
+Width=200
+Height=-1
 Title=MessageBox
 Focusable=true
 MinimumSize=150;80
index 68d1fa823b978c113d37ac58e2d414b0bfbae9e0..0e0dac64a76506565805869a206bebdc81b617d9 100644 (file)
@@ -23,8 +23,8 @@
                </HorizontalStack>
                <HorizontalStack Height="-1" Width="{../../../WidthPolicy}" Margin="3">
                        <GraphicObject Height="5"/>
-                       <Button Caption="Ok" MouseClick="onOkButtonClick"/>
-                       <Button Caption="Cancel" MouseClick="onCancelButtonClick"/>
+                       <Button Caption="Ok" MouseClick="../../../../onOkButtonClick"/>
+                       <Button Caption="Cancel" MouseClick="../../../../onCancelButtonClick"/>
                </HorizontalStack>
        </VerticalStack>
 </Border>
index 81d76346f01ffea0a3053e44359443d869b72559..b70a25423888a6510bdaebe6b300f108aaadb0ce 100644 (file)
@@ -37,6 +37,9 @@ namespace test
                int frameCpt = 0;
                int idx = 0;
                string[] testFiles = {
+                       "testMsgBox.goml",
+                       "testCombobox.goml",
+                       "testExpandable.goml",
                        "test_Listbox.goml",
                        "6.crow",
                        "testGroupBox.goml",
@@ -44,7 +47,6 @@ namespace test
                        "5.crow",
                        "testCheckbox.goml",
                        "testTabView.crow",
-                       "testExpandable.goml",
                        "0.crow",
                        "testImage.crow",
                        "testOutOfClipUpdate.crow",
@@ -55,7 +57,6 @@ namespace test
                        "clip2.crow",
                        "clip0.crow",
                        "clip1.crow",
-                       "testCombobox.goml",
                        "testPopper.goml",
                        "testTextBox.crow",
                        "testColorList.crow",
@@ -80,7 +81,7 @@ namespace test
 //                     "testRadioButton2.goml",
                        "testContainer.goml",
                        "testRadioButton.goml",
-                       "testMsgBox.goml",
+
 //                     "testMeter.goml",
                };
 
@@ -180,7 +181,9 @@ namespace test
                }
                void OnClear (object sender, MouseButtonEventArgs e) => TestList = null;
 
-               void OnLoadList (object sender, MouseButtonEventArgs e) => TestList = Color.ColorDic.ToList();
+               void OnLoadList (object sender, MouseButtonEventArgs e) {
+                       TestList = Color.ColorDic.ToList();
+               }
 
                protected override void OnLoad (EventArgs e)
                {
@@ -189,8 +192,7 @@ namespace test
 
                        GraphicObject obj = LoadInterface("Interfaces/" + testFiles[idx]);
                        obj.DataSource = this;
-
-               }
+       }
                protected override void OnUpdateFrame (FrameEventArgs e)
                {
                        //if (frameCpt % 8 == 0)
@@ -255,5 +257,12 @@ namespace test
                                win.Run (30.0);
                        }
                }
+               void onMsgBoxOk(object sender, EventArgs e){
+                       Debug.WriteLine ("OK");
+               }
+               void onMsgBoxCancel(object sender, EventArgs e)
+               {
+                       Debug.WriteLine ("cancel");
+               }
        }
 }
\ No newline at end of file
index 9cd0e33929f1547ebcade7bb4a2a1997d6cf18fe..680f43b4bade0e103e8f2433e936c02814cb811b 100755 (executable)
@@ -1,2 +1,4 @@
 <?xml version="1.0"?>
-<MessageBox Width="200" Height="-1"/>
\ No newline at end of file
+<MessageBox Title="message" Message="this is a message box"
+       Ok="onMsgBoxOk"
+       Cancel="onMsgBoxCancel"/>
\ No newline at end of file
index cae43d9f134a4dbb4878cd2335d1935726b948b9..2114262e8cd0d3e400466655a4825d4812b8bb2c 100644 (file)
@@ -52,7 +52,7 @@ namespace Crow
                }
                void onCancelButtonClick (object sender, EventArgs e)
                {
-                       Ok.Raise (this, null);
+                       Cancel.Raise (this, null);
                }
 
        }