1 #include "FormView.hpp"
2 
CreateObjectMenu(Bar & bar,int id)3 void FormView::CreateObjectMenu(Bar& bar, int id)
4 {
5 	int selCount = GetSelected().GetCount();
6 
7 	if (selCount > 1)
8 		bar.Add(t_("Align selected"), THISBACK(AlignObjectMenu));
9 
10 	if (selCount != GetObjectCount())
11 		bar.Add(t_("Invert selection"), THISBACK(InvertSelection));
12 
13 	if ((selCount != GetObjectCount()) || selCount > 1)
14 		bar.Separator();
15 
16 	if (selCount == 1)
17 	{
18 		bar.Add(t_("Outline"), THISBACK1(ToggleOutlineDraw, id)).Check(IsOutlineDraw(id));
19 		bar.Separator();
20 	}
21 
22 	if (selCount <= 1)
23 	{
24 		bar.Add(t_("Top"), THISBACK1(MoveToTopObject, id));
25 		bar.Add(t_("Up"), THISBACK1(MoveUpObject, id));
26 		bar.Add(t_("Down"), THISBACK1(MoveDownObject, id));
27 		bar.Add(t_("Bottom"), THISBACK1(MoveToBottomObject, id));
28 		bar.Separator();
29 	}
30 
31 	bar.Add(t_("Delete"), THISBACK(RemoveSelection));
32 
33 	if (selCount >= 1)
34 	{
35 		bar.Separator();
36 		bar.Add(t_("Properties"), THISBACK(DoOpenObjectProperties));
37 	}
38 }
39 
AddObjectMenu(Bar & bar,Point p)40 void FormView::AddObjectMenu(Bar& bar, Point p)
41 {
42 	bar.Add(t_("Button"), THISBACK2(CreateObject, p, "Button"));
43 	bar.Add(t_("EditField"), THISBACK2(CreateObject, p, "EditField"));
44 	bar.Add(t_("EditInt"), THISBACK2(CreateObject, p, "EditInt"));
45 	bar.Add(t_("DropDate"), THISBACK2(CreateObject, p, "DropDate"));
46 	bar.Separator();
47 	bar.Add(t_("ProgressBar"), THISBACK2(CreateObject, p, "ProgressBar"));
48 	bar.Add(t_("Label"), THISBACK2(CreateObject, p, "Label"));
49 	bar.Separator();
50 	bar.Add(t_("TabCtrl"), THISBACK2(CreateObject, p, "TabCtrl"));
51 	bar.Add(t_("GridCtrl"), THISBACK2(CreateObject, p, "GridCtrl"));
52 	bar.Separator();
53 	bar.Add(t_("Form"), THISBACK2(CreateObject, p, "Form"));
54 }
55 
AlignObjectMenu(Bar & bar)56 void FormView::AlignObjectMenu(Bar& bar)
57 {
58 	bar.Add(t_("Top "), THISBACK(AlignTopSelection));
59 	bar.Add(t_("Left"), THISBACK(AlignLeftSelection));
60 	bar.Add(t_("Right"), THISBACK(AlignRightSelection));
61 	bar.Add(t_("Bottom "), THISBACK(AlignBottomSelection));
62 }
63