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>
|
||||
<Filename Value="sudokutype.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="SudokuType"/>
|
||||
</Unit2>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
|
@ -9,6 +9,7 @@ object Form1: TForm1
|
||||
Caption = 'Form1'
|
||||
ClientHeight = 359
|
||||
ClientWidth = 333
|
||||
OnActivate = FormActivate
|
||||
LCLVersion = '2.1.0.0'
|
||||
object StringGrid1: TStringGrid
|
||||
Left = 16
|
||||
@ -22,6 +23,7 @@ object Form1: TForm1
|
||||
FixedRows = 0
|
||||
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goEditing, goSmoothScroll]
|
||||
RowCount = 9
|
||||
ScrollBars = ssNone
|
||||
TabOrder = 2
|
||||
OnPrepareCanvas = StringGrid1PrepareCanvas
|
||||
OnSetEditText = StringGrid1SetEditText
|
||||
|
@ -43,6 +43,7 @@ type
|
||||
StringGrid1: TStringGrid;
|
||||
procedure ButtonFillClick(Sender: TObject);
|
||||
procedure ButtonSolveClick(Sender: TObject);
|
||||
procedure FormActivate(Sender: TObject);
|
||||
procedure StringGrid1PrepareCanvas(sender: TObject; aCol, aRow: Integer;
|
||||
{%H-}aState: TGridDrawState);
|
||||
procedure StringGrid1SetEditText(Sender: TObject; ACol, ARow: Integer;
|
||||
@ -83,6 +84,13 @@ begin
|
||||
ShowSolution;
|
||||
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;
|
||||
aState: TGridDrawState);
|
||||
|
Reference in New Issue
Block a user