Support for Windows PuTTY connecting straight to a local serial port
[u/mdw/putty] / dialog.h
index fc1dd41..a695c85 100644 (file)
--- a/dialog.h
+++ b/dialog.h
@@ -51,6 +51,11 @@ enum {
  */
 typedef union { void *p; int i; } intorptr;
 
+#ifndef INLINE
+intorptr I(int i);
+intorptr P(void *p);
+#endif
+
 #if defined DEFINE_INTORPTR_FNS || defined INLINE
 #ifdef INLINE
 #define PREFIX INLINE
@@ -60,9 +65,6 @@ typedef union { void *p; int i; } intorptr;
 PREFIX intorptr I(int i) { intorptr ret; ret.i = i; return ret; }
 PREFIX intorptr P(void *p) { intorptr ret; ret.p = p; return ret; }
 #undef PREFIX
-#else
-intorptr I(int i);
-intorptr P(void *p);
 #endif
 
 /*
@@ -280,6 +282,11 @@ union control {
         * Return even if it doesn't have the input focus.
         */
        int isdefault;
+       /*
+        * Also, the reverse of this: a default cancel-type button,
+        * which is implicitly pressed when you hit Escape.
+        */
+       int iscancel;
     } button;
     struct {
        STANDARD_PREFIX;
@@ -298,9 +305,16 @@ union control {
         */
        int draglist;
        /*
-        * If this is set, the list can have more than one element
-        * selected at a time. This is not guaranteed to work on a
-        * drop-down list, so don't try it!
+        * If this is non-zero, the list can have more than one
+        * element selected at a time. This is not guaranteed to
+        * work on a drop-down list, so don't try it!
+        * 
+        * Different non-zero values request slightly different
+        * types of multi-selection (this may well be meaningful
+        * only in GTK, so everyone else can ignore it if they
+        * want). 1 means the list box expects to have individual
+        * items selected, whereas 2 means it expects the user to
+        * want to select a large contiguous range at a time.
         */
        int multisel;
        /*
@@ -573,8 +587,8 @@ void dlg_listbox_add(union control *ctrl, void *dlg, char const *text);
  * strings in any listbox then you MUST not assign them different
  * IDs and expect to get meaningful results back.
  */
-void dlg_listbox_addwithindex(union control *ctrl, void *dlg,
-                             char const *text, int id);
+void dlg_listbox_addwithid(union control *ctrl, void *dlg,
+                          char const *text, int id);
 int dlg_listbox_getid(union control *ctrl, void *dlg, int index);
 /* dlg_listbox_index returns <0 if no single element is selected. */
 int dlg_listbox_index(union control *ctrl, void *dlg);
@@ -597,11 +611,16 @@ void dlg_update_done(union control *ctrl, void *dlg);
  */
 void dlg_set_focus(union control *ctrl, void *dlg);
 /*
- * Return the `ctrl' structure for the control that had the input
- * focus before this one. This is NOT GUARANTEED to work on all
- * platforms, so don't base any critical functionality on it!
+ * Change the label text on a control.
+ */
+void dlg_label_change(union control *ctrl, void *dlg, char const *text);
+/*
+ * Return the `ctrl' structure for the most recent control that had
+ * the input focus apart from the one mentioned. This is NOT
+ * GUARANTEED to work on all platforms, so don't base any critical
+ * functionality on it!
  */
-union control *dlg_last_focused(void *dlg);
+union control *dlg_last_focused(union control *ctrl, void *dlg);
 /*
  * During event processing, you might well want to give an error
  * indication to the user. dlg_beep() is a quick and easy generic