list_box.h: no_selection flag for lists without selection (for example, browser)
git-svn-id: svn://kolibrios.org@5779 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
1677400b53
commit
2b2d0c2f0e
@ -112,6 +112,7 @@ void main()
|
||||
if (param) strcpy(#URL, #param); else strcpy(#URL, URL_SERVICE_HOME);
|
||||
WB1.DrawBuf.zoom = 1;
|
||||
WB1.list.SetFont(8, 14, 10111000b);
|
||||
WB1.list.no_selection = true;
|
||||
SetEventMask(0xa7);
|
||||
BEGIN_LOOP_APPLICATION:
|
||||
WaitEventTimeout(2);
|
||||
@ -280,7 +281,8 @@ void Draw_Window()
|
||||
void Scan(dword id__)
|
||||
{
|
||||
action_buf=0;
|
||||
switch (id__)
|
||||
if (WB1.list.ProcessKey(key_scancode)) WB1.DrawPage();
|
||||
else switch (id__)
|
||||
{
|
||||
case SCAN_CODE_BS:
|
||||
case BACK_BUTTON:
|
||||
@ -291,22 +293,6 @@ void Scan(dword id__)
|
||||
if (!BrowserHistory.GoForward()) return;
|
||||
OpenPage();
|
||||
return;
|
||||
case SCAN_CODE_HOME:
|
||||
case SCAN_CODE_END:
|
||||
case SCAN_CODE_PGUP:
|
||||
case SCAN_CODE_PGDN:
|
||||
if (WB1.list.ProcessKey(key_scancode)) WB1.DrawPage();
|
||||
return;
|
||||
case SCAN_CODE_UP:
|
||||
if (WB1.list.first <= 0) return;
|
||||
WB1.list.first--;
|
||||
WB1.DrawPage();
|
||||
return;
|
||||
case SCAN_CODE_DOWN:
|
||||
if (WB1.list.visible + WB1.list.first >= WB1.list.count) return;
|
||||
WB1.list.first++;
|
||||
WB1.DrawPage();
|
||||
return;
|
||||
case GOTOURL_BUTTON:
|
||||
case SCAN_CODE_ENTER:
|
||||
if (!strncmp(#editURL,"http:",5)) || (editURL[0]=='/') || (!strncmp(#editURL,"WebView:",9))
|
||||
|
@ -103,12 +103,24 @@ GETKEYII:
|
||||
$shr eax,8
|
||||
}
|
||||
|
||||
|
||||
unsigned char key_ascii;
|
||||
dword key_scancode, key_modifier;
|
||||
int GetKeys()
|
||||
{
|
||||
$mov eax,2
|
||||
$int 0x40
|
||||
$push edx
|
||||
GETKEY:
|
||||
$mov eax,2
|
||||
$int 0x40
|
||||
$cmp eax,1
|
||||
$jne GETKEYI
|
||||
$mov eax,edx
|
||||
$jmp GETKEYII
|
||||
GETKEYI:
|
||||
$mov edx,eax
|
||||
$jmp GETKEY
|
||||
GETKEYII:
|
||||
$pop edx
|
||||
key_ascii = AH;
|
||||
$shr eax,16
|
||||
key_scancode = AL;
|
||||
|
@ -10,10 +10,11 @@
|
||||
struct llist
|
||||
{
|
||||
int x, y, w, h, line_h, text_y;
|
||||
dword font_w, font_h, font_type;
|
||||
int count, visible, first, current, column_max; //visible = row_max
|
||||
int wheel_size;
|
||||
int active;
|
||||
dword font_w, font_h, font_type;
|
||||
byte wheel_size;
|
||||
byte active;
|
||||
byte no_selection;
|
||||
void ClearList();
|
||||
int MouseOver(int xx, yy);
|
||||
int ProcessMouse(int xx, yy);
|
||||
@ -125,7 +126,7 @@ int llist::ProcessKey(dword key)
|
||||
|
||||
int llist::KeyDown()
|
||||
{
|
||||
if (current-first+1<visible)
|
||||
if (current-first+1<visible) && (!no_selection)
|
||||
{
|
||||
if (current + 1 >= count) return 0;
|
||||
current++;
|
||||
@ -146,7 +147,7 @@ int llist::KeyDown()
|
||||
|
||||
int llist::KeyUp()
|
||||
{
|
||||
if (current > first)
|
||||
if (current > first) && (!no_selection)
|
||||
{
|
||||
current--;
|
||||
}
|
||||
|
@ -146,6 +146,7 @@ void MailBoxLoop() {
|
||||
|
||||
mail_list.h = Form.cheight/4;
|
||||
mail_list.ClearList();
|
||||
WB1.list.no_selection = true;
|
||||
SetMailBoxStatus( NULL , NULL);
|
||||
cur_charset = 0;
|
||||
aim = SEND_NSTAT;
|
||||
|
Loading…
Reference in New Issue
Block a user