File: Test_DDContainer.cs

package info (click to toggle)
mygui 3.4.1%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 38,800 kB
  • sloc: cpp: 122,825; ansic: 30,231; xml: 15,792; cs: 12,601; tcl: 776; python: 397; makefile: 38
file content (50 lines) | stat: -rw-r--r-- 1,673 bytes parent folder | download | duplicates (7)
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
using MyGUI.Sharp;

namespace TestApp.Sharp
{
	public class Test_DDContainer
	{
		//static Widget mWidget;

		public static void Test()
		{
			DDContainer container = Gui.Instance.CreateWidget<DDContainer>("Button", new IntCoord(420, 520, 100, 100), Align.Default, "Main");
			container.NeedDragDrop = !container.NeedDragDrop;

			container.EventChangeDDState += new DDContainer.HandleChangeDDState(container_EventChangeDDState);
			container.EventDropResult += new DDContainer.HandleDropResult(container_EventDropResult);
			container.EventRequestDrop += new DDContainer.HandleRequestDrop(container_EventRequestDrop);
			container.EventStartDrag += new DDContainer.HandleStartDrag(container_EventStartDrag);
			//container.RequestDragWidgetInfo += new DDContainer.HandleDragWidgetInfo(container_RequestDragWidgetInfo);

			//mWidget = Gui.Instance.CreateWidget<Widget>("Button", new IntCoord(0, 0, 10, 10), Align.Default, "Popup");
			//mWidget.Visible = false;
		}

		/*static void container_RequestDragWidgetInfo(DDContainer _sender, ref Widget _item, ref IntCoord _dimension)
		{
			mWidget.Visible = true;
			_item = mWidget;
			_dimension = new IntCoord(0, 0, 20, 20);
		}*/

		static void container_EventStartDrag(DDContainer _sender, ref DDItemInfo _info, ref bool _result)
		{
			_result = true;
		}

		static void container_EventRequestDrop(DDContainer _sender, ref DDItemInfo _info, ref bool _result)
		{
			_result = true;
		}

		static void container_EventDropResult(DDContainer _sender, ref DDItemInfo _info, bool _result)
		{
			//mWidget.Visible = false;
		}

		static void container_EventChangeDDState(DDContainer _sender, DDItemState _state)
		{
		}
	}
}