diff --git a/components/rx/trunk/Demos/RxDBGrid/RxDBGridDemo.lpi b/components/rx/trunk/Demos/RxDBGrid/RxDBGridDemo.lpi index 056d69400..e2f2c45f9 100644 --- a/components/rx/trunk/Demos/RxDBGrid/RxDBGridDemo.lpi +++ b/components/rx/trunk/Demos/RxDBGrid/RxDBGridDemo.lpi @@ -55,13 +55,13 @@ - + - + @@ -70,11 +70,11 @@ - - - + + + + - @@ -96,15 +96,15 @@ - - - - - - - + + + + + + + + - @@ -248,9 +248,11 @@ - - - + + + + + @@ -432,23 +434,18 @@ - - - - - - + + + + - - - - - - + + + @@ -458,9 +455,11 @@ - - - + + + + + @@ -470,8 +469,10 @@ - - + + + + @@ -481,9 +482,11 @@ - - - + + + + + @@ -535,8 +538,9 @@ - - + + + @@ -811,49 +815,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/components/rx/trunk/Demos/RxDBGrid/rxdbgridmainunit.lfm b/components/rx/trunk/Demos/RxDBGrid/rxdbgridmainunit.lfm index b22e7ccec..87d864b52 100644 --- a/components/rx/trunk/Demos/RxDBGrid/rxdbgridmainunit.lfm +++ b/components/rx/trunk/Demos/RxDBGrid/rxdbgridmainunit.lfm @@ -240,24 +240,93 @@ object RxDBGridMainForm: TRxDBGridMainForm end item Glyph.Data = { - C6010000424DC60100000000000036000000280000000A0000000A0000000100 - 2000000000009001000064000000640000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000808080FFFFFF - FFFF000000000000000000000000000000000000000000000000000000008080 - 80FF0000000000000000FFFFFFFF000000000000000000000000000000000000 - 000000000000808080FF0000000000000000FFFFFFFF00000000000000000000 - 00000000000000000000808080FF00000000000000000000000000000000FFFF - FFFF00000000000000000000000000000000808080FF00000000000000000000 - 000000000000FFFFFFFF000000000000000000000000808080FF000000000000 - 000000000000000000000000000000000000FFFFFFFF00000000000000008080 - 80FF808080FF808080FF808080FF808080FF808080FF808080FFFFFFFFFF0000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000 + 76010000424D760100000000000036000000280000000A0000000A0000000100 + 18000000000040010000640000006400000000000000000000007F7F7F7F7F7F + 7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F00007F7F7FEEEEEE + EEEEEEEEEEEE414141414141EEEEEEEEEEEEEEEEEEC3C3C300007F7F7FEEEEEE + EEEEEEEEEEEE414141414141EEEEEEEEEEEEEEEEEEC3C3C300007F7F7FEEEEEE + EEEEEEEEEEEE414141414141EEEEEEEEEEEEEEEEEEC3C3C300007F7F7F414141 + 414141414141414141414141414141414141414141C3C3C300007F7F7F414141 + 414141414141414141414141414141414141414141C3C3C300007F7F7FEEEEEE + EEEEEEEEEEEE414141414141EEEEEEEEEEEEEEEEEEC3C3C300007F7F7FEEEEEE + EEEEEEEEEEEE414141414141EEEEEEEEEEEEEEEEEEC3C3C300007F7F7FEEEEEE + EEEEEEEEEEEE414141414141EEEEEEEEEEEEEEEEEEC3C3C300007F7F7FC3C3C3 + C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C30000 } Hint = 'Style "PlusRx"' Style = ebsPlusRx + end + item + Glyph.Data = { + 76010000424D760100000000000036000000280000000A0000000A0000000100 + 18000000000040010000640000006400000000000000000000007F7F7F7F7F7F + 7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F00007F7F7FEEEEEE + EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEC3C3C300007F7F7FEEEEEE + EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEC3C3C300007F7F7FEEEEEE + EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEC3C3C300007F7F7F414141 + 414141EEEEEE414141414141EEEEEE414141414141C3C3C300007F7F7F414141 + 414141EEEEEE414141414141EEEEEE414141414141C3C3C300007F7F7FEEEEEE + EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEC3C3C300007F7F7FEEEEEE + EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEC3C3C300007F7F7FEEEEEE + EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEC3C3C300007F7F7FC3C3C3 + C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C30000 + } + Hint = 'Style "EllipsisRx"' + Style = ebsEllipsisRx + end + item + Glyph.Data = { + 76010000424D760100000000000036000000280000000A0000000A0000000100 + 18000000000040010000640000006400000000000000000000007F7F7F7F7F7F + 7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F00007F7F7FEEEEEE + EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEC3C3C300007F7F7FEEEEEE + EEEEEE414141EEEEEE414141EEEEEE414141414141C3C3C300007F7F7FEEEEEE + EEEEEE414141EEEEEE414141EEEEEE414141EEEEEEC3C3C300007F7F7FEEEEEE + EEEEEEEEEEEE414141EEEEEEEEEEEEEEEEEEEEEEEEC3C3C300007F7F7FEEEEEE + EEEEEEEEEEEE414141EEEEEEEEEEEEEEEEEEEEEEEEC3C3C300007F7F7FEEEEEE + 414141414141414141414141414141EEEEEEEEEEEEC3C3C300007F7F7FEEEEEE + EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEC3C3C300007F7F7FEEEEEE + EEEEEEEEEEEE414141EEEEEEEEEEEEEEEEEEEEEEEEC3C3C300007F7F7FC3C3C3 + C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C30000 + } + Hint = 'Style "GlyphRx"' + Style = ebsGlyphRx + end + item + Glyph.Data = { + 76010000424D760100000000000036000000280000000A0000000A0000000100 + 18000000000040010000640000006400000000000000000000007F7F7F7F7F7F + 7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F00007F7F7FEEEEEE + EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEC3C3C300007F7F7FEEEEEE + EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEC3C3C300007F7F7FEEEEEE + EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEC3C3C300007F7F7F414141 + 414141414141414141414141414141414141414141C3C3C300007F7F7F414141 + 414141414141414141414141414141414141414141C3C3C300007F7F7FEEEEEE + EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEC3C3C300007F7F7FEEEEEE + EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEC3C3C300007F7F7FEEEEEE + EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEC3C3C300007F7F7FC3C3C3 + C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C30000 + } + Hint = 'Style "MinusRx"' + Style = ebsMinusRx + end + item + Glyph.Data = { + 76010000424D760100000000000036000000280000000A0000000A0000000100 + 18000000000040010000640000006400000000000000000000007F7F7F7F7F7F + 7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F00007F7F7FEEEEEE + EEEEEEEEEEEE414141414141EEEEEEEEEEEEEEEEEEC3C3C300007F7F7FEEEEEE + EEEEEE414141414141414141414141EEEEEEEEEEEEC3C3C300007F7F7FEEEEEE + 414141414141414141414141414141414141EEEEEEC3C3C300007F7F7F414141 + 414141414141414141414141414141414141414141C3C3C300007F7F7F414141 + EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE414141C3C3C300007F7F7FEEEEEE + 414141EEEEEEEEEEEEEEEEEEEEEEEE414141EEEEEEC3C3C300007F7F7FEEEEEE + EEEEEE414141EEEEEEEEEEEE414141EEEEEEEEEEEEC3C3C300007F7F7FEEEEEE + EEEEEEEEEEEE414141414141EEEEEEEEEEEEEEEEEEC3C3C300007F7F7FC3C3C3 + C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C30000 + } + Hint = 'Style "UpDownRx"' + Style = ebsUpDownRx end> Filter.Font.Style = [fsItalic] Filter.DropDownRows = 0 @@ -325,6 +394,7 @@ object RxDBGridMainForm: TRxDBGridMainForm FooterOptions.Active = True FooterOptions.Color = clYellow FooterOptions.RowCount = 2 + FooterOptions.DrawFullLine = True Version = 1 OptionsRx = [rdgAllowColumnsForm, rdgAllowDialogFind, rdgHighlightFocusCol, rdgHighlightFocusRow, rdgDblClickOptimizeColWidth, rdgFooterRows, rdgXORColSizing, rdgMultiTitleLines, rdgAllowQuickSearch, rdgAllowQuickFilter, rdgAllowFilterForm, rdgAllowSortForm, rdgAllowToolMenu] FooterColor = clYellow diff --git a/components/rx/trunk/images/componet_img/all_component_res.bat b/components/rx/trunk/images/componet_img/all_component_res.bat index 310bc11c5..3827a6e9c 100644 --- a/components/rx/trunk/images/componet_img/all_component_res.bat +++ b/components/rx/trunk/images/componet_img/all_component_res.bat @@ -1,8 +1,8 @@ del tooledit.lrs del rxdbgrid.lrs - -..\..\..\..\tools\lazres.exe tooledit.lrs picDateEdit.png -..\..\..\..\tools\lazres.exe rxdbgrid.lrs rx_markerdown.png rx_markerup.png +del tooledit.res +del rxdbgrid.res ..\..\..\..\tools\lazres.exe tooledit.res picDateEdit.png -..\..\..\..\tools\lazres.exe rxdbgrid.res rx_markerdown.png rx_markerup.png +..\..\..\..\tools\lazres.exe rxdbgrid.res rx_markerdown.png rx_markerup.png rx_DropDown.png rx_Ellipsis.png rx_Glyph.png rx_minus.png rx_plus.png rx_UpDown.png rx_menu_grid.png + diff --git a/components/rx/trunk/images/componet_img/all_component_res.sh b/components/rx/trunk/images/componet_img/all_component_res.sh index 51b0f5a3c..aefdab72d 100644 --- a/components/rx/trunk/images/componet_img/all_component_res.sh +++ b/components/rx/trunk/images/componet_img/all_component_res.sh @@ -3,7 +3,7 @@ rm rxdbgrid.lrs rm tooledit.res rm rxdbgrid.res -/usr/local/share/lazarus/tools/lazres rxdbgrid.res rx_markerdown.png rx_markerup.png +/usr/local/share/lazarus/tools/lazres rxdbgrid.res rx_markerdown.png rx_markerup.png rx_DropDown.png rx_Ellipsis.png rx_Glyph.png rx_minus.png rx_plus.png rx_UpDown.png rx_menu_grid.png /usr/local/share/lazarus/tools/lazres rx_lcl.res picDateEdit.png rxbtn_downarrow.png #../../../../tools\lazres.exe tooledit.lrs picDateEdit.bmp diff --git a/components/rx/trunk/images/componet_img/rx_DropDown.png b/components/rx/trunk/images/componet_img/rx_DropDown.png new file mode 100644 index 000000000..d985816ac Binary files /dev/null and b/components/rx/trunk/images/componet_img/rx_DropDown.png differ diff --git a/components/rx/trunk/images/componet_img/rx_Ellipsis.png b/components/rx/trunk/images/componet_img/rx_Ellipsis.png new file mode 100644 index 000000000..d3385669b Binary files /dev/null and b/components/rx/trunk/images/componet_img/rx_Ellipsis.png differ diff --git a/components/rx/trunk/images/componet_img/rx_Glyph.png b/components/rx/trunk/images/componet_img/rx_Glyph.png new file mode 100644 index 000000000..5a76f9f13 Binary files /dev/null and b/components/rx/trunk/images/componet_img/rx_Glyph.png differ diff --git a/components/rx/trunk/images/componet_img/rx_UpDown.png b/components/rx/trunk/images/componet_img/rx_UpDown.png new file mode 100644 index 000000000..654560bc0 Binary files /dev/null and b/components/rx/trunk/images/componet_img/rx_UpDown.png differ diff --git a/components/rx/trunk/images/componet_img/rx_menu_grid.png b/components/rx/trunk/images/componet_img/rx_menu_grid.png new file mode 100644 index 000000000..6d1098433 Binary files /dev/null and b/components/rx/trunk/images/componet_img/rx_menu_grid.png differ diff --git a/components/rx/trunk/images/componet_img/rx_minus.png b/components/rx/trunk/images/componet_img/rx_minus.png new file mode 100644 index 000000000..401752b17 Binary files /dev/null and b/components/rx/trunk/images/componet_img/rx_minus.png differ diff --git a/components/rx/trunk/images/componet_img/rx_plus.png b/components/rx/trunk/images/componet_img/rx_plus.png new file mode 100644 index 000000000..b8d30ebe3 Binary files /dev/null and b/components/rx/trunk/images/componet_img/rx_plus.png differ diff --git a/components/rx/trunk/images/componet_img/rxdbgrid.res b/components/rx/trunk/images/componet_img/rxdbgrid.res new file mode 100644 index 000000000..818b8b31d Binary files /dev/null and b/components/rx/trunk/images/componet_img/rxdbgrid.res differ diff --git a/components/rx/trunk/rx_lcl.res b/components/rx/trunk/rx_lcl.res index ef157ef48..7034a20a6 100644 Binary files a/components/rx/trunk/rx_lcl.res and b/components/rx/trunk/rx_lcl.res differ diff --git a/components/rx/trunk/rxdbgrid.lrs b/components/rx/trunk/rxdbgrid.lrs deleted file mode 100644 index bcb0762b4..000000000 --- a/components/rx/trunk/rxdbgrid.lrs +++ /dev/null @@ -1,25 +0,0 @@ -LazarusResources.Add('rx_markerdown','XPM',[ - '/* XPM */'#10'static char *rx_mark_down[]={'#10'"10 10 3 1",'#10'". c None",' - +#10'"# c #808080",'#10'"a c #ffffff",'#10'"..........",'#10'".#######a.",'#10 - +'".#......a.",'#10'"..#....a..",'#10'"..#....a..",'#10'"...#..a...",'#10'"..' - +'.#..a...",'#10'"....#a....",'#10'"..........",'#10'".........."};'#10 -]); -LazarusResources.Add('rx_markerup','XPM',[ - '/* XPM */'#10'static char *rx_mark_up[]={'#10'"10 10 4 1",'#10'"b c None",' - +#10'". c None",'#10'"# c #808080",'#10'"a c #ffffff",'#10'"..........",'#10 - +'"....#a....",'#10'"...#..a...",'#10'"...#..a...",'#10'"..#....a..",'#10'"..' - +'#....a..",'#10'".#......a.",'#10'".aaaaaaaa.",'#10'".bbbbbbbb.",'#10'".....' - +'....."};'#10 -]); - -LazarusResources.Add('menu_grid','XPM',[ - '/* XPM */'#10'static const unsigned char * menu_grid_xpm[] = {'#10'"16 16 4 1",' - +#10'" c None",'#10'"! c black",'#10'"# c #800000",'#10'"$ c #FFFF00",' - +#10'" ",'#10'" ! ",'#10'" !#! ",' - +#10'" !###! ",'#10'" !##$##! ",'#10'" !!!#$#!!! ",' - +#10'" !#$#! ",'#10'" !#$#! ",'#10'" !#$#! ",' - +#10'" !#$#! ",'#10'" !#$#! ",'#10'" !!!#$#!!! ",' - +#10'" !##$##! ",'#10'" !###! ",'#10'" !#! ",' - +#10'" ! "};'#10 -]); - diff --git a/components/rx/trunk/rxdbgrid.pas b/components/rx/trunk/rxdbgrid.pas index 18e63e8e9..584520dfb 100644 --- a/components/rx/trunk/rxdbgrid.pas +++ b/components/rx/trunk/rxdbgrid.pas @@ -565,8 +565,6 @@ type FOnRxColumnFooterDraw :TOnRxColumnFooterDraw; //auto sort support - FMarkerUp : TBitmap; - FMarkerDown : TBitmap; FAutoSort : boolean; FSortEngine : TRxDBGridSortEngine; FPressedCol : TRxColumn; @@ -578,6 +576,16 @@ type F_Clicked: boolean; F_PopupMenu: TPopupMenu; F_MenuBMP: TBitmap; + //glyph for collumns buttons +{ + FMarkerUp : TBitmap; + FMarkerDown : TBitmap; + FEllipsisRxBMP: TBitmap; + FGlyphRxBMP: TBitmap; + FUpDownRxBMP: TBitmap; + FPlusRxBMP: TBitmap; + FMinusRxBMP: TBitmap; +} F_EventOnFilterRec: TFilterRecordEvent; F_EventOnBeforeDelete: TDataSetNotifyEvent; @@ -611,8 +619,8 @@ type function GetColumns: TRxDbGridColumns; function GetFooterColor: TColor; function GetFooterRowCount: integer; - function GetMarkerDown: TBitmap; - function GetMarkerUp: TBitmap; + //function GetMarkerDown: TBitmap; + //function GetMarkerUp: TBitmap; function GetPropertyStorage: TCustomPropertyStorage; function GetSortField: string; function GetSortOrder: TSortMarker; @@ -626,8 +634,8 @@ type procedure SetFooterOptions(AValue: TRxDBGridFooterOptions); procedure SetFooterRowCount(const AValue: integer); procedure SetKeyStrokes(const AValue: TRxDBGridKeyStrokes); - procedure SetMarkerDown(AValue: TBitmap); - procedure SetMarkerUp(AValue: TBitmap); + //procedure SetMarkerDown(AValue: TBitmap); + //procedure SetMarkerUp(AValue: TBitmap); procedure SetOptionsRx(const AValue: TOptionsRx); procedure SetPropertyStorage(const AValue: TCustomPropertyStorage); procedure SetTitleButtons(const AValue: boolean); @@ -784,8 +792,8 @@ type property SortOrder:TSortMarker read GetSortOrder; property SortColumns:TRxDbGridColumnsSortList read FSortColumns; - property MarkerUp : TBitmap read GetMarkerUp write SetMarkerUp; - property MarkerDown : TBitmap read GetMarkerDown write SetMarkerDown; + //property MarkerUp : TBitmap read GetMarkerUp write SetMarkerUp; + //property MarkerDown : TBitmap read GetMarkerDown write SetMarkerDown; published property AfterQuickSearch: TRxQuickSearchNotifyEvent read FAfterQuickSearch write FAfterQuickSearch; property ColumnDefValues:TRxDBGridColumnDefValues read FColumnDefValues write SetColumnDefValues; @@ -947,6 +955,8 @@ implementation uses Math, rxdconst, rxstrutils, strutils, rxdbgrid_findunit, rxdbgrid_columsunit, rxlookup, tooledit, LCLProc, Clipbrd, rxfilterby, rxsortby, variants; +{$R rxdbgrid.res} + const EditorCommandStrs: array[rxgcNone .. High(TRxDBGridCommand)] of TIdentMapEntry = ( @@ -967,6 +977,15 @@ const var RxDBGridSortEngineList: TStringList; + FMarkerUp : TBitmap = nil; + FMarkerDown : TBitmap = nil; + FEllipsisRxBMP: TBitmap = nil; + FGlyphRxBMP: TBitmap = nil; + FUpDownRxBMP: TBitmap = nil; + FPlusRxBMP: TBitmap = nil; + FMinusRxBMP: TBitmap = nil; + + procedure RegisterRxDBGridSortEngine( RxDBGridSortEngineClass: TRxDBGridSortEngineClass; DataSetClassName: string); var @@ -1693,9 +1712,35 @@ 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; end; procedure TRxColumnEditButton.SetVisible(AValue: Boolean); @@ -1792,10 +1837,16 @@ begin end; constructor TRxColumnEditButton.Create(ACollection: TCollection); +var + P: TBitmap; begin inherited Create(ACollection); FButton:=TSpeedButton.Create(nil); - FButton.Glyph:=LoadLazResBitmapImage('rx_markerdown'); + //FButton.Glyph:=LoadLazResBitmapImage('rx_markerdown'); +{ P:=CreateResBitmap('rx_markerdown'); + FButton.Glyph:=P; + P.Free;} + FSpinBtn:=TRxSpinButton.Create(nil); FSpinBtn.OnBottomClick:=@DoBottomClick; FSpinBtn.OnTopClick:=@DoTopClick; @@ -2436,7 +2487,7 @@ function TRxDBGrid.GetFooterRowCount: integer; begin Result:=FFooterOptions.RowCount; end; - +{ function TRxDBGrid.GetMarkerDown: TBitmap; begin Result:=FMarkerDown; @@ -2446,7 +2497,7 @@ function TRxDBGrid.GetMarkerUp: TBitmap; begin Result:=FMarkerUp; end; - +} function TRxDBGrid.GetDrawFullLine: boolean; begin Result := FFooterOptions.FDrawFullLine; @@ -2546,7 +2597,7 @@ begin UpdateJMenuKeys; end; - +{ procedure TRxDBGrid.SetMarkerDown(AValue: TBitmap); begin FMarkerDown.Assign(AValue); @@ -2556,7 +2607,7 @@ procedure TRxDBGrid.SetMarkerUp(AValue: TBitmap); begin FMarkerUp.Assign(AValue); end; - +} procedure TRxDBGrid.SetOptionsRx(const AValue: TOptionsRx); var OldOpt: TOptionsRx; @@ -5591,8 +5642,20 @@ begin FSortColumns:=TRxDbGridColumnsSortList.Create; - FMarkerUp := LoadLazResBitmapImage('rx_markerup'); - FMarkerDown := LoadLazResBitmapImage('rx_markerdown'); +// FMarkerUp := LoadBitmapFromLazarusResource('rx_markerup'); +// FMarkerDown := LoadBitmapFromLazarusResource('rx_markerdown'); +// F_MenuBMP := LoadBitmapFromLazarusResource('menu_grid'); + + F_MenuBMP := CreateResBitmap('rx_menu_grid'); +(* + FMarkerUp := CreateResBitmap('rx_markerup'); + FMarkerDown := CreateResBitmap('rx_markerdown'); + FEllipsisRxBMP:=CreateResBitmap('rx_Ellipsis'); + FGlyphRxBMP:=CreateResBitmap('rx_Glyph'); + FUpDownRxBMP:=CreateResBitmap('rx_UpDown'); + FPlusRxBMP:=CreateResBitmap('rx_plus'); + FMinusRxBMP:=CreateResBitmap('rx_minus'); +*) Options := Options - [dgTabs]; OptionsRx := OptionsRx + [rdgAllowColumnsForm, rdgAllowDialogFind, rdgAllowQuickFilter]; @@ -5600,7 +5663,6 @@ begin FAutoSort := True; F_Clicked := False; - F_MenuBMP := LoadLazResBitmapImage('menu_grid'); DoCreateJMenu; @@ -5647,13 +5709,19 @@ begin FreeAndNil(FRxDbGridLookupComboEditor); FreeAndNil(FRxDbGridDateEditor); - FreeAndNil(FMarkerDown); - FreeAndNil(FMarkerUp); + //FreeAndNil(FMarkerDown); + //FreeAndNil(FMarkerUp); FreeAndNil(FPropertyStorageLink); FreeAndNil(FFilterListEditor); FreeAndNil(F_PopupMenu); FreeAndNil(F_MenuBMP); +{ FreeAndNil(FEllipsisRxBMP); + FreeAndNil(FGlyphRxBMP); + FreeAndNil(FUpDownRxBMP); + FreeAndNil(FPlusRxBMP); + FreeAndNil(FMinusRxBMP);} + FreeAndNil(F_LastFilter); FreeAndNil(FKeyStrokes); @@ -6678,12 +6746,20 @@ end; initialization RegisterPropertyToSkip( TRxDBGrid, 'AllowedOperations', 'This property duplicated standart DBGrid.Options', ''); - {$I rxdbgrid.lrs} + //{$I rxdbgrid.lrs} // {$I rx_markerdown.lrs} RxDBGridSortEngineList := TStringList.Create; RxDBGridSortEngineList.Sorted := True; + FMarkerUp := CreateResBitmap('rx_markerup'); + FMarkerDown := CreateResBitmap('rx_markerdown'); + FEllipsisRxBMP:=CreateResBitmap('rx_Ellipsis'); + FGlyphRxBMP:=CreateResBitmap('rx_Glyph'); + FUpDownRxBMP:=CreateResBitmap('rx_UpDown'); + FPlusRxBMP:=CreateResBitmap('rx_plus'); + FMinusRxBMP:=CreateResBitmap('rx_minus'); + finalization while (RxDBGridSortEngineList.Count > 0) do @@ -6693,5 +6769,13 @@ finalization end; RxDBGridSortEngineList.Free; + FreeAndNil(FMarkerUp); + FreeAndNil(FMarkerDown); + FreeAndNil(FEllipsisRxBMP); + FreeAndNil(FGlyphRxBMP); + FreeAndNil(FUpDownRxBMP); + FreeAndNil(FPlusRxBMP); + FreeAndNil(FMinusRxBMP); + end. diff --git a/components/rx/trunk/rxdbgrid.res b/components/rx/trunk/rxdbgrid.res new file mode 100644 index 000000000..818b8b31d Binary files /dev/null and b/components/rx/trunk/rxdbgrid.res differ diff --git a/components/rx/trunk/rxnew.lpk b/components/rx/trunk/rxnew.lpk index 39ce4e41d..53f710183 100644 --- a/components/rx/trunk/rxnew.lpk +++ b/components/rx/trunk/rxnew.lpk @@ -25,7 +25,7 @@ translate to Lazarus by alexs in 2005 - 2016 "/> - + @@ -142,173 +142,169 @@ translate to Lazarus by alexs in 2005 - 2016 - - - - - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + diff --git a/components/rx/trunk/vclutils.pas b/components/rx/trunk/vclutils.pas index c1cc48cb8..8a8eead72 100644 --- a/components/rx/trunk/vclutils.pas +++ b/components/rx/trunk/vclutils.pas @@ -62,6 +62,7 @@ procedure OutTextXY90(Canvas:TCanvas; X,Y:integer; Text:string; Orientation:TTex function IsForegroundTask: Boolean; function ValidParentForm(Control: TControl): TCustomForm; function CreateArrowBitmap:TBitmap; +function CreateResBitmap(const AResName:string):TBitmap; function LoadLazResBitmapImage(const ResName: string): TBitmap; {functions from DBGrid} @@ -604,11 +605,10 @@ end; {$ENDIF} function CreateArrowBitmap:TBitmap; -var - C : TCustomBitmap; begin {$IFNDEF RX_USE_LAZARUS_RESOURCE} - Result := TBitmap.Create; + Result:=CreateResBitmap('rxbtn_downarrow'); +(* Result := TBitmap.Create; try try C := TPortableNetworkGraphic.Create; @@ -620,12 +620,31 @@ begin except Result.Free; raise; - end; + end; *) {$ELSE} Result:=LoadLazResBitmapImage('rxbtn_downarrow') {$ENDIF} end; +function CreateResBitmap(const AResName: string): TBitmap; +var + C : TCustomBitmap; +begin + Result := TBitmap.Create; + try + try + C := TPortableNetworkGraphic.Create; + C.LoadFromResourceName(hInstance, AResName); + Result.Assign(C); + finally + C.Free; + end; + except + Result.Free; + raise; + end; +end; + //Code from DBGrid function LoadLazResBitmapImage(const ResName: string): TBitmap; var