AccessKey fixes

git-svn-id: svn://ultimatepp.org/upp/trunk@999 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2009-03-22 10:19:48 +00:00
parent 92a2ef1ec7
commit f197dc6ab5
4 changed files with 625 additions and 615 deletions

View file

@ -120,7 +120,7 @@ int ExtractAccessKey(const char *s, String& label)
while(*s)
if((*s == '&' && !qtf || *s == '\b') && s[1] && s[1] != '&') {
akey = ToAscii(ToUpper(s[1]));
pos = s - start + 1;
pos = text.GetLength() + 1;
s++;
}
else
@ -130,12 +130,12 @@ int ExtractAccessKey(const char *s, String& label)
return MAKELONG(akey, pos);
}
byte ChooseAccessKey(const char *text, dword used)
int ChooseAccessKey(const char *text, dword used)
{
for(const char *s = text; *s; s++) {
byte ac = ToAscii(*s);
if(ac >= 'A' && ac <= 'Z' && (Ctrl::AccessKeyBit(ac) & used) == 0)
return ac;
return MAKELONG(ac, s - text + 1);
}
for(const char *s = text; *s; s++) {
byte ac = ToUpper(ToAscii(*s));

View file

@ -25,7 +25,7 @@ void DrawSmartText(Draw& w, int x, int y, int cx, const char *text,
int ExtractAccessKey(const char *s, String& label);
bool CompareAccessKey(int accesskey, dword key);
byte ChooseAccessKey(const char *s, dword used);
int ChooseAccessKey(const char *s, dword used);
void DrawFocus(Draw& w, int x, int y, int cx, int cy, Color c = SColorText());
void DrawFocus(Draw& w, const Rect& r, Color c = SColorText());

File diff suppressed because it is too large Load diff

View file

@ -87,6 +87,9 @@ void DrawTLText(Draw& draw, int x, int y, int cx, const wchar *text,
const wchar *t = s;
int apos = HIWORD(accesskey);
int akey = LOWORD(accesskey);
DDUMP(text);
DDUMP(akey);
DDUMP(apos);
for(;;) {
if(*s == '\n' || *s == '\0') {
int a = x;