diff --git a/components/rx/trunk/demos/rxdbgrid/RxDBGrid/RxDBGridDemo.lpi b/components/rx/trunk/demos/rxdbgrid/RxDBGrid/RxDBGridDemo.lpi
index 62caa6860..86ac03062 100644
--- a/components/rx/trunk/demos/rxdbgrid/RxDBGrid/RxDBGridDemo.lpi
+++ b/components/rx/trunk/demos/rxdbgrid/RxDBGrid/RxDBGridDemo.lpi
@@ -74,8 +74,7 @@
-
-
+
@@ -477,13 +476,14 @@
+
-
-
+
+
-
-
+
+
@@ -514,7 +514,6 @@
-
@@ -634,8 +633,8 @@
-
-
+
+
@@ -643,123 +642,122 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
diff --git a/components/rx/trunk/demos/rxdbgrid/RxDbGridExportToPDF/project1.lpi b/components/rx/trunk/demos/rxdbgrid/RxDbGridExportToPDF/project1.lpi
index 768991b8e..0e15c2784 100644
--- a/components/rx/trunk/demos/rxdbgrid/RxDbGridExportToPDF/project1.lpi
+++ b/components/rx/trunk/demos/rxdbgrid/RxDbGridExportToPDF/project1.lpi
@@ -1,7 +1,7 @@
-
+
@@ -17,9 +17,10 @@
-
-
-
+
+
+
+
diff --git a/components/rx/trunk/demos/rxdbgrid/RxDbGridExportToPDF/project1.lps b/components/rx/trunk/demos/rxdbgrid/RxDbGridExportToPDF/project1.lps
index 7ad7f3098..e4aa84703 100644
--- a/components/rx/trunk/demos/rxdbgrid/RxDbGridExportToPDF/project1.lps
+++ b/components/rx/trunk/demos/rxdbgrid/RxDbGridExportToPDF/project1.lps
@@ -1,864 +1,853 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/rx/trunk/demos/rxdbgrid/RxDbGridExportToPDF/project1.res b/components/rx/trunk/demos/rxdbgrid/RxDbGridExportToPDF/project1.res
index 877868cb4..f6e849956 100644
Binary files a/components/rx/trunk/demos/rxdbgrid/RxDbGridExportToPDF/project1.res and b/components/rx/trunk/demos/rxdbgrid/RxDbGridExportToPDF/project1.res differ
diff --git a/components/rx/trunk/demos/rxdbgrid/RxDbGridExportToPDF/unit1.lfm b/components/rx/trunk/demos/rxdbgrid/RxDbGridExportToPDF/unit1.lfm
index 16a586ebe..9594c883e 100644
--- a/components/rx/trunk/demos/rxdbgrid/RxDbGridExportToPDF/unit1.lfm
+++ b/components/rx/trunk/demos/rxdbgrid/RxDbGridExportToPDF/unit1.lfm
@@ -11,32 +11,47 @@ object Form1: TForm1
LCLVersion = '1.9.0.0'
object Panel1: TPanel
Left = 0
- Height = 37
- Top = 360
+ Height = 50
+ Top = 347
Width = 1043
Align = alBottom
AutoSize = True
- ClientHeight = 37
+ ClientHeight = 50
ClientWidth = 1043
TabOrder = 0
object Button1: TButton
AnchorSideLeft.Control = Panel1
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = Panel1
- Left = 481
- Height = 23
+ Left = 477
+ Height = 36
Top = 7
- Width = 81
+ Width = 88
AutoSize = True
BorderSpacing.Around = 6
Caption = 'Create PDF'
OnClick = Button1Click
TabOrder = 0
end
+ object CheckBox1: TCheckBox
+ AnchorSideLeft.Control = Button1
+ AnchorSideLeft.Side = asrBottom
+ AnchorSideTop.Control = Panel1
+ AnchorSideTop.Side = asrCenter
+ Left = 571
+ Height = 24
+ Top = 13
+ Width = 105
+ Caption = 'Enable tools'
+ Checked = True
+ OnChange = CheckBox1Change
+ State = cbChecked
+ TabOrder = 1
+ end
end
object PageControl1: TPageControl
Left = 0
- Height = 360
+ Height = 347
Top = 0
Width = 1043
ActivePage = TabSheet1
@@ -45,13 +60,13 @@ object Form1: TForm1
TabOrder = 1
object TabSheet1: TTabSheet
Caption = 'Test data'
- ClientHeight = 334
- ClientWidth = 1035
+ ClientHeight = 313
+ ClientWidth = 1033
object RxDBGrid1: TRxDBGrid
Left = 0
- Height = 334
+ Height = 313
Top = 0
- Width = 1035
+ Width = 1033
ColumnDefValues.BlobText = '(данные)'
TitleButtons = True
AutoSort = True
@@ -63,10 +78,9 @@ object Form1: TForm1
Width = 50
FieldName = 'ID'
EditButtons = <>
- Filter.IsNull = False
- Filter.IsAll = True
Filter.DropDownRows = 0
Filter.EmptyValue = '(Нет)'
+ Filter.NotEmptyValue = '(Не пусто)'
Filter.AllValue = '(All values)'
Filter.EmptyFont.Style = [fsItalic]
Filter.ItemIndex = -1
@@ -80,10 +94,9 @@ object Form1: TForm1
Width = 120
FieldName = 'PDATE'
EditButtons = <>
- Filter.IsNull = False
- Filter.IsAll = True
Filter.DropDownRows = 0
Filter.EmptyValue = '(Нет)'
+ Filter.NotEmptyValue = '(Не пусто)'
Filter.AllValue = '(All values)'
Filter.EmptyFont.Style = [fsItalic]
Filter.ItemIndex = -1
@@ -98,10 +111,9 @@ object Form1: TForm1
Width = 364
FieldName = 'NAME'
EditButtons = <>
- Filter.IsNull = False
- Filter.IsAll = True
Filter.DropDownRows = 0
Filter.EmptyValue = '(Нет)'
+ Filter.NotEmptyValue = '(Не пусто)'
Filter.AllValue = '(All values)'
Filter.EmptyFont.Style = [fsItalic]
Filter.ItemIndex = -1
@@ -133,10 +145,9 @@ object Form1: TForm1
Width = 100
FieldName = 'SUM'
EditButtons = <>
- Filter.IsNull = False
- Filter.IsAll = True
Filter.DropDownRows = 0
Filter.EmptyValue = '(Нет)'
+ Filter.NotEmptyValue = '(Не пусто)'
Filter.AllValue = '(All values)'
Filter.EmptyFont.Style = [fsItalic]
Filter.ItemIndex = -1
@@ -172,10 +183,9 @@ object Form1: TForm1
Width = 60
FieldName = 'FLAG'
EditButtons = <>
- Filter.IsNull = False
- Filter.IsAll = True
Filter.DropDownRows = 0
Filter.EmptyValue = '(Нет)'
+ Filter.NotEmptyValue = '(Не пусто)'
Filter.AllValue = '(All values)'
Filter.EmptyFont.Style = [fsItalic]
Filter.ItemIndex = -1
@@ -196,10 +206,9 @@ object Form1: TForm1
Width = 200
FieldName = 'Country'
EditButtons = <>
- Filter.IsNull = False
- Filter.IsAll = True
Filter.DropDownRows = 0
Filter.EmptyValue = '(Нет)'
+ Filter.NotEmptyValue = '(Не пусто)'
Filter.AllValue = '(All values)'
Filter.EmptyFont.Style = [fsItalic]
Filter.ItemIndex = -1
@@ -212,10 +221,9 @@ object Form1: TForm1
Width = 200
FieldName = 'Sity'
EditButtons = <>
- Filter.IsNull = False
- Filter.IsAll = True
Filter.DropDownRows = 0
Filter.EmptyValue = '(Нет)'
+ Filter.NotEmptyValue = '(Не пусто)'
Filter.AllValue = '(All values)'
Filter.EmptyFont.Style = [fsItalic]
Filter.ItemIndex = -1
@@ -295,7 +303,6 @@ object Form1: TForm1
DataSource = DataSource1
Flat = True
Options = [dgEditing, dgTitles, dgIndicator, dgColumnResize, dgColumnMove, dgColLines, dgRowLines, dgAlwaysShowSelection, dgConfirmDelete, dgCancelOnExit, dgHeaderPushedLook]
- ParentColor = False
TabOrder = 0
TitleStyle = tsNative
end
@@ -396,8 +403,6 @@ object Form1: TForm1
ProviderFlags = [pfInUpdate, pfInWhere]
ReadOnly = False
Required = False
- MaxValue = 0
- MinValue = 0
Precision = 2
end
object RxMemoryData1Country: TStringField
@@ -438,6 +443,7 @@ object Form1: TForm1
object RxDBGridExportPDF1: TRxDBGridExportPDF
RxDBGrid = RxDBGrid1
Caption = 'Export to PDF file'
+ Enabled = True
FileName = 'test111.pdf'
Options = [repExportTitle, repExportColors, repExportFooter, repOverwriteExisting, repExportImages]
PdfOptions.PaperOrientation = ppoLandscape
@@ -554,5 +560,8 @@ object Form1: TForm1
0000000000000000000000000000000000FF0000000000000000000000000000
0000000000000000000000000000
}
+ BitmapAdv = {
+ 4C6900000000
+ }
end
end
diff --git a/components/rx/trunk/demos/rxdbgrid/RxDbGridExportToPDF/unit1.pas b/components/rx/trunk/demos/rxdbgrid/RxDbGridExportToPDF/unit1.pas
index 80bc053ed..206282aa1 100644
--- a/components/rx/trunk/demos/rxdbgrid/RxDbGridExportToPDF/unit1.pas
+++ b/components/rx/trunk/demos/rxdbgrid/RxDbGridExportToPDF/unit1.pas
@@ -15,6 +15,7 @@ type
TForm1 = class(TForm)
Button1: TButton;
+ CheckBox1: TCheckBox;
DataSource1: TDataSource;
ImageList1: TImageList;
Memo1: TMemo;
@@ -33,6 +34,7 @@ type
TabSheet1: TTabSheet;
TabSheet2: TTabSheet;
procedure Button1Click(Sender: TObject);
+ procedure CheckBox1Change(Sender: TObject);
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
procedure FormCreate(Sender: TObject);
private
@@ -139,6 +141,11 @@ begin
RxDBGridExportPDF1.ShowSetupForm:=true;
end;
+procedure TForm1.CheckBox1Change(Sender: TObject);
+begin
+ RxDBGridExportPDF1.Enabled:=CheckBox1.Checked;
+end;
+
procedure TForm1.FormClose(Sender: TObject; var CloseAction: TCloseAction);
begin
FreeAndNil(FontDirList);
diff --git a/components/rx/trunk/rxdb/rxdbgrid.pas b/components/rx/trunk/rxdb/rxdbgrid.pas
index 119dd22bc..83372c30f 100644
--- a/components/rx/trunk/rxdb/rxdbgrid.pas
+++ b/components/rx/trunk/rxdb/rxdbgrid.pas
@@ -876,6 +876,7 @@ type
procedure DoSetColEdtBtn;
procedure AddTools(ATools:TRxDBGridAbstractTools);
procedure RemoveTools(ATools:TRxDBGridAbstractTools);
+ procedure UpdateToolsState(ATools:TRxDBGridAbstractTools);
procedure OnDataSetScrolled(aDataSet:TDataSet; Distance: Integer);
procedure FillFilterData;
@@ -1154,10 +1155,12 @@ type
TRxDBGridAbstractTools = class(TComponent)
private
+ FEnabled: boolean;
FOnAfterExecute: TNotifyEvent;
FOnBeforeExecute: TNotifyEvent;
FShowSetupForm: boolean;
procedure ExecTools(Sender:TObject);
+ procedure SetEnabled(AValue: boolean);
protected
FRxDBGrid: TRxDBGrid;
FCaption:string;
@@ -1177,6 +1180,7 @@ type
property ShowSetupForm:boolean read FShowSetupForm write FShowSetupForm default false;
property OnBeforeExecute:TNotifyEvent read FOnBeforeExecute write FOnBeforeExecute;
property OnAfterExecute:TNotifyEvent read FOnAfterExecute write FOnAfterExecute;
+ property Enabled:boolean read FEnabled write SetEnabled default true;
end;
procedure RegisterRxDBGridSortEngine(RxDBGridSortEngineClass: TRxDBGridSortEngineClass;
@@ -2332,12 +2336,20 @@ begin
Execute;
end;
+procedure TRxDBGridAbstractTools.SetEnabled(AValue: boolean);
+begin
+ if FEnabled=AValue then Exit;
+ FEnabled:=AValue;
+ FRxDBGrid.UpdateToolsState(Self);
+end;
+
constructor TRxDBGridAbstractTools.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FToolsEvents:=[];
FCaption:=Name;
FShowSetupForm:=false;
+ FEnabled:=true;
end;
destructor TRxDBGridAbstractTools.Destroy;
@@ -4065,6 +4077,8 @@ var
i:integer;
R: TMenuItem;
begin
+ if not Assigned(ATools) then Exit;
+
for i:=8 to F_PopupMenu.Items.Count - 1 do
if F_PopupMenu.Items[i].Tag = IntPtr(ATools) then
exit;
@@ -4074,6 +4088,7 @@ begin
R.Caption := ATools.FCaption;
R.OnClick := @(ATools.ExecTools);
R.Tag:=IntPtr(ATools);
+ R.Enabled:=ATools.Enabled;
if Assigned(FToolsList) and (FToolsList.IndexOf(ATools)<0) then
FToolsList.Add(ATools);
@@ -4097,6 +4112,19 @@ begin
FToolsList.Remove(ATools);
end;
+procedure TRxDBGrid.UpdateToolsState(ATools: TRxDBGridAbstractTools);
+var
+ i: Integer;
+begin
+ if not Assigned(ATools) then Exit;
+ for i:=8 to F_PopupMenu.Items.Count - 1 do
+ if F_PopupMenu.Items[i].Tag = IntPtr(ATools) then
+ begin
+ F_PopupMenu.Items[i].Enabled:=ATools.Enabled;
+ exit;
+ end;
+end;
+
procedure TRxDBGrid.OnDataSetScrolled(aDataSet: TDataSet; Distance: Integer);
begin
if Assigned(FSaveOnDataSetScrolled) then