這個輸入框的自動完成的功能,是比較智能化的。因為它會根據以往的輸入自動完成,或者智能提示所需要的連接或者內容。
下面就來先看這個類的定義:
#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
的開發,它是一套基于模板的窗口框架。下一次再仔細地分析自動完成的實現過程。
更多文章、技術交流、商務合作、聯系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號聯系: 360901061
您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元
