source: trunk/NewView/GlobalSearchForm.pas@ 228

Last change on this file since 228 was 228, checked in by RBRi, 18 years ago

refactoring for language handling

  • Property svn:eol-style set to native
File size: 19.8 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;
111 const Apply: boolean );
112
113 SearchCaption: string;
114 StopCaption: string;
115 NoResultsMsg: string;
116 ScanDirectoriesMsg: string;
117 SearchingFileMsg: string;
118 OfMsg: string;
119 DoneMsg: string;
120 SearchErrorTitle: string;
121 SearchError: string;
122
123 StandardHelpPathsLocation: string;
124 FixedDrivesLocation: string;
125 SelectedHelpPathsLocation: string;
126 CustomPathsLocation: string;
127
128 public
129 // set by caller
130 ViewTopicCallback: TViewTopicCallback;
131 Procedure DoSearch;
132 End;
133
134Var
135 GlobalSearchForm: TGlobalSearchForm;
136
137procedure EnsureGlobalSearchFormLoaded;
138
139Implementation
140
141uses
142 SysUtils,
143 DebugUnit,
144 ACLDialogs,
145 ControlsUtility,
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, 11, 16 );
304 SearchButton.Align := alFixedRightTop;
305
306 if SearchLocationComboBox.Items.Count = 0 then
307 begin
308 // must match teh global search location enum...
309 SearchLocationComboBox.Items.Add( StandardHelpPathsLocation );
310 SearchLocationComboBox.Items.Add( FixedDrivesLocation );
311 SearchLocationComboBox.Items.Add( SelectedHelpPathsLocation );
312 SearchLocationComboBox.Items.Add( CustomPathsLocation );
313
314 SearchLocationComboBox.ItemIndex := Ord( Settings.GlobalSearchLocation );
315 end;
316
317End;
318
319Procedure TGlobalSearchForm.OnLanguageEvent(Language: TLanguageFile; const Apply: boolean );
320var
321 tmpPrefix : String;
322begin
323 // LogEvent(LogI18n, 'TGlobalSearchForm.OnLanguageEvent apply: "' + BoolToStr(Apply) + '"');
324
325 Language.LoadComponentLanguage(self, Apply);
326
327 tmpPrefix := 'GlobalSearchForm' + LANGUAGE_LABEL_DELIMITER;
328
329 Language.LL(Apply, SearchCaption, tmpPrefix + 'SearchCaption', '~Search');
330 Language.LL(Apply, StopCaption, tmpPrefix + 'StopCaption', '~Stop');
331 Language.LL(Apply, NoResultsMsg, tmpPrefix + 'NoResultsMsg', '(No results found)');
332 Language.LL(Apply, ScanDirectoriesMsg, tmpPrefix + 'ScanDirectoriesMsg', 'Finding help files...');
333 Language.LL(Apply, SearchingFileMsg, tmpPrefix + 'SearchingFileMsg', 'Searching ');
334 Language.LL(Apply, OfMsg, tmpPrefix + 'OfMsg', ' of ');
335 Language.LL(Apply, DoneMsg, tmpPrefix + 'DoneMsg', 'Done');
336 Language.LL(Apply, SearchErrorTitle, tmpPrefix + 'SearchErrorTitle', 'Search');
337 Language.LL(Apply, SearchError, tmpPrefix + 'SearchError', 'Error in search syntax: ');
338
339 Language.LL(Apply, StandardHelpPathsLocation, tmpPrefix + 'StandardHelpPathsLocation', 'Standard Help Paths');
340 Language.LL(Apply, FixedDrivesLocation, tmpPrefix + 'FixedDrivesLocation', 'All Hard Drives');
341 Language.LL(Apply, SelectedHelpPathsLocation, tmpPrefix + 'SelectedHelpPathsLocation', 'Selected Help Paths');
342 Language.LL(Apply, CustomPathsLocation, tmpPrefix + 'CustomPathsLocation', 'Directory List');
343end;
344
345
346Procedure TGlobalSearchForm.CancelButtonOnClick (Sender: TObject);
347Begin
348 Close;
349End;
350
351Procedure TGlobalSearchForm.GlobalSearchFormOnClose (Sender: TObject;
352 Var Action: TCloseAction);
353Begin
354 ClearResults;
355
356 if SearchLocationComboBox.ItemIndex = -1 then
357 begin
358 Settings.GlobalSearchLocation := gsCustom;
359 Settings.SearchDirectories.Clear;
360 Settings.SearchDirectories.Add( SearchLocationComboBox.Text );
361 end;
362
363 Action := caFreeHandle; // DON'T release the form! (Default action for non-modal forms)
364End;
365
366Procedure TGlobalSearchForm.ResultsOutlineOnItemDblClick (Node: TNode);
367Begin
368 ViewTopic;
369End;
370
371Procedure TGlobalSearchForm.ViewTopicButtonOnClick (Sender: TObject);
372begin
373 ViewTopic;
374end;
375
376Procedure TGlobalSearchForm.ViewTopic;
377var
378 Node: TNode;
379 HelpFileInfo: THelpFileInfo;
380 TopicIndex: longint;
381Begin
382 Node := ResultsOutline.SelectedNode;
383 if Node = nil then
384 exit;
385 case Node.Level of
386 0:
387 begin
388 // file node
389 HelpFileInfo := Node.Data as THelpFileInfo;
390 TopicIndex := -1;
391 end;
392
393 1:
394 begin
395 // topic node
396 HelpFileInfo := Node.Parent.Data as THelpFileInfo;
397 TopicIndex := longint( Node.Data );
398 end;
399
400 else
401 assert( false, 'Invalid node level in ViewTopic!: ' + IntToStr( Node.Level ) );
402 end;
403
404 ViewTopicCallback( HelpFileInfo.FileName, TopicIndex );
405End;
406
407Procedure TGlobalSearchForm.GlobalSearchFormOnCreate (Sender: TObject);
408Begin
409 RegisterEventForLanguages( OnLanguageEvent );
410
411 UpdateButtons;
412
413 ThreadManager := TGenericThreadManager.Create( self );
414 ThreadManager.OnProgressUpdate := OnSearchProgress;
415 ThreadManager.OnDataFromThread := OnThreadData;
416 ThreadManager.OnJobComplete := OnSearchFinished;
417End;
418
419Procedure TGlobalSearchForm.OnSearchFinished( Result: TObject );
420Begin
421 SearchButton.Caption := SearchCaption;
422 ProgressBar.Hide;
423 LED.LedCondition := false;
424 LEDTimer.Stop;
425
426 if ResultsOutline.ChildCount > 0 then
427 begin
428 ResultsOutline.SelectedNode:= ResultsOutline.Children[ 0 ];
429 ResultsOutline.Focus;
430 SetProgressLabel( '' );
431 end
432 else
433 begin
434 SetProgressLabel( NoResultsMsg );
435 end;
436
437End;
438
439Procedure TGlobalSearchForm.GlobalSearchFormOnCloseQuery (Sender: TObject;
440 Var CanClose: Boolean);
441Begin
442 if ThreadManager.IsRunning then
443 begin
444 ThreadManager.Stop;
445 end;
446End;
447
448Procedure TGlobalSearchForm.SetProgressLabel( const S: String );
449begin
450 ProgressLabel.Text := S;
451 ProgressLabel.Refresh;
452end;
453
454Procedure TGlobalSearchForm.OnSearchProgress ( n, outof: integer;
455 S: String );
456Begin
457 ProgressBar.Position := n * 100 div outof;
458 SetProgressLabel( S );
459End;
460
461Function TGlobalSearchForm.Search( Parameters: TObject ): TObject;
462var
463 Files : TStringList;
464 FileIndex: longint;
465 Filename: string;
466 HelpFile: THelpFile;
467 SearchResult: TSearchResult;
468 MatchingTopics: TList;
469
470 tmpSearchParameters : TSearchParameters;
471 Query: TTextSearchQuery;
472 i: longint;
473 Dir: string;
474
475Begin
476 tmpSearchParameters := Parameters as TSearchParameters;
477
478 Query := tmpSearchParameters.Query;
479 Files := TStringList.Create;
480
481 MatchingTopics := TList.Create;
482 LogEvent(LogParse, 'Creating file list');
483
484 // make sure we ignore duplicate files...
485 Files.Sorted := true;
486 Files.CaseSensitive := false;
487 Files.Duplicates := dupIgnore;
488
489 for i := 0 to tmpSearchParameters.Directories.Count - 1 do
490 begin
491 if ThreadManager.StopRequested then
492 begin
493 break;
494 end;
495
496 ThreadManager.UpdateProgress( i * 10 div tmpSearchParameters.Directories.Count,
497 100,
498 ScanDirectoriesMsg );
499 Dir := tmpSearchParameters.Directories[ i ];
500 if StrEndsWith('...', Dir) then
501 begin
502 Dir := StrLeftWithout( Dir, 3 );
503 ListFilesInDirectoryRecursiveWithTermination(
504 Dir,
505 '*.inf;*.hlp',
506 true,
507 Files,
508 ThreadManager.StopRequested,
509 true ); // check termination
510 end
511 else
512 begin
513 ListFilesInDirectory( Dir, '*.inf;*.hlp', true, Files);
514 end;
515 end;
516
517 for FileIndex := 0 to Files.Count - 1 do
518 begin
519 if ThreadManager.StopRequested then
520 begin
521 break;
522 end;
523
524 Filename := Files[FileIndex];
525
526 ThreadManager.UpdateProgress( 10 + FileIndex * 95 div Files.Count,
527 100,
528 SearchingFileMsg
529 + Filename
530 + ' ('
531 + IntToStr( FileIndex + 1 )
532 + OfMsg
533 + IntToStr( Files.Count )
534 + ')...' );
535
536 try
537 HelpFile := THelpFile.Create( FileName );
538 MatchingTopics.Clear;
539 SearchHelpFile( HelpFile,
540 Query,
541 MatchingTopics,
542 nil // don't care about words matched
543 );
544
545 if MatchingTopics.Count > 0 then
546 begin
547 // Create a searchresult object to send back to main thread.
548 SearchResult := TSearchResult.Create;
549 SearchResult.Filename := HelpFile.Filename;
550 SearchResult.FileTitle := HelpFile.Title;
551
552 SearchResult.MatchingTopics.Assign( MatchingTopics );
553
554 SearchResult.MatchingTopics.Sort( TopicRelevanceCompare );
555 ThreadManager.SendData( '', SearchResult );
556 end;
557
558 HelpFile.Destroy;
559
560 except
561 on E: EHelpFileException do
562 begin
563 ; // ignore exceptions
564 end;
565
566 on E: EWindowsHelpFormatException do
567 begin
568 ; // ignore Windows help files
569 end;
570 end;
571
572 end;
573 ThreadManager.UpdateProgress( 100, 100, DoneMsg );
574 Files.Destroy;
575
576 Query.Destroy;
577
578 tmpSearchParameters.Directories.Destroy;
579 tmpSearchParameters.Destroy;
580
581 Result := nil;
582End;
583
584Procedure TGlobalSearchForm.ClearResults;
585var
586 FileIndex: longint;
587begin
588 for FileIndex := 0 to ResultsOutline.ChildCount - 1 do
589 ResultsOutline.Children[ FileIndex ].Data.Free;
590 ResultsOutline.Clear;
591 ViewTopicButton.Enabled := false;
592end;
593
594Procedure TGlobalSearchForm.SearchButtonOnClick (Sender: TObject);
595begin
596 DoSearch;
597end;
598
599Procedure TGlobalSearchForm.DoSearch;
600var
601 tmpSelectedDirectories : TStringList;
602 i : integer;
603
604 SearchText: string;
605 Query: TTextSearchQuery;
606 SearchParameters: TSearchParameters;
607Begin
608 if ThreadManager.IsRunning then
609 begin
610 ThreadManager.Stop;
611 exit;
612 end;
613
614 SearchText := trim( SearchTextEdit.Text );
615 if SearchText = '' then
616 exit;
617
618 try
619 Query := TTextSearchQuery.Create(SearchText);
620 except
621 on e: ESearchSyntaxError do
622 begin
623 DoErrorDlg( SearchErrorTitle,
624 SearchError
625 + e.Message );
626 exit;
627 end;
628 end;
629
630 ClearResults;
631
632 SearchParameters := TSearchParameters.Create;
633
634 SearchParameters.Query := Query;
635
636 // now the directories to search in
637 SearchParameters.Directories := TStringList.Create;
638
639 tmpSelectedDirectories := TStringList.Create;
640 GetSelectedDirectories(tmpSelectedDirectories);
641
642 // clear the list and add only the selected ones
643 for i := 0 to tmpSelectedDirectories.Count - 1 do
644 begin
645 if tmpSelectedDirectories.Objects[i] = nil then
646 begin
647 SearchParameters.Directories.add(tmpSelectedDirectories[i]);
648 end;
649 end;
650 tmpSelectedDirectories.Destroy;
651
652 ThreadManager.StartJob( Search, SearchParameters );
653 SearchButton.Caption := StopCaption;
654 ProgressBar.Show;
655
656 LED.LedCondition := true;
657 LEDTimer.Start;
658End;
659
660Procedure TGlobalSearchForm.GlobalSearchFormOnShow (Sender: TObject);
661Begin
662 // make search button default
663 SearchButton.Focus;
664 SearchTextEdit.Focus;
665 SetProgressLabel( '' );
666 PostMsg( Handle, WM_OPENED, 0, 0 );
667 SearchButton.Caption := SearchCaption;
668 ProgressBar.Hide;
669 ViewTopicButton.Enabled := false;
670End;
671
672Procedure TGlobalSearchForm.OnThreadData( S: string; Data: TObject );
673var
674 SearchResult: TSearchResult;
675begin
676 SearchResult := Data as TSearchResult;
677 OnMatchFound( SearchResult );
678 SearchResult.Destroy;
679end;
680
681Procedure TGlobalSearchForm.OnMatchFound( SearchResult: TSearchResult );
682var
683 Topic: TTopic;
684 HelpFileInfo: THelpFileInfo;
685 FileNode: TNode;
686 TopicIndex: longint;
687begin
688 ViewTopicButton.Enabled := true;
689
690 HelpFileInfo := THelpFileInfo.Create;
691 HelpFileInfo.FileName := SearchResult.FileName;
692 FileNode := ResultsOutline.AddChild( SearchResult.FileTitle
693 + ' ('
694 + SearchResult.FileName
695 + ')',
696 HelpFileInfo );
697 for TopicIndex := 0 to SearchResult.MatchingTopics.Count - 1 do
698 begin
699 Topic := SearchResult.MatchingTopics[ TopicIndex ];
700 FileNode.AddChild( Topic.Title,
701 TObject( Topic.Index ) );
702 end;
703end;
704
705Procedure TGlobalSearchForm.WMOpened( Var Msg: TMessage );
706begin
707 SearchTextLabel.XAlign := xaLeft;
708 SearchTextLabel.YAlign := yaTop;
709
710 SearchTextEdit.XStretch := xsFrame;
711 SearchTextEdit.YAlign := yaTop;
712 SearchTextEdit.Focus;
713
714 SearchButton.XAlign := xaRight;
715 SearchButton.YAlign := yaTop;
716
717 SearchTextLabel1.XAlign := xaLeft;
718 SearchTextLabel1.YAlign := yaTop;
719
720 SearchLocationComboBox.XStretch := xsFrame;
721 SearchLocationComboBox.YAlign := yaTop;
722
723 SelectDrivesButton.XAlign := xaRight;
724 SelectDrivesButton.YAlign := yaTop;
725
726 Bevel.XStretch := xsFrame;
727 Bevel.YAlign := yaTop;
728
729 LED.XAlign := xaRight;
730 LED.YAlign := yaTop;
731
732 ResultsLabel.XAlign := xaLeft;
733 ResultsLabel.YAlign := yaTop;
734
735 ProgressLabel.XStretch := xsFrame;
736 ProgressLabel.YAlign := yaTop;
737
738 ResultsOutline.XStretch := xsFrame;
739 ResultsOutline.YStretch := ysFrame;
740
741 ProgressBar.XStretch := xsFrame;
742 ProgressBar.YAlign := yaBottom;
743
744end;
745
746procedure EnsureGlobalSearchFormLoaded;
747begin
748 if GlobalSearchForm = nil then
749 GlobalSearchForm := TGlobalSearchForm.Create( nil );
750end;
751
752Initialization
753 RegisterClasses ([TGlobalSearchForm, TEdit, TLabel,
754 TProgressBar, TButton, TOutline2, TComboBox, TBevel, TLed, TTimer]);
755
756 RegisterUpdateProcForLanguages(EnsureGlobalSearchFormLoaded);
757End.
Note: See TracBrowser for help on using the repository browser.