CtrlLib: SuggestCtrl fixed for CLANG

git-svn-id: svn://ultimatepp.org/upp/trunk@7381 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2014-05-16 06:06:02 +00:00
parent ea97ce32fe
commit dd14fd2819
4 changed files with 14 additions and 9 deletions

View file

@ -57,20 +57,22 @@ void SuggestCtrl::Select()
bool SuggestCtrl::Key(dword key, int count)
{
if(list.IsOpen()) {
if(key == K_UP || key == K_PAGEUP || key == K_CTRL_PAGEDOWN)
if(key == K_UP || key == K_PAGEUP || key == K_CTRL_PAGEDOWN) {
if(list.IsCursor())
return list.Key(key, count);
else {
list.GoEnd();
return true;
}
if(key == K_DOWN || key == K_PAGEDOWN || key == K_CTRL_PAGEUP)
}
if(key == K_DOWN || key == K_PAGEDOWN || key == K_CTRL_PAGEUP) {
if(list.IsCursor())
return list.Key(key, count);
else {
list.GoBegin();
return true;
}
}
}
if(key == K_ENTER && list.IsOpen() && list.IsCursor()) {
Select();

View file

@ -22,8 +22,9 @@ private:
public:
void ClearList() { data.Clear(); }
void Add(const WString& s) { data.Add(s); }
void Add(const String& s) { data.Add(s.ToWString()); }
void AddList(const WString& s) { data.Add(s); }
void AddList(const String& s) { data.Add(s.ToWString()); }
void AddList(const char *s) { data.Add(s); }
void Pick(Vector<WString> rval_ list) { data = pick(list); }

View file

@ -2,7 +2,7 @@
#define _CtrlLib_icpp_init_stub
#include "CtrlCore/init"
#include "PdfDraw/init"
#define BLITZ_INDEX__ Fa588a2a7bb40a3ed36760f6c2bef5026
#define BLITZ_INDEX__ F2a95805f3896075b0a556396aabaf515
#include "CtrlLib.icpp"
#undef BLITZ_INDEX__
#endif

View file

@ -29,10 +29,12 @@ topic "";
[s2;%% Clears the suggestions list.&]
[s3; &]
[s4; &]
[s5;:SuggestCtrl`:`:Add`(const WString`&`): [@(0.0.255) void]_[* Add]([@(0.0.255) const]_[_^WString^ W
String][@(0.0.255) `&]_[*@3 s])&]
[s5;:SuggestCtrl`:`:Add`(const String`&`): [@(0.0.255) void]_[* Add]([@(0.0.255) const]_[_^String^ S
tring][@(0.0.255) `&]_[*@3 s])&]
[s5;:SuggestCtrl`:`:AddList`(const WString`&`): [@(0.0.255) void]_[* AddList]([@(0.0.255) c
onst]_[_^WString^ WString][@(0.0.255) `&]_[*@3 s])&]
[s5;:SuggestCtrl`:`:AddList`(const String`&`): [@(0.0.255) void]_[* AddList]([@(0.0.255) co
nst]_[_^String^ String][@(0.0.255) `&]_[*@3 s])&]
[s5;:SuggestCtrl`:`:AddList`(const char`*`): [@(0.0.255) void]_[* AddList]([@(0.0.255) cons
t]_[@(0.0.255) char]_`*[*@3 s])&]
[s2;%% Adds [%-*@3 s] to suggestions list.&]
[s3;%% &]
[s4;%% &]