diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2016-02-29 08:53:57 +0100 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2016-02-29 08:53:57 +0100 |
| commit | bda85a51243ad024b3cbddba85f71ab15c8c9acd (patch) | |
| tree | 1e3342babb04a6d827b4405431fbf8676792f86d | |
| parent | deece778998c711608b93250685efc88dbff866b (diff) | |
MessageBox styling and events
| -rw-r--r-- | Styles/MessageBox.style | 3 | ||||
| -rw-r--r-- | Templates/MessageBox.goml | 4 | ||||
| -rw-r--r-- | Tests/GOLIBTests.cs | 21 | ||||
| -rwxr-xr-x | Tests/Interfaces/testMsgBox.goml | 4 | ||||
| -rw-r--r-- | src/GraphicObjects/MessageBox.cs | 2 |
5 files changed, 23 insertions, 11 deletions
diff --git a/Styles/MessageBox.style b/Styles/MessageBox.style index 046db0e0..294a996b 100644 --- a/Styles/MessageBox.style +++ b/Styles/MessageBox.style @@ -1,4 +1,5 @@ -Width=260 +Width=200 +Height=-1 Title=MessageBox Focusable=true MinimumSize=150;80 diff --git a/Templates/MessageBox.goml b/Templates/MessageBox.goml index 68d1fa82..0e0dac64 100644 --- a/Templates/MessageBox.goml +++ b/Templates/MessageBox.goml @@ -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> diff --git a/Tests/GOLIBTests.cs b/Tests/GOLIBTests.cs index 81d76346..b70a2542 100644 --- a/Tests/GOLIBTests.cs +++ b/Tests/GOLIBTests.cs @@ -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 diff --git a/Tests/Interfaces/testMsgBox.goml b/Tests/Interfaces/testMsgBox.goml index 9cd0e339..680f43b4 100755 --- a/Tests/Interfaces/testMsgBox.goml +++ b/Tests/Interfaces/testMsgBox.goml @@ -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 diff --git a/src/GraphicObjects/MessageBox.cs b/src/GraphicObjects/MessageBox.cs index cae43d9f..2114262e 100644 --- a/src/GraphicObjects/MessageBox.cs +++ b/src/GraphicObjects/MessageBox.cs @@ -52,7 +52,7 @@ namespace Crow } void onCancelButtonClick (object sender, EventArgs e) { - Ok.Raise (this, null); + Cancel.Raise (this, null); } } |