char *clipdata;
static unsigned char sel_nl[] = SEL_NL;
+ if (count == 0) { /* can't copy zero stuff */
+ MessageBeep(0);
+ break;
+ }
+
size = 0;
for (i = 0; i < count; i++)
size += strlen(events[selitems[i]]) + sizeof(sel_nl);
memcpy(p, sel_nl, sizeof(sel_nl));
p += sizeof(sel_nl);
}
- write_clip(clipdata, size);
- term_deselect();
+ write_clip(clipdata, size, TRUE);
free(clipdata);
}
free(selitems);
+
+ for (i = 0; i < nevents; i++)
+ SendDlgItemMessage(hwnd, IDN_LIST, LB_SETSEL,
+ FALSE, i);
}
}
return 0;
};
/* Used on self-constructed dialogs. */
-void ctlposinit(struct ctlpos *cp, HWND hwnd) {
+static void ctlposinit(struct ctlpos *cp, HWND hwnd) {
RECT r;
cp->hwnd = hwnd;
cp->units = GetWindowLong(hwnd, GWL_USERDATA);
}
/* Used on kosher dialogs. */
-void ctlposinit2(struct ctlpos *cp, HWND hwnd) {
+static void ctlposinit2(struct ctlpos *cp, HWND hwnd) {
RECT r;
cp->hwnd = hwnd;
r.left = r.top = 0;
cp->width = (r.right * 4) / (cp->units & 0xFFFF) - 2*GAPBETWEEN;
}
-void doctl(struct ctlpos *cp, RECT r, char *wclass, int wstyle, int exstyle,
- char *wtext, int wid) {
+static void doctl(struct ctlpos *cp, RECT r,
+ char *wclass, int wstyle, int exstyle,
+ char *wtext, int wid) {
HWND ctl;
/*
* Note nonstandard use of RECT. This is deliberate: by
* Some edit boxes. Each one has a static above it. The percentages
* of the horizontal space are provided.
*/
-void multiedit(struct ctlpos *cp, ...) {
+static void multiedit(struct ctlpos *cp, ...) {
RECT r;
va_list ap;
int percent, xpos;
* needed to line up some 2s and some 3s to look good in the same
* panel).
*/
-void radioline(struct ctlpos *cp, char *text, int id, int nacross, ...) {
+static void radioline(struct ctlpos *cp,
+ char *text, int id, int nacross, ...) {
RECT r;
va_list ap;
int group;
* A set of radio buttons on multiple lines, with a static above
* them.
*/
-void radiobig(struct ctlpos *cp, char *text, int id, ...) {
+static void radiobig(struct ctlpos *cp, char *text, int id, ...) {
RECT r;
va_list ap;
int group;
/*
* A single standalone checkbox.
*/
-void checkbox(struct ctlpos *cp, char *text, int id) {
+static void checkbox(struct ctlpos *cp, char *text, int id) {
RECT r;
r.left = GAPBETWEEN; r.top = cp->ypos;
/*
* A button on the right hand side, with a static to its left.
*/
-void staticbtn(struct ctlpos *cp, char *stext, int sid, char *btext, int bid) {
+static void staticbtn(struct ctlpos *cp, char *stext, int sid,
+ char *btext, int bid) {
const int height = (PUSHBTNHEIGHT > STATICHEIGHT ?
PUSHBTNHEIGHT : STATICHEIGHT);
RECT r;
/*
* An edit control on the right hand side, with a static to its left.
*/
-void staticedit(struct ctlpos *cp, char *stext, int sid, int eid) {
+static void staticedit(struct ctlpos *cp, char *stext, int sid, int eid) {
const int height = (EDITHEIGHT > STATICHEIGHT ?
EDITHEIGHT : STATICHEIGHT);
RECT r;
/*
* A tab-control substitute when a real tab control is unavailable.
*/
-void ersatztab(struct ctlpos *cp, char *stext, int sid, int lid, int s2id) {
+static void ersatztab(struct ctlpos *cp, char *stext, int sid,
+ int lid, int s2id) {
const int height = (COMBOHEIGHT > STATICHEIGHT ?
COMBOHEIGHT : STATICHEIGHT);
RECT r;
* A static line, followed by an edit control on the left hand side
* and a button on the right.
*/
-void editbutton(struct ctlpos *cp, char *stext, int sid,
- int eid, char *btext, int bid) {
+static void editbutton(struct ctlpos *cp, char *stext, int sid,
+ int eid, char *btext, int bid) {
const int height = (EDITHEIGHT > PUSHBTNHEIGHT ?
EDITHEIGHT : PUSHBTNHEIGHT);
RECT r;
* that a list box. To the right of the list box, a column of
* buttons.
*/
-void sesssaver(struct ctlpos *cp, char *text,
- int staticid, int editid, int listid, ...) {
+static void sesssaver(struct ctlpos *cp, char *text,
+ int staticid, int editid, int listid, ...) {
RECT r;
va_list ap;
int lwid, rwid, rpos;
doctl(cp, r, "EDIT",
WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL,
WS_EX_CLIENTEDGE,
- "", staticid);
+ "", editid);
/*
* The buttons (we should hold off on the list box until we
* static line first; then a pair of edit boxes with associated
* statics, and two buttons; then a list box.
*/
-void envsetter(struct ctlpos *cp, char *stext, int sid,
- char *e1stext, int e1sid, int e1id,
- char *e2stext, int e2sid, int e2id,
- int listid, char *b1text, int b1id, char *b2text, int b2id) {
+static void envsetter(struct ctlpos *cp, char *stext, int sid,
+ char *e1stext, int e1sid, int e1id,
+ char *e2stext, int e2sid, int e2id,
+ int listid,
+ char *b1text, int b1id, char *b2text, int b2id) {
RECT r;
const int height = (STATICHEIGHT > EDITHEIGHT && STATICHEIGHT > PUSHBTNHEIGHT ?
STATICHEIGHT :
* static, then a list, then a line containing a
* button-and-static-and-edit.
*/
-void charclass(struct ctlpos *cp, char *stext, int sid, int listid,
- char *btext, int bid, int eid, char *s2text, int s2id) {
+static void charclass(struct ctlpos *cp, char *stext, int sid, int listid,
+ char *btext, int bid, int eid, char *s2text, int s2id) {
RECT r;
const int height = (STATICHEIGHT > EDITHEIGHT && STATICHEIGHT > PUSHBTNHEIGHT ?
STATICHEIGHT :
* then on the left, a list box, and on the right, a sequence of
* two-part statics followed by a button.
*/
-void colouredit(struct ctlpos *cp, char *stext, int sid, int listid,
- char *btext, int bid, ...) {
+static void colouredit(struct ctlpos *cp, char *stext, int sid, int listid,
+ char *btext, int bid, ...) {
RECT r;
int y;
va_list ap;
multiedit(&cp,
"Host &Name", IDC_HOSTSTATIC, IDC_HOST, 75,
"&Port", IDC_PORTSTATIC, IDC_PORT, 25, NULL);
- radioline(&cp, "Protocol:", IDC_PROTSTATIC, 3,
- "&Raw", IDC_PROTRAW,
- "&Telnet", IDC_PROTTELNET,
+ if (backends[2].backend == NULL) {
+ /* this is PuTTYtel, so only two protocols available */
+ radioline(&cp, "Protocol:", IDC_PROTSTATIC, 3,
+ "&Raw", IDC_PROTRAW,
+ "&Telnet", IDC_PROTTELNET, NULL);
+ } else {
+ radioline(&cp, "Protocol:", IDC_PROTSTATIC, 3,
+ "&Raw", IDC_PROTRAW,
+ "&Telnet", IDC_PROTTELNET,
#ifdef FWHACK
- "SS&H/hack",
+ "SS&H/hack",
#else
- "SS&H",
+ "SS&H",
#endif
- IDC_PROTSSH, NULL);
+ IDC_PROTSSH, NULL);
+ }
sesssaver(&cp, "Stor&ed Sessions",
IDC_SESSSTATIC, IDC_SESSEDIT, IDC_SESSLIST,
"&Load", IDC_SESSLOAD,