diff --git a/components/rx/trunk/demos/RxDBVerticalGrid/project1.lps b/components/rx/trunk/demos/RxDBVerticalGrid/project1.lps index 72faff93d..33308997c 100644 --- a/components/rx/trunk/demos/RxDBVerticalGrid/project1.lps +++ b/components/rx/trunk/demos/RxDBVerticalGrid/project1.lps @@ -9,7 +9,7 @@ - + @@ -18,10 +18,9 @@ - - - - + + + @@ -34,7 +33,7 @@ - + @@ -43,7 +42,7 @@ - + @@ -176,12 +175,12 @@ - - - + + + - + @@ -306,7 +305,8 @@ - + + @@ -492,11 +492,10 @@ - + - @@ -508,7 +507,7 @@ - + @@ -538,133 +537,132 @@ - + - - - + + - - + + - - + + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - - + + - - + + - - + + - - + + - + - + - + - + - - + + - - + + diff --git a/components/rx/trunk/demos/RxDBVerticalGrid/unit1.lfm b/components/rx/trunk/demos/RxDBVerticalGrid/unit1.lfm index f30f3ca70..545bfc79e 100644 --- a/components/rx/trunk/demos/RxDBVerticalGrid/unit1.lfm +++ b/components/rx/trunk/demos/RxDBVerticalGrid/unit1.lfm @@ -7,12 +7,14 @@ object Form1: TForm1 ClientHeight = 749 ClientWidth = 1206 OnCreate = FormCreate + Position = poScreenCenter LCLVersion = '1.9.0.0' object RxDBVerticalGrid1: TRxDBVerticalGrid - Left = 440 - Height = 416 - Top = 328 - Width = 728 + Left = 899 + Height = 642 + Top = 107 + Width = 307 + Align = alClient Color = clWindow GridDefValues.BlobText = '(данные)' DataCoumn.Title.Alignment = taCenter @@ -168,10 +170,10 @@ object Form1: TForm1 ) end object RxDBGrid1: TRxDBGrid - Left = 40 - Height = 312 - Top = 8 - Width = 1080 + Left = 0 + Height = 642 + Top = 107 + Width = 894 ColumnDefValues.BlobText = '(данные)' TitleButtons = False AutoSort = True @@ -353,6 +355,7 @@ object Form1: TForm1 SearchOptions.QuickSearchOptions = [loCaseInsensitive, loPartialKey] SearchOptions.FromStart = False OptionsRx = [rdgAllowColumnsForm, rdgAllowDialogFind, rdgAllowQuickFilter] + Align = alLeft Color = clWindow DrawFullLine = False FocusColor = clRed @@ -363,69 +366,106 @@ object Form1: TForm1 TabOrder = 1 TitleStyle = tsNative end - object Button1: TButton - Left = 208 - Height = 36 - Top = 430 - Width = 80 + object Panel1: TPanel + Left = 0 + Height = 107 + Top = 0 + Width = 1206 + Align = alTop AutoSize = True - Caption = 'Diconnect' - OnClick = Button1Click + ClientHeight = 107 + ClientWidth = 1206 TabOrder = 2 + object Button1: TButton + AnchorSideLeft.Control = Panel1 + AnchorSideTop.Control = Panel1 + Left = 7 + Height = 36 + Top = 7 + Width = 80 + AutoSize = True + BorderSpacing.Around = 6 + Caption = 'Diconnect' + OnClick = Button1Click + TabOrder = 0 + end + object Button2: TButton + AnchorSideLeft.Control = Button1 + AnchorSideLeft.Side = asrBottom + AnchorSideTop.Control = Panel1 + Left = 93 + Height = 36 + Top = 7 + Width = 69 + AutoSize = True + BorderSpacing.Around = 6 + Caption = 'Connect' + OnClick = Button2Click + TabOrder = 1 + end + object RadioGroup1: TRadioGroup + AnchorSideLeft.Control = Button2 + AnchorSideLeft.Side = asrBottom + AnchorSideTop.Control = Panel1 + Left = 168 + Height = 93 + Top = 7 + Width = 83 + AutoFill = True + AutoSize = True + BorderSpacing.Around = 6 + Caption = 'Image align' + ChildSizing.LeftRightSpacing = 6 + ChildSizing.EnlargeHorizontal = crsHomogenousChildResize + ChildSizing.EnlargeVertical = crsHomogenousChildResize + ChildSizing.ShrinkHorizontal = crsScaleChilds + ChildSizing.ShrinkVertical = crsScaleChilds + ChildSizing.Layout = cclLeftToRightThenTopToBottom + ChildSizing.ControlsPerLine = 1 + ClientHeight = 72 + ClientWidth = 81 + ItemIndex = 0 + Items.Strings = ( + 'Left' + 'Rigth' + 'Center' + ) + OnClick = CheckBox1Change + TabOrder = 2 + end + object CheckBox2: TCheckBox + AnchorSideLeft.Control = RadioGroup1 + AnchorSideLeft.Side = asrBottom + AnchorSideTop.Control = CheckBox1 + AnchorSideTop.Side = asrBottom + Left = 257 + Height = 24 + Top = 37 + Width = 111 + BorderSpacing.Around = 6 + Caption = 'Show images' + OnChange = CheckBox1Change + TabOrder = 3 + end + object CheckBox1: TCheckBox + AnchorSideLeft.Control = RadioGroup1 + AnchorSideLeft.Side = asrBottom + AnchorSideTop.Control = Panel1 + Left = 257 + Height = 24 + Top = 7 + Width = 110 + BorderSpacing.Around = 6 + Caption = 'Show header' + OnChange = CheckBox1Change + TabOrder = 4 + end end - object Button2: TButton - Left = 208 - Height = 36 - Top = 472 - Width = 69 - AutoSize = True - Caption = 'Connect' - OnClick = Button2Click - TabOrder = 3 - end - object CheckBox1: TCheckBox - Left = 28 - Height = 24 - Top = 341 - Width = 110 - Caption = 'Show header' - OnChange = CheckBox1Change - TabOrder = 4 - end - object RadioGroup1: TRadioGroup - Left = 24 - Height = 93 - Top = 400 - Width = 83 - AutoFill = True - AutoSize = True - Caption = 'Image align' - ChildSizing.LeftRightSpacing = 6 - ChildSizing.EnlargeHorizontal = crsHomogenousChildResize - ChildSizing.EnlargeVertical = crsHomogenousChildResize - ChildSizing.ShrinkHorizontal = crsScaleChilds - ChildSizing.ShrinkVertical = crsScaleChilds - ChildSizing.Layout = cclLeftToRightThenTopToBottom - ChildSizing.ControlsPerLine = 1 - ClientHeight = 72 - ClientWidth = 81 - ItemIndex = 0 - Items.Strings = ( - 'Left' - 'Rigth' - 'Center' - ) - OnClick = CheckBox1Change - TabOrder = 5 - end - object CheckBox2: TCheckBox - Left = 28 - Height = 24 - Top = 368 - Width = 111 - Caption = 'Show images' - OnChange = CheckBox1Change - TabOrder = 6 + object Splitter1: TSplitter + Left = 894 + Height = 642 + Top = 107 + Width = 5 end object dsData: TDataSource DataSet = rxData diff --git a/components/rx/trunk/demos/RxDBVerticalGrid/unit1.pas b/components/rx/trunk/demos/RxDBVerticalGrid/unit1.pas index 4d3f07859..f7035666f 100644 --- a/components/rx/trunk/demos/RxDBVerticalGrid/unit1.pas +++ b/components/rx/trunk/demos/RxDBVerticalGrid/unit1.pas @@ -32,6 +32,7 @@ type MenuItem7: TMenuItem; MenuItem8: TMenuItem; MenuItem9: TMenuItem; + Panel1: TPanel; PopupMenu1: TPopupMenu; PopupMenu2: TPopupMenu; PopupMenu3: TPopupMenu; @@ -51,6 +52,7 @@ type RxDBGrid1: TRxDBGrid; RxDBVerticalGrid1: TRxDBVerticalGrid; rxData: TRxMemoryData; + Splitter1: TSplitter; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); procedure CheckBox1Change(Sender: TObject); diff --git a/components/rx/trunk/rxdb/rxdbverticalgrid.pas b/components/rx/trunk/rxdb/rxdbverticalgrid.pas index fba422a42..35a4e66cf 100644 --- a/components/rx/trunk/rxdb/rxdbverticalgrid.pas +++ b/components/rx/trunk/rxdb/rxdbverticalgrid.pas @@ -292,6 +292,7 @@ type procedure SetRows(AValue: TRxDBVerticalGridRows); procedure RecordChanged; procedure RowsChanged(aRow: TRxDBVerticalGridRow); + procedure UpdateRowsHight; protected procedure OutCaptionCellText(aCol, aRow: integer; const aRect: TRect; aState: TGridDrawState; const ACaption: string); @@ -1181,6 +1182,19 @@ begin end; end; +procedure TRxCustomDBVerticalGrid.UpdateRowsHight; +var + R: TRxDBVerticalGridRow; + i: Integer; +begin + for R in Rows do + RowHeights[R.Index + FixedRows]:=R.RowHeight; + + if FixedRows > 0 then + for i:=0 to FixedRows-1 do + RowHeights[i]:=DefaultRowHeight; +end; + procedure TRxCustomDBVerticalGrid.OutCaptionCellText(aCol, aRow: integer; const aRect: TRect; aState: TGridDrawState; const ACaption: string); begin @@ -1596,6 +1610,8 @@ begin RowCount:=RowCount - 1; FixedRows:=0; end; + + UpdateRowsHight; end; function TRxCustomDBVerticalGrid.GetDataSource: TDataSource;