RxDBGrid - fix column width in columns dialog

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3304 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
alexs75
2014-07-10 07:33:19 +00:00
parent db24ac3a9b
commit de36e9419b
3 changed files with 8 additions and 7 deletions

View File

@ -791,6 +791,9 @@ type
property DataSource; property DataSource;
property DefaultDrawing; property DefaultDrawing;
property DefaultRowHeight; // stored IsDefaultRowHeightStored; property DefaultRowHeight; // stored IsDefaultRowHeightStored;
property DefaultColWidth;
property DragCursor; property DragCursor;
property DragKind; property DragKind;
property DragMode; property DragMode;

View File

@ -126,7 +126,7 @@ object rxDBGridColumsForm: TrxDBGridColumsForm
end end
object btnApply: TBitBtn object btnApply: TBitBtn
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 150 Left = -63
Height = 30 Height = 30
Top = 0 Top = 0
Width = 71 Width = 71
@ -151,19 +151,15 @@ object rxDBGridColumsForm: TrxDBGridColumsForm
Columns = < Columns = <
item item
ButtonStyle = cbsCheckboxColumn ButtonStyle = cbsCheckboxColumn
ReadOnly = False
SizePriority = 0 SizePriority = 0
Title.Alignment = taCenter Title.Alignment = taCenter
Title.Caption = '...' Title.Caption = '...'
Title.MultiLine = False
Width = 30 Width = 30
end end
item item
Alignment = taLeftJustify
ButtonStyle = cbsNone ButtonStyle = cbsNone
ReadOnly = True ReadOnly = True
Title.Caption = 'Caption' Title.Caption = 'Caption'
Title.MultiLine = False
Width = 377 Width = 377
end end
item item
@ -171,7 +167,6 @@ object rxDBGridColumsForm: TrxDBGridColumsForm
SizePriority = 0 SizePriority = 0
Title.Alignment = taCenter Title.Alignment = taCenter
Title.Caption = 'Width' Title.Caption = 'Width'
Title.MultiLine = False
Width = 60 Width = 60
end> end>
FixedCols = 0 FixedCols = 0

View File

@ -179,7 +179,10 @@ begin
begin begin
StringGrid1.Cells[0, i+1]:=BoolToStr(AGrid.Columns[i].Visible, '1', '0'); StringGrid1.Cells[0, i+1]:=BoolToStr(AGrid.Columns[i].Visible, '1', '0');
StringGrid1.Cells[1, i+1]:=AGrid.Columns[i].Title.Caption; StringGrid1.Cells[1, i+1]:=AGrid.Columns[i].Title.Caption;
StringGrid1.Cells[2, i+1]:=IntToStr(AGrid.Columns[i].Width); if AGrid.Columns[i].Width = 0 then
StringGrid1.Cells[2, i+1]:=IntToStr(AGrid.DefaultColWidth)
else
StringGrid1.Cells[2, i+1]:=IntToStr(AGrid.Columns[i].Width);
end; end;
end end
else else