You've already forked lazarus-ccr
Sudoku: remove SGrid's OnSetEditText event, it's not necessary. TheValues is fully set wehn querying a solution.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7230 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -28,7 +28,6 @@ object Form1: TForm1
|
|||||||
TabOrder = 2
|
TabOrder = 2
|
||||||
OnPrepareCanvas = SGridPrepareCanvas
|
OnPrepareCanvas = SGridPrepareCanvas
|
||||||
OnSelectEditor = SGridSelectEditor
|
OnSelectEditor = SGridSelectEditor
|
||||||
OnSetEditText = SGridSetEditText
|
|
||||||
end
|
end
|
||||||
object ButtonFill: TButton
|
object ButtonFill: TButton
|
||||||
Left = 16
|
Left = 16
|
||||||
|
@ -49,8 +49,6 @@ type
|
|||||||
{%H-}aState: TGridDrawState);
|
{%H-}aState: TGridDrawState);
|
||||||
procedure SGridSelectEditor(Sender: TObject; {%H-}aCol, {%H-}aRow: Integer;
|
procedure SGridSelectEditor(Sender: TObject; {%H-}aCol, {%H-}aRow: Integer;
|
||||||
var Editor: TWinControl);
|
var Editor: TWinControl);
|
||||||
procedure SGridSetEditText(Sender: TObject; ACol, ARow: Integer;
|
|
||||||
const Value: string);
|
|
||||||
private
|
private
|
||||||
{ private declarations }
|
{ private declarations }
|
||||||
theValues: TValues;
|
theValues: TValues;
|
||||||
@ -145,15 +143,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TForm1.SGridSetEditText(Sender: TObject; ACol, ARow: Integer;
|
|
||||||
const Value: string);
|
|
||||||
begin
|
|
||||||
if (Length(Value) >= 1) and (Value[1] in ['1'..'9']) then begin
|
|
||||||
theValues[ACol + 1, ARow + 1] := StrToInt(Value[1]);
|
|
||||||
end else begin
|
|
||||||
theValues[ACol + 1, ARow + 1] := 0;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TForm1.SolveSudoku: Boolean;
|
function TForm1.SolveSudoku: Boolean;
|
||||||
var
|
var
|
||||||
|
Reference in New Issue
Block a user