File size: 3,331 Bytes
b6a38d7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
-- ========== GENERATED BY XTemplate Editor (Alt-F3) DO NOT EDIT MANUALLY! ==========

PlaceObj('XTemplate', {
	__is_kind_of = "GedTextPanel",
	group = "GedApps",
	id = "GedStatusBar",
	save_in = "Ged",
	PlaceObj('XTemplateWindow', {
		'comment', "see Preset:GetPresetStatusText",
		'__context', function (parent, context) return "SelectedObject" end,
		'__class', "GedTextPanel",
		'Id', "idStatusBar",
		'Margins', box(2, 2, 2, 0),
		'Padding', box(2, 0, 1, 0),
		'Dock', "bottom",
		'FoldWhenHidden', true,
		'Title', "",
		'DisplayWarnings', false,
		'FormatFunc', "GedPresetStatusText",
	}, {
		PlaceObj('XTemplateWindow', {
			'__class', "XToggleButton",
			'Id', "idViewErrorsOnly",
			'Margins', box(2, 2, 2, 2),
			'BorderWidth', 1,
			'Padding', box(2, 0, 2, 0),
			'Dock', "right",
			'VAlign', "center",
			'LayoutMethod', "VList",
			'FoldWhenHidden', true,
			'BorderColor', RGBA(0, 0, 0, 0),
			'OnPress', function (self, gamepad)
				XToggleButton.OnPress(self, gamepad)
				local root_panel = GetParentOfKind(self, "GedTreePanel")
				local mode = not root_panel.view_errors_only
				root_panel:SetViewErrorsOnly(mode)
			end,
			'PressedBackground', RGBA(160, 160, 160, 255),
			'TextStyle', "GedError",
			'Text', "Errors only",
			'ToggledBackground', RGBA(40, 43, 48, 255),
			'ToggledBorderColor', RGBA(240, 0, 0, 255),
		}),
		PlaceObj('XTemplateWindow', {
			'__class', "XToggleButton",
			'Id', "idViewWarningsOnly",
			'Margins', box(2, 2, 2, 2),
			'BorderWidth', 1,
			'Padding', box(2, 0, 2, 0),
			'Dock', "right",
			'VAlign', "center",
			'LayoutMethod', "VList",
			'FoldWhenHidden', true,
			'BorderColor', RGBA(0, 0, 0, 0),
			'OnPress', function (self, gamepad)
				XToggleButton.OnPress(self, gamepad)
				local root_panel = GetParentOfKind(self, "GedTreePanel")
				local mode = not root_panel.view_warnings_only
				root_panel:SetViewWarningsOnly(mode)
			end,
			'PressedBackground', RGBA(160, 160, 160, 255),
			'TextStyle', "GedWarning",
			'Text', "Warnings only",
			'ToggledBackground', RGBA(40, 43, 48, 255),
			'ToggledBorderColor', RGBA(255, 140, 0, 255),
		}),
		PlaceObj('XTemplateWindow', {
			'__context', function (parent, context) return "SelectedObject" end,
			'__class', "GedBindView",
			'Id', "idBindView",
			'BindView', "warning_error_count",
			'BindFunc', "GedPresetWarningsErrors",
			'OnViewChanged', function (self, value, control)
				local errsButton = self:ResolveId("idViewErrorsOnly")
				if errsButton then
					errsButton:SetVisible(value ~= 0)
				end
				local warnsButton = self:ResolveId("idViewWarningsOnly")
				if warnsButton then
					warnsButton:SetVisible(value ~= 0)
				end
				if value == 0 then
					local treeParent = GetParentOfKind(self, "GedTreePanel")
					treeParent:SetViewWarningsOnly(false)
					treeParent:SetViewErrorsOnly(false)
				end
			end,
		}),
		PlaceObj('XTemplateFunc', {
			'name', "Open(self,...)",
			'func', function (self,...)
				if self.FormatFunc == "GedPresetStatusText" then
					self:ResolveId("idBindView").BindFunc = "GedPresetWarningsErrors"
				elseif self.FormatFunc == "GedModStatusText" then
					self:ResolveId("idBindView").BindFunc =  "GedModWarningsErrors"
				else
					self:ResolveId("idBindView").BindFunc = "GedPresetWarningsErrors"
				end
				GedTextPanel.Open(self,...)
			end,
		}),
		}),
})