mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-25 06:12:47 -06:00
reference: SuggestCtrl
git-svn-id: svn://ultimatepp.org/upp/trunk@7377 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
4547a6b29d
commit
4a5d0fc6be
3 changed files with 72 additions and 0 deletions
11
reference/SuggestCtrl/SuggestCtrl.upp
Normal file
11
reference/SuggestCtrl/SuggestCtrl.upp
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
description "Demostrates SuggestCtrl, string editor giving suggestions\377";
|
||||
|
||||
uses
|
||||
CtrlLib;
|
||||
|
||||
file
|
||||
main.cpp;
|
||||
|
||||
mainconfig
|
||||
"" = "GUI SSE2";
|
||||
|
||||
4
reference/SuggestCtrl/init
Normal file
4
reference/SuggestCtrl/init
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef _SuggestCtrl_icpp_init_stub
|
||||
#define _SuggestCtrl_icpp_init_stub
|
||||
#include "CtrlLib/init"
|
||||
#endif
|
||||
57
reference/SuggestCtrl/main.cpp
Normal file
57
reference/SuggestCtrl/main.cpp
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
#include <CtrlLib/CtrlLib.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
inline int CharFilterToUpperAscii(int c)
|
||||
{
|
||||
return ToUpper(ToAscii(c));
|
||||
}
|
||||
|
||||
int Sep(int c)
|
||||
{
|
||||
return c == ';' || c == ',' ? ';' : 0;
|
||||
}
|
||||
|
||||
GUI_APP_MAIN
|
||||
{
|
||||
TopWindow win;
|
||||
SuggestCtrl ctrl;
|
||||
|
||||
static const char *cpp[] = {
|
||||
"namespace", "asm", "__asm", "else", "struct",
|
||||
"enum", "switch", "auto", "__except", "template",
|
||||
"explicit", "this",
|
||||
"bool", "extern", "mutable", "thread",
|
||||
"break", "false", "throw",
|
||||
"case", "__fastcall", "true",
|
||||
"catch", "__finally", "new", "try",
|
||||
"__cdecl", "float", "__try",
|
||||
"char", "wchar_t", "for", "operator", "typedef",
|
||||
"class", "friend", "private", "typeid",
|
||||
"const", "goto", "protected", "typename",
|
||||
"const_cast", "if", "public", "union",
|
||||
"continue", "inline", "register", "unsigned",
|
||||
"__declspec", "__inline", "reinterpret_cast", "using",
|
||||
"using", "default", "int", "return",
|
||||
"delete", "__int8", "short", "__uuidof",
|
||||
"dllexport", "__int16", "signed", "virtual",
|
||||
"dllimport", "__int32", "sizeof", "void",
|
||||
"do", "__int64", "static", "volatile",
|
||||
"double", "__leave", "static_cast",
|
||||
"dynamic_cast", "long", "__stdcall", "while",
|
||||
"force_inline",
|
||||
"and", "bitor", "or", "xor",
|
||||
"compl", "bitand", "and_eq", "or_eq",
|
||||
"xor_eq", "not", "not_eq",
|
||||
"char16_t", "char32_t", "constexpr", "decltype",
|
||||
"noexcept", "nullptr", "static_assert",
|
||||
"override", "final"
|
||||
};
|
||||
|
||||
for(int i = 0; i < __countof(cpp); i++)
|
||||
ctrl.Add(cpp[i]);
|
||||
ctrl.Delimiter(Sep);
|
||||
ctrl.CompareFilter(CharFilterToUpperAscii);
|
||||
win.Add(ctrl.HSizePos().TopPos(0));
|
||||
win.Run();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue