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并读取数据进行可视化展现. 回头想想还是应该好好捋 ...
随机推荐
- windows 环境变量 %SystemDrive% 和 %SystemRoot%
%SYSTEMROOT% == c:\windows (or the root windows directory) %SYSTEMDRIVE% == the drive windows is ins ...
- js object(对象)
http://www.cnblogs.com/pingchuanxin/p/5773326.html Object(对象)是在所有的编程语言中都十分重要的一个概念,对于事物我们可以把他们看作是一个对象 ...
- [html] src与href的区别
src用于替换当前元素,href用于在当前文档和引用资源之间确立联系. src是source的缩写,指向外部资源的位置,指向的内容将会嵌入到文档中当前标签所在位置:在请求src资源时会将其指向的资源下 ...
- SQL语句在数据库中是如何执行的
第一步:应用程序把查询SQL语句发给服务器端执行 我们在数据层执行SQL语句时,应用程序会连接到相应的数据库服务器,把SQL语句发送给服务器处理. 第二步:服务器解析请求的SQL语句 SQL计划缓存, ...
- 数据存储之SQLite
SQLite是目前主流的嵌入式关系型数据库,其最主要的特点就是轻量级.跨平台,当前很多嵌入式操作系统都将其作为数据库首选.虽然SQLite是一款轻型数据库,但是其功能也绝不亚于很多大型关系数据库.学习 ...
- enum类型
1.设有变量a,b,c被说明为上述的weekday,可采用下述任一种方式: enum weekday{sun,mon,tue,wed,thu,fri,sat}; enum weekday a,b,c; ...
- 【MRPT】【icp-slam-live】Vs2013+ cmake3.6.1 + mrpt1.4.0+opencv2.9.4+wxWidget3.0.2环境配置
Win10下Vs2013 + cmake3.6.1 + mrpt1.4.0+opencv2.9.4+wxWidget3.1.0环境配置 所接触过的最令我崩溃的环境配置.之前没有考虑到vs2013 20 ...
- 栈 - 从零开始实现by C++
参考链接:数据结构探险-栈篇 学了队列之后,栈就很简单了,换汤不换药. 栈 栈的模型 后进先出(电梯,进制转换,括号的匹配检测) 栈的基本元素 栈顶,栈底(一般很少用到),栈容量,栈长度 注意 ...
- ios CoreBluetooth 警告 is being dealloc'ed while pending connection
ios CoreBluetooth 警告 is being dealloc'ed while pending connection CoreBluetooth[WARNING] <CBPerip ...
- iOS 使用drawRect: 绘制虚线椭圆
iOS 使用drawRect: 绘制虚线椭圆 1:首先如果要使用 drawRect 绘图 要导入 CoreGraphics.framework 框架 然后 创建 自定义view, 即是 myView继 ...