Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/mcs
diff options
context:
space:
mode:
authorAlexandre Pigolkine <pigolkine@mono-cvs.ximian.com>2003-03-11 00:06:34 +0300
committerAlexandre Pigolkine <pigolkine@mono-cvs.ximian.com>2003-03-11 00:06:34 +0300
commit7131f36d63601ac8892272c683ef389d57d0ac4b (patch)
treee016ac7b49ce539a53985e244430a3c79849eda2 /mcs
parentae2f8c58af535b2aedf4415f8d383149a07b56c9 (diff)
check in for Steven Stewart
svn path=/trunk/mcs/; revision=12412
Diffstat (limited to 'mcs')
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/Button.cs20
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ChangeLog4
2 files changed, 20 insertions, 4 deletions
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/Button.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/Button.cs
index 64ad9031484..eeab9732b57 100644
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/Button.cs
+++ b/mcs/class/System.Windows.Forms/System.Windows.Forms/Button.cs
@@ -78,16 +78,27 @@ namespace System.Windows.Forms {
}
// --- IButtonControl method ---
- [MonoTODO]
public virtual void NotifyDefault(bool value)
{
- //FIXME:
+ //Sanity check...bail out if this ain't a window.
+ if (!Win32.IsWindow(this.Handle)) return;
+
+ //Figure what the caller wants, and set the value accordingly
+ uint nDefPushButton;//this will hold the value of either BS_DEFPUSHBUTTON or it's logial opposite
+ if (value)
+ nDefPushButton = (uint)ButtonStyles.BS_DEFPUSHBUTTON;
+ else //Ok, so we gotta find the bitwise opposite of BS_DEFPUSHBUTTON;
+ nDefPushButton = 0xFFFFFFFF ^ (uint)ButtonStyles.BS_DEFPUSHBUTTON; // a number's opposite is determined by xor-ing it with a full house of 1's, and since uint is 4Bytes that's FFFFFFFF
+
+ uint nOldStyle = (uint)Win32.GetWindowLong(this.Handle, GetWindowLongFlag.GWL_STYLE);
+ uint nNewStyle = nDefPushButton & nOldStyle; //Our chosen value, BitAnd-ed with the existing style
+ Win32.SendMessage(this.Handle, (Msg)ButtonMessages.BM_SETSTYLE, (int)nNewStyle, (int)1);
}
- [MonoTODO]
public void PerformClick()
{
- //FIXME:
+ EventArgs e = new EventArgs();
+ OnClick(e);
}
// --- Button methods for events ---
@@ -295,3 +306,4 @@ namespace System.Windows.Forms {
*/
}
}
+
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/System.Windows.Forms/System.Windows.Forms/ChangeLog
index 3ec08eaeed2..270dbc89ca9 100644
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ChangeLog
+++ b/mcs/class/System.Windows.Forms/System.Windows.Forms/ChangeLog
@@ -1,3 +1,7 @@
+2003-03-10 Alexandre Pigolkine <pigolkine@gmx.de>
+ * Button.cs
+ check in for Steven Stewart <stevenstewart@mindspring.com>
+
2003-03-09 Alexandre Pigolkine <pigolkine@gmx.de>
* Application.cs fixed line terminators