这个输入框的自动完成的功能,是比较智能化的。因为它会根据以往的输入自动完成,或者智能提示所需要的连接或者内容。
下面就来先看这个类的定义:
#001 // Provides the implementation of an edit control with a drop-down
#002 // autocomplete box. The box itself is implemented in autocomplete_popup.cc
#003 // This file implements the edit box and management for the popup.
#004 //
#005 // This implementation is currently appropriate for the URL bar, where the
#006 // autocomplete dropdown is always displayed because there is always a
#007 // default item. For web page autofill and other applications, this is
#008 // probably not appropriate. We may want to add a flag to determine which
#009 // of these modes we're in.
#010 class AutocompleteEdit
#011 : public CWindowImpl<AutocompleteEdit,
#012 CRichEditCtrl,
#013 CWinTraits<WS_CHILD | WS_VISIBLE | ES_AUTOHSCROLL |
#014 ES_NOHIDESEL> >,
#015 public CRichEditCommands<AutocompleteEdit>,
#016 public Menu::Delegate {
类AutocompleteEdit继承了类CWindowImpl、类CRichEditCommands、类Menu::Delegate。其中类CWindowImpl实现了Windows窗口,它是WTL里的窗口模板类,主要用来创建窗口界面类,并且使用类CRichEditCtrl作为基类,类CRichEditCtrl主要调用Windows里的编辑类。类CRichEditCommands实现RichEdit的命令功能。Menu::Delegate类是实现智能下拉式菜单的提示界面。因此,要学习开发chrome,需要先学习WTL的开发,它是一套基于模板的窗口框架。下一次再仔细地分析自动完成的实现过程。
再分享一下我老师大神的人工智能教程吧。零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到我们人工智能的队伍中来!https://blog.csdn.net/jiangjunshow