diff options
author | Graeme Geldenhuys <graemeg@gmail.com> | 2009-11-21 23:22:10 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graemeg@gmail.com> | 2009-11-21 23:22:10 +0200 |
commit | b49103083829274dd01bb61bcf2a4b86faab7103 (patch) | |
tree | 2a385e344f078e4bdaaa3e5ed0494b5dfd0138ef /src | |
parent | 102a169d0b4bc03ee15a469d70250ad5558ca757 (diff) | |
download | fpGUI-b49103083829274dd01bb61bcf2a4b86faab7103.tar.xz |
New ClearIndexComponents procedure introduced.
* After viewing the index of one INF while and then switching to
another INF file, the components on the Index tabsheet was not
reset. eg: last focused item, text in indexsearch edit etc...
This method resolves that.
* Also in now clears previously searched text so incorrect text is
not highlighted when switching INF files at runtime.
Diffstat (limited to 'src')
-rw-r--r-- | src/frm_main.pas | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/frm_main.pas b/src/frm_main.pas index e56d069f..b5120378 100644 --- a/src/frm_main.pas +++ b/src/frm_main.pas @@ -127,6 +127,7 @@ type // Used in loading contents procedure AddChildNodes(AHelpFile: THelpFile; AParentNode: TfpgTreeNode; ALevel: longint; var ATopicIndex: longint ); procedure ClearNotes; + procedure ClearIndexComponents; procedure SaveNotes(AHelpFile: THelpFile); procedure DisplayTopic(ATopic: TTopic = nil); procedure ResetProgress; @@ -273,6 +274,7 @@ end; procedure TMainForm.MainFormDestroy(Sender: TObject); begin + ClearAllWordSequences; DisplayedIndex.Free; // save splitter position gINI.WriteInteger('Options', 'SplitterLeft', PageControl1.Width); @@ -1095,7 +1097,8 @@ begin SaveNotes( lHelpFile ); end; - DisplayedIndex.Clear; + ClearIndexComponents; + ClearAllWordSequences; // Now destroy help files for FileIndex := 0 to Files.Count - 1 do @@ -1425,6 +1428,15 @@ begin { TODO -oGraeme : Implement me } end; +procedure TMainForm.ClearIndexComponents; +begin + IndexSearchEdit.Clear; + lbIndex.FocusItem := -1; + lbIndex.Items.Clear; + DisplayedIndex.Clear; + IndexLoaded := False; +end; + procedure TMainForm.SaveNotes(AHelpFile: THelpFile); begin { TODO -oGraeme : Implement me } |