mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-06-30 11:02:48 -05:00
Platform-independent support for zooming around session list by typing
in the session name box. Thwarted on Unix by GTK not automatically scrolling the listbox to the selected item, but we can fix that in the platform-specific side later. [originally from svn r6337]
This commit is contained in:
16
config.c
16
config.c
@ -350,9 +350,25 @@ static void sessionsaver_handler(union control *ctrl, void *dlg,
|
|||||||
dlg_update_done(ctrl, dlg);
|
dlg_update_done(ctrl, dlg);
|
||||||
}
|
}
|
||||||
} else if (event == EVENT_VALCHANGE) {
|
} else if (event == EVENT_VALCHANGE) {
|
||||||
|
int top, bottom, halfway, i;
|
||||||
if (ctrl == ssd->editbox) {
|
if (ctrl == ssd->editbox) {
|
||||||
dlg_editbox_get(ctrl, dlg, savedsession,
|
dlg_editbox_get(ctrl, dlg, savedsession,
|
||||||
SAVEDSESSION_LEN);
|
SAVEDSESSION_LEN);
|
||||||
|
top = ssd->sesslist.nsessions;
|
||||||
|
bottom = -1;
|
||||||
|
while (top-bottom > 1) {
|
||||||
|
halfway = (top+bottom)/2;
|
||||||
|
i = strcmp(savedsession, ssd->sesslist.sessions[halfway]);
|
||||||
|
if (i <= 0 ) {
|
||||||
|
top = halfway;
|
||||||
|
} else {
|
||||||
|
bottom = halfway;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (top == ssd->sesslist.nsessions) {
|
||||||
|
top -= 1;
|
||||||
|
}
|
||||||
|
dlg_listbox_select(ssd->listbox, dlg, top);
|
||||||
}
|
}
|
||||||
} else if (event == EVENT_ACTION) {
|
} else if (event == EVENT_ACTION) {
|
||||||
if (!ssd->midsession &&
|
if (!ssd->midsession &&
|
||||||
|
Reference in New Issue
Block a user