Update of /cvsroot/mmclibrary/mmclibrary/MMCLib2/PropertyPages
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv11362/MMCLib2/PropertyPages
Modified Files:
PropertySheet.cs
Log Message:
gave buttons on propertysheet public property
Index: PropertySheet.cs
===================================================================
RCS file: /cvsroot/mmclibrary/mmclibrary/MMCLib2/PropertyPages/PropertySheet.cs,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** PropertySheet.cs 19 Jan 2005 23:51:38 -0000 1.13
--- PropertySheet.cs 19 Sep 2006 11:04:58 -0000 1.14
***************
*** 37,43 ****
#region
! private Button _btnOk;
! private Button _btnCancel;
! private Button _btnApply;
private PropertySheetTabControl _tc;
private PropertyPageList _allPages = new PropertyPageList();
--- 37,49 ----
#region
! private Button _btnOk = new Button();
!
!
! private Button _btnCancel = new Button();
!
!
! private Button _btnApply = new Button();
!
!
private PropertySheetTabControl _tc;
private PropertyPageList _allPages = new PropertyPageList();
***************
*** 52,56 ****
// Properties
//
! #region
/// <summary>
/// Get the item we are a property page for.
--- 58,89 ----
// Properties
//
! #region Properties
! //[--added by Harald Binkle (tigerharry)
! /// <summary>
! /// Apply button at the buttomn of the propertypage. Set to null if should not be added.
! /// </summary>
! public Button BtnApply
! {
! get { return _btnApply; }
! set { _btnApply = value; }
! }
! /// <summary>
! /// Cancel button at the buttomn of the propertypage. Set to null if should not be added.
! /// </summary>
! public Button BtnCancel
! {
! get { return _btnCancel; }
! set { _btnCancel = value; }
! }
! /// <summary>
! /// OK button at the buttomn of the propertypage
! /// </summary>
! public Button BtnOk
! {
! get { return _btnOk; }
! set { _btnOk = value; }
! }
! //--]
!
/// <summary>
/// Get the item we are a property page for.
***************
*** 100,104 ****
public bool IsApplyEnabled()
{
! return _btnApply.Enabled;
}
--- 133,138 ----
public bool IsApplyEnabled()
{
! //changed by Harald Binkle (tigerharry)
! return _btnApply != null ? _btnApply.Enabled : false;
}
***************
*** 201,229 ****
nHeight += 15;
! // Now put the Ok, Cancel, and Apply buttons on the page.
! _btnApply = new Button();
! _btnApply.Size = new System.Drawing.Size(75, 23);
! _btnApply.Location = new Point(nWidth-_btnApply.Width+4, nHeight);
! _btnApply.Text = SnapinBase.Translate("Apply");
! _btnApply.Enabled = false;
! _btnApply.TabIndex = 3;
! _btnApply.Click += new EventHandler(OnApplyClick);
! //Added by Alexander Kachalkov
! _btnApply.FlatStyle = FlatStyle.System;
! Controls.Add(_btnApply);
!
! _btnCancel = new Button();
! _btnCancel.Size = new System.Drawing.Size(75, 23);
! _btnCancel.Location = new Point(_btnApply.Location.X - _btnCancel.Width-5, nHeight);
! _btnCancel.Text = SnapinBase.Translate("Cancel");
! _btnCancel.Click += new EventHandler(OnCancelClick);
! _btnCancel.TabIndex = 2;
! //Added by Alexander Kachalkov
! _btnCancel.FlatStyle = FlatStyle.System;
! Controls.Add(_btnCancel);
- _btnOk = new Button();
_btnOk.Size = new System.Drawing.Size(75, 23);
! _btnOk.Location = new Point(_btnCancel.Location.X - _btnOk.Width - 5, nHeight);
_btnOk.Text = SnapinBase.Translate("Ok");
_btnOk.TabIndex = 1;
--- 235,272 ----
nHeight += 15;
! // Now put the Ok, Cancel, and Apply buttons on the page.
! //[--added if(!=null), nextBtnPos and space by Harald Binkle (tigerharry)
! int nextBtnPos = nWidth;
! int space = +4;
! if (_btnApply != null)
! {
! _btnApply.Size = new System.Drawing.Size(75, 23);
! _btnApply.Location = new Point(nextBtnPos - _btnApply.Width + space, nHeight);
! space = -space;
! nextBtnPos = _btnApply.Location.X;
! _btnApply.Text = SnapinBase.Translate("Apply");
! _btnApply.Enabled = false;
! _btnApply.TabIndex = 3;
! _btnApply.Click += new EventHandler(OnApplyClick);
! //Added by Alexander Kachalkov
! _btnApply.FlatStyle = FlatStyle.System;
! Controls.Add(_btnApply);
! }
! if (_btnCancel != null)
! {
! _btnCancel.Size = new System.Drawing.Size(75, 23);
! _btnCancel.Location = new Point(nextBtnPos - _btnCancel.Width + space, nHeight);
! space = -Math.Abs(space);
! nextBtnPos = _btnCancel.Location.X;
! _btnCancel.Text = SnapinBase.Translate("Cancel");
! _btnCancel.Click += new EventHandler(OnCancelClick);
! _btnCancel.TabIndex = 2;
! //Added by Alexander Kachalkov
! _btnCancel.FlatStyle = FlatStyle.System;
! Controls.Add(_btnCancel);
! }
_btnOk.Size = new System.Drawing.Size(75, 23);
! _btnOk.Location = new Point(nextBtnPos - _btnOk.Width + space, nHeight);
_btnOk.Text = SnapinBase.Translate("Ok");
_btnOk.TabIndex = 1;
***************
*** 232,235 ****
--- 275,280 ----
_btnOk.FlatStyle = FlatStyle.System;
Controls.Add(_btnOk);
+ //--]
+
// Make sure we account for the height of the button
***************
*** 375,379 ****
{
SendApplyToAll();
! _btnApply.Enabled = false;
}
}
--- 420,424 ----
{
SendApplyToAll();
! DeactivateApplyButton();
}
}
|