diff --git a/components/rx/trunk/Demos/RxDBGrid/RxDBGridDemo.lpi b/components/rx/trunk/Demos/RxDBGrid/RxDBGridDemo.lpi index b41429a46..6c4dea6db 100644 --- a/components/rx/trunk/Demos/RxDBGrid/RxDBGridDemo.lpi +++ b/components/rx/trunk/Demos/RxDBGrid/RxDBGridDemo.lpi @@ -55,7 +55,7 @@ - + @@ -75,949 +75,8 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -1041,37 +100,4 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/components/rx/trunk/Demos/RxMemDSFilter/project1.lps b/components/rx/trunk/Demos/RxMemDSFilter/project1.lps index df1c4c007..6237f077c 100644 --- a/components/rx/trunk/Demos/RxMemDSFilter/project1.lps +++ b/components/rx/trunk/Demos/RxMemDSFilter/project1.lps @@ -3,7 +3,7 @@ - + @@ -11,7 +11,7 @@ - + @@ -20,168 +20,196 @@ - - - - + + + + - - - + + + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + - - + + - - + + - + - - + + - - + + - - + + - + - - + + - - + + - - + + - + - - + + - - + + - - + + - - + + - - + + - + + - + + - - + + - - + + - - + + - - + + - + - - - + + - - + - + - - - - - - - - diff --git a/components/rx/trunk/Demos/RxMemDSFilter/unit1.lfm b/components/rx/trunk/Demos/RxMemDSFilter/unit1.lfm index 44433cfc6..6e4b169ed 100644 --- a/components/rx/trunk/Demos/RxMemDSFilter/unit1.lfm +++ b/components/rx/trunk/Demos/RxMemDSFilter/unit1.lfm @@ -98,12 +98,73 @@ object Form1: TForm1 Footers = <> end item + ButtonStyle = cbsPickList Title.Alignment = taCenter Title.Orientation = toHorizontal Title.Caption = 'CODE' - Width = 100 + Width = 200 FieldName = 'CODE' - EditButtons = <> + EditButtons = < + item + Glyph.Data = { + C6010000424DC60100000000000036000000280000000A0000000A0000000100 + 2000000000009001000064000000640000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000004141 + 41FF414141FF00000000414141FF414141FF00000000414141FF414141FF0000 + 000000000000414141FF414141FF00000000414141FF414141FF000000004141 + 41FF414141FF0000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000 + } + Style = ebsEllipsisRx + end + item + Glyph.Data = { + C6010000424DC60100000000000036000000280000000A0000000A0000000100 + 2000000000009001000064000000640000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000414141FF414141FF000000000000 + 0000000000000000000000000000000000000000000000000000414141FF4141 + 41FF000000000000000000000000000000000000000000000000000000000000 + 0000414141FF414141FF00000000000000000000000000000000000000004141 + 41FF414141FF414141FF414141FF414141FF414141FF414141FF414141FF0000 + 000000000000414141FF414141FF414141FF414141FF414141FF414141FF4141 + 41FF414141FF0000000000000000000000000000000000000000414141FF4141 + 41FF000000000000000000000000000000000000000000000000000000000000 + 0000414141FF414141FF00000000000000000000000000000000000000000000 + 00000000000000000000414141FF414141FF0000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000 + } + Style = ebsPlusRx + end + item + Glyph.Data = { + C6010000424DC60100000000000036000000280000000A0000000A0000000100 + 2000000000009001000064000000640000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000004141 + 41FF414141FF414141FF414141FF414141FF414141FF414141FF414141FF0000 + 000000000000414141FF414141FF414141FF414141FF414141FF414141FF4141 + 41FF414141FF0000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000 + } + Style = ebsMinusRx + end> Filter.IsNull = False Filter.IsAll = True Filter.DropDownRows = 0 @@ -178,9 +239,8 @@ object Form1: TForm1 SelectedColor = clHighlight GridLineStyle = psSolid DataSource = DataSource1 - Options = [dgTitles, dgIndicator, dgColumnResize, dgColumnMove, dgColLines, dgRowLines, dgAlwaysShowSelection, dgConfirmDelete, dgCancelOnExit] + Options = [dgEditing, dgTitles, dgIndicator, dgColumnResize, dgColumnMove, dgColLines, dgRowLines, dgAlwaysShowEditor, dgAlwaysShowSelection, dgConfirmDelete, dgCancelOnExit] ParentColor = False - ReadOnly = True TabOrder = 2 end object Memo1: TMemo @@ -195,6 +255,34 @@ object Form1: TForm1 ReadOnly = True TabOrder = 3 end + object Edit2: TEdit + Left = 656 + Height = 37 + Top = 0 + Width = 80 + TabOrder = 4 + Text = '64' + end + object Button1: TButton + Left = 832 + Height = 36 + Top = 1 + Width = 83 + AutoSize = True + Caption = 'Def height' + OnClick = Button1Click + TabOrder = 5 + end + object Button2: TButton + Left = 736 + Height = 36 + Top = 0 + Width = 86 + AutoSize = True + Caption = ' Set height' + OnClick = Button2Click + TabOrder = 6 + end object RxMemoryData1: TRxMemoryData FieldDefs = < item diff --git a/components/rx/trunk/Demos/RxMemDSFilter/unit1.pas b/components/rx/trunk/Demos/RxMemDSFilter/unit1.pas index cdc73fdac..2ca346e1b 100644 --- a/components/rx/trunk/Demos/RxMemDSFilter/unit1.pas +++ b/components/rx/trunk/Demos/RxMemDSFilter/unit1.pas @@ -13,9 +13,12 @@ type { TForm1 } TForm1 = class(TForm) + Button1: TButton; + Button2: TButton; CheckBox1: TCheckBox; DataSource1: TDataSource; Edit1: TEdit; + Edit2: TEdit; Label1: TLabel; Memo1: TMemo; RxDBGrid1: TRxDBGrid; @@ -24,6 +27,8 @@ type RxMemoryData1CODE: TLongintField; RxMemoryData1ID: TLongintField; RxMemoryData1NAME: TStringField; + procedure Button1Click(Sender: TObject); + procedure Button2Click(Sender: TObject); procedure CheckBox1Change(Sender: TObject); procedure FormCreate(Sender: TObject); private @@ -36,6 +41,7 @@ var Form1: TForm1; implementation +uses DBGrids; {$R *.lfm} @@ -45,6 +51,7 @@ procedure TForm1.FormCreate(Sender: TObject); var i: Integer; begin + RxDBGrid1.Options:=RxDBGrid1.Options + [dgAlwaysShowEditor]; RxMemoryData1.Open; for i:=1 to 20 do begin @@ -60,6 +67,7 @@ begin end; RxDBGrid1.CreateToolMenuItem(#0, '-', nil); RxDBGrid1.CreateToolMenuItem(#0, 'Show info box', @RxDBGridInfoBox); +// RxDBGrid1.DefaultRowHeight:=; end; procedure TForm1.RxDBGridInfoBox(Sender: TObject); @@ -81,5 +89,18 @@ begin end; end; +procedure TForm1.Button2Click(Sender: TObject); +begin + RxDBGrid1.DefaultRowHeight:=StrToInt(Edit2.Text); +end; + +type + THackGrid = class(TRxDBGrid); + +procedure TForm1.Button1Click(Sender: TObject); +begin + RxDBGrid1.DefaultRowHeight:=THackGrid(RxDBGrid1).GetDefaultRowHeight; +end; + end. diff --git a/components/rx/trunk/rxdbgrid.pas b/components/rx/trunk/rxdbgrid.pas index 70e6b9a97..631d6ad66 100644 --- a/components/rx/trunk/rxdbgrid.pas +++ b/components/rx/trunk/rxdbgrid.pas @@ -1724,42 +1724,24 @@ begin end; procedure TRxColumnEditButton.SetStyle(AValue: TRxColumnEditButtonStyle); -{var - G: TRxDBGrid; - P: TPersistent;} begin if FStyle=AValue then Exit; FStyle:=AValue; - -{ if Assigned(Collection) and Assigned(Collection.Owner) - and Assigned(TRxColumn(Collection.Owner).Collection) - and Assigned(TRxColumn(Collection.Owner).Collection.Owner) then - begin - P:=Collection; - P:=Collection.Owner; - P:=TRxColumn(Collection.Owner).Collection; - P:=TRxColumn(Collection.Owner).Collection.Owner; - G:=TRxDBGrid(TRxColumn(Collection.Owner).Collection.Owner); -} - case FStyle of - ebsDropDownRx:FButton.Glyph.Assign(FMarkerDown); - ebsEllipsisRx:FButton.Glyph.Assign(FEllipsisRxBMP); - ebsGlyphRx:FButton.Glyph.Assign(FGlyphRxBMP); - ebsUpDownRx:FButton.Glyph.Assign(FUpDownRxBMP); - ebsPlusRx:FButton.Glyph.Assign(FPlusRxBMP); - ebsMinusRx:FButton.Glyph.Assign(FMinusRxBMP); - else - FButton.Glyph.Assign(nil); - end; - -// end; + case FStyle of + ebsDropDownRx:FButton.Glyph.Assign(FMarkerDown); + ebsEllipsisRx:FButton.Glyph.Assign(FEllipsisRxBMP); + ebsGlyphRx:FButton.Glyph.Assign(FGlyphRxBMP); + ebsUpDownRx:FButton.Glyph.Assign(FUpDownRxBMP); + ebsPlusRx:FButton.Glyph.Assign(FPlusRxBMP); + ebsMinusRx:FButton.Glyph.Assign(FMinusRxBMP); + else + FButton.Glyph.Assign(nil); + end; end; procedure TRxColumnEditButton.SetVisible(AValue: Boolean); begin -// if FVisible=AValue then Exit; FVisible:=AValue; - if AValue then begin if Style = ebsUpDownRx then @@ -4652,25 +4634,15 @@ function TRxDBGrid.GetBufferCount: integer; var H:integer; begin -{ Result := ClientHeight div DefaultRowHeight; - if rdgWordWrap in FOptionsRx then + if DefaultRowHeight > 0 then begin - H:=UpdateRowsHeight; -// if H>0 then -// Result := H; - end; - if dgTitles in Options then - begin - Dec(Result, RowHeights[0] div DefaultRowHeight); - end; - if FFooterOptions.Active then - Dec(Result, FFooterOptions.RowCount);} - H:=ClientHeight - GCache.FixedHeight; - if FFooterOptions.Active then - H:=H - DefaultRowHeight * FFooterOptions.RowCount; - - Result := H div DefaultRowHeight; -// result := (ClientHeight - GCache.FixedHeight - DefaultRowHeight) div DefaultRowHeight; + H:=ClientHeight - GCache.FixedHeight; + if FFooterOptions.Active then + H:=H - DefaultRowHeight * FFooterOptions.RowCount; + Result := H div DefaultRowHeight; + end + else + Result := 1; end; {procedure TRxDBGrid.CMHintShow(var Message: TLMessage);