From ddb2fad7b7e66a653592a5844d06e32b2b7dd939 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Fri, 12 Oct 2001 01:28:38 +0000 Subject: Patch from John to allow double-clicking in autocompletion lists on GTK+. --- include/Platform.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'include/Platform.h') diff --git a/include/Platform.h b/include/Platform.h index 74de63174..6d37799e7 100644 --- a/include/Platform.h +++ b/include/Platform.h @@ -332,6 +332,11 @@ public: } }; +/** + * A simple callback action passing one piece of untyped user data. + */ +typedef void (*CallBackAction)(void*); + /** * Class to hide the details of window manipulation. * Does not own the window which will normally have a longer life than this object. @@ -373,7 +378,9 @@ public: /** * Listbox management. */ + class ListBox : public Window { +private: #if PLAT_GTK WindowID list; WindowID scroller; @@ -382,6 +389,9 @@ class ListBox : public Window { int desiredVisibleRows; unsigned int maxItemCharacters; unsigned int aveCharWidth; +public: + CallBackAction doubleClickAction; + void *doubleClickActionData; public: ListBox(); virtual ~ListBox(); @@ -398,6 +408,10 @@ public: int Find(const char *prefix); void GetValue(int n, char *value, int len); void Sort(); + void SetDoubleClickAction(CallBackAction action, void *data) { + doubleClickAction = action; + doubleClickActionData = data; + } }; /** -- cgit v1.2.3