-
Notifications
You must be signed in to change notification settings - Fork 1
/
WidgetElem.cs
81 lines (73 loc) · 1.54 KB
/
WidgetElem.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/*
* Creato da SharpDevelop.
* Utente: Family Rose
* Data: 26/12/2008
* Ora: 12.12
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using wx;
using System.Windows.Forms;
using System.Drawing;
using System.Collections;
namespace mkdb
{
public enum StandardWidgetType
{
WID_UNKNOWN = 0,
WID_FRAME = 1,
WID_BOXSIZER = 2,
WID_APP = 3,
WID_BUTTON = 4,
}
public interface IWDBBase
{
wx.SizerItem SizerItem { get; }
wx.Window ParentContainer { get; }
wx.Sizer ParentSizer { get; }
bool IsSizer { get; }
bool IsSelected { get; set; }
WidgetProps Properties { get; }
int WidgetType { get; }
void HighlightSelection();
bool InsertWidget();
bool DeleteWidget();
long FindBlockInText();
bool CanAcceptChildren();
}
public class WidgetTreeNode : TreeNode
{
protected IWDBBase _elem;
public WidgetTreeNode(string treenodename) : base(treenodename)
{
}
public IWDBBase Widget
{
get { return _elem; }
set { _elem = value; }
}
public void OnCut() {}
public void OnCopy() {}
public void OnPaste() {}
public void OnDelete()
{
// Delete this widget and
// all his children, if any.
// Remove as Node.
Remove();
_elem.DeleteWidget();
if (_elem.IsSizer == true)
{
wx.Sizer sizer = (wx.Sizer)_elem;
sizer.Dispose();
} else {
wx.Window win = (wx.Window)_elem;
win.Close();
win.Dispose();
}
}
public void OnMoveUp() {}
public void OnMoveDown() {}
}
}