RxFPC:RxDBGrid - add metod for add custom command for RxDBGrid tools menu
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5138 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
parent
739b507e7b
commit
7f58cbbef8
@ -11,7 +11,7 @@
|
||||
<WindowIndex Value="-1"/>
|
||||
<TopLine Value="-1"/>
|
||||
<CursorPos X="-1" Y="-1"/>
|
||||
<UsageCount Value="21"/>
|
||||
<UsageCount Value="23"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="unit1.pas"/>
|
||||
@ -21,18 +21,18 @@
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<UnitName Value="Unit1"/>
|
||||
<IsVisibleTab Value="True"/>
|
||||
<TopLine Value="11"/>
|
||||
<CursorPos X="6" Y="21"/>
|
||||
<UsageCount Value="21"/>
|
||||
<TopLine Value="54"/>
|
||||
<CursorPos X="44" Y="61"/>
|
||||
<UsageCount Value="23"/>
|
||||
<Loaded Value="True"/>
|
||||
<LoadedDesigner Value="True"/>
|
||||
</Unit1>
|
||||
<Unit2>
|
||||
<Filename Value="../../rxdbgrid.pas"/>
|
||||
<EditorIndex Value="1"/>
|
||||
<TopLine Value="4375"/>
|
||||
<CursorPos X="34" Y="4400"/>
|
||||
<UsageCount Value="10"/>
|
||||
<TopLine Value="788"/>
|
||||
<CursorPos X="44" Y="788"/>
|
||||
<UsageCount Value="11"/>
|
||||
<Bookmarks Count="1">
|
||||
<Item0 Y="5181" ID="1"/>
|
||||
</Bookmarks>
|
||||
@ -43,7 +43,7 @@
|
||||
<EditorIndex Value="4"/>
|
||||
<TopLine Value="102"/>
|
||||
<CursorPos X="73" Y="118"/>
|
||||
<UsageCount Value="10"/>
|
||||
<UsageCount Value="11"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit3>
|
||||
<Unit4>
|
||||
@ -51,7 +51,7 @@
|
||||
<EditorIndex Value="2"/>
|
||||
<TopLine Value="381"/>
|
||||
<CursorPos X="30" Y="386"/>
|
||||
<UsageCount Value="10"/>
|
||||
<UsageCount Value="11"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit4>
|
||||
<Unit5>
|
||||
@ -59,127 +59,128 @@
|
||||
<EditorIndex Value="3"/>
|
||||
<TopLine Value="1358"/>
|
||||
<CursorPos X="51" Y="1372"/>
|
||||
<UsageCount Value="10"/>
|
||||
<UsageCount Value="11"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit5>
|
||||
</Units>
|
||||
<JumpHistory Count="30" HistoryIndex="29">
|
||||
<Position1>
|
||||
<Filename Value="../../rxdbgrid.pas"/>
|
||||
<Caret Line="5285" Column="47" TopLine="5260"/>
|
||||
<Caret Line="3741" Column="54" TopLine="3717"/>
|
||||
</Position1>
|
||||
<Position2>
|
||||
<Filename Value="../../rxdbgrid.pas"/>
|
||||
<Caret Line="6155" Column="16" TopLine="6129"/>
|
||||
<Caret Line="4741" Column="44" TopLine="4716"/>
|
||||
</Position2>
|
||||
<Position3>
|
||||
<Filename Value="../../rxdbgrid.pas"/>
|
||||
<Caret Line="446" Column="17" TopLine="425"/>
|
||||
<Caret Line="5153" Column="75" TopLine="5128"/>
|
||||
</Position3>
|
||||
<Position4>
|
||||
<Filename Value="../../rxdbgrid.pas"/>
|
||||
<Caret Line="3741" Column="54" TopLine="3717"/>
|
||||
<Caret Line="5285" Column="47" TopLine="5260"/>
|
||||
</Position4>
|
||||
<Position5>
|
||||
<Filename Value="../../rxdbgrid.pas"/>
|
||||
<Caret Line="4741" Column="83" TopLine="4729"/>
|
||||
<Caret Line="6154" Column="14" TopLine="6129"/>
|
||||
</Position5>
|
||||
<Position6>
|
||||
<Filename Value="../../rxdbgrid.pas"/>
|
||||
<Caret Line="5151" Column="63" TopLine="5128"/>
|
||||
<Caret Line="5153" Column="76" TopLine="5132"/>
|
||||
</Position6>
|
||||
<Position7>
|
||||
<Filename Value="../../rxdbgrid.pas"/>
|
||||
<Caret Line="387" Column="52" TopLine="359"/>
|
||||
</Position7>
|
||||
<Position8>
|
||||
<Filename Value="../../rxdbgrid.pas"/>
|
||||
<Caret Line="369" Column="16" TopLine="344"/>
|
||||
<Caret Line="397" Column="51" TopLine="368"/>
|
||||
</Position8>
|
||||
<Position9>
|
||||
<Filename Value="../../rxdbgrid.pas"/>
|
||||
<Caret Line="390" Column="67" TopLine="366"/>
|
||||
<Caret Line="3746" Column="54" TopLine="3721"/>
|
||||
</Position9>
|
||||
<Position10>
|
||||
<Filename Value="../../rxdbgrid.pas"/>
|
||||
<Caret Line="3741" Column="54" TopLine="3717"/>
|
||||
<Caret Line="750" Column="15" TopLine="737"/>
|
||||
</Position10>
|
||||
<Position11>
|
||||
<Filename Value="../../rxdbgrid.pas"/>
|
||||
<Caret Line="4741" Column="44" TopLine="4716"/>
|
||||
<Caret Line="709" Column="15" TopLine="696"/>
|
||||
</Position11>
|
||||
<Position12>
|
||||
<Filename Value="../../rxdbgrid.pas"/>
|
||||
<Caret Line="5153" Column="75" TopLine="5128"/>
|
||||
<Caret Line="3745" Column="94" TopLine="3721"/>
|
||||
</Position12>
|
||||
<Position13>
|
||||
<Filename Value="../../rxdbgrid.pas"/>
|
||||
<Caret Line="5285" Column="47" TopLine="5260"/>
|
||||
<Caret Line="4748" Column="44" TopLine="4723"/>
|
||||
</Position13>
|
||||
<Position14>
|
||||
<Filename Value="../../rxdbgrid.pas"/>
|
||||
<Caret Line="6154" Column="14" TopLine="6129"/>
|
||||
<Caret Line="5175" Column="29" TopLine="5152"/>
|
||||
</Position14>
|
||||
<Position15>
|
||||
<Filename Value="../../rxdbgrid.pas"/>
|
||||
<Caret Line="5153" Column="76" TopLine="5132"/>
|
||||
<Caret Line="470" Column="14" TopLine="462"/>
|
||||
</Position15>
|
||||
<Position16>
|
||||
<Filename Value="../../rxdbgrid.pas"/>
|
||||
<Caret Line="387" Column="52" TopLine="359"/>
|
||||
<Caret Line="5181" TopLine="5154"/>
|
||||
</Position16>
|
||||
<Position17>
|
||||
<Filename Value="../../rxdbgrid.pas"/>
|
||||
<Caret Line="397" Column="51" TopLine="368"/>
|
||||
<Caret Line="6177" Column="59" TopLine="6169"/>
|
||||
</Position17>
|
||||
<Position18>
|
||||
<Filename Value="../../rxdbgrid.pas"/>
|
||||
<Caret Line="3746" Column="54" TopLine="3721"/>
|
||||
</Position18>
|
||||
<Position19>
|
||||
<Filename Value="../../rxdbgrid.pas"/>
|
||||
<Caret Line="750" Column="15" TopLine="737"/>
|
||||
<Filename Value="../../dbutils.pas"/>
|
||||
</Position19>
|
||||
<Position20>
|
||||
<Filename Value="../../rxdbgrid.pas"/>
|
||||
<Caret Line="709" Column="15" TopLine="696"/>
|
||||
<Filename Value="../../dbutils.pas"/>
|
||||
<Caret Line="386" Column="27" TopLine="382"/>
|
||||
</Position20>
|
||||
<Position21>
|
||||
<Filename Value="../../rxdbgrid.pas"/>
|
||||
<Caret Line="3745" Column="94" TopLine="3721"/>
|
||||
<Caret Line="41" Column="36" TopLine="15"/>
|
||||
</Position21>
|
||||
<Position22>
|
||||
<Filename Value="../../rxdbgrid.pas"/>
|
||||
<Caret Line="4748" Column="44" TopLine="4723"/>
|
||||
<Caret Line="588" Column="15" TopLine="581"/>
|
||||
</Position22>
|
||||
<Position23>
|
||||
<Filename Value="../../rxdbgrid.pas"/>
|
||||
<Caret Line="5175" Column="29" TopLine="5152"/>
|
||||
<Caret Line="2515" Column="38" TopLine="2490"/>
|
||||
</Position23>
|
||||
<Position24>
|
||||
<Filename Value="../../rxdbgrid.pas"/>
|
||||
<Caret Line="470" Column="14" TopLine="462"/>
|
||||
<Caret Line="2516" Column="16" TopLine="2491"/>
|
||||
</Position24>
|
||||
<Position25>
|
||||
<Filename Value="../../rxdbgrid.pas"/>
|
||||
<Caret Line="5181" TopLine="5154"/>
|
||||
<Caret Line="788" Column="74" TopLine="784"/>
|
||||
</Position25>
|
||||
<Position26>
|
||||
<Filename Value="../../rxdbgrid.pas"/>
|
||||
<Caret Line="6177" Column="59" TopLine="6169"/>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="21" Column="6" TopLine="11"/>
|
||||
</Position26>
|
||||
<Position27>
|
||||
<Filename Value="../../rxdbgrid.pas"/>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="61" Column="36" TopLine="44"/>
|
||||
</Position27>
|
||||
<Position28>
|
||||
<Filename Value="../../dbutils.pas"/>
|
||||
<Filename Value="../../rxdbgrid.pas"/>
|
||||
<Caret Line="788" Column="44" TopLine="775"/>
|
||||
</Position28>
|
||||
<Position29>
|
||||
<Filename Value="../../dbutils.pas"/>
|
||||
<Caret Line="386" Column="27" TopLine="382"/>
|
||||
<Filename Value="../../rxdbgrid.pas"/>
|
||||
<Caret Line="2509" Column="59" TopLine="2509"/>
|
||||
</Position29>
|
||||
<Position30>
|
||||
<Filename Value="../../rxdbgrid.pas"/>
|
||||
<Caret Line="41" Column="36" TopLine="15"/>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="30" Column="30" TopLine="13"/>
|
||||
</Position30>
|
||||
</JumpHistory>
|
||||
</ProjectSession>
|
||||
|
@ -27,7 +27,7 @@ type
|
||||
procedure CheckBox1Change(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
private
|
||||
|
||||
procedure RxDBGridInfoBox(Sender: TObject);
|
||||
public
|
||||
|
||||
end;
|
||||
@ -58,6 +58,13 @@ begin
|
||||
RxMemoryData1.Post;
|
||||
|
||||
end;
|
||||
RxDBGrid1.CreateToolMenuItem(#0, '-', nil);
|
||||
RxDBGrid1.CreateToolMenuItem(#0, 'Show info box', @RxDBGridInfoBox);
|
||||
end;
|
||||
|
||||
procedure TForm1.RxDBGridInfoBox(Sender: TObject);
|
||||
begin
|
||||
ShowMessage('Hello world form RXDBGrid tools menu');
|
||||
end;
|
||||
|
||||
procedure TForm1.CheckBox1Change(Sender: TObject);
|
||||
|
@ -785,6 +785,7 @@ type
|
||||
procedure DeSelectAllRows;
|
||||
procedure InvertSelection;
|
||||
procedure CopyCellValue;
|
||||
procedure CreateToolMenuItem(ShortCut: char; const ACaption: string; MenuAction: TNotifyEvent);
|
||||
|
||||
procedure SetSort(AFields: array of String; ASortMarkers: array of TSortMarker; PreformSort: Boolean = False);
|
||||
|
||||
@ -2505,33 +2506,32 @@ begin
|
||||
FFooterOptions.DrawFullLine := Value;
|
||||
end;
|
||||
|
||||
procedure TRxDBGrid.CreateToolMenuItem(ShortCut: char; const ACaption: string;
|
||||
MenuAction: TNotifyEvent);
|
||||
var
|
||||
R: TMenuItem;
|
||||
begin
|
||||
R := TMenuItem.Create(F_PopupMenu);
|
||||
F_PopupMenu.Items.Add(R);
|
||||
R.Caption := ACaption;
|
||||
if ShortCut <> #0 then
|
||||
R.ShortCut := KeyToShortCut(Ord(ShortCut), [ssCtrl]);
|
||||
R.OnClick := MenuAction;
|
||||
end;
|
||||
|
||||
procedure TRxDBGrid.DoCreateJMenu;
|
||||
|
||||
procedure CreateMenuItem(ShortCut: char; const ACaption: string;
|
||||
MenuAction: TNotifyEvent);
|
||||
var
|
||||
R: TMenuItem;
|
||||
begin
|
||||
R := TMenuItem.Create(F_PopupMenu);
|
||||
F_PopupMenu.Items.Add(R);
|
||||
R.Caption := ACaption;
|
||||
if ShortCut <> #0 then
|
||||
R.ShortCut := KeyToShortCut(Ord(ShortCut), [ssCtrl]);
|
||||
R.OnClick := MenuAction;
|
||||
end;
|
||||
|
||||
begin
|
||||
F_PopupMenu := TPopupMenu.Create(Self);
|
||||
F_PopupMenu.Name := 'OptionsMenu';
|
||||
CreateMenuItem('F', sRxDBGridFind, @OnFind);
|
||||
CreateMenuItem('T', sRxDBGridFilter, @OnFilterBy);
|
||||
CreateMenuItem('E', sRxDBGridFilterSimple, @OnFilter);
|
||||
CreateMenuItem('Q', sRxDBGridFilterClear, @OnFilterClose);
|
||||
CreateMenuItem(#0, '-', nil);
|
||||
CreateMenuItem('C', sRxDBGridSortByColumns, @OnSortBy);
|
||||
CreateMenuItem('W', sRxDBGridSelectColumns, @OnChooseVisibleFields);
|
||||
CreateMenuItem('A', sRxDBGridSelectAllRows, @OnSelectAllRows);
|
||||
CreateMenuItem(#0, sRxDBGridCopyCellValue, @OnCopyCellValue);
|
||||
CreateToolMenuItem('F', sRxDBGridFind, @OnFind);
|
||||
CreateToolMenuItem('T', sRxDBGridFilter, @OnFilterBy);
|
||||
CreateToolMenuItem('E', sRxDBGridFilterSimple, @OnFilter);
|
||||
CreateToolMenuItem('Q', sRxDBGridFilterClear, @OnFilterClose);
|
||||
CreateToolMenuItem(#0, '-', nil);
|
||||
CreateToolMenuItem('C', sRxDBGridSortByColumns, @OnSortBy);
|
||||
CreateToolMenuItem('W', sRxDBGridSelectColumns, @OnChooseVisibleFields);
|
||||
CreateToolMenuItem('A', sRxDBGridSelectAllRows, @OnSelectAllRows);
|
||||
CreateToolMenuItem(#0, sRxDBGridCopyCellValue, @OnCopyCellValue);
|
||||
end;
|
||||
|
||||
function TRxDBGrid.GetPropertyStorage: TCustomPropertyStorage;
|
||||
|
Loading…
Reference in New Issue
Block a user