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的更多相关文章

  1. myeclipse的ctrl+f搜索面板功能详解

    1.查找/替换方向:Direction Forward:向前 Backward:向后 2.范围:Scope All:全部(当前文件) Selected lines:选中的几行 3.选项:Options ...

  2. 如何定义搜索面板的过滤器?DevExpress WPF超easy

    DevExpress广泛应用于ECM企业内容管理. 成本管控.进程监督.生产调度,在企业/政务信息化管理中占据一席重要之地.通过DevExpress WPF Controls,您能创建有着强大互动功能 ...

  3. 搜索框focus 搜索面板显示 点击别处消失 从浏览器别的页面回来消失

    开始是设置了回到页面使display:none(离开页面操作失效),但是发现回到页面,面板显示,dom获取却为null,于是做了个延时的处理 currentPage: function() { var ...

  4. Spring Data Solr的分组查询 for 搜索面板的商品分类

    private List searchCategoryList(Map searchMap) { SimpleQuery query = new SimpleQuery(new Criteria(&q ...

  5. 【extjs】 extjs5 Ext.grid.Panel 搜索示例

    先看效果图: 页面js: <script type="text/javascript"> /** * 日志类型 store * */ var logTypeStore ...

  6. 【extjs】 ext5 Ext.grid.Panel 分页,搜索

    带有分页,搜索的grid. <%@page language="java" contentType="text/html; charset=UTF-8" ...

  7. chrome浏览器 开发者工具简介

    Chrome浏览器得益于其优秀的V8解释器,javascript执行速度和内存占有率表现非常优秀. 掌握了Chrome工具可提高学习效率和开发效率. 有如下功能面板,可以使用Ctrl+[和Ctrl+] ...

  8. [No00009B]win10快捷键大全

    微软为Win10命令行(Command Prompt)加入了Ctrl + V的支持 Win10新增功能快捷键大全: 贴靠窗口:Win + 左/右 >  Win + 上/下 > 窗口可以变为 ...

  9. 漫谈可视化Prefuse(二)---一分钟学会Prefuse

    前篇<漫谈可视化Prefuse(一)---从SQL Server数据库读取数据>主要介绍了prefuse如何连接数据库sql server并读取数据进行可视化展现. 回头想想还是应该好好捋 ...

随机推荐

  1. 【浏览器渲染原理】渲染树构建之渲染树和DOM树的关系(转载 学习中。。。)

    在DOM树构建的同时,浏览器会构建渲染树(render tree).渲染树的节点(渲染器),在Gecko中称为frame,而在webkit中称为renderer.渲染器是在文档解析和创建DOM节点后创 ...

  2. redis web 客户端工具 redis-admin

    redis-admin是基于java的redis web客户端(redis client),以方便广大程序员使用redis为宗旨,集五种数据结构增删改查于一身. https://github.com/ ...

  3. find和xargs

    find 命令的一般形式为 find pathname -options [-print -exec -ok] 让我们来看看该命令的参数: pathname find命令所查找的目录路径.例如用.来表 ...

  4. zabbix实现原理及架构详解

    想要用好zabbix进行监控,那么我们首要需要了解下zabbix这个软件的实现原理及它的架构.建议多阅读官方文档. 一.总体上zabbix的整体架构如下图所示: 重要组件说明: 1)zabbix se ...

  5. Machine Learning - 第4周(Neural Networks: Representation)

    Neural networks is a model inspired by how the brain works. It is widely used today in many applicat ...

  6. OneProxy与其它数据库中间件的对比

    OneProxy 优点 性能 缺点 闭源,被商业公司掌控,到时候随别人蹂躏 可维护性极差,缺乏友好的出错信息,光维护这个环节就被他人掌控 定价不明 有没有这样的公司? 大到10wtps,但是没人能理解 ...

  7. Java多线程基础:进程和线程之由来

    转载: Java多线程基础:进程和线程之由来 在前面,已经介绍了Java的基础知识,现在我们来讨论一点稍微难一点的问题:Java并发编程.当然,Java并发编程涉及到很多方面的内容,不是一朝一夕就能够 ...

  8. 解决 placeholder 垂直不居中,偏上的问题

    解决 placeholder 垂直不居中,偏上的问题 安卓浏览器显示placeholder 垂直不居中,而iphone没问题,搜了一下答案,解决方法是把input的line-height去掉就行 参考 ...

  9. hibernate的懒加载问题

    产生原因: 当使用hibernate查询一个对象的时候,如果Session关闭,再调用该对象关联的集合或者对象的时候,会产生懒加载异常! 解决方案: 方案一: 在Session关闭之前,查询对象关联的 ...

  10. HTML5自学笔记[ 7 ]defer和async

    defer:给位于最前面的script标签设置defer="defer",外联js就会在onload触发之前才加载. async:给script标签设置async="as ...