2009-07-10 19:15:22 +00:00
|
|
|
|
|
|
|
|
|
#region ================== Copyright (c) 2007 Pascal vd Heiden
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com
|
|
|
|
|
* This program is released under GNU General Public License
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
2019-08-29 14:30:49 +00:00
|
|
|
|
#if !NO_FORMS_DESIGN
|
|
|
|
|
|
2009-07-10 19:15:22 +00:00
|
|
|
|
#region ================== Namespaces
|
|
|
|
|
|
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.ComponentModel.Design;
|
|
|
|
|
using System.Windows.Forms.Design.Behavior;
|
|
|
|
|
using System.Windows.Forms.Design;
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
namespace CodeImp.DoomBuilder.Controls
|
|
|
|
|
{
|
|
|
|
|
// Designer for ButtonsNumericTextbox
|
|
|
|
|
internal class ButtonsNumericTextboxDesigner : ControlDesigner
|
|
|
|
|
{
|
|
|
|
|
public override IList SnapLines
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
IList snaplines = base.SnapLines;
|
|
|
|
|
|
|
|
|
|
ButtonsNumericTextbox control = base.Control as ButtonsNumericTextbox;
|
|
|
|
|
if(control == null) { return snaplines; }
|
|
|
|
|
|
|
|
|
|
IDesigner designer = TypeDescriptor.CreateDesigner(control.Textbox, typeof(IDesigner));
|
|
|
|
|
if(designer == null) { return snaplines; }
|
|
|
|
|
designer.Initialize(control.Textbox);
|
|
|
|
|
|
|
|
|
|
using(designer)
|
|
|
|
|
{
|
|
|
|
|
ControlDesigner boxdesigner = designer as ControlDesigner;
|
|
|
|
|
if(boxdesigner == null) { return snaplines; }
|
|
|
|
|
|
|
|
|
|
// Add the baseline and right snap lines from the textbox
|
|
|
|
|
foreach(SnapLine line in boxdesigner.SnapLines)
|
|
|
|
|
{
|
|
|
|
|
if(line.SnapLineType == SnapLineType.Baseline)
|
|
|
|
|
snaplines.Add(new SnapLine(line.SnapLineType, line.Offset + control.Textbox.Top, line.Filter, line.Priority));
|
|
|
|
|
|
|
|
|
|
if(line.SnapLineType == SnapLineType.Right)
|
|
|
|
|
snaplines.Add(new SnapLine(line.SnapLineType, line.Offset + control.Textbox.Left, line.Filter, line.Priority));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return snaplines;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-08-29 14:30:49 +00:00
|
|
|
|
|
|
|
|
|
#endif
|