source: trunk/NewView/GlobalSearchForm.pas@ 94

Last change on this file since 94 was 94, checked in by RBRi, 19 years ago

+ i18n debug messages

  • Property svn:eol-style set to native
File size: 19.9 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 ViewHelpPathsButtonOnClick (Sender: TObject);
74 Procedure SelectDrivesButtonOnClick (Sender: TObject);
75 Procedure GlobalSearchFormOnSetupShow (Sender: TObject);
76 Procedure CancelButtonOnClick (Sender: TObject);
77 Procedure GlobalSearchFormOnClose (Sender: TObject;
78 Var Action: TCloseAction);
79 Procedure ResultsOutlineOnItemDblClick (Node: TNode);
80 Procedure ViewTopicButtonOnClick (Sender: TObject);
81 Procedure GlobalSearchFormOnCreate (Sender: TObject);
82 Procedure GlobalSearchFormOnCloseQuery (Sender: TObject;
83 Var CanClose: Boolean);
84 Procedure SearchButtonOnClick (Sender: TObject);
85 Procedure GlobalSearchFormOnShow (Sender: TObject);
86 Protected
87 Procedure OnSearchProgress ( n, outof: integer;
88 S: String );
89 Procedure OnMatchFound( SearchResult: TSearchResult );
90 Procedure OnThreadData( S: string; Data: TObject );
91 Procedure OnSearchFinished( Result: TObject );
92 Procedure SetProgressLabel( const S: String );
93
94 // Handle our own WM_OPENED message
95 Procedure WMOpened( Var Msg: TMessage ); Message WM_OPENED;
96 Procedure ClearResults;
97 Procedure ViewTopic;
98
99 ThreadManager: TGenericThreadManager;
100
101 Procedure UpdateButtons;
102
103
104 Procedure GetSelectedDirectories( List: TStringList );
105
106 // search thread context
107
108 Function Search( Parameters: TObject ): TObject;
109
110 protected
111 Procedure OnLanguageEvent( Language: TLanguageFile;
112 const Apply: boolean );
113
114 SearchCaption: string;
115 StopCaption: string;
116 NoResultsMsg: string;
117 ScanDirectoriesMsg: string;
118 SearchingFileMsg: string;
119 OfMsg: string;
120 DoneMsg: string;
121 SearchErrorTitle: string;
122 SearchError: string;
123
124 StandardHelpPathsLocation: string;
125 FixedDrivesLocation: string;
126 SelectedHelpPathsLocation: string;
127 CustomPathsLocation: string;
128
129 public
130 // set by caller
131 ViewTopicCallback: TViewTopicCallback;
132 Procedure DoSearch;
133 End;
134
135Var
136 GlobalSearchForm: TGlobalSearchForm;
137
138procedure EnsureGlobalSearchFormLoaded;
139
140Implementation
141
142uses
143 SysUtils,
144 DebugUnit,
145 ACLDialogs,
146 ControlsUtility,
147 DriveInfoUnit,
148 ACLStringUtility,
149 IPFFileFormatUnit,
150 HelpTopic,
151 SearchUnit,
152 SearchDirectoriesFormUnit,
153 SettingsUnit,
154 InformationFormUnit,
155 FileUtilsUnit;
156
157type
158 // Used to store filenames in outline
159 THelpFileInfo = class
160 FileName: string;
161 end;
162
163constructor TSearchResult.Create;
164begin
165 inherited Create;
166 MatchingTopics := TList.Create;
167end;
168
169destructor TSearchResult.Destroy;
170begin
171 MatchingTopics.Destroy;
172 inherited Destroy;
173end;
174
175Procedure TGlobalSearchForm.SearchLocationComboBoxOnItemSelect (Sender: TObject; Index: LongInt);
176Begin
177 Settings.GlobalSearchLocation := TGlobalSearchLocation( SearchLocationComboBox.ItemIndex );
178End;
179
180Procedure TGlobalSearchForm.LEDTimerOnTimer (Sender: TObject);
181Begin
182 LED.LedCondition := not LED.LedCondition;
183End;
184
185Procedure TGlobalSearchForm.SearchInComboBoxOnChange (Sender: TObject);
186Begin
187End;
188
189Procedure TGlobalSearchForm.ResultsOutlineOnEnter (Sender: TObject);
190Begin
191 ViewTopicButton.Default := true;
192End;
193
194Procedure TGlobalSearchForm.SearchTextEditOnEnter (Sender: TObject);
195Begin
196 SearchButton.Default := true;
197End;
198
199Procedure TGlobalSearchForm.ViewHelpPathsButtonOnClick (Sender: TObject);
200var
201 Dirs: TStringList;
202Begin
203 Dirs := TStringList.Create;
204
205 with InformationForm.InformationMemo do
206 begin
207 Lines.Clear;
208
209 Lines.Add( 'HELP:' );
210 GetDirsInPath( 'HELP', Dirs );
211 Lines.AddStrings( Dirs );
212
213 Lines.Add( '' );
214 Lines.Add( 'BOOKSHELF:' );
215 GetDirsInPath( 'BOOKSHELF', Dirs );
216 Lines.AddStrings( Dirs );
217 end;
218 InformationForm.ShowModal;
219
220 Dirs.Destroy;
221End;
222
223Procedure TGlobalSearchForm.GetSelectedDirectories( List: TStringList );
224Var
225 DriveNumber: longint;
226 DriveType: TDriveType;
227 DriveLetter: char;
228 Dirs: TStringList;
229 i: longint;
230 Dir: string;
231 FoundIndex: longint;
232begin
233 List.Clear;
234 case SearchLocationComboBox.ItemIndex of
235 -1:
236 begin
237 // one custom dir...
238 List.Add( SearchLocationComboBox.Text );
239 end;
240
241 Ord( gsHelpPaths ),
242 Ord( gsSelectedHelpPaths ): // standard or selected help paths
243 Begin
244 Dirs := TStringList.Create;
245 List.Sorted := true;
246 List.Duplicates := dupIgnore;
247
248 GetDirsInPath( 'HELP', Dirs );
249 List.AddStrings( Dirs );
250
251 GetDirsInPath( 'BOOKSHELF', Dirs );
252 List.AddStrings( Dirs );
253
254 Dirs.Destroy;
255
256 if SearchLocationComboBox.ItemIndex = Ord( gsSelectedHelpPaths ) then
257 begin
258 // now mark some as non-selected...
259 for i := 0 to List.Count - 1 do
260 begin
261 Dir := List[ i ];
262 if not Settings.SearchDirectories.Find( Dir, FoundIndex ) then
263 List.Objects[ i ] := pointer( 1 );
264 end;
265 end;
266 end;
267
268 Ord( gsFixedDrives ):
269 begin
270 // drives
271 For DriveNumber := MinDriveNumber To MaxDriveNumber Do
272 Begin
273 DriveType := GetDriveType( DriveNumber );
274 DriveLetter := Chr( DriveNumber + Ord( 'A' ) - 1 );
275
276 if DriveType = dtHard then
277 begin
278 List.Add( DriveLetter + ':\...' );
279 end;
280 end;
281 end;
282
283 Ord( gsCustom ):
284 begin
285 // already custom...
286 List.Assign( Settings.SearchDirectories );
287 end;
288 end;
289end;
290
291Procedure TGlobalSearchForm.SelectDrivesButtonOnClick (Sender: TObject);
292Begin
293 GetSelectedDirectories( SearchDirectoriesForm.SelectedFolders );
294
295 SearchDirectoriesForm.ShowModal;
296 if SearchDirectoriesForm.ModalResult <> mrOK then
297 exit;
298
299 if SearchLocationComboBox.ItemIndex = Ord( gsHelpPaths ) then
300 SearchLocationComboBox.ItemIndex := Ord( gsSelectedHelpPaths );
301
302 if SearchLocationComboBox.ItemIndex = Ord( gsFixedDrives ) then
303 SearchLocationComboBox.ItemIndex := Ord( gsCustom );
304
305 if SearchDirectoriesForm.CustomDirAdded then
306 SearchLocationComboBox.ItemIndex := Ord( gsCustom );
307
308 Settings.SearchDirectories.Assign( SearchDirectoriesForm.SelectedFolders );
309
310 SaveSettings;
311End;
312
313Procedure TGlobalSearchForm.UpdateButtons;
314Begin
315 // HelpPathsRadioButton.Checked := SearchType = stHelpPaths;
316 // EverywhereRadioButton.Checked := SearchType = stDrives;
317// FolderRadioButton.Checked := SearchType = stFolder;
318
319End;
320
321Procedure TGlobalSearchForm.GlobalSearchFormOnSetupShow (Sender: TObject);
322Begin
323 ScaleForm( self, 11, 16 );
324 SearchButton.Align := alFixedRightTop;
325
326 if SearchLocationComboBox.Items.Count = 0 then
327 begin
328 // must match teh global search location enum...
329 SearchLocationComboBox.Items.Add( StandardHelpPathsLocation );
330 SearchLocationComboBox.Items.Add( FixedDrivesLocation );
331 SearchLocationComboBox.Items.Add( SelectedHelpPathsLocation );
332 SearchLocationComboBox.Items.Add( CustomPathsLocation );
333
334 SearchLocationComboBox.ItemIndex := Ord( Settings.GlobalSearchLocation );
335 end;
336
337End;
338
339Procedure TGlobalSearchForm.OnLanguageEvent(Language: TLanguageFile; const Apply: boolean );
340begin
341 LogEvent(LogI18n, 'TGlobalSearchForm.OnLanguageEvent apply: "' + BoolToStr(Apply) + '"');
342
343 Language.LoadComponentLanguage(self, Apply);
344
345 Language.LL(Apply, SearchCaption, 'SearchCaption', '~Search');
346 Language.LL(Apply, StopCaption, 'StopCaption', '~Stop');
347 Language.LL(Apply, NoResultsMsg, 'NoResultsMsg', '(No results found)');
348 Language.LL(Apply, ScanDirectoriesMsg, 'ScanDirectoriesMsg', 'Finding help files...');
349 Language.LL(Apply, SearchingFileMsg, 'SearchingFileMsg', 'Searching ');
350 Language.LL(Apply, OfMsg, 'OfMsg', ' of ');
351 Language.LL(Apply, DoneMsg, 'DoneMsg', 'Done');
352 Language.LL(Apply, SearchErrorTitle, 'SearchErrorTitle', 'Search');
353 Language.LL(Apply, SearchError, 'SearchError', 'Error in search syntax: ');
354
355 Language.LL(Apply, StandardHelpPathsLocation, 'StandardHelpPathsLocation', 'Standard Help Paths');
356 Language.LL(Apply, FixedDrivesLocation, 'FixedDrivesLocation', 'All Hard Drives');
357 Language.LL(Apply, SelectedHelpPathsLocation, 'SelectedHelpPathsLocation', 'Selected Help Paths');
358 Language.LL(Apply, CustomPathsLocation, 'CustomPathsLocation', 'Directory List');
359end;
360
361
362Procedure TGlobalSearchForm.CancelButtonOnClick (Sender: TObject);
363Begin
364 Close;
365End;
366
367Procedure TGlobalSearchForm.GlobalSearchFormOnClose (Sender: TObject;
368 Var Action: TCloseAction);
369Begin
370 ClearResults;
371
372 if SearchLocationComboBox.ItemIndex = -1 then
373 begin
374 Settings.GlobalSearchLocation := gsCustom;
375 Settings.SearchDirectories.Clear;
376 Settings.SearchDirectories.Add( SearchLocationComboBox.Text );
377 end;
378
379 Action := caFreeHandle; // DON'T release the form! (Default action for non-modal forms)
380End;
381
382Procedure TGlobalSearchForm.ResultsOutlineOnItemDblClick (Node: TNode);
383Begin
384 ViewTopic;
385End;
386
387Procedure TGlobalSearchForm.ViewTopicButtonOnClick (Sender: TObject);
388begin
389 ViewTopic;
390end;
391
392Procedure TGlobalSearchForm.ViewTopic;
393var
394 Node: TNode;
395 HelpFileInfo: THelpFileInfo;
396 TopicIndex: longint;
397Begin
398 Node := ResultsOutline.SelectedNode;
399 if Node = nil then
400 exit;
401 case Node.Level of
402 0:
403 begin
404 // file node
405 HelpFileInfo := Node.Data as THelpFileInfo;
406 TopicIndex := -1;
407 end;
408
409 1:
410 begin
411 // topic node
412 HelpFileInfo := Node.Parent.Data as THelpFileInfo;
413 TopicIndex := longint( Node.Data );
414 end;
415
416 else
417 assert( false, 'Invalid node level in ViewTopic!: ' + IntToStr( Node.Level ) );
418 end;
419
420 ViewTopicCallback( HelpFileInfo.FileName, TopicIndex );
421End;
422
423Procedure TGlobalSearchForm.GlobalSearchFormOnCreate (Sender: TObject);
424Begin
425 RegisterForLanguages( OnLanguageEvent );
426
427 UpdateButtons;
428
429 ThreadManager := TGenericThreadManager.Create( self );
430 ThreadManager.OnProgressUpdate := OnSearchProgress;
431 ThreadManager.OnDataFromThread := OnThreadData;
432 ThreadManager.OnJobComplete := OnSearchFinished;
433End;
434
435Procedure TGlobalSearchForm.OnSearchFinished( Result: TObject );
436Begin
437 SearchButton.Caption := SearchCaption;
438 ProgressBar.Hide;
439 LED.LedCondition := false;
440 LEDTimer.Stop;
441
442 if ResultsOutline.ChildCount > 0 then
443 begin
444 ResultsOutline.SelectedNode:= ResultsOutline.Children[ 0 ];
445 ResultsOutline.Focus;
446 SetProgressLabel( '' );
447 end
448 else
449 begin
450 SetProgressLabel( NoResultsMsg );
451 end;
452
453End;
454
455Procedure TGlobalSearchForm.GlobalSearchFormOnCloseQuery (Sender: TObject;
456 Var CanClose: Boolean);
457Begin
458 if ThreadManager.IsRunning then
459 begin
460 ThreadManager.Stop;
461 end;
462End;
463
464Procedure TGlobalSearchForm.SetProgressLabel( const S: String );
465begin
466 ProgressLabel.Text := S;
467 ProgressLabel.Refresh;
468end;
469
470Procedure TGlobalSearchForm.OnSearchProgress ( n, outof: integer;
471 S: String );
472Begin
473 ProgressBar.Position := n * 100 div outof;
474 SetProgressLabel( S );
475End;
476
477Function TGlobalSearchForm.Search( Parameters: TObject ): TObject;
478var
479 Files: TStringList;
480 FileIndex: longint;
481 Filename: string;
482 HelpFile: THelpFile;
483 SearchResult: TSearchResult;
484 MatchingTopics: TList;
485
486 SearchParameters: TSearchParameters;
487 Query: TTextSearchQuery;
488 i: longint;
489 Dir: string;
490
491Begin
492// StartProfile( GetLogFilesDir + 'NewViewSearch.prf' );
493
494 SearchParameters := Parameters as TSearchParameters;
495
496 Query := SearchParameters.Query;
497 Files := TStringList.Create;
498
499 // MatchingTopics.Add( nil ); // artificial crash
500 MatchingTopics := TList.Create;
501
502 LogEvent(LogParse, 'Getting files');
503
504 // make sure we ignore duplicate files...
505 Files.Sorted := true;
506 Files.CaseSensitive := false;
507 Files.Duplicates := dupIgnore;
508
509 for i := 0 to SearchParameters.Directories.Count - 1 do
510 begin
511 if ThreadManager.StopRequested then
512 break;
513 ThreadManager.UpdateProgress( i * 10 div SearchParameters.Directories.Count,
514 100,
515 ScanDirectoriesMsg );
516 Dir := SearchParameters.Directories[ i ];
517 if StrEnds( '...', Dir ) then
518 begin
519 Dir := StrLeftWithout( Dir, 3 );
520 ListFilesInDirectoryRecursiveWithTermination(
521 Dir,
522 '*.inf;*.hlp',
523 Files,
524 ThreadManager.StopRequested,
525 true ); // check termination
526 end
527 else
528 begin
529 ListFilesInDirectory( Dir,
530 '*.inf;*.hlp',
531 Files);
532 end;
533 end;
534
535 LogEvent(LogParse, ' Searching ' + IntToStr( Files.Count ) + ' files');
536 for FileIndex := 0 to Files.Count - 1 do
537 begin
538 if ThreadManager.StopRequested then
539 break;
540 Filename := Files[ FileIndex ];
541 LogEvent(LogParse, Filename);
542 ThreadManager.UpdateProgress( 10 + FileIndex * 95 div Files.Count,
543 100,
544 SearchingFileMsg
545 + Filename
546 + ' ('
547 + IntToStr( FileIndex + 1 )
548 + OfMsg
549 + IntToStr( Files.Count )
550 + ')...' );
551
552 try
553 LogEvent(LogParse, ' Create THelpFile');
554 HelpFile := THelpFile.Create( FileName );
555
556 LogEvent(LogParse, ' Helpfile created');
557 MatchingTopics.Clear;
558
559 LogEvent(LogParse, ' Search file');
560 SearchHelpFile( HelpFile,
561 Query,
562 MatchingTopics,
563 nil // don't care about words matched
564 );
565
566 if MatchingTopics.Count > 0 then
567 begin
568 LogEvent(LogParse, ' Sort results');
569 // Create a searchresult object to send back to main thread.
570 SearchResult := TSearchResult.Create;
571 SearchResult.Filename := HelpFile.Filename;
572 SearchResult.FileTitle := HelpFile.Title;
573
574 SearchResult.MatchingTopics.Assign( MatchingTopics );
575
576 SearchResult.MatchingTopics.Sort( TopicRelevanceCompare );
577 LogEvent(LogParse, ' Display results');
578
579 ThreadManager.SendData( '', SearchResult );
580 end;
581
582 LogEvent(LogParse, 'Unload helpfile');
583 HelpFile.Destroy;
584
585 except
586 on E: EHelpFileException do
587 begin
588 ; // ignore exceptions
589 end;
590
591 on E: EWindowsHelpFormatException do
592 begin
593 ; // ignore Windows help files
594 end;
595 end;
596
597 end;
598 LogEvent(LogParse, 'search completed');
599 ThreadManager.UpdateProgress( 100, 100, DoneMsg );
600 Files.Destroy;
601
602 Query.Destroy;
603
604 SearchParameters.Directories.Destroy;
605 SearchParameters.Destroy;
606
607 Result := nil;
608 LogEvent(LogParse, 'done');
609End;
610
611Procedure TGlobalSearchForm.ClearResults;
612var
613 FileIndex: longint;
614begin
615 for FileIndex := 0 to ResultsOutline.ChildCount - 1 do
616 ResultsOutline.Children[ FileIndex ].Data.Free;
617 ResultsOutline.Clear;
618 ViewTopicButton.Enabled := false;
619end;
620
621Procedure TGlobalSearchForm.SearchButtonOnClick (Sender: TObject);
622begin
623 DoSearch;
624end;
625
626Procedure TGlobalSearchForm.DoSearch;
627var
628 SearchText: string;
629 Query: TTextSearchQuery;
630 SearchParameters: TSearchParameters;
631Begin
632 if ThreadManager.IsRunning then
633 begin
634 ThreadManager.Stop;
635 exit;
636 end;
637
638 SearchText := trim( SearchTextEdit.Text );
639 if SearchText = '' then
640 exit;
641
642 try
643 Query := TTextSearchQuery.Create( SearchText );
644 except
645 on e: ESearchSyntaxError do
646 begin
647 DoErrorDlg( SearchErrorTitle,
648 SearchError
649 + e.Message );
650 exit;
651 end;
652 end;
653
654 ClearResults;
655
656 SearchParameters := TSearchParameters.Create;
657 SearchParameters.Directories := TStringList.Create;
658
659 SearchParameters.Query := Query;
660
661 GetSelectedDirectories( SearchParameters.Directories );
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.