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并读取数据进行可视化展现. 回头想想还是应该好好捋 ...
随机推荐
- JavaSE复习_6 枚举类
△单例类是指只有一个实例,而枚举类实际上就是有有限个实例的类,在类里已经把实例定义好了. △枚举类的三种创建形式: 1) enum Week { MON,TUE,WED;//枚举类有默认构造函数创建的 ...
- JavaSE复习_1 Java的基本格式和运算符
△.代表在当前目录.classpath能在任何路径下访问类文件. △单行注释可以嵌套,多行注释不能嵌套 △java中的标识符只能有数字,字母,$和_,其他的符号都是错误的,不合法的.其中数字不能是开头 ...
- 在map中根据value获取key
原文:http://blog.csdn.net/mexican_jacky/article/details/51789548 //根据map的value获取map的key private static ...
- Asp.NET设置Session过期时间的四种方式
在Asp.net中,可以有四处设置Session的过期时间: 一.全局网站(即服务器)级 IIS-网站-属性-Asp.net-编辑配置-状态管理-会话超时(分钟)-设置为120,即为2小时,即120分 ...
- 20160815_Redis安装
OS: CentOS6.4(x64) 参考网址: http://www.cnblogs.com/haoxinyue/p/3620648.html http://www.codeceo.com/arti ...
- C#高级知识点概要(2) - 线程和并发
原文地址:http://www.cnblogs.com/Leo_wl/p/4192935.html 我也想过跳过C#高级知识点概要直接讲MVC,但经过前思后想,还是觉得有必要讲的.我希望通过自己的经验 ...
- [svn] 分支开发
参考博客: http://www.cnblogs.com/cxd4321/archive/2012/07/12/2588110.html (1)为什么要使用SVN分支开发和主干合并? 目的:在SVN下 ...
- Columbia遗留问题
本来Columbia只是按照顺序,导航不可以点击,数组按照顺序push的小东西 在leader的要求下,要变成导航可以点击,无顺序的一团浆糊,经过了大概长达两天(我是不是太适合做程序!)的反复纠结,浆 ...
- poj-----(2828)Buy Tickets(线段树单点更新)
Buy Tickets Time Limit: 4000MS Memory Limit: 65536K Total Submissions: 12930 Accepted: 6412 Desc ...
- Greenplum——升级的分布式PostgresSQL
Greenplum数据库基于PostgreSQL开源技术.本质上讲,它是多个PostgreSQL实例一起充当一个数据库管理系统.Greenplum以PostgreSQL 8.2.15为基础构建,在SQ ...