You've already forked lazarus-ccr
Sudoku: adjust width/height of grid, and width of mainform @runtime.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7226 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -49,6 +49,7 @@
|
|||||||
<Unit2>
|
<Unit2>
|
||||||
<Filename Value="sudokutype.pas"/>
|
<Filename Value="sudokutype.pas"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
|
<UnitName Value="SudokuType"/>
|
||||||
</Unit2>
|
</Unit2>
|
||||||
</Units>
|
</Units>
|
||||||
</ProjectOptions>
|
</ProjectOptions>
|
||||||
|
@ -9,6 +9,7 @@ object Form1: TForm1
|
|||||||
Caption = 'Form1'
|
Caption = 'Form1'
|
||||||
ClientHeight = 359
|
ClientHeight = 359
|
||||||
ClientWidth = 333
|
ClientWidth = 333
|
||||||
|
OnActivate = FormActivate
|
||||||
LCLVersion = '2.1.0.0'
|
LCLVersion = '2.1.0.0'
|
||||||
object StringGrid1: TStringGrid
|
object StringGrid1: TStringGrid
|
||||||
Left = 16
|
Left = 16
|
||||||
@ -22,6 +23,7 @@ object Form1: TForm1
|
|||||||
FixedRows = 0
|
FixedRows = 0
|
||||||
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goEditing, goSmoothScroll]
|
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goEditing, goSmoothScroll]
|
||||||
RowCount = 9
|
RowCount = 9
|
||||||
|
ScrollBars = ssNone
|
||||||
TabOrder = 2
|
TabOrder = 2
|
||||||
OnPrepareCanvas = StringGrid1PrepareCanvas
|
OnPrepareCanvas = StringGrid1PrepareCanvas
|
||||||
OnSetEditText = StringGrid1SetEditText
|
OnSetEditText = StringGrid1SetEditText
|
||||||
|
@ -43,6 +43,7 @@ type
|
|||||||
StringGrid1: TStringGrid;
|
StringGrid1: TStringGrid;
|
||||||
procedure ButtonFillClick(Sender: TObject);
|
procedure ButtonFillClick(Sender: TObject);
|
||||||
procedure ButtonSolveClick(Sender: TObject);
|
procedure ButtonSolveClick(Sender: TObject);
|
||||||
|
procedure FormActivate(Sender: TObject);
|
||||||
procedure StringGrid1PrepareCanvas(sender: TObject; aCol, aRow: Integer;
|
procedure StringGrid1PrepareCanvas(sender: TObject; aCol, aRow: Integer;
|
||||||
{%H-}aState: TGridDrawState);
|
{%H-}aState: TGridDrawState);
|
||||||
procedure StringGrid1SetEditText(Sender: TObject; ACol, ARow: Integer;
|
procedure StringGrid1SetEditText(Sender: TObject; ACol, ARow: Integer;
|
||||||
@ -83,6 +84,13 @@ begin
|
|||||||
ShowSolution;
|
ShowSolution;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.FormActivate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Self.OnActivate := nil;
|
||||||
|
StringGrid1.ClientWidth := 9 * StringGrid1.DefaultColWidth;
|
||||||
|
StringGrid1.ClientHeight := 9 * StringGrid1.DefaultRowHeight;
|
||||||
|
ClientWidth := 2 * StringGrid1.Left + StringGrid1.Width;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TForm1.StringGrid1PrepareCanvas(sender: TObject; aCol, aRow: Integer;
|
procedure TForm1.StringGrid1PrepareCanvas(sender: TObject; aCol, aRow: Integer;
|
||||||
aState: TGridDrawState);
|
aState: TGridDrawState);
|
||||||
|
Reference in New Issue
Block a user