source: trunk/NewView/GlobalSearchForm.pas@ 465

Last change on this file since 465 was 465, checked in by ataylor, 3 years ago

Finish(?) implementing scale-to-font logic for NewView dialogs.

  • Property svn:eol-style set to native
File size: 20.2 KB
Line 
1Unit GlobalSearchForm;
2
3// NewView - a new OS/2 Help Viewer
4// Copyright 2003 Aaron Lawrence (aaronl at consultant dot com)
5// This software is released under the Gnu Public License - see readme.txt
6
7Interface
8
9// Global search uses a thread to load helpfiles, search them, and
10// send the results to be displayed.
11
12Uses
13 PmWin,
14 Classes,
15 Forms,
16 Buttons,
17 StdCtrls,
18 ComCtrls,
19 Outline2,
20 GenericThread,
21 ACLLanguageUnit,
22 TextSearchQuery,
23 HelpFile,
24 ExtCtrls,
25 LED;
26
27const
28 // Custom window messages for this form
29 // NOTE! Sibyl uses WM_USER+1 and +2!
30 WM_OPENED = WM_USER + 10;
31
32Type
33 TViewTopicCallback = procedure( Filename: string;
34 TopicIndex: longint ) of object;
35
36 TSearchParameters = class
37 Query: TTextSearchQuery;
38 Directories: TStringList;
39 end;
40
41 // Returned by thread. (Note - helpfiles and topics are destroyed dynamically.)
42 TSearchResult = class
43 Filename: string;
44 FileTitle: string;
45 MatchingTopics: TList;
46 constructor Create;
47 destructor Destroy; override;
48 end;
49
50 TGlobalSearchForm = Class (TForm)
51 SearchTextEdit: TEdit;
52 SearchTextLabel: TLabel;
53 SelectDrivesButton: TButton;
54 SearchTextLabel1: TLabel;
55 ResultsLabel: TLabel;
56 Led: TLed;
57 LEDTimer: TTimer;
58 SearchLocationComboBox: TComboBox;
59 Bevel: TBevel;
60 HelpButton: TButton;
61 ResultsOutline: TOutline2;
62 SearchButton: TButton;
63 ViewTopicButton: TButton;
64 CancelButton: TButton;
65 ProgressBar: TProgressBar;
66 ProgressLabel: TLabel;
67 Procedure SearchLocationComboBoxOnItemSelect (Sender: TObject;
68 Index: LongInt);
69 Procedure LEDTimerOnTimer (Sender: TObject);
70 Procedure SearchInComboBoxOnChange (Sender: TObject);
71 Procedure ResultsOutlineOnEnter (Sender: TObject);
72 Procedure SearchTextEditOnEnter (Sender: TObject);
73 Procedure SelectDrivesButtonOnClick (Sender: TObject);
74 Procedure GlobalSearchFormOnSetupShow (Sender: TObject);
75 Procedure CancelButtonOnClick (Sender: TObject);
76 Procedure GlobalSearchFormOnClose (Sender: TObject;
77 Var Action: TCloseAction);
78 Procedure ResultsOutlineOnItemDblClick (Node: TNode);
79 Procedure ViewTopicButtonOnClick (Sender: TObject);
80 Procedure GlobalSearchFormOnCreate (Sender: TObject);
81 Procedure GlobalSearchFormOnCloseQuery (Sender: TObject;
82 Var CanClose: Boolean);
83 Procedure SearchButtonOnClick (Sender: TObject);
84 Procedure GlobalSearchFormOnShow (Sender: TObject);
85 Protected
86 Procedure OnSearchProgress ( n, outof: integer;
87 S: String );
88 Procedure OnMatchFound( SearchResult: TSearchResult );
89 Procedure OnThreadData( S: string; Data: TObject );
90 Procedure OnSearchFinished( Result: TObject );
91 Procedure SetProgressLabel( const S: String );
92
93 // Handle our own WM_OPENED message
94 Procedure WMOpened( Var Msg: TMessage ); Message WM_OPENED;
95 Procedure ClearResults;
96 Procedure ViewTopic;
97
98 ThreadManager: TGenericThreadManager;
99
100 Procedure UpdateButtons;
101
102
103 Procedure GetSelectedDirectories( List: TStringList );
104
105 // search thread context
106
107 Function Search( Parameters: TObject ): TObject;
108
109 protected
110 Procedure OnLanguageEvent( Language: TLanguageFile; const Apply: boolean );
111
112 SearchCaption: string;
113 StopCaption: string;
114 NoResultsMsg: string;
115 ScanDirectoriesMsg: string;
116 SearchingFileMsg: string;
117 OfMsg: string;
118 DoneMsg: string;
119 SearchErrorTitle: string;
120 SearchError: string;
121
122 StandardHelpPathsLocation: string;
123 FixedDrivesLocation: string;
124 SelectedHelpPathsLocation: string;
125 CustomPathsLocation: string;
126
127 public
128 // set by caller
129 ViewTopicCallback: TViewTopicCallback;
130 Procedure DoSearch;
131 End;
132
133Var
134 GlobalSearchForm: TGlobalSearchForm;
135
136procedure EnsureGlobalSearchFormLoaded;
137
138Implementation
139
140uses
141 SysUtils,
142 DebugUnit,
143 ACLDialogs,
144 ControlsUtility,
145 DriveInfoUnit,
146 IPFFileFormatUnit,
147 HelpTopic,
148 SearchUnit,
149 SearchDirectoriesFormUnit,
150 SettingsUnit,
151 InformationFormUnit,
152 StringUtilsUnit,
153 FileUtilsUnit;
154
155type
156 // Used to store filenames in outline
157 THelpFileInfo = class
158 FileName: string;
159 end;
160
161constructor TSearchResult.Create;
162begin
163 inherited Create;
164 MatchingTopics := TList.Create;
165end;
166
167destructor TSearchResult.Destroy;
168begin
169 MatchingTopics.Destroy;
170 inherited Destroy;
171end;
172
173Procedure TGlobalSearchForm.SearchLocationComboBoxOnItemSelect (Sender: TObject; Index: LongInt);
174Begin
175 Settings.GlobalSearchLocation := TGlobalSearchLocation( SearchLocationComboBox.ItemIndex );
176End;
177
178Procedure TGlobalSearchForm.LEDTimerOnTimer (Sender: TObject);
179Begin
180 LED.LedCondition := not LED.LedCondition;
181End;
182
183Procedure TGlobalSearchForm.SearchInComboBoxOnChange (Sender: TObject);
184Begin
185End;
186
187Procedure TGlobalSearchForm.ResultsOutlineOnEnter (Sender: TObject);
188Begin
189 ViewTopicButton.Default := true;
190End;
191
192Procedure TGlobalSearchForm.SearchTextEditOnEnter (Sender: TObject);
193Begin
194 SearchButton.Default := true;
195End;
196
197
198Procedure TGlobalSearchForm.GetSelectedDirectories(List: TStringList);
199Var
200 tmpDirectories : TStringList;
201
202 DriveNumber: longint;
203 DriveType: TDriveType;
204 DriveLetter: char;
205 i: longint;
206 Dir: string;
207 FoundIndex: longint;
208begin
209 List.Clear;
210 case SearchLocationComboBox.ItemIndex of
211 -1:
212 begin
213 // one custom dir...
214 List.Add( SearchLocationComboBox.Text );
215 end;
216
217 Ord( gsHelpPaths ),
218 Ord( gsSelectedHelpPaths ): // standard or selected help paths
219 Begin
220 tmpDirectories := TStringList.Create;
221 List.Sorted := true;
222 List.Duplicates := dupIgnore;
223
224 // GetDirsInPath clears the list tmpDirectories
225 GetDirsInPath(HelpPathEnvironmentVar, tmpDirectories);
226 List.AddStrings(tmpDirectories);
227
228 GetDirsInPath(BookshelfEnvironmentVar, tmpDirectories);
229 List.AddStrings(tmpDirectories);
230
231 tmpDirectories.Destroy;
232
233 // for selected paths we have to adjust the selection
234 if SearchLocationComboBox.ItemIndex = Ord( gsSelectedHelpPaths ) then
235 begin
236 // now mark some as non-selected...
237 for i := 0 to List.Count - 1 do
238 begin
239 Dir := List[i];
240 if not Settings.SearchDirectories.Find( Dir, FoundIndex ) then
241 List.Objects[i] := pointer(1);
242 end;
243 end;
244 end;
245
246
247 Ord( gsFixedDrives ):
248 begin
249 // drives
250 For DriveNumber := MinDriveNumber To MaxDriveNumber Do
251 Begin
252 DriveType := GetDriveType( DriveNumber );
253 DriveLetter := Chr( DriveNumber + Ord( 'A' ) - 1 );
254
255 if DriveType = dtHard then
256 begin
257 List.Add( DriveLetter + ':\...' );
258 end;
259 end;
260 end;
261
262 Ord( gsCustom ):
263 begin
264 // already custom...
265 List.Assign(Settings.SearchDirectories);
266 end;
267 end;
268end;
269
270Procedure TGlobalSearchForm.SelectDrivesButtonOnClick (Sender: TObject);
271begin
272 GetSelectedDirectories(SearchDirectoriesForm.SelectedFolders);
273
274 SearchDirectoriesForm.ShowModal;
275 if SearchDirectoriesForm.ModalResult <> mrOK then
276 exit;
277
278 // there was a selection, so we have to change the dropdown
279 if SearchLocationComboBox.ItemIndex = Ord( gsHelpPaths ) then
280 SearchLocationComboBox.ItemIndex := Ord( gsSelectedHelpPaths );
281
282 if SearchLocationComboBox.ItemIndex = Ord( gsFixedDrives ) then
283 SearchLocationComboBox.ItemIndex := Ord( gsCustom );
284
285 if SearchDirectoriesForm.CustomDirAdded then
286 SearchLocationComboBox.ItemIndex := Ord( gsCustom );
287
288 // update the settings
289 Settings.SearchDirectories.Assign( SearchDirectoriesForm.SelectedFolders );
290 SaveSettings;
291End;
292
293Procedure TGlobalSearchForm.UpdateButtons;
294Begin
295 // HelpPathsRadioButton.Checked := SearchType = stHelpPaths;
296 // EverywhereRadioButton.Checked := SearchType = stDrives;
297// FolderRadioButton.Checked := SearchType = stFolder;
298
299End;
300
301Procedure TGlobalSearchForm.GlobalSearchFormOnSetupShow (Sender: TObject);
302Begin
303 ScaleForm( self, 8, 16 );
304 // Fix scaling issues on some controls
305 if SearchTextLabel1.Top > (SearchLocationComboBox.Top + 2) then
306 SearchTextLabel1.Top := SearchLocationComboBox.Top + 2;
307 Bevel.Bottom := ClientHeight - ResultsLabel.Top + 4;
308 Led.Height := ResultsLabel.Height;
309 Led.Width := Led.Height;
310 Led.Top := ResultsLabel.Top;
311
312 SearchButton.Align := alFixedRightTop;
313
314 if SearchLocationComboBox.Items.Count = 0 then
315 begin
316 // must match teh global search location enum...
317 SearchLocationComboBox.Items.Add( StandardHelpPathsLocation );
318 SearchLocationComboBox.Items.Add( FixedDrivesLocation );
319 SearchLocationComboBox.Items.Add( SelectedHelpPathsLocation );
320 SearchLocationComboBox.Items.Add( CustomPathsLocation );
321
322 SearchLocationComboBox.ItemIndex := Ord( Settings.GlobalSearchLocation );
323 end;
324
325End;
326
327Procedure TGlobalSearchForm.OnLanguageEvent(Language: TLanguageFile; const Apply: boolean );
328begin
329 LogEvent(LogI18n, 'TGlobalSearchForm.OnLanguageEvent apply: "' + BoolToStr(Apply) + '"');
330
331 Language.LoadComponentLanguage(self, Apply);
332
333 Language.LL(Apply, SearchCaption, 'SearchCaption', '~Search');
334 Language.LL(Apply, StopCaption, 'StopCaption', '~Stop');
335 Language.LL(Apply, NoResultsMsg, 'NoResultsMsg', '(No results found)');
336 Language.LL(Apply, ScanDirectoriesMsg, 'ScanDirectoriesMsg', 'Finding help files...');
337 Language.LL(Apply, SearchingFileMsg, 'SearchingFileMsg', 'Searching ');
338 Language.LL(Apply, OfMsg, 'OfMsg', ' of ');
339 Language.LL(Apply, DoneMsg, 'DoneMsg', 'Done');
340 Language.LL(Apply, SearchErrorTitle, 'SearchErrorTitle', 'Search');
341 Language.LL(Apply, SearchError, 'SearchError', 'Error in search syntax: ');
342
343 Language.LL(Apply, StandardHelpPathsLocation, 'StandardHelpPathsLocation', 'Standard Help Paths');
344 Language.LL(Apply, FixedDrivesLocation, 'FixedDrivesLocation', 'All Hard Drives');
345 Language.LL(Apply, SelectedHelpPathsLocation, 'SelectedHelpPathsLocation', 'Selected Help Paths');
346 Language.LL(Apply, CustomPathsLocation, 'CustomPathsLocation', 'Directory List');
347end;
348
349
350Procedure TGlobalSearchForm.CancelButtonOnClick (Sender: TObject);
351Begin
352 Close;
353End;
354
355Procedure TGlobalSearchForm.GlobalSearchFormOnClose (Sender: TObject;
356 Var Action: TCloseAction);
357Begin
358 ClearResults;
359
360 if SearchLocationComboBox.ItemIndex = -1 then
361 begin
362 Settings.GlobalSearchLocation := gsCustom;
363 Settings.SearchDirectories.Clear;
364 Settings.SearchDirectories.Add( SearchLocationComboBox.Text );
365 end;
366
367 Action := caFreeHandle; // DON'T release the form! (Default action for non-modal forms)
368End;
369
370Procedure TGlobalSearchForm.ResultsOutlineOnItemDblClick (Node: TNode);
371Begin
372 ViewTopic;
373End;
374
375Procedure TGlobalSearchForm.ViewTopicButtonOnClick (Sender: TObject);
376begin
377 ViewTopic;
378end;
379
380Procedure TGlobalSearchForm.ViewTopic;
381var
382 Node: TNode;
383 HelpFileInfo: THelpFileInfo;
384 TopicIndex: longint;
385Begin
386 Node := ResultsOutline.SelectedNode;
387 if Node = nil then
388 exit;
389 case Node.Level of
390 0:
391 begin
392 // file node
393 HelpFileInfo := Node.Data as THelpFileInfo;
394 TopicIndex := -1;
395 end;
396
397 1:
398 begin
399 // topic node
400 HelpFileInfo := Node.Parent.Data as THelpFileInfo;
401 TopicIndex := longint( Node.Data );
402 end;
403
404 else
405 assert( false, 'Invalid node level in ViewTopic!: ' + IntToStr( Node.Level ) );
406 end;
407
408 ViewTopicCallback( HelpFileInfo.FileName, TopicIndex );
409End;
410
411Procedure TGlobalSearchForm.GlobalSearchFormOnCreate (Sender: TObject);
412Begin
413 RegisterForLanguages( OnLanguageEvent );
414
415 UpdateButtons;
416
417 ThreadManager := TGenericThreadManager.Create( self );
418 ThreadManager.OnProgressUpdate := OnSearchProgress;
419 ThreadManager.OnDataFromThread := OnThreadData;
420 ThreadManager.OnJobComplete := OnSearchFinished;
421End;
422
423Procedure TGlobalSearchForm.OnSearchFinished( Result: TObject );
424Begin
425 SearchButton.Caption := SearchCaption;
426 ProgressBar.Hide;
427 LED.LedCondition := false;
428 LEDTimer.Stop;
429
430 if ResultsOutline.ChildCount > 0 then
431 begin
432 ResultsOutline.SelectedNode:= ResultsOutline.Children[ 0 ];
433 ResultsOutline.Focus;
434 SetProgressLabel( '' );
435 end
436 else
437 begin
438 SetProgressLabel( NoResultsMsg );
439 end;
440
441End;
442
443Procedure TGlobalSearchForm.GlobalSearchFormOnCloseQuery (Sender: TObject;
444 Var CanClose: Boolean);
445Begin
446 if ThreadManager.IsRunning then
447 begin
448 ThreadManager.Stop;
449 end;
450End;
451
452Procedure TGlobalSearchForm.SetProgressLabel( const S: String );
453begin
454 ProgressLabel.Text := S;
455 ProgressLabel.Refresh;
456end;
457
458Procedure TGlobalSearchForm.OnSearchProgress ( n, outof: integer;
459 S: String );
460Begin
461 ProgressBar.Position := n * 100 div outof;
462 SetProgressLabel( S );
463End;
464
465Function TGlobalSearchForm.Search( Parameters: TObject ): TObject;
466var
467 Files : TStringList;
468 FileIndex: longint;
469 Filename: string;
470 HelpFile: THelpFile;
471 SearchResult: TSearchResult;
472 MatchingTopics: TList;
473
474 tmpSearchParameters : TSearchParameters;
475 Query: TTextSearchQuery;
476 i: longint;
477 tmpDir: string;
478
479Begin
480 // LogEvent(LogDebug, 'TGlobalSearchForm.Search');
481
482 tmpSearchParameters := Parameters as TSearchParameters;
483
484 Query := tmpSearchParameters.Query;
485 Files := TStringList.Create;
486
487 MatchingTopics := TList.Create;
488 LogEvent(LogParse, 'Creating file list');
489
490 // make sure we ignore duplicate files...
491 Files.Sorted := true;
492 Files.CaseSensitive := false;
493 Files.Duplicates := dupIgnore;
494
495 for i := 0 to tmpSearchParameters.Directories.Count - 1 do
496 begin
497 if ThreadManager.StopRequested then
498 begin
499 break;
500 end;
501
502 ThreadManager.UpdateProgress( i * 10 div tmpSearchParameters.Directories.Count, 100, ScanDirectoriesMsg );
503 tmpDir := tmpSearchParameters.Directories[i];
504 // LogEvent(LogDebug, 'TGlobalSearchForm.Search in dir: ' + tmpDir);
505 if StrEndsWith(tmpDir, '...') then
506 begin
507 tmpDir := StrLeftWithout(tmpDir, 3 );
508 ListFilesInDirectoryRecursiveWithTermination(
509 tmpDir,
510 '*.inf;*.hlp',
511 true,
512 false,
513 Files,
514 ThreadManager.StopRequested,
515 true ); // check termination
516 end
517 else
518 begin
519 ListFilesInDirectory( tmpDir, '*.inf;*.hlp', true, Files);
520 end;
521 end;
522
523 for FileIndex := 0 to Files.Count - 1 do
524 begin
525 if ThreadManager.StopRequested then
526 begin
527 break;
528 end;
529
530 Filename := Files[FileIndex];
531
532 ThreadManager.UpdateProgress( 10 + FileIndex * 95 div Files.Count,
533 100,
534 SearchingFileMsg
535 + Filename
536 + ' ('
537 + IntToStr( FileIndex + 1 )
538 + OfMsg
539 + IntToStr( Files.Count )
540 + ')...' );
541
542 try
543 HelpFile := THelpFile.Create( FileName );
544 MatchingTopics.Clear;
545 SearchHelpFile( HelpFile,
546 Query,
547 MatchingTopics,
548 nil // don't care about words matched
549 );
550
551 if MatchingTopics.Count > 0 then
552 begin
553 // Create a searchresult object to send back to main thread.
554 SearchResult := TSearchResult.Create;
555 SearchResult.Filename := HelpFile.Filename;
556 SearchResult.FileTitle := HelpFile.Title;
557
558 SearchResult.MatchingTopics.Assign( MatchingTopics );
559
560 SearchResult.MatchingTopics.Sort( TopicRelevanceCompare );
561 ThreadManager.SendData( '', SearchResult );
562 end;
563
564 HelpFile.Destroy;
565
566 except
567 on E: EHelpFileException do
568 begin
569 ; // ignore exceptions
570 end;
571
572 on E: EWindowsHelpFormatException do
573 begin
574 ; // ignore Windows help files
575 end;
576 end;
577
578 end;
579 ThreadManager.UpdateProgress( 100, 100, DoneMsg );
580 Files.Destroy;
581
582 Query.Destroy;
583
584 tmpSearchParameters.Directories.Destroy;
585 tmpSearchParameters.Destroy;
586
587 Result := nil;
588End;
589
590Procedure TGlobalSearchForm.ClearResults;
591var
592 FileIndex: longint;
593begin
594 for FileIndex := 0 to ResultsOutline.ChildCount - 1 do
595 ResultsOutline.Children[ FileIndex ].Data.Free;
596 ResultsOutline.Clear;
597 ViewTopicButton.Enabled := false;
598end;
599
600Procedure TGlobalSearchForm.SearchButtonOnClick (Sender: TObject);
601begin
602 DoSearch;
603end;
604
605Procedure TGlobalSearchForm.DoSearch;
606var
607 tmpSelectedDirectories : TStringList;
608 i : integer;
609 tmpSearchText: string;
610
611 Query: TTextSearchQuery;
612 SearchParameters: TSearchParameters;
613Begin
614 // LogEvent(LogDebug, 'DoSearch');
615
616 if ThreadManager.IsRunning then
617 begin
618 ThreadManager.Stop;
619 exit;
620 end;
621
622 tmpSearchText := trim( SearchTextEdit.Text );
623 if tmpSearchText = '' then
624 exit;
625
626 // LogEvent(LogDebug, 'DoSearch: ' + tmpSearchText);
627 try
628 Query := TTextSearchQuery.Create(tmpSearchText);
629 except
630 on e: ESearchSyntaxError do
631 begin
632 DoErrorDlg( SearchErrorTitle,
633 SearchError
634 + e.Message );
635 exit;
636 end;
637 end;
638
639 ClearResults;
640
641 SearchParameters := TSearchParameters.Create;
642
643 SearchParameters.Query := Query;
644
645 // now the directories to search in
646 SearchParameters.Directories := TStringList.Create;
647
648 tmpSelectedDirectories := TStringList.Create;
649 GetSelectedDirectories(tmpSelectedDirectories);
650
651 LogEvent(LogDebug, 'DoSearch: tmpSelectedDirectories.Count ' + IntToStr(tmpSelectedDirectories.Count));
652
653 // clear the list and add only the selected ones
654 for i := 0 to tmpSelectedDirectories.Count - 1 do
655 begin
656 if tmpSelectedDirectories.Objects[i] = nil then
657 begin
658 SearchParameters.Directories.add(tmpSelectedDirectories[i]);
659 end;
660 end;
661 tmpSelectedDirectories.Destroy;
662
663 ThreadManager.StartJob( Search, SearchParameters );
664 SearchButton.Caption := StopCaption;
665 ProgressBar.Show;
666
667 LED.LedCondition := true;
668 LEDTimer.Start;
669End;
670
671Procedure TGlobalSearchForm.GlobalSearchFormOnShow (Sender: TObject);
672Begin
673 // make search button default
674 SearchButton.Focus;
675 SearchTextEdit.Focus;
676 SetProgressLabel( '' );
677 PostMsg( Handle, WM_OPENED, 0, 0 );
678 SearchButton.Caption := SearchCaption;
679 ProgressBar.Hide;
680 ViewTopicButton.Enabled := false;
681End;
682
683Procedure TGlobalSearchForm.OnThreadData( S: string; Data: TObject );
684var
685 SearchResult: TSearchResult;
686begin
687 SearchResult := Data as TSearchResult;
688 OnMatchFound( SearchResult );
689 SearchResult.Destroy;
690end;
691
692Procedure TGlobalSearchForm.OnMatchFound( SearchResult: TSearchResult );
693var
694 Topic: TTopic;
695 HelpFileInfo: THelpFileInfo;
696 FileNode: TNode;
697 TopicIndex: longint;
698begin
699 ViewTopicButton.Enabled := true;
700
701 HelpFileInfo := THelpFileInfo.Create;
702 HelpFileInfo.FileName := SearchResult.FileName;
703 FileNode := ResultsOutline.AddChild( SearchResult.FileTitle
704 + ' ('
705 + SearchResult.FileName
706 + ')',
707 HelpFileInfo );
708 for TopicIndex := 0 to SearchResult.MatchingTopics.Count - 1 do
709 begin
710 Topic := SearchResult.MatchingTopics[ TopicIndex ];
711 FileNode.AddChild( Topic.Title,
712 TObject( Topic.Index ) );
713 end;
714end;
715
716Procedure TGlobalSearchForm.WMOpened( Var Msg: TMessage );
717begin
718 SearchTextLabel.XAlign := xaLeft;
719 SearchTextLabel.YAlign := yaTop;
720
721 SearchTextEdit.XStretch := xsFrame;
722 SearchTextEdit.YAlign := yaTop;
723 SearchTextEdit.Focus;
724
725 SearchButton.XAlign := xaRight;
726 SearchButton.YAlign := yaTop;
727
728 SearchTextLabel1.XAlign := xaLeft;
729 SearchTextLabel1.YAlign := yaTop;
730
731 SearchLocationComboBox.XStretch := xsFrame;
732 SearchLocationComboBox.YAlign := yaTop;
733
734 SelectDrivesButton.XAlign := xaRight;
735 SelectDrivesButton.YAlign := yaTop;
736
737 Bevel.XStretch := xsFrame;
738 Bevel.YAlign := yaTop;
739
740 LED.XAlign := xaRight;
741 LED.YAlign := yaTop;
742
743 ResultsLabel.XAlign := xaLeft;
744 ResultsLabel.YAlign := yaTop;
745
746 ProgressLabel.XStretch := xsFrame;
747 ProgressLabel.YAlign := yaTop;
748
749 ResultsOutline.XStretch := xsFrame;
750 ResultsOutline.YStretch := ysFrame;
751
752 ProgressBar.XStretch := xsFrame;
753 ProgressBar.YAlign := yaBottom;
754
755end;
756
757procedure EnsureGlobalSearchFormLoaded;
758begin
759 if GlobalSearchForm = nil then
760 GlobalSearchForm := TGlobalSearchForm.Create( nil );
761end;
762
763Initialization
764 RegisterClasses ([TGlobalSearchForm, TEdit, TLabel,
765 TProgressBar, TButton, TOutline2, TComboBox, TBevel, TLed, TTimer]);
766 RegisterUpdateProcForLanguages( EnsureGlobalSearchFormLoaded );
767End.
Note: See TracBrowser for help on using the repository browser.