aboutsummaryrefslogtreecommitdiffstatsci
path: root/Samples/DebugLogAnalyzer/ui/main.crow
blob: 5afc6c6c34711443e3f3fbdca89cb7989b7f093f (plain)
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<?xml version="1.0"?>
<VerticalStack Background="DarkGrey">
	<HorizontalStack >
		<TabView Width="25%" >
			<VerticalStack Name="Explorer" Background="Onyx">
				<HorizontalStack Height="Fit" Margin="2" >
					<Image Margin="2" Width="16" Height="16" Path="#Crow.Icons.level-up.svg" MouseClick="goUpDirClick"
								 Background="Jet" MouseEnter="{Background=Grey}" MouseLeave="{Background=Jet}" />			
					<TextBox Text="{²CurrentDir}" Margin="2"/>
				</HorizontalStack>		
				<DirectoryView Margin="1" Name="dv" CurrentDirectory="{CurrentDir}" SelectedItemChanged="Dv_SelectedItemChanged">
					<Template>
						<TreeView IsRoot="true" Name="treeView" Data="{./FileSystemEntries}" Background="{./Background}"
								SelectedItemChanged="./onSelectedItemChanged">
							<ItemTemplate DataType="System.IO.FileInfo">
								<ListItem CornerRadius="2" Margin="0" Height="Fit" Width="Stretched"
										ContextCommands="{GetCommands}" 
										Selected="{Background=${ControlHighlight}}"
										Unselected="{Background=Transparent}">
									<HorizontalStack>
										<Image Margin="1" Width="14" Height="14" Path="#Crow.Icons.file.svg"/>
										<Label Text="{Name}" Width="Stretched"/>
									</HorizontalStack>
								</ListItem>
							</ItemTemplate>
							<ItemTemplate DataType="System.IO.DirectoryInfo" Data="GetFileSystemInfosOrdered">
								<ListItem ContextCommands="{GetCommands}"
										Selected="{/exp.Background=${ControlHighlight}}"
										Unselected="{/exp.Background=Transparent}">
									<Expandable Name="exp" Caption="{Name}" MouseDoubleClick="/onClickForExpand">
										<Template>
											<VerticalStack>
												<Border CornerRadius="2" Margin="0" Height="Fit" MouseDoubleClick="./onClickForExpand"
														Foreground="Transparent"
														MouseEnter="{Foreground=DimGrey}"
														MouseLeave="{Foreground=Transparent}">
													<HorizontalStack Background="{./Background}" Spacing="1">
														<Image Margin="1" Width="9" Height="9" Focusable="true" MouseDown="./onClickForExpand"
															Path="{./Image}"
															Visible="{./IsExpandable}"
															SvgSub="{./IsExpanded}"
															MouseEnter="{Background=LightGrey}"
															MouseLeave="{Background=Transparent}"/>
														<Image Margin="1" Width="16" Height="16"
															Path="#Crow.Icons.folder.svg" SvgSub="{./IsExpanded}"/>
														<Label Text="{./Caption}"/>
													</HorizontalStack>
												</Border>
												<Container Name="Content" Visible="false"/>
											</VerticalStack>
										</Template>
										<HorizontalStack Height="Fit">
											<Widget Width="12" Height="10"/>
											<VerticalStack Height="Fit" Name="ItemsContainer"/>
										</HorizontalStack>
									</Expandable>
								</ListItem>
							</ItemTemplate>
						</TreeView>
					</Template>		
				</DirectoryView>
			</VerticalStack>
			<VerticalStack Name="DebugLogger" Margin="5" IsVisible="false" Background="Onyx">
				<HorizontalStack Height="Fit">
					<Image Width="30" Height="20" Path="#Crow.Icons.IconAlerte.svg" Visible="{../../../../dbgIfaceWidget.CrowDebuggerNOK}"/>
					<Label Fit="true" Text="Crow debug assembly path:"/>
					<Widget Width="5" Height="5" Background="SeaGreen" IsVisible="{../../../../dbgIfaceWidget.HasFocus}"/>
					<Widget Width="5" Height="5" Background="Yellow" IsVisible="{../../../../dbgIfaceWidget.IsHover}"/>
					<TextBox Text="{²CrowDbgAssemblyLocation}" Margin="2"/>
				</HorizontalStack>
				<Label Background="Red" Foreground="White" Margin="5" Width="Stretched" Text="{../../../dbgIfaceWidget.CrowDebuggerErrorMessage}"
					IsVisible="{../../../dbgIfaceWidget.CrowDebuggerNOK}"/>
				<!--<CheckBox Name="cbFile" Caption="Record to file" IsChecked="{²DebugLogToFile}" Background="Onyx"/>-->
				<HorizontalStack Height="Fit" Width="Stretched" IsEnabled="{../cbFile.IsChecked}" Background="Onyx" Margin="5">
					<Label Text="Debug log output file:" Fit="true"/>
					<TextBox Text="{²../../../../dbgIfaceWidget.DebugLogFilePath}"  />
				</HorizontalStack>
				<EnumSelector RadioButtonStyle="CheckBox2" Template="#Dbg.EnumSelector.template"
						Background="Grey"
						Caption="Recorded Events" EnumValue="{²RecordedEvents}" BitFieldExcludeMask="255" />					
				<EnumSelector RadioButtonStyle="CheckBox2" Template="#Dbg.EnumSelector.template"
						Background="Onyx"
						Caption="Discarded Events" EnumValue="{²DiscardedEvents}" BitFieldExcludeMask="255" />
				<CheckBox Caption="Begin recording on startup" IsChecked="{²DebugLogOnStartup}" Background="Onyx"/>				
				<HorizontalStack Height="Fit">
					<CheckBox Caption="Recording" IsChecked="{²DebugLogRecording}" Height="40" Width="60"	
						Checked="{sh.Path='A 8,8,7.5,0,6.3 O 0.8,0,0,1 f O 0,0,0,0.5 G'}"
						Unchecked="{sh.Path='R 0.5,0.5,15,15 f O 0,0,0,1 G'}">
						<Template>
							<Border Background="Onyx" Margin="10" CornerRadius="5">
								<Shape Name="sh"  Foreground="Grey" Size="16,16" Path="R 0.5,0.5,15,15 f O 0,0,0,1 G"/> 
							</Border>
						</Template>
					</CheckBox>
					<Menu Data="{../../../../dbgIfaceWidget.LoggerCommands}" Height="Fit" Width="Stretched">
						<Template>
							<Wrapper Orientation="Vertical" Name="ItemsContainer" Margin="0" Background="{./Background}"/>
						</Template>
						<ItemTemplate>
							<Button Command="{}" Height="Stretched" Width="Fit"/>
						</ItemTemplate>
					</Menu>					
				</HorizontalStack>					
			</VerticalStack>			
		</TabView>
		<Splitter Width="6" />
		<VerticalStack>
			<DebugInterfaceWidget Name="dbgIfaceWidget" Height="60%" Background="Black" Focusable="true"
					CrowDbgAssemblyLocation="{²CrowDbgAssemblyLocation}"
					Recording="{²DebugLogRecording}"
					IMLSource="{Source}"
					CurrentException="{²CurrentException}"
					DiscardedEvents="{DiscardedEvents}" RecordedEvents="{RecordedEvents}" DebugLogToFile="{DebugLogToFile}"/>
			<Splitter/>
			<!--<TabView>-->
				<VerticalStack Name="Editor" Spacing="0">
					<HorizontalStack Height="Fit">
						<Button Style="IcoButton" Command="{CMDNew}" />
						<Button Style="IcoButton" Command="{CMDSave}" />
						<Button Style="IcoButton" Command="{CMDSaveAs}" />
						<Button Style="IcoButton" Command="{CMDUndo}" />
						<Button Style="IcoButton" Command="{CMDRedo}" />
						<!--<Button Style="IcoButton" Command="{CMDCut}" />
						<Button Style="IcoButton" Command="{CMDCopy}" />
						<Button Style="IcoButton" Command="{CMDPaste}" />-->
						<Widget Width="Stretched" />
						<Widget Background="Red" IsVisible="{DebugLogRecording}" CornerRadius="10" Width="12" Height="12"/>
					</HorizontalStack>

					<HorizontalStack>
						<Editor Name="tb" Text="{Source}" Multiline="true" Font="consolas, 12" Focusable="true" Height="Stretched" Width="Stretched"						
								TextChanged="onTextChanged" KeyDown="textView_KeyDown" ContextCommands="{EditorCommands}"
								Foreground="DarkGrey" Background="White"/>
								<!--SelectionChanged="onSelectedTextChanged"-->
						<ScrollBar Value="{²../tb.ScrollY}"
								LargeIncrement="{../tb.PageHeight}" SmallIncrement="1"
								CursorRatio="{../tb.ChildHeightRatio}" Maximum="{../tb.MaxScrollY}" />
					</HorizontalStack>
					<ScrollBar Style="HScrollBar" Value="{²../tb.ScrollX}"
							LargeIncrement="{../tb.PageWidth}" SmallIncrement="1"
							CursorRatio="{../tb.ChildWidthRatio}" Maximum="{../tb.MaxScrollX}" />
					<HorizontalStack Height="Fit" Spacing="10" Background="DarkGrey">
						<Widget Width="10" Height="10" Background="RoyalBlue" Visible="{IsDirty}"/>
						<Label Text="{CurrentFile}" Width="Stretched"/>
						<Widget Width="Stretched"/>
						<Label Text="Line:" Foreground="Grey"/>
						<Label Text="{../../tb.CurrentLine}"  Margin="2"/>
						<Label Text="Col:" Foreground="Grey"/>
						<Label Text="{../../tb.CurrentColumn}" Margin="2"/>
					</HorizontalStack>
					<Popper IsVisible="{ShowError}" Background="Red">
						<Template>
							<CheckBox IsChecked="{²./IsPopped}" MouseEnter="{IsChecked='true'}" MouseLeave="{IsChecked='false'}">
								<Template>
									<Label Text="{CurrentExceptionMSG}" Background="Red" Foreground="White" Width="Stretched" Margin="2"
										Multiline="true"/>
								</Template>
							</CheckBox>
						</Template>
						<Label Text="{CurrentException}" Background="DarkRed" Foreground="White" Width="Stretched" Margin="2" Multiline="true"/>
					</Popper>			
				</VerticalStack>
				
			<!--</TabView>-->
		</VerticalStack>
	</HorizontalStack>
</VerticalStack>