public inbox for cygwin-apps-cvs@sourceware.org
help / color / mirror / Atom feed
* [setup - the official Cygwin setup program used to install Cygwin and keep it up to date] branch master, updated. release_2.874-6-g1c1913d
@ 2016-08-02 9:18 corinna
0 siblings, 0 replies; only message in thread
From: corinna @ 2016-08-02 9:18 UTC (permalink / raw)
To: cygwin-apps-cvs
https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=1c1913d10e0af982006cfef9f560884a3a52dedf
commit 1c1913d10e0af982006cfef9f560884a3a52dedf
Author: Ronald Ramos <ronjoe223@gmail.com>
Date: Mon Aug 1 23:17:22 2016 -0400
(Usability improvement) Implement half-second wait for user to finish typing before searching packages
commit 357c1e7576586349efb8514dc9d8d03950e225ee
Author: Ronald Ramos <ronjoe223@gmail.com>
Date: Mon Aug 1 23:05:44 2016 -0400
* proppage.h (PropertyPage)
New member OnTimerMessage (delegates similarly to OnMouseWheel)
* proppage.cc
(DialogProc) Added handling of WM_TIMER
* choose.h (ChooserPage)
(OnTimerMessage) New function prototype
(timer_id) New member variable
Added DEFINE-ed default values for timer_id and search timer delay
Reorganized private members for consistency
* choose.cc
(constructor) Initialize timer_id
(OnMessageCmd) Replaced search-refresh with a SetTimer
(OnSearchTimer) New; contains search-refresh removed from OnMessageCmd
https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=80abe8995e0afa81fca807eac5aa01a16d9347e4
commit 80abe8995e0afa81fca807eac5aa01a16d9347e4
Author: Ronald Ramos <ronjoe223@gmail.com>
Date: Mon Aug 1 20:24:34 2016 -0400
README: Fixed mailing list address (typo)
commit 5d7c3beee3317926eb3256dd7a1bed8f55a6952b
Author: Ronald Ramos <ronjoe223@gmail.com>
Date: Mon Aug 1 20:21:47 2016 -0400
* README: Fixed which mailing list this app belongs to
Diff:
---
README | 2 +-
choose.cc | 31 +++++++++++++++++++++++--------
choose.h | 14 ++++++++++++--
proppage.cc | 12 +++++++++++-
proppage.h | 2 ++
5 files changed, 49 insertions(+), 12 deletions(-)
diff --git a/README b/README
index 9ad78b6..a05b18f 100644
--- a/README
+++ b/README
@@ -70,7 +70,7 @@ Follow the general directions given in the Cygwin contributions document:
The appropriate mailing list for this project is cygwin-apps
(rather than cygwin-patches). Thus, the appropriate final command would be:
- $ git send-email --to="cygwin-patches@cygwin.com"
+ $ git send-email --to="cygwin-apps@cygwin.com"
WISHLIST:
diff --git a/choose.cc b/choose.cc
index 42d8b74..106ac81 100644
--- a/choose.cc
+++ b/choose.cc
@@ -92,7 +92,8 @@ static ControlAdjuster::ControlInfo ChooserControlsInfo[] = {
};
ChooserPage::ChooserPage () :
- cmd_show_set (false), saved_geom (false), saw_geom_change (false)
+ cmd_show_set (false), saved_geom (false), saw_geom_change (false),
+ timer_id (DEFAULT_TIMER_ID)
{
sizeProcessor.AddControlInfo (ChooserControlsInfo);
@@ -382,9 +383,7 @@ ChooserPage::OnMessageCmd (int id, HWND hwndctl, UINT code)
{
if (code == EN_CHANGE && id == IDC_CHOOSE_SEARCH_EDIT)
{
- std::string value (egetString (GetHWND (), IDC_CHOOSE_SEARCH_EDIT));
- chooser->SetPackageFilter (value);
- chooser->refresh ();
+ SetTimer(GetHWND (), timer_id, SEARCH_TIMER_DELAY, (TIMERPROC) NULL);
return true;
}
else if (code != BN_CLICKED && code != EN_CHANGE)
@@ -397,10 +396,10 @@ ChooserPage::OnMessageCmd (int id, HWND hwndctl, UINT code)
{
case IDC_CHOOSE_CLEAR_SEARCH:
{
- std::string value;
- eset (GetHWND (), IDC_CHOOSE_SEARCH_EDIT, value);
- chooser->SetPackageFilter (value);
- chooser->refresh ();
+ std::string value;
+ eset (GetHWND (), IDC_CHOOSE_SEARCH_EDIT, value);
+ chooser->SetPackageFilter (value);
+ chooser->refresh ();
}
break;
@@ -444,3 +443,19 @@ ChooserPage::OnMouseWheel (UINT message, WPARAM wParam, LPARAM lParam)
{
return chooser->WindowProc (message, wParam, lParam);
}
+
+INT_PTR CALLBACK
+ChooserPage::OnTimerMessage (UINT message, WPARAM wParam, LPARAM lparam)
+{
+ if (wParam == timer_id)
+ {
+ std::string value (egetString (GetHWND (), IDC_CHOOSE_SEARCH_EDIT));
+
+ KillTimer (GetHWND (), timer_id);
+ chooser->SetPackageFilter (value);
+ chooser->refresh ();
+ return TRUE;
+ }
+
+ return FALSE;
+}
diff --git a/choose.h b/choose.h
index 9dc5882..46f0f35 100644
--- a/choose.h
+++ b/choose.h
@@ -21,6 +21,9 @@
#include "package_meta.h"
#include "PickView.h"
+#define DEFAULT_TIMER_ID 5 //value doesn't matter, as long as it's unique
+#define SEARCH_TIMER_DELAY 500 //in milliseconds
+
extern bool hasManualSelections;
class ChooserPage:public PropertyPage
@@ -32,6 +35,8 @@ public:
virtual bool OnMessageCmd (int id, HWND hwndctl, UINT code);
virtual INT_PTR CALLBACK OnMouseWheel (UINT message, WPARAM wParam,
LPARAM lParam);
+ virtual INT_PTR CALLBACK OnTimerMessage (UINT message, WPARAM wParam,
+ LPARAM lparam);
bool Create ();
virtual void OnInit ();
@@ -53,20 +58,25 @@ private:
void logOnePackageResult(packagemeta const *aPkg);
void logResults();
void setPrompt(char const *aPrompt);
- PickView *chooser;
+ void PlaceDialog (bool);
+ PickView *chooser;
static HWND ins_dialog;
bool cmd_show_set;
bool saved_geom;
bool saw_geom_change;
WINDOWPLACEMENT window_placement;
WINDOWPLACEMENT pre_chooser_placement;
+ UINT_PTR timer_id;
union writer
{
WINDOWPLACEMENT wp;
UINT wpi[sizeof (WINDOWPLACEMENT) / sizeof (UINT)];
};
- void PlaceDialog (bool);
+
+
+
+
};
#endif /* SETUP_CHOOSE_H */
diff --git a/proppage.cc b/proppage.cc
index 8a63104..c03e5f7 100644
--- a/proppage.cc
+++ b/proppage.cc
@@ -343,7 +343,11 @@ PropertyPage::DialogProc (UINT message, WPARAM wParam, LPARAM lParam)
// to the parent of the window that received the scroll, so it would
// not work to just process this message there.)
return OnMouseWheel (message, wParam, lParam);
- break;
+
+ case WM_TIMER:
+ // similar delegation as with WM_MOUSEWHEEL
+ return OnTimerMessage (message, wParam, lParam);
+
default:
break;
}
@@ -366,6 +370,12 @@ PropertyPage::OnMouseWheel (UINT message, WPARAM wParam, LPARAM lParam)
return 1; // not handled; define in a derived class to support this
}
+INT_PTR CALLBACK
+PropertyPage::OnTimerMessage (UINT message, WPARAM wParam, LPARAM lParam)
+{
+ return 1; // not handled; define in a derived class to support this
+}
+
void
PropertyPage::setTitleFont ()
{
diff --git a/proppage.h b/proppage.h
index 8e2cb40..9424ffc 100644
--- a/proppage.h
+++ b/proppage.h
@@ -82,6 +82,8 @@ protected:
LPARAM lParam);
virtual INT_PTR CALLBACK OnMouseWheel (UINT message, WPARAM wParam,
LPARAM lParam);
+ virtual INT_PTR CALLBACK OnTimerMessage (UINT message, WPARAM wParam,
+ LPARAM lparam);
public:
PropertyPage ();
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-08-02 9:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-02 9:18 [setup - the official Cygwin setup program used to install Cygwin and keep it up to date] branch master, updated. release_2.874-6-g1c1913d corinna
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).