From: Paulo P. <po...@gm...> - 2011-10-17 20:17:31
|
On 17 October 2011 15:58, Van Nguyen <ngu...@gm...> wrote: > I try to implement an Combo Box that Suggests Options. > Eg: if I enters "ES" in the symbol box, only those items that have ES somewhere > in their name will show > up, like ESCAPE, TEST. > But the implemented ComboBox doesn't show dropdow list, > show user must click on button of ComboBox to show it. > > Source: > > import Graphics.UI.WX > import Graphics.UI.WXCore > import Graphics.UI.WX.Events > import Data.List > symbols = > ["ESH11","VIETTEL","METFONE","VIETNET","MENFONE","HUNET"] > > --filter item in the symbols list > searchString :: String -> String -> String > searchString strInput strRaw = do > if strInput `isInfixOf` strRaw then > strRaw > else > "" > > dataManager :: IO () > dataManager = do > frmDataManager <- frame [text:= "Data Manager"] > cbbSymbols <- comboBoxEx frmDataManager wxCB_DROPDOWN [visible := True] The style you are using is "wxCB_DROPDOWN". >From [1], there is another style called "wxCB_SIMPLE", maybe that is what you want. Image example of both is show at [2]. -- [1] http://docs.wxwidgets.org/trunk/classwx_combo_box.html [2] http://www.java2s.com/Tutorial/Python/0380__wxPython/Twocomboboxes.htm |