summaryrefslogtreecommitdiffabout
authorMichael Krelin <hacker@klever.net>2006-02-03 01:05:14 (UTC)
committer Michael Krelin <hacker@klever.net>2006-02-03 01:05:14 (UTC)
commit51d59e6f7f45b8f4a60d2933e50bb8ee0c2ea20d (patch) (unidiff)
treea6693752131aaa39e56ebbca841179a8df4230ef
parenta772d9f284b4c2a909c30ea33a132a487d932600 (diff)
downloadpumpkin-51d59e6f7f45b8f4a60d2933e50bb8ee0c2ea20d.zip
pumpkin-51d59e6f7f45b8f4a60d2933e50bb8ee0c2ea20d.tar.gz
pumpkin-51d59e6f7f45b8f4a60d2933e50bb8ee0c2ea20d.tar.bz2
made main window resizable
git-svn-id: http://svn.klever.net/kin/pumpkin/trunk@146 fe716a7a-6dde-0310-88d9-d003556173a8
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--PumpKINDlg.cpp84
-rw-r--r--PumpKINDlg.h13
-rw-r--r--help/pumpkin.rtf1
-rw-r--r--help/pumpkin.xml1
-rw-r--r--pumpkin.clw12
-rw-r--r--pumpkin.mak76
-rw-r--r--pumpkin.rc10
7 files changed, 124 insertions, 73 deletions
diff --git a/PumpKINDlg.cpp b/PumpKINDlg.cpp
index 4cb1633..9786ef0 100644
--- a/PumpKINDlg.cpp
+++ b/PumpKINDlg.cpp
@@ -131,2 +131,6 @@ void CPumpKINDlg::DoDataExchange(CDataExchange* pDX)
131 //{{AFX_DATA_MAP(CPumpKINDlg) 131 //{{AFX_DATA_MAP(CPumpKINDlg)
132 DDX_Control(pDX, ID_HELP, m_HelpCtl);
133 DDX_Control(pDX, IDC_PUT, m_PutCtl);
134 DDX_Control(pDX, IDC_GET, m_GetCtl);
135 DDX_Control(pDX, IDC_EXIT, m_ExitCtl);
132 DDX_Control(pDX, IDC_LISTENING, m_ListenCtl); 136 DDX_Control(pDX, IDC_LISTENING, m_ListenCtl);
@@ -158,2 +162,3 @@ BEGIN_MESSAGE_MAP(CPumpKINDlg, CDialog)
158 ON_COMMAND(ID_TRAY_SHOWPUMPKINWINDOW, OnTrayShowpumpkinwindow) 162 ON_COMMAND(ID_TRAY_SHOWPUMPKINWINDOW, OnTrayShowpumpkinwindow)
163 ON_COMMAND(ID_TRAY_LISTEN, OnTrayListen)
159 ON_COMMAND(ID_TRAY_EXIT, OnTrayExit) 164 ON_COMMAND(ID_TRAY_EXIT, OnTrayExit)
@@ -170,3 +175,4 @@ BEGIN_MESSAGE_MAP(CPumpKINDlg, CDialog)
170 ON_BN_CLICKED(IDC_LISTENING, OnListening) 175 ON_BN_CLICKED(IDC_LISTENING, OnListening)
171 ON_COMMAND(ID_TRAY_LISTEN, OnTrayListen) 176 ON_WM_GETMINMAXINFO()
177 ON_WM_SIZE()
172 //}}AFX_MSG_MAP 178 //}}AFX_MSG_MAP
@@ -203,3 +209,2 @@ BOOL CPumpKINDlg::OnInitDialog()
203 209
204
205 m_Images.Create(16,16,TRUE,2,1); 210 m_Images.Create(16,16,TRUE,2,1);
@@ -227,2 +232,16 @@ CRect listrc;
227 232
233CRect wrci, wrco;
234 GetWindowRect(&wrco);
235 GetClientRect(&wrci);
236CRect brc;
237 m_GetCtl.GetWindowRect(&brc); ScreenToClient(&brc);
238 m_rightGapButtons = wrci.right-brc.right;
239 m_List.GetWindowRect(&brc); ScreenToClient(&brc);
240 m_rightGapList = wrci.right-brc.right;
241 m_ListenCtl.GetWindowRect(&brc); ScreenToClient(&brc);
242 m_bottomGapListen = wrci.bottom-brc.bottom;
243 m_Log.GetWindowRect(&brc);ScreenToClient(&brc);
244 m_bottomGapLog = wrci.bottom-brc.bottom;
245 m_MinSize.cx = wrco.Width(); m_MinSize.cy=wrco.Height();
246
228CRect rc, drc; 247CRect rc, drc;
@@ -2079 +2098,62 @@ void CPumpKINDlg::LogLine(LPCTSTR str)
2079} 2098}
2099
2100void CPumpKINDlg::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI)
2101{
2102 CDialog::OnGetMinMaxInfo(lpMMI);
2103 if(m_MinSize.cx>0 && m_MinSize.cy>0){
2104 lpMMI->ptMinTrackSize.x = m_MinSize.cx;
2105 lpMMI->ptMinTrackSize.y = m_MinSize.cy;
2106 }
2107}
2108
2109void CPumpKINDlg::OnSize(UINT nType, int cx, int cy)
2110{
2111 CDialog::OnSize(nType, cx, cy);
2112 if(nType==SIZE_RESTORED)
2113 RecalcLayout(cx,cy);
2114}
2115
2116void CPumpKINDlg::RecalcLayout(int,int)
2117{
2118 CRect wrc;
2119 GetClientRect(&wrc);
2120 AdjustButton(m_GetCtl,wrc);
2121 AdjustButton(m_PutCtl,wrc);
2122 AdjustButton(m_AbortCtl,wrc);
2123 AdjustButton(m_HelpCtl,wrc);
2124 AdjustButton(m_ExitCtl,wrc);
2125 AdjustButton(m_OptionsCtl,wrc);
2126 CRect brc;
2127 m_List.GetWindowRect(&brc); ScreenToClient(&brc);
2128 m_List.SetWindowPos(
2129 0,
2130 brc.left, brc.top,
2131 wrc.right-m_rightGapList-brc.left, brc.bottom-brc.top,
2132 SWP_NOACTIVATE|SWP_NOOWNERZORDER|SWP_NOZORDER|SWP_NOCOPYBITS );
2133 m_Log.GetWindowRect(&brc); ScreenToClient(&brc);
2134 m_Log.SetWindowPos(
2135 0,
2136 brc.left, brc.top,
2137 wrc.right-m_rightGapButtons-brc.left, wrc.bottom-m_bottomGapLog-brc.top,
2138 SWP_NOACTIVATE|SWP_NOOWNERZORDER|SWP_NOZORDER|SWP_NOCOPYBITS );
2139 m_ListenCtl.GetWindowRect(&brc); ScreenToClient(&brc);
2140 m_ListenCtl.SetWindowPos(
2141 0,
2142 wrc.right-brc.Width()-m_rightGapButtons, wrc.bottom-brc.Height()-m_bottomGapListen,
2143 0,0,
2144 SWP_NOACTIVATE|SWP_NOOWNERZORDER|SWP_NOSIZE|SWP_NOZORDER|SWP_NOCOPYBITS );
2145 int i = m_Log.GetCount();
2146 if(i!=LB_ERR)
2147 m_Log.SetCurSel(i-1);
2148}
2149
2150void CPumpKINDlg::AdjustButton(CWnd& w,CRect& wrc)
2151{
2152 CRect brc;
2153 w.GetWindowRect(&brc); ScreenToClient(&brc);
2154 w.SetWindowPos(
2155 0,
2156 wrc.right-brc.Width()-m_rightGapButtons, brc.top,
2157 0, 0,
2158 SWP_NOACTIVATE|SWP_NOOWNERZORDER|SWP_NOSIZE|SWP_NOZORDER|SWP_NOCOPYBITS );
2159}
diff --git a/PumpKINDlg.h b/PumpKINDlg.h
index b247c56..c5469f1 100644
--- a/PumpKINDlg.h
+++ b/PumpKINDlg.h
@@ -369,2 +369,9 @@ class CPumpKINDlg : public CDialog
369public: 369public:
370 void AdjustButton(CWnd& w,CRect& wrc);
371 void RecalcLayout(int,int);
372 CSize m_MinSize;
373 UINT m_bottomGapLog;
374 UINT m_bottomGapListen;
375 UINT m_rightGapList;
376 UINT m_rightGapButtons;
370 CString m_lastlogerr; 377 CString m_lastlogerr;
@@ -432,2 +439,6 @@ public:
432 enum { IDD = IDD_PUMPKIN_DIALOG }; 439 enum { IDD = IDD_PUMPKIN_DIALOG };
440 CButtonm_HelpCtl;
441 CButtonm_PutCtl;
442 CButtonm_GetCtl;
443 CButtonm_ExitCtl;
433 CButtonm_ListenCtl; 444 CButtonm_ListenCtl;
@@ -484,2 +495,4 @@ protected:
484 afx_msg void OnListening(); 495 afx_msg void OnListening();
496 afx_msg void OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI);
497 afx_msg void OnSize(UINT nType, int cx, int cy);
485 //}}AFX_MSG 498 //}}AFX_MSG
diff --git a/help/pumpkin.rtf b/help/pumpkin.rtf
index abdca4f..505cbf2 100644
--- a/help/pumpkin.rtf
+++ b/help/pumpkin.rtf
@@ -34,2 +34,3 @@ ${\footnote What's New}
34\par\pard\plain\fi0\li0\f1\fs18 \bullet Logging to file 34\par\pard\plain\fi0\li0\f1\fs18 \bullet Logging to file
35\par\pard\plain\fi0\li0\f1\fs18 \bullet Resizable main window
35\par\pard\plain\f1\fs24\qc\cf2\b 2.6 - August 6th, 2005 36\par\pard\plain\f1\fs24\qc\cf2\b 2.6 - August 6th, 2005
diff --git a/help/pumpkin.xml b/help/pumpkin.xml
index 46e3bbc..5c951bb 100644
--- a/help/pumpkin.xml
+++ b/help/pumpkin.xml
@@ -15,2 +15,3 @@
15 <ni>Logging to file</ni> 15 <ni>Logging to file</ni>
16 <ni>Resizable main window</ni>
16 </newsfor> 17 </newsfor>
diff --git a/pumpkin.clw b/pumpkin.clw
index 5344bfd..213d8c1 100644
--- a/pumpkin.clw
+++ b/pumpkin.clw
@@ -4,3 +4,3 @@
4Version=1 4Version=1
5LastClass=CPropsServer 5LastClass=CPumpKINDlg
6LastTemplate=CComboBox 6LastTemplate=CComboBox
@@ -18,3 +18,3 @@ Resource2=IDD_PROPS_NETWORK
18Resource3=IDD_CONFIRM_RRQ 18Resource3=IDD_CONFIRM_RRQ
19Resource4=IDD_ABOUTBOX 19Resource4=IDD_PROPS_SERVER
20Class4=CPropsServer 20Class4=CPropsServer
@@ -25,3 +25,3 @@ Class6=CConfirmRRQDlg
25Class7=CConfirmWRQDlg 25Class7=CConfirmWRQDlg
26Resource7=IDD_PUMPKIN_DIALOG 26Resource7=IDD_ABOUTBOX
27Class8=CRequestDlg 27Class8=CRequestDlg
@@ -35,3 +35,3 @@ Class13=CPropsACL
35Class14=CACLTargetCombo 35Class14=CACLTargetCombo
36Resource10=IDD_PROPS_SERVER 36Resource10=IDD_PUMPKIN_DIALOG
37 37
@@ -82,3 +82,3 @@ Control6=IDC_EXIT,button,1342259200
82Control7=ID_HELP,button,1342259200 82Control7=ID_HELP,button,1342259200
83Control8=IDC_LOG,listbox,1353728129 83Control8=IDC_LOG,listbox,1353728385
84Control9=IDCANCEL,button,1073741824 84Control9=IDCANCEL,button,1073741824
@@ -136,3 +136,3 @@ Filter=D
136VirtualFilter=idWC 136VirtualFilter=idWC
137LastObject=IDC_LOGFILE_BROWSE 137LastObject=CPropsServer
138 138
diff --git a/pumpkin.mak b/pumpkin.mak
index 7d2ec22..a22a6fa 100644
--- a/pumpkin.mak
+++ b/pumpkin.mak
@@ -40,3 +40,3 @@ NULL=nul
40# Begin Project 40# Begin Project
41# PROP Target_Last_Scanned "Install - Win32 Canned" 41# PROP Target_Last_Scanned "PumpKIN - Win32 Debug"
42CPP=cl.exe 42CPP=cl.exe
@@ -708,2 +708,3 @@ DEP_CPP_PUMPK=\
708 ".\PumpKINDlg.h"\ 708 ".\PumpKINDlg.h"\
709 ".\shared-code\BellsNWhistles.h"\
709 ".\shared-code\kHelpers.h"\ 710 ".\shared-code\kHelpers.h"\
@@ -740,5 +741,2 @@ DEP_CPP_PUMPK=\
740SOURCE=.\PumpKINDlg.cpp 741SOURCE=.\PumpKINDlg.cpp
741
742!IF "$(CFG)" == "PumpKIN - Win32 Release"
743
744DEP_CPP_PUMPKI=\ 742DEP_CPP_PUMPKI=\
@@ -762,2 +760,5 @@ DEP_CPP_PUMPKI=\
762 760
761!IF "$(CFG)" == "PumpKIN - Win32 Release"
762
763
763"$(INTDIR)\PumpKINDlg.obj" : $(SOURCE) $(DEP_CPP_PUMPKI) "$(INTDIR)"\ 764"$(INTDIR)\PumpKINDlg.obj" : $(SOURCE) $(DEP_CPP_PUMPKI) "$(INTDIR)"\
@@ -768,20 +769,2 @@ DEP_CPP_PUMPKI=\
768 769
769DEP_CPP_PUMPKI=\
770 ".\ACLTargetCombo.h"\
771 ".\ConfirmRRQDlg.h"\
772 ".\ConfirmWRQDlg.h"\
773 ".\PropsACL.h"\
774 ".\PropsNetwork.h"\
775 ".\PropsServer.h"\
776 ".\PropsSounds.h"\
777 ".\pumpkin.h"\
778 ".\PumpKINDlg.h"\
779 ".\RequestDlg.h"\
780 ".\Resolver.h"\
781 ".\Retrier.h"\
782 ".\shared-code\BellsNWhistles.h"\
783 ".\shared-code\kHelpers.h"\
784 ".\stdafx.h"\
785 ".\Trayer.h"\
786
787 770
@@ -796,20 +779,2 @@ DEP_CPP_PUMPKI=\
796 779
797DEP_CPP_PUMPKI=\
798 ".\ACLTargetCombo.h"\
799 ".\ConfirmRRQDlg.h"\
800 ".\ConfirmWRQDlg.h"\
801 ".\PropsACL.h"\
802 ".\PropsNetwork.h"\
803 ".\PropsServer.h"\
804 ".\PropsSounds.h"\
805 ".\pumpkin.h"\
806 ".\PumpKINDlg.h"\
807 ".\RequestDlg.h"\
808 ".\Resolver.h"\
809 ".\Retrier.h"\
810 ".\shared-code\BellsNWhistles.h"\
811 ".\shared-code\kHelpers.h"\
812 ".\stdafx.h"\
813 ".\Trayer.h"\
814
815 780
@@ -1043,2 +1008,3 @@ DEP_CPP_PROPS=\
1043 ".\pumpkin.h"\ 1008 ".\pumpkin.h"\
1009 ".\shared-code\BellsNWhistles.h"\
1044 ".\shared-code\kHelpers.h"\ 1010 ".\shared-code\kHelpers.h"\
@@ -1136,2 +1102,3 @@ DEP_CPP_CONFI=\
1136 ".\PumpKINDlg.h"\ 1102 ".\PumpKINDlg.h"\
1103 ".\shared-code\BellsNWhistles.h"\
1137 ".\shared-code\kHelpers.h"\ 1104 ".\shared-code\kHelpers.h"\
@@ -1191,2 +1158,3 @@ DEP_CPP_CONFIR=\
1191 ".\PumpKINDlg.h"\ 1158 ".\PumpKINDlg.h"\
1159 ".\shared-code\BellsNWhistles.h"\
1192 ".\shared-code\kHelpers.h"\ 1160 ".\shared-code\kHelpers.h"\
@@ -1285,2 +1253,3 @@ DEP_CPP_RESOL=\
1285 ".\Resolver.h"\ 1253 ".\Resolver.h"\
1254 ".\shared-code\BellsNWhistles.h"\
1286 ".\shared-code\kHelpers.h"\ 1255 ".\shared-code\kHelpers.h"\
@@ -1340,2 +1309,3 @@ DEP_CPP_RETRI=\
1340 ".\Retrier.h"\ 1309 ".\Retrier.h"\
1310 ".\shared-code\BellsNWhistles.h"\
1341 ".\shared-code\kHelpers.h"\ 1311 ".\shared-code\kHelpers.h"\
@@ -1394,2 +1364,3 @@ DEP_CPP_TRAYE=\
1394 ".\PumpKINDlg.h"\ 1364 ".\PumpKINDlg.h"\
1365 ".\shared-code\BellsNWhistles.h"\
1395 ".\shared-code\kHelpers.h"\ 1366 ".\shared-code\kHelpers.h"\
@@ -1470,2 +1441,3 @@ DEP_CPP_PROPSS=\
1470 ".\PumpKINDlg.h"\ 1441 ".\PumpKINDlg.h"\
1442 ".\shared-code\BellsNWhistles.h"\
1471 ".\shared-code\kHelpers.h"\ 1443 ".\shared-code\kHelpers.h"\
@@ -1503,5 +1475,2 @@ DEP_CPP_PROPSS=\
1503SOURCE=.\PropsACL.cpp 1475SOURCE=.\PropsACL.cpp
1504
1505!IF "$(CFG)" == "PumpKIN - Win32 Release"
1506
1507DEP_CPP_PROPSA=\ 1476DEP_CPP_PROPSA=\
@@ -1516,2 +1485,5 @@ DEP_CPP_PROPSA=\
1516 1485
1486!IF "$(CFG)" == "PumpKIN - Win32 Release"
1487
1488
1517"$(INTDIR)\PropsACL.obj" : $(SOURCE) $(DEP_CPP_PROPSA) "$(INTDIR)"\ 1489"$(INTDIR)\PropsACL.obj" : $(SOURCE) $(DEP_CPP_PROPSA) "$(INTDIR)"\
@@ -1522,10 +1494,2 @@ DEP_CPP_PROPSA=\
1522 1494
1523DEP_CPP_PROPSA=\
1524 ".\ACLTargetCombo.h"\
1525 ".\PropsACL.h"\
1526 ".\pumpkin.h"\
1527 ".\PumpKINDlg.h"\
1528 ".\shared-code\kHelpers.h"\
1529 ".\stdafx.h"\
1530
1531 1495
@@ -1540,11 +1504,2 @@ DEP_CPP_PROPSA=\
1540 1504
1541DEP_CPP_PROPSA=\
1542 ".\ACLTargetCombo.h"\
1543 ".\PropsACL.h"\
1544 ".\pumpkin.h"\
1545 ".\PumpKINDlg.h"\
1546 ".\shared-code\BellsNWhistles.h"\
1547 ".\shared-code\kHelpers.h"\
1548 ".\stdafx.h"\
1549
1550 1505
@@ -1583,2 +1538,3 @@ DEP_CPP_ACLTA=\
1583 ".\PumpKINDlg.h"\ 1538 ".\PumpKINDlg.h"\
1539 ".\shared-code\BellsNWhistles.h"\
1584 ".\shared-code\kHelpers.h"\ 1540 ".\shared-code\kHelpers.h"\
diff --git a/pumpkin.rc b/pumpkin.rc
index 87745db..9933454 100644
--- a/pumpkin.rc
+++ b/pumpkin.rc
@@ -96,4 +96,3 @@ END
96IDD_PUMPKIN_DIALOG DIALOGEX 0, 0, 362, 193 96IDD_PUMPKIN_DIALOG DIALOGEX 0, 0, 362, 193
97STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION | 97STYLE DS_3DLOOK | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
98 WS_SYSMENU
99EXSTYLE WS_EX_ACCEPTFILES | WS_EX_APPWINDOW 98EXSTYLE WS_EX_ACCEPTFILES | WS_EX_APPWINDOW
@@ -115,4 +114,5 @@ BEGIN
115 PUSHBUTTON "&Help",ID_HELP,305,97,50,17,BS_NOTIFY,WS_EX_CLIENTEDGE 114 PUSHBUTTON "&Help",ID_HELP,305,97,50,17,BS_NOTIFY,WS_EX_CLIENTEDGE
116 LISTBOX IDC_LOG,7,115,348,65,LBS_USETABSTOPS | LBS_NOSEL | 115 LISTBOX IDC_LOG,7,115,348,64,LBS_USETABSTOPS |
117 WS_VSCROLL | WS_HSCROLL,WS_EX_DLGMODALFRAME 116 LBS_NOINTEGRALHEIGHT | LBS_NOSEL | WS_VSCROLL |
117 WS_HSCROLL,WS_EX_DLGMODALFRAME
118 PUSHBUTTON "..",IDCANCEL,0,183,6,7,NOT WS_VISIBLE | NOT WS_TABSTOP 118 PUSHBUTTON "..",IDCANCEL,0,183,6,7,NOT WS_VISIBLE | NOT WS_TABSTOP
@@ -120,3 +120,3 @@ BEGIN
120 BS_AUTOCHECKBOX | BS_LEFTTEXT | BS_FLAT | WS_TABSTOP,286, 120 BS_AUTOCHECKBOX | BS_LEFTTEXT | BS_FLAT | WS_TABSTOP,286,
121 180,69,11,WS_EX_TRANSPARENT | WS_EX_STATICEDGE 121 181,69,11,WS_EX_TRANSPARENT | WS_EX_STATICEDGE
122END 122END