TDBGridEh的 搜索面板 TDBGridSearchPanel
TCustomDBGridEh.Create
FSearchPanelControl := TDBGridSearchPanelControlEh.Create(Self); //这里,创建的构造函数是 另外一个类
with FSearchPanelControl do
begin
Parent := Self;
Name := 'FSearchPanelControl';
Visible := False;
SetBounds(,,,);
{$IFDEF FPC}
{$ELSE}
ParentBackground := False;
{$ENDIF}
Text := '';
end; constructor TDBGridSearchPanelControlEh.Create(AGrid: TCustomGridEh);
begin
inherited Create(AGrid); //这里 继承的
ControlStyle := ControlStyle - [csSetCaption];
FGrid := AGrid;
InitItems;
DoubleBuffered := True;
Caption := '';
end; procedure TDBGridSearchPanelControlEh.InitItems;
var
FI: TDBGridEhNavigatorFindBtn;
FindBtn: TNavFindButtonEh;
X: Integer;
// ResName: string;
begin
MinBtnSize := Point(, );
X := ; FFindEditor := TNavFindEditEh.Create(Self); //这里 其实叫 FFindEditor,构造函数是 另外一个类
FFindEditor.Flat := True;
FFindEditor.SetBounds(X, , , MinBtnSize.Y-);
{$IFDEF FPC}
{$ELSE}
FFindEditor.BevelEdges := [beLeft, beTop, beRight, beBottom];
FFindEditor.BevelInner := bvNone;
FFindEditor.BevelKind := bkFlat;
FFindEditor.BorderStyle := bsNone;
FFindEditor.Ctl3D := True;
{$ENDIF}
FFindEditor.TabStop := False;
// FFindEditor.SpecInternalSetText('Search');
FFindEditor.EmptyDataInfo.Text := SSearchPanelEditorPromptText;
FFindEditor.Parent := Self;
FFindEditor.AutoSize := False;
FFindEditor.IsEmptyState := True;
FFindEditor.Font.Color := clGrayText;
FFindEditor.Grid := FGrid;
FFindEditor.OnUpdateModified := FindEditorUpdateModified;
FFindEditor.EditButton.Visible := False;
// FFindEditor.EditButton.Style := ebsAltDropDownEh; X := X + ; for FI := Low(FindButtons) to High(FindButtons) do
begin
FindBtn := TNavFindButtonEh.Create(Self);
FindBtn.Flat := True;
FindBtn.Index := FI;
FindBtn.ImageIndex := Ord(FI)+;
FindBtn.Enabled := True;
FindBtn.SetBounds (X, , MinBtnSize.X, MinBtnSize.Y);
FindBtn.Enabled := False;
FindBtn.Enabled := True;
FindBtn.OnClick := ClickHandler;
FindBtn.OnMouseDown := BtnMouseDown;
FindBtn.Parent := Self;
FindButtons[FI] := FindBtn;
X := X + MinBtnSize.X;
end; FindButtons[gnfbCancelSearchFilterEh].Hint := SSearchPanelApplyFilterEh;
FindButtons[gnfbFindNextEh].Hint := SSearchPanelFindNextEh;
FindButtons[gnfbFindPrevEh].Hint := SSearchPanelFindPrevEh;
FindButtons[gnfbOptionsEh].Hint := SSearchPanelOptionsEh; ResetVisibleControls;
end; constructor TCustomDBComboBoxEh.Create(AOwner: TComponent); 这里
begin
inherited Create(AOwner); //这里
FItems := TStringList.Create;
TStringList(FItems).OnChange := ItemsChanged;
FKeyItems := TStringListEh.Create;
TStringListEh(FKeyItems).CaseSensitive := True;
TStringList(FKeyItems).OnChange := KeyItemsChanged;
FVarValue := Null;
FDropDownBox := CreateDropDownBox;
FDropDownBox.Rows := ;
FItemIndex := -;
FCaseInsensitiveTextSearch := True;
TStringList(FItems).CaseSensitive := not FCaseInsensitiveTextSearch;
end; constructor TCustomDBEditEh.Create(AOwner: TComponent);
begin inherited Create(AOwner); 这里
ControlStyle := ControlStyle + [csReplicatable, csCaptureMouse];
FDataLink := CreateDataLink;
FDataLink.Control := Self;
FDataLink.OnDataChange := DataChange;
FDataLink.OnEditingChange := EditingChange;
FDataLink.OnUpdateData := InternalUpdateData;
FDataLink.OnActiveChange := ActiveChange; FEditButton := CreateEditButton;
FEditButton.OnChanged := EditButtonChanged;
FEditButton.OnRefComponentChanged := EditButtonImagesRefComponentNotifyEvent;
FEditButtons := CreateEditButtons;
FEditButtons.OnChanged := EditButtonChanged;
FEditButtons.OnRefComponentChanged := EditButtonImagesRefComponentNotifyEvent;
FEditImage := CreateEditImage; FMRUList := TMRUListEh.Create(Self);
FMRUList.OnSetDropDown := MRUListDropDown;
FMRUList.OnSetCloseUp := MRUListCloseUp; FDynProps := TDynVarsEh.Create(Self);
FEmptyDataInfo := TControlEmptyDataInfoEh.Create(Self);
UpdateControlReadOnly;
UpdateImageIndex; FButtonsBox := TEditButtonsBoxEh.Create(Self);
FButtonsBox.SetBounds(,,,);
FButtonsBox.Visible := False;
FButtonsBox.Parent := Self;
FButtonsBox.OnDown := EditButtonDown;
FButtonsBox.OnClick := EditButtonClick;
FButtonsBox.OnMouseMove := EditButtonMouseMove;
FButtonsBox.OnMouseUp := EditButtonMouseUp;
FButtonsBox.OnCreateEditButtonControl := CreateEditButtonControl; FControlLabel := TControlLabelEh.Create(Self);
FControlLabel.FreeNotification(Self);
FControlLabel.FocusControl := Self;
FControlLabelLocation := TControlLabelLocationEh.Create(Self);
end; constructor TCustomMaskEdit.Create(AOwner: TComponent);
begin
inherited Create(AOwner);这里
FMaskState := [];
FMaskBlank := DefaultBlank;
end; constructor TCustomEdit.Create(AOwner: TComponent);
const
EditStyle = [csClickEvents, csSetCaption, csDoubleClicks, csFixedHeight, csPannable];
begin
inherited Create(AOwner); 这里
if NewStyleControls then
ControlStyle := EditStyle else
ControlStyle := EditStyle + [csFramed];
Width := ;
Height := ;
TabStop := True;
ParentColor := False;
FBorderStyle := bsSingle;
FAutoSize := True;
FAutoSelect := True;
FHideSelection := True;
AdjustHeight;
FOldSelLength := -;
FOldSelStart := -;
end; ======================================================================== procedure TCustomDBEditEh.WMChar(var Message: TWMChar);
var
CharMsg: Windows.TMsg;
DBC: Boolean;
begin
FCompleteKeyPress := Char(Message.CharCode);
try
DBC := False;
if (CharInSetEh(Char(Message.CharCode), LeadBytes)) then
if PeekMessage(CharMsg, Handle, WM_CHAR, WM_CHAR, PM_NOREMOVE) then
if CharMsg.Message <> WM_Quit then
begin
{$IFDEF CIL}
// FCompleteKeyPress := FCompleteKeyPress + Char(CharMsg.wParam);
{$ELSE}
FCompleteKeyPress := FCompleteKeyPress + Char(CharMsg.wParam);
{$ENDIF}
DBC := True;
end; inherited; if DBC and (Char(Message.CharCode) = #) then
PeekMessage(CharMsg, Handle, WM_CHAR, WM_CHAR, PM_REMOVE);
finally
FCompleteKeyPress := '';
end;
end; function TWinControl.DoKeyPress(var Message: TWMKey): Boolean;
var
Form: TCustomForm;
Ch: Char;
begin
Result := True;
Form := GetParentForm(Self);
if (Form <> nil) and (Form <> Self) and Form.KeyPreview and
TWinControl(Form).DoKeyPress(Message) then Exit;
if not (csNoStdEvents in ControlStyle) then
with Message do
begin
Ch := Char(CharCode);
KeyPress(Ch);
CharCode := Word(Ch);
if Char(CharCode) = # then Exit;
end;
Result := False;
end; procedure TNavFindEditEh.KeyPress(var Key: Char); 这里 输入
begin
if (Key = #) and not ListVisible then //ESC
begin
{ if CanUndo then
begin
Undo;
ClearUndo;
Modified := False;
UpdateModified;
end else}
CancelSearchEditorMode;
Key := #;
end else if (Key = #) and not ListVisible then
begin
if TCustomDBGridEhCrack(Grid).SearchPanel.FilterEnabled then
ApplySearchFilter
else
begin
if GetKeyState(VK_SHIFT) <
then TDBGridSearchPanelControlEh(Parent).FindPrev
else TDBGridSearchPanelControlEh(Parent).FindNext;
end;
Key := #;
end;
inherited KeyPress(Key);
end; procedure TDBGridSearchPanelControlEh.FindBtnClick(Index: TDBGridEhNavigatorFindBtn);右边3个按钮
var
Grid: TCustomDBGridEhCrack;
begin
Grid := TCustomDBGridEhCrack(FGrid);
if (Grid.DataSource <> nil) and (Grid.DataSource.State <> dsInactive) then
begin
if Grid.SearchEditorMode = False then
Grid.SearchEditorMode := True;
case Index of
gnfbCancelSearchFilterEh:
if not FFindEditor.TextAppliedAsFilter
then FFindEditor.ApplySearchFilter
else FFindEditor.CancelSearchEditorMode;
gnfbFindNextEh:
FindNext;
gnfbFindPrevEh:
FindPrev;
gnfbOptionsEh: ;
end;
end;
end; procedure TNavFindEditEh.CancelSearchEditorMode;
begin
SpecInternalSetText('');
TDBGridSearchPanelEhCrack(TCustomDBGridEhCrack(Grid).SearchPanel).InterSetSearchingText(Text);
TCustomDBGridEhCrack(Grid).SearchEditorMode := False;
TCustomDBGridEhCrack(Grid).ClearSearchFilter;
Modified := False;
TextAppliedAsFilter := True;
UpdateModified;
end;
TDBGridEh的 搜索面板 TDBGridSearchPanel的更多相关文章
- myeclipse的ctrl+f搜索面板功能详解
1.查找/替换方向:Direction Forward:向前 Backward:向后 2.范围:Scope All:全部(当前文件) Selected lines:选中的几行 3.选项:Options ...
- 如何定义搜索面板的过滤器?DevExpress WPF超easy
DevExpress广泛应用于ECM企业内容管理. 成本管控.进程监督.生产调度,在企业/政务信息化管理中占据一席重要之地.通过DevExpress WPF Controls,您能创建有着强大互动功能 ...
- 搜索框focus 搜索面板显示 点击别处消失 从浏览器别的页面回来消失
开始是设置了回到页面使display:none(离开页面操作失效),但是发现回到页面,面板显示,dom获取却为null,于是做了个延时的处理 currentPage: function() { var ...
- Spring Data Solr的分组查询 for 搜索面板的商品分类
private List searchCategoryList(Map searchMap) { SimpleQuery query = new SimpleQuery(new Criteria(&q ...
- 【extjs】 extjs5 Ext.grid.Panel 搜索示例
先看效果图: 页面js: <script type="text/javascript"> /** * 日志类型 store * */ var logTypeStore ...
- 【extjs】 ext5 Ext.grid.Panel 分页,搜索
带有分页,搜索的grid. <%@page language="java" contentType="text/html; charset=UTF-8" ...
- chrome浏览器 开发者工具简介
Chrome浏览器得益于其优秀的V8解释器,javascript执行速度和内存占有率表现非常优秀. 掌握了Chrome工具可提高学习效率和开发效率. 有如下功能面板,可以使用Ctrl+[和Ctrl+] ...
- [No00009B]win10快捷键大全
微软为Win10命令行(Command Prompt)加入了Ctrl + V的支持 Win10新增功能快捷键大全: 贴靠窗口:Win + 左/右 > Win + 上/下 > 窗口可以变为 ...
- 漫谈可视化Prefuse(二)---一分钟学会Prefuse
前篇<漫谈可视化Prefuse(一)---从SQL Server数据库读取数据>主要介绍了prefuse如何连接数据库sql server并读取数据进行可视化展现. 回头想想还是应该好好捋 ...
随机推荐
- JavaWeb 7 Servlet
7 Servlet Servlet学习的大纲:1. servlet概念及相关接口简介2. servet 执行过程3. servlet路径映射4. 缺省servlet --应用5. s ...
- iOS 开发之照片框架详解(1)
http://kayosite.com/ios-development-and-detail-of-photo-framework.html/comment-page-1 一. 概要 在 iOS 设备 ...
- D3.js 完整的柱形图
一个完整的柱形图包含三部分:矩形.文字.坐标轴.制作一个实用的柱形图,内容包括:选择集.数据绑定.比例尺.坐标轴等内容. 1. 添加 SVG 画布 //画布大小 var width = 400; va ...
- JavaScript数学揭密之函数与勾股定理
一.函数 function show(n){ return n*2; } alert( show(2) ); alert( show(3) ); alert( show(4) ); 二.勾股定理 1. ...
- CentOS查看内核版本,位数,版本号 (zhuan)
http://blog.csdn.net/painsonline/article/details/7668824 ******************************************* ...
- Python类属性详解
在python开发中,我们常常用到python的类,今天就通过实例和大家扒一扒类的属性,一起来看看吧. 类属性 1.类定义后就存在,而且不需要实例化 2.类属性使得相同类的不同实例共同持有相同变量 类 ...
- 队列 - 从零开始实现by C++
参考链接:数据结构探险-队列篇 数据结构太重要了,不学好是没法进行软件开发的. C++写数据结构基本套路:一个.h文件写该数据结构类的接口:一个.cpp文件写接口的具体实现:一个main.cpp用于测 ...
- 销售 >> 当今社会生产力最大的源泉为 >>自助服务 与推销员随之消失
销售可能是变化最大的企业职能.比如,经济学家喜欢提出陷阱问题“什么概念或者想法成为当今社会生产力最大的源泉?” 大多数人回答计算机, 正确的回答是自助服务与推销员随之消失 ...
- Selenium Grid 运行报错 Exception thrown in Navigator.Start first time ->Error forwarding the new session Empty pool of VM for setup Capabilities
Selenium Grid 运行报错 : Exception thrown in Navigator.Start first time ->Error forwarding the new se ...
- JS禁止右键
function cancelMouse(){return false;}document.oncontextmenu = cancelMouse;