1 { KOL MCK } // Do not remove this line!
\r
8 const _TabControl1_Tab0 = 0;
\r
9 const _TabControl1_Tab1 = 1;
\r
10 const _TabControl1_Tab2 = 2;
\r
11 const _tc1_Tab3 = 3;
\r
15 const pmHistory = 0;
\r
16 const pmRestore = 1;
\r
21 const pmDirRestore = 0;
\r
22 const pmDirOpen = 2;
\r
29 procedure NewfmMainGuard( var Result: PfmMainGuard; AParent: PControl );
\r
33 Result := PfmMainGuard.Create;
\r
35 New( Result, Create );
\r
36 {$ENDIF KOL CLASSES/OBJECTS}
\r
37 Result.Form := NewForm( AParent, 'File Guard' ).SetPosition( 188, 136 ).SetClientSize( 624, 399 );
\r
38 Result.Form.Add2AutoFree( Result );
\r
39 Result.Form.Visible := False;
\r
40 Result.Form.Font.FontHeight := 16;
\r
41 Result.Form.Font.FontName := 'Arial';
\r
42 Applet.OnMinimize := Result.KOLForm1Minimize;
\r
43 Result.Form.OnClose := Result.KOLForm1Close;
\r
44 Result.Form.OnMinimize := Result.KOLForm1Minimize;
\r
45 Result.Form.OnShow := Result.KOLForm1Show;
\r
46 Result.Form.OnDestroy := Result.KOLForm1Destroy;
\r
47 NewMenu( Result.Form, 0, [ '' ], nil );
\r
49 {$R fmMainGuard_TrayIcon1.RES}
\r
50 Result.TrayIcon1 := NewTrayIcon( Applet, LoadIcon( hInstance, 'ZFMMAINGUARD_TRAYICON1' ) );
\r
51 Result.TrayIcon1.Tooltip := 'File Guard';
\r
52 Result.TrayIcon1.AutoRecreate := TRUE;
\r
53 Result.Form.Add2AutoFree( Result.TrayIcon1 );
\r
54 Result.TrayIcon1.OnMouse := Result.TrayIcon1Mouse;
\r
56 Result.ThreadRescanStorageTree := NewThread;
\r
57 Result.ThreadRescanStorageTree.OnExecute := Result.ThreadRescanStorageTreeExecute;
\r
58 Result.ThreadRescanStorageTree.ThreadPriority := THREAD_PRIORITY_IDLE;
\r
59 Result.Form.Add2AutoFree( Result.ThreadRescanStorageTree );
\r
63 Result.TimerCheckConnect := NewTimer( 10000 );
\r
64 Result.Form.Add2AutoFree( Result.TimerCheckConnect );
\r
65 Result.TimerCheckConnect.OnTimer := Result.TimerCheckConnectTimer;
\r
67 Result.dSelStorage := NewOpenDirDialog( 'Select directory for save file changes history', [ ] );
\r
68 Result.Form.Add2AutoFree( Result.dSelStorage );
\r
70 Result.TimerHide := NewTimer( 100 );
\r
71 Result.Form.Add2AutoFree( Result.TimerHide );
\r
72 Result.TimerHide.OnTimer := Result.TimerHideTimer;
\r
74 Result.pm2 := NewMenu( Result.Form, 0, [ '&History'
\r
75 , '&Restore', '' ], nil );
\r
76 Result.pm2.AssignEvents( 0, [ Result.pm2pmHistoryMenu ] );
\r
77 Result.pm2.AssignEvents( 1, [ Result.pm2pmRestoreMenu ] );
\r
79 Result.pm1 := NewMenu( Result.Form, 0, [
\r
80 'Settings and State', 'Exit', '' ], nil );
\r
81 Result.pm1.AssignEvents( 0, [ Result.pm1pmStateMenu ] );
\r
82 Result.pm1.AssignEvents( 1, [ Result.pm1pmExitMenu ] );
\r
84 Result.pm3 := NewMenu( Result.Form, 0, [ '&Restore'
\r
85 , '-' + '', '&Open Directory', '' ], nil );
\r
86 Result.pm3.AssignEvents( 0, [ Result.pm3pmDirRestoreMenu ] );
\r
87 Result.pm3.AssignEvents( 2, [ Result.pm3pmDirOpenMenu ] );
\r
89 Result.ImageList3 := NewImageList( Result.Form );
\r
90 Result.ImageList3.LoadSystemIcons( True );
\r
92 Result.ImageList1 := NewImageList( Result.Form );
\r
93 Result.ImageList1.Colors := ilcColorDDB;
\r
94 Result.ImageList1.ImgWidth := 16;
\r
95 Result.ImageList1.ImgHeight := 16;
\r
96 {$R fmMainGuard_ImageList1.res}
\r
97 Result.ImageList1.AddMasked( LoadBmp( hInstance, 'FMMAINGUARD_IMAGELIST1', Result.ImageList1 ), clBlack );
\r
99 Result.ImageList2 := NewImageList( Result.Form );
\r
100 Result.ImageList2.Colors := ilcColorDDB;
\r
101 {$R fmMainGuard_ImageList2.res}
\r
102 Result.ImageList2.AddMasked( LoadBmp( hInstance, 'FMMAINGUARD_IMAGELIST2', Result.ImageList2 ), clBlack );
\r
103 // Result.tc1.TabOrder = 0
\r
104 Result.tc1 := NewTabControl( Result.Form, [ 'Monitor', 'Storage', 'Log', 'About' ], [ tcoFocusTabs ], nil, 0 ).SetAlign ( caClient );
\r
105 Result.tc1.TabStop := FALSE;
\r
106 // Result.tc1.Pages[ 0 ].TabOrder = 0
\r
107 // Result.Panel3.TabOrder = 0
\r
108 Result.Panel3 := NewPanel( Result.tc1.Pages[ 0 ], esNone ).SetAlign ( caTop ).SetSize( 0, 31 );
\r
109 Result.Panel3.Transparent := True;
\r
110 // Result.Toolbar1.TabOrder = 0
\r
111 {$R fmMainGuard_Toolbar1.res}
\r
112 Result.Toolbar1 := NewToolbar( Result.Panel3, caTop, [tboTextRight, tboFlat, tboNoDivider], 0, [ ' ', ' ', ' ', '-', ' ', ' ' ], [ 32, 20, 7, -2, 0, 1 ] ).SetAlign ( caTop );
\r
113 Result.Toolbar1.Color := clBtnFace;
\r
114 Result.Toolbar1.Transparent := True;
\r
115 Result.Toolbar1.EraseBackground := TRUE;
\r
116 Result.Toolbar1.TBBtnImgWidth := 16;
\r
117 Result.Toolbar1.TBAddBitmap( LoadMappedBitmapEx( Result.Toolbar1, hInstance, 'FMMAINGUARD_TBBMP5000', [ clFuchsia, Color2RGB( clBtnFace ) ] ) );
\r
118 Result.Toolbar1.TBAddBitmap( THandle( -1 ) );
\r
119 Result.Toolbar1.TBAddBitmap( THandle( -5 ) );
\r
120 Result.Toolbar1.TBAddBitmap( THandle( -9 ) );
\r
121 Result.Toolbar1.TBSetTooltips( Result.Toolbar1.TBIndex2Item( 0 ), [ 'Add directory to filter', 'Edit filter', 'Remove filter', '', 'Move Up', 'Move Down' ] );
\r
122 Result.Toolbar1.TBAssignEvents( 0, [ Result.Toolbar1TBAddClick, Result.Toolbar1TBEditClick, Result.Toolbar1TBDelClick, nil, Result.Toolbar1TBUpClick, Result.Toolbar1TBDnClick ] );
\r
123 if WinVer >= wvXP then
\r
125 Result.Toolbar1.Style := Result.Toolbar1.Style or TBSTYLE_WRAPABLE;
\r
126 Result.Toolbar1.Transparent := TRUE;
\r
128 // Result.lv1.TabOrder = 1
\r
129 Result.lv1 := NewListView( Result.tc1.Pages[ 0 ], lvsDetail, [ lvoGridLines, lvoRowSelect, lvoOwnerData ], Result.ImageList1, nil, Result.ImageList1 ).SetAlign ( caClient );
\r
130 Result.lv1.Color := clWindow;
\r
131 Result.lv1.LVColAdd( 'Directory', taLeft, 315);
\r
132 Result.lv1.LVColAdd( 'Filter', taLeft, 150);
\r
133 Result.lv1.LVColAdd( 'Time', taRight, 50);
\r
134 // Result.tc1.Pages[ 1 ].TabOrder = 1
\r
135 // Result.Panel2.TabOrder = 0
\r
136 Result.Panel2 := NewPanel( Result.tc1.Pages[ 1 ], esNone ).SetAlign ( caTop ).SetSize( 0, 26 );
\r
137 // Result.eStoragePath.TabOrder = 0
\r
138 Result.eStoragePath := NewEditBox( Result.Panel2, [ ] ).SetAlign ( caClient );
\r
139 Result.eStoragePath.Color := clWindow;
\r
140 // Result.bBrowseStorage.TabOrder = 1
\r
141 Result.bBrowseStorage := NewButton( Result.Panel2, 'Browse' ).SetAlign ( caRight );
\r
142 // Result.Panel7.TabOrder = 1
\r
143 Result.Panel7 := NewPanel( Result.tc1.Pages[ 1 ], esNone ).SetAlign ( caTop ).SetSize( 0, 19 );
\r
144 // Result.lStorageStatus.TabOrder = -1
\r
145 Result.lStorageStatus := NewLabel( Result.Panel7, ' ' ).SetAlign ( caClient ).AutoSize( TRUE );
\r
146 // Result.tvDirs.TabOrder = 2
\r
147 Result.tvDirs := NewTreeView( Result.tc1.Pages[ 1 ], [ tvoLinesRoot ], Result.ImageList3, nil ).SetAlign ( caLeft ).SetSize( 223, 0 );
\r
148 Result.tvDirs.Color := clWindow;
\r
149 Result.tvDirs.MinWidth := 100;
\r
150 Result.tvDirs.TVRightClickSelect := TRUE;
\r
151 Result.tvDirs.SetAutoPopupMenu( Result.pm3 );
\r
152 // Result.Splitter1.TabOrder = 3
\r
153 Result.Splitter1 := NewSplitter( Result.tc1.Pages[ 1 ], 0, 0 ).SetAlign ( caLeft ).SetSize( 6, 0 );
\r
154 // Result.lvFiles.TabOrder = 4
\r
155 Result.lvFiles := NewListView( Result.tc1.Pages[ 1 ], lvsDetail, [ lvoMultiselect, lvoRowSelect, lvoOwnerData ], Result.ImageList3, nil, nil ).SetAlign ( caClient );
\r
156 Result.lvFiles.Color := clWindow;
\r
157 Result.lvFiles.MinWidth := 100;
\r
158 Result.lvFiles.SetAutoPopupMenu( Result.pm2 );
\r
159 Result.lvFiles.LVColAdd( 'Name', taLeft, 145);
\r
160 Result.lvFiles.LVColAdd( 'Date', taLeft, 80);
\r
161 Result.lvFiles.LVColAdd( 'Size', taRight, 60);
\r
162 Result.lvFiles.LVColAdd( 'Used', taRight, 60);
\r
163 // Result.tc1.Pages[ 2 ].TabOrder = 2
\r
164 // Result.Memo1.TabOrder = 0
\r
165 Result.Memo1 := NewEditBox( Result.tc1.Pages[ 2 ], [ eoMultiline, eoNoHScroll, eoReadonly ] ).SetAlign ( caClient );
\r
166 Result.Memo1.Color := clWindow;
\r
167 // Result.pnLogInfo.TabOrder = 1
\r
168 Result.pnLogInfo := NewPanel( Result.tc1.Pages[ 2 ], esLowered ).SetAlign ( caBottom ).SetSize( 0, 24 );
\r
169 // Result.lQueued.TabOrder = -1
\r
170 Result.lQueued := NewLabel( Result.pnLogInfo, ' ' ).SetAlign ( caRight ).AutoSize( TRUE );
\r
171 // Result.cDetailed.TabOrder = 0
\r
172 Result.cDetailed := NewCheckBox( Result.pnLogInfo, 'Detailed' ).SetAlign ( caLeft ).AutoSize( TRUE );
\r
173 // Result.tc1.Pages[ 3 ].TabOrder = 3
\r
174 // Result.lLink.TabOrder = -1
\r
175 Result.lLink := NewLabel( Result.tc1.Pages[ 3 ], 'http://bonanzas.rinet.ru' ).SetAlign ( caBottom ).AutoSize( TRUE );
\r
176 Result.lLink.Font.Color := clBlue;
\r
177 Result.lLink.Font.FontStyle := [ fsUnderline ];
\r
178 Result.lLink.TextAlign := taCenter;
\r
179 Result.lLink.Cursor := LoadCursor( 0, IDC_HAND );
\r
180 // Result.Panel4.TabOrder = 0
\r
181 Result.Panel4 := NewPanel( Result.tc1.Pages[ 3 ], esLowered ).SetAlign ( caTop ).SetSize( 0, 47 );
\r
182 // Result.ImageShow1.TabOrder = 0
\r
183 Result.ImageShow1 := NewImageShow( Result.Panel4, Result.ImageList2, 0 ).SetAlign ( caLeft );
\r
184 Result.ImageShow1.Transparent := True;
\r
185 // Result.Panel5.TabOrder = 1
\r
186 Result.Panel5 := NewPanel( Result.Panel4, esNone ).SetAlign ( caClient );
\r
187 Result.Panel5.Border := 0;
\r
188 // Result.LabelEffect2.TabOrder = -1
\r
189 Result.LabelEffect2 := NewLabelEffect( Result.Panel5, ' File Guard v1.0.1 Beta', 2 ).SetAlign ( caLeft ).AutoSize( TRUE );
\r
190 Result.LabelEffect2.Ctl3D := False;
\r
191 Result.LabelEffect2.Font.Color := clPurple;
\r
192 Result.LabelEffect2.Font.FontStyle := [ fsBold ];
\r
193 Result.LabelEffect2.Font.FontHeight := 31;
\r
194 Result.LabelEffect2.TextAlign := taLeft;
\r
195 Result.LabelEffect2.Color2 := clBlack;
\r
196 // Result.LabelEffect1.TabOrder = -1
\r
197 Result.LabelEffect1 := NewLabelEffect( Result.Panel5, ' (C) by Vladimir Kladov, 2004', 1 ).SetAlign ( caLeft ).AutoSize( TRUE );
\r
198 Result.LabelEffect1.Ctl3D := False;
\r
199 Result.LabelEffect1.Font.Color := clBlue;
\r
200 Result.LabelEffect1.Font.FontStyle := [ fsBold ];
\r
201 Result.LabelEffect1.Font.FontHeight := 24;
\r
202 Result.LabelEffect1.TextAlign := taLeft;
\r
203 Result.LabelEffect1.VerticalAlign := vaBottom;
\r
204 Result.LabelEffect1.Color2 := clBlack;
\r
205 // Result.Panel6.TabOrder = 1
\r
206 Result.Panel6 := NewPanel( Result.tc1.Pages[ 3 ], esNone ).SetAlign ( caClient );
\r
207 Result.Panel6.Border := 12;
\r
208 // Result.lDescription_About.TabOrder = -1
\r
209 Result.lDescription_About := NewWordWrapLabel( Result.Panel6, 'text here' ).SetAlign ( caClient );
\r
210 // Result.Panel1.TabOrder = 1
\r
211 Result.Panel1 := NewPanel( Result.Form, esLowered ).SetAlign ( caTop ).SetSize( 0, 27 );
\r
212 // Result.lStatus.TabOrder = -1
\r
213 Result.lStatus := NewLabel( Result.Panel1, 'Monitored: 0 dirs Storage: <not set>' ).SetAlign ( caClient ).AutoSize( TRUE );
\r
214 Result.lStatus.VerticalAlign := vaCenter;
\r
215 // Result.bExit.TabOrder = 0
\r
216 Result.bExit := NewButton( Result.Panel1, 'Exit' ).SetAlign ( caRight ).SetSize( 49, 0 );
\r
217 Result.lLink.OnClick := Result.lLinkClick;
\r
218 Result.lLink.OnMouseEnter := Result.lLinkMouseEnter;
\r
219 Result.lLink.OnMouseLeave := Result.lLinkMouseLeave;
\r
220 Result.eStoragePath.OnChange := Result.eStoragePathChange;
\r
221 Result.tc1.CurIndex := 2;
\r
222 Result.tc1.Pages[ 2 ].BringToFront;
\r
223 Result.bExit.OnClick := Result.bExitClick;
\r
224 Result.lv1.OnMouseDblClk := Result.lv1MouseDblClk;
\r
225 Result.lv1.OnKeyDown := Result.lv1KeyDown;
\r
226 Result.lv1.OnLVData := Result.lv1LVData;
\r
227 Result.lv1.OnLVStateChange := Result.lv1LVStateChange;
\r
228 Result.bBrowseStorage.OnClick := Result.bBrowseStorageClick;
\r
229 Result.tvDirs.OnSelChange := Result.tvDirsSelChange;
\r
230 Result.TrayIcon1.Active := TRUE;
\r
231 Result.dSelStorage.WndOwner := Result.Form.GetWindowHandle;
\r
232 Result.lvFiles.OnMouseDblClk := Result.lvFilesMouseDblClk;
\r
233 Result.lvFiles.OnKeyDown := Result.lvFilesKeyDown;
\r
234 Result.lvFiles.OnLVData := Result.lvFilesLVData;
\r
235 Result.lvFiles.OnLVStateChange := Result.lvFilesLVStateChange;
\r
236 Result.Form.CenterOnParent;
\r
237 Result.Form.MinimizeNormalAnimated;
\r
238 Result.KOLForm1FormCreate( Result );
\r