📄 drop-down-list-box.zc
字号:
//[of]:description
//[c]Select an item from a drop-down list.
//[c]
//[cf]
//[of]:license
//[c]Code Browser - a folding text editor for programmers
//[c]Copyright (C) 2003-07 Marc Kerbiquet
//[c]
//[c]This program is free software; you can redistribute it and/or modify
//[c]it under the terms of the GNU General Public License as published by
//[c]the Free Software Foundation; either version 2 of the License, or
//[c](at your option) any later version.
//[c]
//[c]This program is distributed in the hope that it will be useful,
//[c]but WITHOUT ANY WARRANTY; without even the implied warranty of
//[c]MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//[c]GNU General Public License for more details.
//[c]
//[c]You should have received a copy of the GNU General Public License
//[c]along with this program; if not, write to the Free Software
//[c]Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//[cf]
//[of]:imports
import "base/types"
import "base/memory-allocator"
import "text/vector-of-strings"
import "text/string"
import "text/string-buffer"
//[c]
import "graphics/geometry"
import "graphics/graphics"
import "user/box"
//[c]
import "win32/windows"
//[cf]
//[c]
//[of]:drop down list box
//[of]:type
public struct drop down list box : local box
private
list of strings: vector of strings
index in list: int
end
//[cf]
//[of]:instance creation
//[of]:new drop down list box (parent)
public func new drop down list box (parent: box)
equ s = sizeof local drop down list box
def e = allocate memory (s): drop down list box
initialize (e, parent)
return e
end
//[cf]
//[cf]
//[of]:index
//[of]:index
//[c]Returns the index of the currently selected item,
//[c]if any, in the list box of a drop down list box.
//[c]
public func index (m: drop down list box)
index in list (m) = send message (m, CB_GETCURSEL): int
return index in list (m)
end
//[cf]
//[of]:set index (index)
//[c]Specifies the zero-based index of the string to select.
//[c]If the index parameter is
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -