Changeset 1712 for cprs/branches/HealthSevak-CPRS/CPRS-Lib/Hans SpellCheck
- Timestamp:
- May 9, 2015, 2:00:05 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cprs/branches/HealthSevak-CPRS/CPRS-Lib/Hans SpellCheck/skaSpellCheck.pas
r1694 r1712 89 89 function GetAboutThis: String; 90 90 procedure SaveForUndo(const Ignoring: Boolean=False); 91 procedure ShowBtnClose(const ShowIt: Boolean = True); 91 92 public 92 93 constructor Create(AOwner: TComponent); overload; override; … … 159 160 function TskaHunSpellChecker.AbortSpellCheck(Verbose: Boolean = True): Boolean; 160 161 begin 162 if FStatus <> ssChecking then 163 begin 164 FStatus := ssCancelled; 165 Close; 166 exit; 167 end; 168 161 169 Result := (not isModified) or 162 170 (not Verbose) or (MessageDlg(ConfirmAbort, mtConfirmation, … … 165 173 if Result then 166 174 FStatus := ssCancelled; 175 176 ShowBtnClose; 167 177 end; 168 178 … … 211 221 begin 212 222 full := SourceTextControl.Lines[CurrentLine]; 213 prefix := copy(CurrentText, 1, WordPos-1);223 prefix := copy(CurrentText, 2, WordPos-2); //remember there is one extra space at the start of the line prefixed while populating this variable 214 224 Suffix := copy(CurrentText, WordPos+WordLength, 215 225 length(CurrentText)); … … 228 238 Initialize; 229 239 WaitForUser := False; 240 FStatus := ssChecking; 230 241 SourceTextControl.Invalidate; 231 242 Result := not WaitForUser; … … 251 262 SourceTextControl.Invalidate; 252 263 //SourceTextControl.Invalidate; 264 ShowBtnClose(False); 253 265 end; 254 266 … … 403 415 uHunSpellLib.hunspell_suggest_free(FpointerHunLib, suggestions, Count); 404 416 end; 417 end; 418 419 procedure TskaHunSpellChecker.ShowBtnClose(const ShowIt: Boolean); 420 begin 421 if Assigned(btnClose) then 422 begin 423 btnClose.Enabled := ShowIt; 424 btnClose.Visible := ShowIt; 425 if ShowIt then 426 begin 427 btnClose.BringToFront; 428 btnClose.SetFocus; 429 end; 430 end; 405 431 end; 406 432 … … 508 534 begin 509 535 FStatus := ssCompleted; 510 if Assigned(btnClose) then 511 btnClose.Click; 536 if ShowCompletionMessage then 537 ShowMessage(CompletionMessage); 538 ShowBtnClose; 512 539 end; 513 540 {$R+}
Note:
See TracChangeset
for help on using the changeset viewer.