Sudoku: DigitSetEditor:

- disallow setting values that are not in original DigitsPPossible set
- disallow clearing the set entirely


git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7250 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
lazarus-bart
2020-01-08 12:08:49 +00:00
parent 21c87d8266
commit b24bcfec2b
3 changed files with 47 additions and 12 deletions

View File

@@ -226,16 +226,17 @@ end;
procedure TScratchForm.EditCell(ACol, ARow: Integer);
var
S: String;
DigitSet: TDigitSet;
CurrentDigitSet: TDigitSet;
begin
S := ScratchGrid.Cells[ACol, ARow];
DigitSet := StrToDigitSet(S);
DigitSetEditorForm.DigitSet := DigitSet;
CurrentDigitSet := StrToDigitSet(S);
DigitSetEditorForm.OriginalDigitsPossible := FRawData[ACol+1,ARow+1].DigitsPossible; //always set this first
DigitSetEditorForm.CurrentDigitSet := CurrentDigitSet;
DigitSetEditorForm.Top := Top;
DigitSetEditorForm.PreferredRight := Left;
if (DigitSetEditorForm.ShowModal = mrOK) then
begin
S := DigitSetToStr(DigitSetEditorForm.DigitSet);
S := DigitSetToStr(DigitSetEditorForm.CurrentDigitSet);
ScratchGrid.Cells[ACol, ARow] := S;
end;
end;