[PATCH] Setup: make "Local Dir" and "Root" dialogs resizeable
Igor Pechtchanski
pechtcha@cs.nyu.edu
Mon Dec 8 04:55:00 GMT 2003
Hi,
I realized it's been a while since I sent a patch to setup to this list,
so here's one that makes the "Root Directory" (IDD_ROOT) and "Local
Package Directory" (IDD_LOCAL_DIR) dialogs resizeable. Unfortunately,
this required a change to resource.h - apologies to setup developers with
slow machines. One caveat to this patch is that it will not resize the
"Install For" and "Default Text File Type" group boxes (although it will
resize the radio buttons inside the boxes)[*]. As usual, the ChangeLog is
below.
Igor
[*] This was done intentionally, in hopes that there will eventually be a
change to ControlAdjuster::ControlInfo::adjust that will loop through
*all* dialog items with a given id. Frank Richter claimed it was possible
(in <http://cygwin.com/ml/cygwin-apps/2003-10/msg00260.html>), but try as
I might searching MSDN and the web, I couldn't figure out how to retrieve
more than one dialog control with a particular id, so any pointers are
appreciated. In the meantime, you can comment out the IDC_ROOT_SYSTEM,
IDC_ROOT_USER, IDC_ROOT_TEXT, and IDC_ROOT_BINARY lines in root.cc to
prevent those controls from moving.
==============================================================================
ChangeLog:
2003-12-07 Igor Pechtchanski <pechtcha@cs.nyu.edu>
* resource.h (IDC_GROUPBOX): New control id.
* res.rc (IDD_ROOT): Change the control id of the group boxes
to IDC_GROUPBOX.
(IDD_LOCAL_DIR): Ditto.
* root.cc (RootControlsInfo): Position specifiers for root dir
selection dialog controls.
* localdir.cc (LocalDirControlsInfo): Position specifiers for
local dir selection dialog controls.
--
http://cs.nyu.edu/~pechtcha/
|\ _,,,---,,_ pechtcha@cs.nyu.edu
ZZZzz /,`.-'`' -. ;-;;,_ igor@watson.ibm.com
|,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D.
'---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow!
"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster." -- Patrick Naughton
-------------- next part --------------
Index: localdir.cc
===================================================================
RCS file: /cvs/cygwin-apps/setup/localdir.cc,v
retrieving revision 2.19
diff -u -p -r2.19 localdir.cc
--- localdir.cc 1 Nov 2003 07:23:47 -0000 2.19
+++ localdir.cc 8 Dec 2003 04:31:32 -0000
@@ -42,11 +42,28 @@ static const char *cvsid =
#include "localdir.h"
#include "UserSettings.h"
+#include "ControlAdjuster.h"
+
#include "getopt++/StringOption.h"
#include "threebar.h"
extern ThreeBarProgressPage Progress;
extern LogFile * theLog;
+
+/*
+ Sizing information.
+ */
+static ControlAdjuster::ControlInfo LocalDirControlsInfo[] = {
+ {IDC_LOCAL_DIR, CP_STRETCH, CP_TOP},
+ {IDC_LOCAL_DIR_BROWSE, CP_RIGHT, CP_TOP},
+ {IDC_GROUPBOX, CP_STRETCH, CP_TOP},
+ {0, CP_LEFT, CP_TOP}
+};
+
+LocalDirPage::LocalDirPage ()
+{
+ sizeProcessor.AddControlInfo (LocalDirControlsInfo);
+}
static StringOption LocalDirOption ("", 'l', "local-package-dir", "Local package directory", false);
Index: localdir.h
===================================================================
RCS file: /cvs/cygwin-apps/setup/localdir.h,v
retrieving revision 2.6
diff -u -p -r2.6 localdir.h
--- localdir.h 27 Jul 2003 10:29:53 -0000 2.6
+++ localdir.h 8 Dec 2003 04:31:32 -0000
@@ -25,9 +25,7 @@
class LocalDirPage:public PropertyPage
{
public:
- LocalDirPage ()
- {
- };
+ LocalDirPage ();
virtual ~ LocalDirPage ()
{
};
Index: res.rc
===================================================================
RCS file: /cvs/cygwin-apps/setup/res.rc,v
retrieving revision 2.54
diff -u -p -r2.54 res.rc
--- res.rc 1 Nov 2003 07:23:47 -0000 2.54
+++ res.rc 8 Dec 2003 04:31:32 -0000
@@ -81,7 +81,7 @@ FONT 8, "MS Shell Dlg"
BEGIN
EDITTEXT IDC_LOCAL_DIR,58,83,165,15,ES_AUTOHSCROLL | WS_GROUP
PUSHBUTTON "B&rowse...",IDC_LOCAL_DIR_BROWSE,223,83,34,14
- GROUPBOX "Local Package Directory",IDC_STATIC,53,67,210,45
+ GROUPBOX "Local Package Directory",IDC_GROUPBOX,53,67,210,45
ICON IDI_CYGWIN,IDC_HEADICON,290,0,21,20
CONTROL "",IDC_HEADSEPARATOR,"Static",SS_BLACKFRAME | SS_SUNKEN,0,28,
317,1
@@ -96,9 +96,9 @@ STYLE DS_MODALFRAME | DS_CENTER | WS_CHI
CAPTION "Cygwin Setup - Choose Installation Directory"
FONT 8, "MS Shell Dlg"
BEGIN
- GROUPBOX "Root Directory",IDC_STATIC,5,50,305,40,WS_TABSTOP
- GROUPBOX "Install For",IDC_STATIC,5,105,150,50,WS_TABSTOP
- GROUPBOX "Default Text File Type",IDC_STATIC,160,105,150,50
+ GROUPBOX "Root Directory",IDC_GROUPBOX,5,50,305,40,WS_TABSTOP
+ GROUPBOX "Install For",IDC_GROUPBOX,5,105,150,50,WS_TABSTOP
+ GROUPBOX "Default Text File Type",IDC_GROUPBOX,160,105,150,50
EDITTEXT IDC_ROOT_DIR,15,65,245,15,ES_AUTOHSCROLL | WS_GROUP
PUSHBUTTON "B&rowse...",IDC_ROOT_BROWSE,260,65,44,14
CONTROL "&All Users",IDC_ROOT_SYSTEM,"Button",BS_AUTORADIOBUTTON |
Index: resource.h
===================================================================
RCS file: /cvs/cygwin-apps/setup/resource.h,v
retrieving revision 2.23
diff -u -p -r2.23 resource.h
--- resource.h 26 Oct 2003 19:38:30 -0000 2.23
+++ resource.h 8 Dec 2003 04:31:32 -0000
@@ -124,6 +124,7 @@
#define IDS_SKIP_PACKAGE 1071
#define IDC_HEADICON 1072
#define IDC_HEADSEPARATOR 1073
+#define IDC_GROUPBOX 1074
#define IDC_STATIC -1
// Next default values for new objects
Index: root.cc
===================================================================
RCS file: /cvs/cygwin-apps/setup/root.cc,v
retrieving revision 2.15
diff -u -p -r2.15 root.cc
--- root.cc 29 Jul 2003 14:14:06 -0000 2.15
+++ root.cc 8 Dec 2003 04:31:40 -0000
@@ -36,9 +36,30 @@ static const char *cvsid =
#include "log.h"
#include "root.h"
+#include "ControlAdjuster.h"
+
#include "getopt++/StringOption.h"
using namespace std;
+
+/*
+ Sizing information.
+ */
+static ControlAdjuster::ControlInfo RootControlsInfo[] = {
+ {IDC_ROOT_DIR, CP_STRETCH, CP_TOP},
+ {IDC_ROOT_BROWSE, CP_RIGHT, CP_TOP},
+ {IDC_ROOT_SYSTEM, CP_CENTERED, CP_TOP},
+ {IDC_ROOT_USER, CP_CENTERED, CP_TOP},
+ {IDC_ROOT_TEXT, CP_CENTERED, CP_TOP},
+ {IDC_ROOT_BINARY, CP_CENTERED, CP_TOP},
+ {IDC_GROUPBOX, CP_STRETCH, CP_TOP},
+ {0, CP_LEFT, CP_TOP}
+};
+
+RootPage::RootPage ()
+{
+ sizeProcessor.AddControlInfo (RootControlsInfo);
+}
StringOption RootOption ("", 'R', "root", "Root installation directory", false);
Index: root.h
===================================================================
RCS file: /cvs/cygwin-apps/setup/root.h,v
retrieving revision 2.5
diff -u -p -r2.5 root.h
--- root.h 29 Jul 2003 14:14:06 -0000 2.5
+++ root.h 8 Dec 2003 04:31:40 -0000
@@ -6,9 +6,7 @@
class RootPage:public PropertyPage
{
public:
- RootPage ()
- {
- };
+ RootPage ();
virtual ~ RootPage ()
{
};
More information about the Cygwin-apps
mailing list