Commit bceed4852db3c7733c500dae050546d00489c531

Authored by xiemeng
1 parent 639bea37

简化, 删除一些不必要的窗口

... ... @@ -394,10 +394,7 @@ void CmdDispatch(int iMenuChoice, HWND hwnd, LPARAM lParam)
394 394
395 395 if (!GetOpenFileName(&ofn))
396 396 break;
397   -
398   - dwFreq = GetAFrequency();
399   -
400   - TransferRepeatCreate(szFileName, dwFreq);
  397 + TransferRepeatCreate(szFileName, 3000);
401 398 }
402 399 break;
403 400
... ...
... ... @@ -63,8 +63,8 @@
63 63 #define STARTXWINDOW 80
64 64 #define STARTYWINDOW 70
65 65
66   -#define SETTINGSFACTOR 5
67   -#define STATUSFACTOR 5
  66 +#define SETTINGSFACTOR 2
  67 +#define STATUSFACTOR 2
68 68
69 69 //
70 70 // window timer ids
... ... @@ -220,7 +220,6 @@ void TransferFileTextStart( LPCSTR );
220 220 void TransferFileTextEnd( void );
221 221 // void TransferFileText( LPCTSTR );
222 222 void ReceiveFileText( LPCTSTR );
223   -DWORD GetAFrequency( void );
224 223
225 224 //
226 225 // Buffer manipulation functions
... ...
... ... @@ -53,152 +53,22 @@ BEGIN
53 53 EDITTEXT IDC_OSVERSIONINFO,36,81,104,46,ES_MULTILINE | ES_AUTOHSCROLL | ES_READONLY
54 54 END
55 55
56   -IDD_TOOLBARSETTINGS DIALOGEX 0, 0, 414, 48
  56 +IDD_TOOLBARSETTINGS DIALOGEX 0, 0, 414, 18
57 57 STYLE DS_ABSALIGN | DS_SETFONT | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_BORDER
58 58 FONT 12, "??", 400, 0, 0x0
59 59 BEGIN
60   - COMBOBOX IDC_PORTCOMBO,2,13,48,51,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
61   - COMBOBOX IDC_BAUDCOMBO,168,0,48,64,CBS_DROPDOWNLIST | WS_DISABLED | WS_VSCROLL | WS_TABSTOP
62   - COMBOBOX IDC_PARITYCOMBO,170,13,48,56,CBS_DROPDOWNLIST | WS_DISABLED | WS_VSCROLL | WS_TABSTOP
63   - COMBOBOX IDC_DATABITSCOMBO,217,0,48,48,CBS_DROPDOWNLIST | CBS_SORT | WS_DISABLED | WS_VSCROLL | WS_TABSTOP
64   - COMBOBOX IDC_STOPBITSCOMBO,219,12,48,39,CBS_DROPDOWNLIST | CBS_SORT | WS_DISABLED | WS_VSCROLL | WS_TABSTOP
65   - LTEXT "Port",IDC_STATIC,2,2,17,8
66   - CONTROL "Local Echo",IDC_LOCALECHOCHK,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_DISABLED | WS_TABSTOP,268,0,49,10
67   - CONTROL "Display Errors",IDC_DISPLAYERRORSCHK,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_DISABLED | WS_TABSTOP,268,7,57,10
68   - PUSHBUTTON "Font...",IDC_FONTBTN,10,30,33,14,NOT WS_VISIBLE
69   - PUSHBUTTON "Comm Events...",IDC_COMMEVENTSBTN,47,30,61,14,NOT WS_VISIBLE
70   - CONTROL "CR => CR/LF",IDC_LFBTN,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_DISABLED | WS_TABSTOP,268,14,56,10
71   - CONTROL "Autowrap",IDC_AUTOWRAPCHK,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_DISABLED | WS_TABSTOP,268,21,43,10
72   - PUSHBUTTON "Flow Control...",IDC_FLOWCONTROLBTN,112,30,59,14,NOT WS_VISIBLE
73   - PUSHBUTTON "Timeouts...",IDC_TIMEOUTSBTN,175,30,49,14,NOT WS_VISIBLE
74   - CONTROL "No Reading",IDC_NOREADINGCHK,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_DISABLED | WS_TABSTOP,327,0,53,10
75   - CONTROL "No Writing",IDC_NOWRITINGCHK,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_DISABLED | WS_TABSTOP,327,6,58,10
76   - CONTROL "No Status",IDC_NOSTATUSCHK,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_DISABLED | WS_TABSTOP,327,21,54,10
77   - CONTROL "No Events",IDC_NOEVENTSCHK,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_DISABLED | WS_TABSTOP,327,13,68,10
78   - PUSHBUTTON "连接夹具",IDC_BUTTON_CONNECT_UART,52,11,50,14
79   - PUSHBUTTON "软件路径",IDC_BUTTON2_SEC_BINFILE,109,11,50,14
  60 + COMBOBOX IDC_PORTCOMBO,2,0,48,51,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
  61 + PUSHBUTTON "连接夹具",IDC_BUTTON_CONNECT_UART,52,0,50,14
  62 + PUSHBUTTON "软件路径",IDC_BUTTON2_SEC_BINFILE,109,0,50,14
80 63 END
81 64
82   -IDD_STATUSDIALOG DIALOGEX 0, 0, 460, 48
  65 +IDD_STATUSDIALOG DIALOGEX 0, 0, 448, 19
83 66 STYLE DS_ABSALIGN | DS_SETFONT | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_BORDER
84 67 FONT 8, "MS Sans Serif", 0, 0, 0x0
85 68 BEGIN
86   - PUSHBUTTON "",IDC_ABORTBTN,7,31,60,12,NOT WS_VISIBLE
87   - CONTROL "Generic1",IDC_TRANSFERPROGRESS,"msctls_progress32",NOT WS_VISIBLE | WS_BORDER,75,33,65,6
88   - GROUPBOX "Modem Status",IDC_MODEMSTATUSGRP,2,0,153,25
89   - CONTROL "CTS",IDC_STATCTS,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,5,10,26,10
90   - CONTROL "DSR",IDC_STATDSR,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,35,10,29,10
91   - CONTROL "RING",IDC_STATRING,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,68,10,30,10
92   - CONTROL "RLSD (CD)",IDC_STATRLSD,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,103,10,48,10
93   - GROUPBOX "Comm Status",IDC_STATIC,158,0,164,47,WS_DISABLED
94   - CONTROL "CTS Hold",IDC_CTSHOLDCHK,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,162,10,50,10
95   - CONTROL "DSR Hold",IDC_DSRHOLDCHK,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,162,22,50,10
96   - CONTROL "RLSD Hold",IDC_RLSDHOLDCHK,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,162,34,50,10
97   - CONTROL "XOFF Hold",IDC_XOFFHOLDCHK,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,214,10,48,10
98   - CONTROL "XOFF Sent",IDC_XOFFSENTCHK,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,214,22,48,10
99   - CONTROL "EOF Sent",IDC_EOFSENTCHK,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,214,34,47,10
100   - CONTROL "TX Char",IDC_TXIMCHK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,265,10,42,10
101   - LTEXT "TX Chars:",IDC_STATIC,265,23,34,8
102   - EDITTEXT IDC_TXCHAREDIT,299,20,19,12,ES_AUTOHSCROLL | ES_READONLY
103   - LTEXT "RX Chars:",IDC_STATIC,265,35,34,8
104   - EDITTEXT IDC_RXCHAREDIT,299,33,19,12,ES_AUTOHSCROLL | ES_READONLY
105   - EDITTEXT IDC_STATUSEDIT,324,3,96,43,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | WS_VSCROLL
106   -END
107   -
108   -IDD_COMMEVENTSDLG DIALOG 0, 0, 226, 113
109   -STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
110   -CAPTION "Select Comm Events"
111   -FONT 8, "MS Sans Serif"
112   -BEGIN
113   - DEFPUSHBUTTON "OK",IDOK,164,8,50,14
114   - PUSHBUTTON "Cancel",IDCANCEL,164,26,50,14
115   - PUSHBUTTON "&Defaults",IDC_DEFAULTSBTN,164,44,50,14
116   - CONTROL "Errors",IDC_EVERRBTN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,10,40,10
117   - CONTROL "Break",IDC_EVBREAKBTN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,74,10,40,10
118   - CONTROL "CTS Changes",IDC_EVCTSBTN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,22,60,10
119   - CONTROL "Ring Indicator",IDC_EVRINGBTN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,74,22,65,10
120   - CONTROL "DSR Changes",IDC_EVDSRBTN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,34,60,10
121   - CONTROL "RLSD (CD) Changes",IDC_EVRLSDBTN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,74,34,80,10
122   - CONTROL "Transmit Buffer Empty",IDC_EVTXEMPTYBTN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,46,89,10
123   - CONTROL "Character Reception",IDC_EVRXCHARBTN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,58,85,10
124   - CONTROL "Flag Character Reception",IDC_EVRXFLAGBTN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,70,99,10
125   - EDITTEXT IDC_FLAGEDIT,19,95,25,12,ES_UPPERCASE | ES_AUTOHSCROLL
126   - EDITTEXT IDC_FLAGCHAR,49,95,14,12,ES_AUTOHSCROLL | ES_READONLY
127   - LTEXT "Flag Char Value:",IDC_STATIC,10,85,65,8
128   - LTEXT "0x",IDC_STATIC,10,99,9,8
129   -END
130   -
131   -IDD_FLOWCONTROLDLG DIALOG 0, 0, 210, 208
132   -STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
133   -CAPTION "Flow Control Settings"
134   -FONT 8, "MS Sans Serif"
135   -BEGIN
136   - DEFPUSHBUTTON "OK",IDOK,153,8,50,14
137   - PUSHBUTTON "Cancel",IDCANCEL,153,26,50,14
138   - PUSHBUTTON "&Rts/Cts",IDC_RTSCTSBTN,153,44,50,14
139   - PUSHBUTTON "&Xoff/Xon",IDC_XOFFXONBTN,153,80,50,14
140   - PUSHBUTTON "&None",IDC_NONEBTN,153,98,50,14
141   - CONTROL "CTS Output Control",IDC_CTSOUTCHK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,20,84,10
142   - CONTROL "DSR Output Control",IDC_DSROUTCHK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,32,84,10
143   - CONTROL "DSR Sensitivity (Input Control)",IDC_DSRINCHK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,44,113,10
144   - LTEXT "DTR Control:",IDC_STATIC,16,60,45,9
145   - LTEXT "RTS Control:",IDC_STATIC,76,60,45,9
146   - COMBOBOX IDC_DTRCONTROLCOMBO,16,68,52,48,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
147   - COMBOBOX IDC_RTSCONTROLCOMBO,76,68,52,49,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
148   - CONTROL "XON/XOFF Output Control",IDC_XONXOFFOUTCHK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,111,102,10
149   - CONTROL "XON/XOFF Input Control",IDC_XONXOFFINCHK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,123,102,10
150   - EDITTEXT IDC_XONLIMITEDIT,15,158,40,12,ES_AUTOHSCROLL
151   - EDITTEXT IDC_XOFFLIMITEDIT,79,158,40,12,ES_AUTOHSCROLL
152   - EDITTEXT IDC_XONCHAREDIT,27,182,24,12,ES_AUTOHSCROLL
153   - EDITTEXT IDC_XOFFCHAREDIT,91,182,24,12,ES_AUTOHSCROLL
154   - LTEXT "XON Limit:",IDC_STATIC,15,150,39,8
155   - LTEXT "XOFF Limit:",IDC_STATIC,79,150,39,8
156   - LTEXT "Ox",IDC_STATIC,15,185,9,8
157   - LTEXT "Ox",IDC_STATIC,79,185,9,8
158   - LTEXT "XON Char:",IDC_STATIC,15,174,39,8
159   - LTEXT "XOFF Char:",IDC_STATIC,79,174,39,8
160   - GROUPBOX "Hardware Control Settings",IDC_STATIC,8,8,128,80
161   - GROUPBOX "Software Control Settings",IDC_STATIC,8,96,136,105
162   - EDITTEXT IDC_XONCHARDISP,55,182,15,12,ES_AUTOHSCROLL | WS_DISABLED
163   - EDITTEXT IDC_XOFFCHARDISP,119,182,15,12,ES_AUTOHSCROLL | WS_DISABLED
164   - CONTROL "Continue sending after XOFF sent",IDC_TXAFTERXOFFSENTCHK,
165   - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,135,122,10
166   - PUSHBUTTON "&Dtr/Dsr",IDC_DTRDSRBTN,153,62,50,14
167   -END
168   -
169   -IDD_TIMEOUTSDLG DIALOG 0, 0, 231, 158
170   -STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
171   -CAPTION "Timeouts"
172   -FONT 8, "MS Sans Serif"
173   -BEGIN
174   - DEFPUSHBUTTON "OK",IDOK,172,6,50,14
175   - PUSHBUTTON "Cancel",IDCANCEL,172,24,50,14
176   - PUSHBUTTON "&Defaults",IDC_DEFAULTSBTN,171,42,50,14
177   - EDITTEXT IDC_READINTERVALEDIT,114,19,40,14,ES_AUTOHSCROLL
178   - EDITTEXT IDC_READMULTIPLIEREDIT,114,37,40,14,ES_AUTOHSCROLL
179   - EDITTEXT IDC_READCONSTANTEDIT,113,55,40,14,ES_AUTOHSCROLL
180   - EDITTEXT IDC_WRITEMULTIPLIEREDIT,113,95,40,14,ES_AUTOHSCROLL
181   - EDITTEXT IDC_WRITECONSTANTEDIT,113,113,40,14,ES_AUTOHSCROLL
182   - LTEXT "Read Interval Timeout:",IDC_STATIC,14,22,76,8
183   - LTEXT "Read Total Timeout Multipler:",IDC_STATIC,14,40,98,8
184   - LTEXT "Read Total Timeout Constant:",IDC_STATIC,13,58,99,8
185   - LTEXT "Write Total Timeout Multiplier:",IDC_STATIC,13,99,99,8
186   - LTEXT "Write Total Timeout Constant:",IDC_STATIC,13,115,99,8
187   - GROUPBOX "Read Timeouts",IDC_STATIC,7,7,155,69
188   - GROUPBOX "Write Timeouts",IDC_STATIC,7,84,155,50
189   - CONTROL "Display Timeout Status Messages",IDC_DISPLAYTIMEOUTS,
190   - "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,20,140,122,10
191   -END
192   -
193   -IDD_GETADWORD DIALOG 0, 0, 183, 68
194   -STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
195   -CAPTION "Please Enter A Number"
196   -FONT 8, "MS Sans Serif"
197   -BEGIN
198   - EDITTEXT IDC_DWORDEDIT,25,45,52,14,ES_AUTOHSCROLL
199   - DEFPUSHBUTTON "OK",IDOK,125,10,50,14
200   - PUSHBUTTON "Cancel",IDCANCEL,125,30,50,14
201   - LTEXT "Please enter a frequency in milliseconds for the repeated transfer:",IDC_DWORDSTATIC,10,10,94,25
  69 + PUSHBUTTON "",IDC_ABORTBTN,0,1,60,12,NOT WS_VISIBLE
  70 + CONTROL "Generic1",IDC_TRANSFERPROGRESS,"msctls_progress32",NOT WS_VISIBLE | WS_BORDER,68,3,65,6
  71 + EDITTEXT IDC_STATUSEDIT,178,0,262,16,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | WS_VSCROLL
202 72 END
203 73
204 74
... ... @@ -316,25 +186,6 @@ BEGIN
316 186 END
317 187 END
318 188
319   -
320   -/////////////////////////////////////////////////////////////////////////////
321   -//
322   -// DESIGNINFO
323   -//
324   -
325   -#ifdef APSTUDIO_INVOKED
326   -GUIDELINES DESIGNINFO
327   -BEGIN
328   - IDD_GETADWORD, DIALOG
329   - BEGIN
330   - LEFTMARGIN, 7
331   - RIGHTMARGIN, 176
332   - TOPMARGIN, 7
333   - BOTTOMMARGIN, 61
334   - END
335   -END
336   -#endif // APSTUDIO_INVOKED
337   -
338 189 #endif // 中文(中华人民共和国) resources
339 190 /////////////////////////////////////////////////////////////////////////////
340 191
... ...
... ... @@ -147,7 +147,7 @@
147 147 AssemblerListingLocation=".\WinDebug/"
148 148 ObjectFile=".\WinDebug/"
149 149 ProgramDataBaseFileName=".\WinDebug/"
150   - WarningLevel="3"
  150 + WarningLevel="2"
151 151 SuppressStartupBanner="true"
152 152 DebugInformationFormat="4"
153 153 />
... ...
... ... @@ -160,6 +160,7 @@ HISTORY: Date: Author: Comment:
160 160 -----------------------------------------------------------------------------*/
161 161 void OutputABuffer(HWND hTTY, char * lpBuf, DWORD dwBufLen)
162 162 {
  163 + dwBufLen = strlen(lpBuf);
163 164 if (dwBufLen == 0) {
164 165 OutputDebugString("NULL Buffer in OutputABuffer\n\r");
165 166 return;
... ...
... ... @@ -54,20 +54,19 @@ void FillComboBox( HWND, char ** szString, DWORD *, WORD, DWORD );
54 54 BOOL SettingsDlgInit( HWND );
55 55 DWORD GetdwTTYItem( HWND, int, char **, DWORD *, int );
56 56 BYTE GetbTTYItem( HWND, int, char **, DWORD *, int);
57   -BOOL CALLBACK CommEventsProc( HWND, UINT, WPARAM, LPARAM );
  57 +//BOOL CALLBACK CommEventsProc( HWND, UINT, WPARAM, LPARAM );
58 58 BOOL CALLBACK ToolbarProc( HWND, UINT, WPARAM, LPARAM );
59 59 void InitHexControl(HWND, WORD, WORD, char);
60 60 char GetHexControl(HWND, WORD, WORD);
61   -void SaveCommEventsDlg( HWND );
62   -void InitCommEventsDlg( HWND, DWORD );
63   -BOOL CALLBACK FlowControlProc( HWND, UINT, WPARAM, LPARAM );
64   -void InitFlowControlDlg( HWND );
65   -void SaveFlowControlDlg( HWND );
66   -void FlowDefault(HWND hdlg, WORD wId);
67   -BOOL CALLBACK TimeoutsProc( HWND, UINT, WPARAM, LPARAM );
68   -void InitTimeoutsDlg( HWND, COMMTIMEOUTS );
69   -void SaveTimeoutsDlg( HWND );
70   -BOOL CALLBACK GetADWORDProc( HWND, UINT, WPARAM, LPARAM );
  61 +//void SaveCommEventsDlg( HWND );
  62 +//void InitCommEventsDlg( HWND, DWORD );
  63 +//BOOL CALLBACK FlowControlProc( HWND, UINT, WPARAM, LPARAM );
  64 +//void InitFlowControlDlg( HWND );
  65 +//void SaveFlowControlDlg( HWND );
  66 +//void FlowDefault(HWND hdlg, WORD wId);
  67 +//BOOL CALLBACK TimeoutsProc( HWND, UINT, WPARAM, LPARAM );
  68 +//void InitTimeoutsDlg( HWND, COMMTIMEOUTS );
  69 +//void SaveTimeoutsDlg( HWND );
71 70
72 71 /*
73 72 GLOBALS for this file
... ... @@ -179,18 +178,6 @@ void ChangeConnection( HWND hwnd, BOOL fConnected )
179 178 EnableMenuItem( hMenu, ID_TRANSFER_ABORTREPEATEDSENDING,
180 179 MF_DISABLED | MF_GRAYED | MF_BYCOMMAND );
181 180
182   -// EnableWindow( GetDlgItem(ghWndToolbarDlg, IDC_PORTCOMBO), FALSE);
183   -// EnableWindow( GetDlgItem(ghWndToolbarDlg, IDC_NOWRITINGCHK), FALSE);
184   -// EnableWindow( GetDlgItem(ghWndToolbarDlg, IDC_NOREADINGCHK), FALSE);
185   -// EnableWindow( GetDlgItem(ghWndToolbarDlg, IDC_NOEVENTSCHK), FALSE);
186   -// EnableWindow( GetDlgItem(ghWndToolbarDlg, IDC_NOSTATUSCHK), FALSE);
187   -//
188   -// for (i = IDC_STATCTS; i <= IDC_STATRLSD; i++)
189   -// EnableWindow( GetDlgItem(ghWndStatusDlg, i), TRUE );
190   -//
191   -// for (i = IDC_CTSHOLDCHK; i <= IDC_RXCHAREDIT; i++)
192   -// EnableWindow( GetDlgItem(ghWndStatusDlg, i), TRUE);
193   -
194 181 SetFocus(ghWndTTY);
195 182 }
196 183 else {
... ... @@ -200,38 +187,12 @@ void ChangeConnection( HWND hwnd, BOOL fConnected )
200 187 hMenu = GetMenu( hwnd ) ;
201 188 EnableMenuItem( hMenu, ID_FILE_CONNECT, MF_DISABLED | MF_GRAYED) ;
202 189 EnableMenuItem( hMenu, ID_FILE_DISCONNECT,MF_DISABLED | MF_GRAYED) ;
203   -
204   - EnableMenuItem( hMenu, ID_TRANSFER_SENDFILETEXT,
205   - MF_DISABLED | MF_GRAYED | MF_BYCOMMAND ) ;
206   - EnableMenuItem( hMenu, ID_TRANSFER_RECEIVEFILETEXT,
207   - MF_DISABLED | MF_GRAYED | MF_BYCOMMAND ) ;
208   - EnableMenuItem( hMenu, ID_TRANSFER_SENDREPEATEDLY,
209   - MF_DISABLED | MF_GRAYED | MF_BYCOMMAND ) ;
210   - EnableMenuItem( hMenu, ID_TRANSFER_ABORTSENDING,
211   - MF_DISABLED | MF_GRAYED | MF_BYCOMMAND ) ;
212   - EnableMenuItem( hMenu, ID_TRANSFER_ABORTREPEATEDSENDING,
213   - MF_DISABLED | MF_GRAYED | MF_BYCOMMAND );
214   -
  190 + EnableMenuItem( hMenu, ID_TRANSFER_SENDFILETEXT,MF_DISABLED | MF_GRAYED | MF_BYCOMMAND ) ;
  191 + EnableMenuItem( hMenu, ID_TRANSFER_RECEIVEFILETEXT,MF_DISABLED | MF_GRAYED | MF_BYCOMMAND ) ;
  192 + EnableMenuItem( hMenu, ID_TRANSFER_SENDREPEATEDLY,MF_DISABLED | MF_GRAYED | MF_BYCOMMAND ) ;
  193 + EnableMenuItem( hMenu, ID_TRANSFER_ABORTSENDING,MF_DISABLED | MF_GRAYED | MF_BYCOMMAND ) ;
  194 + EnableMenuItem( hMenu, ID_TRANSFER_ABORTREPEATEDSENDING,MF_DISABLED | MF_GRAYED | MF_BYCOMMAND );
215 195 EnableWindow( GetDlgItem(ghWndToolbarDlg, IDC_PORTCOMBO), TRUE);
216   - EnableWindow( GetDlgItem(ghWndToolbarDlg, IDC_NOWRITINGCHK), TRUE);
217   - EnableWindow( GetDlgItem(ghWndToolbarDlg, IDC_NOREADINGCHK), TRUE);
218   - EnableWindow( GetDlgItem(ghWndToolbarDlg, IDC_NOEVENTSCHK), TRUE);
219   - EnableWindow( GetDlgItem(ghWndToolbarDlg, IDC_NOSTATUSCHK), TRUE);
220   -
221   - for (i = IDC_STATCTS; i <= IDC_STATRLSD; i++) {
222   - CheckDlgButton(ghWndStatusDlg, i, 0);
223   - EnableWindow( GetDlgItem(ghWndStatusDlg, i), FALSE );
224   - }
225   -
226   - for (i = IDC_CTSHOLDCHK; i <= IDC_RXCHAREDIT; i++) {
227   - if (i != IDC_TXCHAREDIT && i != IDC_RXCHAREDIT)
228   - CheckDlgButton(ghWndStatusDlg, i, 0);
229   - else
230   - SetDlgItemInt(ghWndStatusDlg, i, 0, FALSE);
231   -
232   - EnableWindow( GetDlgItem(ghWndStatusDlg, i), FALSE);
233   - }
234   -
235 196 SetFocus(ghwndMain);
236 197 }
237 198
... ... @@ -255,43 +216,9 @@ HISTORY: Date: Author: Comment:
255 216 -----------------------------------------------------------------------------*/
256 217 void UpdateTTYInfo()
257 218 {
258   - //
259   - // update globals from dialog settings
260   - //
261 219 GetDlgItemText(ghWndToolbarDlg, IDC_PORTCOMBO, gszPort, sizeof(gszPort));
262   -
263   - TTYInfo.dwBaudRate = GetdwTTYItem( ghWndToolbarDlg,
264   - IDC_BAUDCOMBO,
265   - szBaud,
266   - BaudTable,
267   - sizeof(BaudTable)/sizeof(BaudTable[0]));
268   -
269   - TTYInfo.bParity = GetbTTYItem( ghWndToolbarDlg,
270   - IDC_PARITYCOMBO,
271   - szParity,
272   - ParityTable,
273   - sizeof(ParityTable)/sizeof(ParityTable[0]));
274   -
275   - TTYInfo.bStopBits = GetbTTYItem( ghWndToolbarDlg,
276   - IDC_STOPBITSCOMBO,
277   - szStopBits,
278   - StopBitsTable,
279   - sizeof(StopBitsTable)/sizeof(StopBitsTable[0]));
280   -
281   - TTYInfo.fLocalEcho = IsDlgButtonChecked(ghWndToolbarDlg, IDC_LOCALECHOCHK);
282   - TTYInfo.bByteSize = GetDlgItemInt(ghWndToolbarDlg, IDC_DATABITSCOMBO, NULL, FALSE);
283   - TTYInfo.fNewLine = IsDlgButtonChecked(ghWndToolbarDlg, IDC_LFBTN);
284   - TTYInfo.fAutowrap = IsDlgButtonChecked(ghWndToolbarDlg, IDC_AUTOWRAPCHK);
285   - TTYInfo.fDisplayErrors = IsDlgButtonChecked(ghWndToolbarDlg, IDC_DISPLAYERRORSCHK);
286   -
287   - TTYInfo.fNoReading = IsDlgButtonChecked(ghWndToolbarDlg, IDC_NOREADINGCHK);
288   - TTYInfo.fNoWriting = IsDlgButtonChecked(ghWndToolbarDlg, IDC_NOWRITINGCHK);
289   - TTYInfo.fNoEvents = IsDlgButtonChecked(ghWndToolbarDlg, IDC_NOEVENTSCHK);
290   - TTYInfo.fNoStatus = IsDlgButtonChecked(ghWndToolbarDlg, IDC_NOSTATUSCHK);
291   -
292 220 if (TTYInfo.fConnected) // if connected, then update port state
293 221 UpdateConnection();
294   -
295 222 return;
296 223 }
297 224
... ... @@ -490,59 +417,23 @@ BOOL SettingsDlgInit( HWND hDlg )
490 417
491 418 GetDlgItemText(hDlg, IDC_PORTCOMBO, gszPort, sizeof(gszPort));
492 419
493   - //
494   - // fill baud combo box and make initial selection
495   - //
496   - FillComboBox( GetDlgItem( hDlg, IDC_BAUDCOMBO ),
497   - szBaud, BaudTable,
498   - sizeof( BaudTable ) / sizeof( BaudTable[ 0 ] ),
499   - TTYInfo.dwBaudRate ) ;
500 420
501 421 //
502 422 // fill data bits combo box and make initial selection
503 423 //
504   - for (wCount = 5; wCount < 9; wCount++) {
505   - wsprintf( szBuffer, "%d", wCount ) ;
506   - wPosition = LOWORD( SendDlgItemMessage( hDlg, IDC_DATABITSCOMBO,
507   - CB_ADDSTRING, 0,
508   - (LPARAM) (LPSTR) szBuffer ) ) ;
509   -
510   - //
  424 + for (wCount = 5; wCount < 9; wCount++)
  425 + {
  426 + //wsprintf( szBuffer, "%d", wCount ) ;
  427 + //wPosition = LOWORD( SendDlgItemMessage( hDlg, IDC_DATABITSCOMBO,CB_ADDSTRING, 0,(LPARAM) (LPSTR) szBuffer ) ) ;
511 428 // if wCount is current selection, tell the combo box
512   - //
513   - if (wCount == TTYInfo.bByteSize)
514   - SendDlgItemMessage( hDlg, IDC_DATABITSCOMBO, CB_SETCURSEL,
515   - (WPARAM) wPosition, 0L ) ;
  429 + //if (wCount == TTYInfo.bByteSize)SendDlgItemMessage( hDlg, IDC_DATABITSCOMBO, CB_SETCURSEL,(WPARAM) wPosition, 0L ) ;
516 430 }
517 431
518   - //
519 432 // fill parity combo box and make initial selection
520   - //
521   - FillComboBox( GetDlgItem( hDlg, IDC_PARITYCOMBO ),
522   - szParity, ParityTable,
523   - sizeof( ParityTable ) / sizeof( ParityTable[ 0 ] ),
524   - TTYInfo.bParity ) ;
525   -
526   - //
  433 + //FillComboBox( GetDlgItem( hDlg, IDC_PARITYCOMBO ),szParity, ParityTable,sizeof( ParityTable ) / sizeof( ParityTable[ 0 ] ),TTYInfo.bParity ) ;
527 434 // fill stop bits combo box and make initial selection
528   - //
529   - FillComboBox( GetDlgItem( hDlg, IDC_STOPBITSCOMBO ),
530   - szStopBits, StopBitsTable,
531   - sizeof( StopBitsTable ) / sizeof ( StopBitsTable[ 0 ] ),
532   - TTYInfo.bStopBits ) ;
533   - //
534   - // set check marks based on TTY data
535   - //
536   - CheckDlgButton( hDlg, IDC_LOCALECHOCHK, TTYInfo.fLocalEcho ) ;
537   - CheckDlgButton( hDlg, IDC_DISPLAYERRORSCHK, TTYInfo.fDisplayErrors );
538   - CheckDlgButton( hDlg, IDC_LFBTN, TTYInfo.fNewLine );
539   - CheckDlgButton( hDlg, IDC_AUTOWRAPCHK, TTYInfo.fAutowrap );
540   -
541   - CheckDlgButton( hDlg, IDC_NOWRITINGCHK, TTYInfo.fNoWriting );
542   - CheckDlgButton( hDlg, IDC_NOREADINGCHK, TTYInfo.fNoReading );
543   - CheckDlgButton( hDlg, IDC_NOSTATUSCHK, TTYInfo.fNoStatus );
544   - CheckDlgButton( hDlg, IDC_NOEVENTSCHK, TTYInfo.fNoEvents );
545   -
  435 + //FillComboBox( GetDlgItem( hDlg, IDC_STOPBITSCOMBO ),szStopBits, StopBitsTable,sizeof( StopBitsTable ) / sizeof ( StopBitsTable[ 0 ] ),TTYInfo.bStopBits ) ;
  436 +
546 437 return ( TRUE ) ;
547 438
548 439 } // end of SettingsDlgInit()
... ... @@ -768,18 +659,18 @@ BOOL CALLBACK ToolbarProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
768 659 break;
769 660
770 661 case IDC_COMMEVENTSBTN: // comm events button pressed
771   - DialogBox(ghInst, MAKEINTRESOURCE(IDD_COMMEVENTSDLG), ghwndMain, CommEventsProc);
772   - fRet = FALSE;
  662 + //DialogBox(ghInst, MAKEINTRESOURCE(IDD_COMMEVENTSDLG), ghwndMain, CommEventsProc);
  663 + //fRet = FALSE;
773 664 break;
774 665
775 666 case IDC_FLOWCONTROLBTN:
776   - DialogBox(ghInst, MAKEINTRESOURCE(IDD_FLOWCONTROLDLG), ghwndMain, FlowControlProc);
777   - fRet = FALSE;
  667 + //DialogBox(ghInst, MAKEINTRESOURCE(IDD_FLOWCONTROLDLG), ghwndMain, FlowControlProc);
  668 + //fRet = FALSE;
778 669 break;
779 670
780 671 case IDC_TIMEOUTSBTN:
781   - DialogBox(ghInst, MAKEINTRESOURCE(IDD_TIMEOUTSDLG), ghwndMain, TimeoutsProc);
782   - fRet = FALSE;
  672 + //DialogBox(ghInst, MAKEINTRESOURCE(IDD_TIMEOUTSDLG), ghwndMain, TimeoutsProc);
  673 + //fRet = FALSE;
783 674 break;
784 675
785 676 default: // some other control has been modified
... ... @@ -884,589 +775,6 @@ char GetHexControl(HWND hdlg, WORD wIdNumberBox, WORD wIdCharBox)
884 775
885 776 return chFlag[0];
886 777 }
887   -
888   -/*-----------------------------------------------------------------------------
889   -
890   -FUNCTION: InitCommEventsDlg(HWND, DWORD)
891   -
892   -PURPOSE: Initializes Comm Event Dialog Control
893   -
894   -PARAMETERS:
895   - hdlg - Dialog window handle
896   - dwEventFlags - event flag to set controls to
897   -
898   -COMMENTS: Since controls are checked based on the dwEventFlags parameter,
899   - it is easy to init control based on current settings,
900   - or default settings.
901   -
902   -HISTORY: Date: Author: Comment:
903   - 10/27/95 AllenD Wrote it
904   -
905   ------------------------------------------------------------------------------*/
906   -void InitCommEventsDlg(HWND hdlg, DWORD dwEventFlags)
907   -{
908   - int i,j;
909   -
910   - for (i = IDC_EVBREAKBTN, j = 0; i <= IDC_EVTXEMPTYBTN; i++, j++)
911   - CheckDlgButton( hdlg, i, dwEventFlags & EventFlagsTable[j]) ;
912   -
913   - InitHexControl(hdlg, IDC_FLAGEDIT, IDC_FLAGCHAR, TTYInfo.chFlag);
914   -
915   - EnableWindow(GetDlgItem(hdlg, IDC_FLAGEDIT), dwEventFlags & EV_RXFLAG);
916   - EnableWindow(GetDlgItem(hdlg, IDC_FLAGCHAR), dwEventFlags & EV_RXFLAG);
917   -
918   - return;
919   -}
920   -
921   -/*-----------------------------------------------------------------------------
922   -
923   -FUNCTION: SaveCommEventsDlg(HWND)
924   -
925   -PURPOSE: Saves new Comm Events Flag
926   -
927   -PARAMETERS:
928   - hdlg - Dialog window handle
929   -
930   -COMMENTS: Builds a new flag based on current dialog control.
931   - If the new flag differs from old, then new is updated.
932   -
933   -HISTORY: Date: Author: Comment:
934   - 10/27/95 AllenD Wrote it
935   -
936   ------------------------------------------------------------------------------*/
937   -void SaveCommEventsDlg(HWND hdlg)
938   -{
939   - int i,j;
940   - DWORD dwNew = {0};
941   - char chNewFlag = '\0';
942   - BOOL fChangingRXFLAG;
943   -
944   - //
945   - // create a flag out of dialog selections
946   - //
947   - for (i = IDC_EVBREAKBTN, j = 0; i <= IDC_EVTXEMPTYBTN; i++, j++) {
948   - if (IsDlgButtonChecked(hdlg, i))
949   - dwNew |= EventFlagsTable[j];
950   - }
951   -
952   - //
953   - // get current flag character from dialog
954   - //
955   - chNewFlag = GetHexControl(hdlg, IDC_FLAGEDIT, IDC_FLAGCHAR);
956   - fChangingRXFLAG = (TTYInfo.dwEventFlags & EV_RXFLAG) != (dwNew & EV_RXFLAG);
957   - if (chNewFlag != TTYInfo.chFlag || fChangingRXFLAG) {
958   - TTYInfo.chFlag = chNewFlag;
959   - UpdateTTYInfo();
960   - }
961   -
962   - //
963   - // if new flags have been selected, or
964   - //
965   - if (dwNew != TTYInfo.dwEventFlags)
966   - TTYInfo.dwEventFlags = dwNew;
967   -
968   - return;
969   -}
970   -
971   -/*-----------------------------------------------------------------------------
972   -
973   -FUNCTION: CommEventsProc(HWND, UINT, WPARAM, LPARAM)
974   -
975   -PURPOSE: Dialog Procedure for Comm Events Dialog
976   -
977   -PARAMETERS:
978   - hdlg - Dialog window handle
979   - uMessage - window message
980   - wparam - message parameter (depends on message)
981   - lparam - message parameter (depends on message)
982   -
983   -RETURN:
984   - TRUE if message is handled
985   - FALSE if message is not handled
986   - Exception is WM_INITDIALOG: returns FALSE since focus is not set
987   -
988   -HISTORY: Date: Author: Comment:
989   - 10/27/95 AllenD Wrote it
990   -
991   ------------------------------------------------------------------------------*/
992   -BOOL CALLBACK CommEventsProc(HWND hdlg, UINT uMessage, WPARAM wparam, LPARAM lparam)
993   -{
994   - switch(uMessage)
995   - {
996   - case WM_INITDIALOG: // init controls
997   - InitCommEventsDlg(hdlg, TTYInfo.dwEventFlags);
998   - break;
999   -
1000   - case WM_COMMAND:
1001   - switch(LOWORD(wparam))
1002   - {
1003   - case IDOK:
1004   - SaveCommEventsDlg(hdlg);
1005   -
1006   - //
1007   - // FALL THROUGH
1008   - //
1009   -
1010   - case IDCANCEL:
1011   - EndDialog(hdlg, LOWORD(wparam));
1012   - return TRUE;
1013   -
1014   - case IDC_DEFAULTSBTN:
1015   - InitCommEventsDlg(hdlg, EVENTFLAGS_DEFAULT);
1016   - return TRUE;
1017   -
1018   - case IDC_EVRXFLAGBTN:
1019   - EnableWindow(GetDlgItem(hdlg, IDC_FLAGEDIT), IsDlgButtonChecked(hdlg, IDC_EVRXFLAGBTN));
1020   - EnableWindow(GetDlgItem(hdlg, IDC_FLAGCHAR), IsDlgButtonChecked(hdlg, IDC_EVRXFLAGBTN));
1021   - return TRUE;
1022   -
1023   - case IDC_FLAGEDIT:
1024   - GetHexControl(hdlg, IDC_FLAGEDIT, IDC_FLAGCHAR);
1025   - return TRUE;
1026   - }
1027   - break;
1028   - }
1029   -
1030   - return FALSE;
1031   -}
1032   -
1033   -/*-----------------------------------------------------------------------------
1034   -
1035   -FUNCTION: SaveFlowControlDlg(HWND)
1036   -
1037   -PURPOSE: Sets TTY flow control settings based on dlg controls
1038   -
1039   -PARAMETERS:
1040   - hdlg - Dialog window handle
1041   -
1042   -HISTORY: Date: Author: Comment:
1043   - 10/27/95 AllenD Wrote it
1044   -
1045   ------------------------------------------------------------------------------*/
1046   -void SaveFlowControlDlg(HWND hdlg)
1047   -{
1048   - BOOL fNewCTSOut, fNewDSROut, fNewDSRIn, fNewXOut, fNewXIn, fNewTXafterXoffSent;
1049   - DWORD dwNewDTRControl, dwNewRTSControl;
1050   - WORD wNewXONLimit, wNewXOFFLimit;
1051   - char chNewXON, chNewXOFF;
1052   - BOOL fSuccess;
1053   -
1054   - BOOL fUpdateDCB = FALSE;
1055   -
1056   - //
1057   - // update DTR and RTS control if needed
1058   - //
1059   - dwNewDTRControl = GetdwTTYItem( hdlg, IDC_DTRCONTROLCOMBO,
1060   - szDTRControlStrings, DTRControlTable,
1061   - sizeof(DTRControlTable)/sizeof(DTRControlTable[0]));
1062   -
1063   - dwNewRTSControl = GetdwTTYItem( hdlg, IDC_RTSCONTROLCOMBO,
1064   - szRTSControlStrings, RTSControlTable,
1065   - sizeof(RTSControlTable)/sizeof(RTSControlTable[0]));
1066   - if (dwNewRTSControl != TTYInfo.fRtsControl ||
1067   - dwNewDTRControl != TTYInfo.fDtrControl) {
1068   - TTYInfo.fRtsControl = dwNewRTSControl;
1069   - TTYInfo.fDtrControl = dwNewDTRControl;
1070   - fUpdateDCB = TRUE;
1071   - }
1072   -
1073   - //
1074   - // update XON/XOFF limits if needed
1075   - //
1076   - wNewXONLimit = GetDlgItemInt(hdlg, IDC_XONLIMITEDIT, &fSuccess, FALSE);
1077   - wNewXOFFLimit = GetDlgItemInt(hdlg, IDC_XOFFLIMITEDIT, &fSuccess, FALSE);
1078   - if (wNewXOFFLimit != TTYInfo.wXOFFLimit ||
1079   - wNewXONLimit != TTYInfo.wXONLimit) {
1080   - TTYInfo.wXOFFLimit = wNewXOFFLimit;
1081   - TTYInfo.wXONLimit = wNewXONLimit;
1082   - fUpdateDCB = TRUE;
1083   - }
1084   -
1085   - //
1086   - // update XON/XOFF chars if needed
1087   - //
1088   - chNewXON = GetHexControl(hdlg, IDC_XONCHAREDIT, IDC_XONCHARDISP);
1089   - chNewXOFF = GetHexControl(hdlg, IDC_XOFFCHAREDIT, IDC_XOFFCHARDISP);
1090   - if (chNewXOFF != TTYInfo.chXOFF ||
1091   - chNewXON != TTYInfo.chXON) {
1092   - TTYInfo.chXOFF = chNewXOFF;
1093   - TTYInfo.chXON = chNewXON;
1094   - fUpdateDCB = TRUE;
1095   - }
1096   -
1097   - //
1098   - // update booleans from check boxes
1099   - //
1100   - fNewTXafterXoffSent = IsDlgButtonChecked(hdlg, IDC_TXAFTERXOFFSENTCHK);
1101   - fNewCTSOut = IsDlgButtonChecked(hdlg, IDC_CTSOUTCHK);
1102   - fNewDSROut = IsDlgButtonChecked(hdlg, IDC_DSROUTCHK);
1103   - fNewDSRIn = IsDlgButtonChecked(hdlg, IDC_DSRINCHK);
1104   - fNewXOut = IsDlgButtonChecked(hdlg, IDC_XONXOFFOUTCHK);
1105   - fNewXIn = IsDlgButtonChecked(hdlg, IDC_XONXOFFINCHK);
1106   -
1107   - if (fNewTXafterXoffSent != TTYInfo.fTXafterXoffSent ||
1108   - fNewCTSOut != TTYInfo.fCTSOutFlow ||
1109   - fNewDSROut != TTYInfo.fDSROutFlow ||
1110   - fNewDSRIn != TTYInfo.fDSRInFlow ||
1111   - fNewXOut != TTYInfo.fXonXoffOutFlow ||
1112   - fNewXIn != TTYInfo.fXonXoffInFlow ) {
1113   - TTYInfo.fCTSOutFlow = fNewCTSOut;
1114   - TTYInfo.fDSROutFlow = fNewDSROut;
1115   - TTYInfo.fDSRInFlow = fNewDSRIn;
1116   - TTYInfo.fXonXoffOutFlow = fNewXOut;
1117   - TTYInfo.fXonXoffInFlow = fNewXIn;
1118   - TTYInfo.fTXafterXoffSent = fNewTXafterXoffSent;
1119   - fUpdateDCB = TRUE;
1120   - }
1121   -
1122   - //
1123   - // update current settings if they have actually changed
1124   - //
1125   - if (fUpdateDCB)
1126   - UpdateTTYInfo();
1127   -
1128   - return;
1129   -}
1130   -
1131   -/*-----------------------------------------------------------------------------
1132   -
1133   -FUNCTION: InitFlowControlDlg(HWND)
1134   -
1135   -PURPOSE: Sets controls based on current tty flow control settings
1136   -
1137   -PARAMETERS:
1138   - hdlg - Dialog window handle
1139   -
1140   -HISTORY: Date: Author: Comment:
1141   - 10/27/95 AllenD Wrote it
1142   -
1143   ------------------------------------------------------------------------------*/
1144   -void InitFlowControlDlg(HWND hdlg)
1145   -{
1146   - //
1147   - // fill and init DTR control combo
1148   - //
1149   - FillComboBox( GetDlgItem( hdlg, IDC_DTRCONTROLCOMBO ),
1150   - szDTRControlStrings, DTRControlTable,
1151   - sizeof( DTRControlTable) / sizeof( DTRControlTable[0] ),
1152   - TTYInfo.fDtrControl );
1153   -
1154   - //
1155   - // fill and init RTS control combo
1156   - //
1157   - FillComboBox( GetDlgItem( hdlg, IDC_RTSCONTROLCOMBO ),
1158   - szRTSControlStrings, RTSControlTable,
1159   - sizeof( RTSControlTable) / sizeof( RTSControlTable[0] ),
1160   - TTYInfo.fRtsControl );
1161   -
1162   - //
1163   - // XON/XOFF characters
1164   - //
1165   - InitHexControl(hdlg, IDC_XONCHAREDIT, IDC_XONCHARDISP, TTYInfo.chXON);
1166   - InitHexControl(hdlg, IDC_XOFFCHAREDIT, IDC_XOFFCHARDISP, TTYInfo.chXOFF);
1167   -
1168   - //
1169   - // XON/XOFF limits
1170   - //
1171   - SetDlgItemInt(hdlg, IDC_XONLIMITEDIT, TTYInfo.wXONLimit, FALSE);
1172   - SetDlgItemInt(hdlg, IDC_XOFFLIMITEDIT, TTYInfo.wXOFFLimit, FALSE);
1173   -
1174   - //
1175   - // check boxes
1176   - //
1177   - CheckDlgButton(hdlg, IDC_CTSOUTCHK, TTYInfo.fCTSOutFlow);
1178   - CheckDlgButton(hdlg, IDC_DSROUTCHK, TTYInfo.fDSROutFlow);
1179   - CheckDlgButton(hdlg, IDC_DSRINCHK, TTYInfo.fDSRInFlow);
1180   - CheckDlgButton(hdlg, IDC_XONXOFFOUTCHK, TTYInfo.fXonXoffOutFlow);
1181   - CheckDlgButton(hdlg, IDC_XONXOFFINCHK, TTYInfo.fXonXoffInFlow);
1182   - CheckDlgButton(hdlg, IDC_TXAFTERXOFFSENTCHK, TTYInfo.fTXafterXoffSent);
1183   -
1184   - return;
1185   -}
1186   -
1187   -/*-----------------------------------------------------------------------------
1188   -
1189   -FUNCTION: FlowDefault(HWND, WORD)
1190   -
1191   -PURPOSE: Sets controls based on hardware or software flow control
1192   -
1193   -PARAMETERS:
1194   - hdlg - Dialog window handle
1195   - wId - ID of button used to set the default:
1196   - IDC_DTRDSRBTN - DTR/DSR hardware flow-control
1197   - IDC_RTSCTSBTN - RTS/CTS hardware flow-control
1198   - IDC_XOFFXONBTNBTN - XOFF/XON software flow control
1199   - IDC_NONEBTN - no flow control
1200   -
1201   -HISTORY: Date: Author: Comment:
1202   - 10/27/95 AllenD Wrote it
1203   -
1204   ------------------------------------------------------------------------------*/
1205   -void FlowDefault(HWND hdlg, WORD wId)
1206   -{
1207   - //
1208   - // set dtr control to handshake if using DTR/DSR flow-control
1209   - //
1210   - SetComboBox( GetDlgItem( hdlg, IDC_DTRCONTROLCOMBO ),
1211   - sizeof( DTRControlTable) / sizeof( DTRControlTable[0] ),
1212   - wId == IDC_DTRDSRBTN ? DTR_CONTROL_HANDSHAKE : DTR_CONTROL_ENABLE);
1213   -
1214   - //
1215   - // set rts control to handshake if using RTS/CTS flow-control
1216   - //
1217   - SetComboBox( GetDlgItem( hdlg, IDC_RTSCONTROLCOMBO ),
1218   - sizeof( RTSControlTable) / sizeof( RTSControlTable[0] ),
1219   - wId == IDC_RTSCTSBTN ? RTS_CONTROL_HANDSHAKE : RTS_CONTROL_ENABLE);
1220   -
1221   - //
1222   - // set check boxes according to wId
1223   - //
1224   - switch(wId)
1225   - {
1226   - case IDC_RTSCTSBTN:
1227   - case IDC_DTRDSRBTN:
1228   - CheckDlgButton(hdlg, IDC_CTSOUTCHK, wId == IDC_RTSCTSBTN);
1229   - CheckDlgButton(hdlg, IDC_DSROUTCHK, wId == IDC_DTRDSRBTN);
1230   - CheckDlgButton(hdlg, IDC_XONXOFFOUTCHK, FALSE);
1231   - CheckDlgButton(hdlg, IDC_XONXOFFINCHK, FALSE);
1232   - break;
1233   -
1234   - case IDC_XOFFXONBTN:
1235   - case IDC_NONEBTN:
1236   - CheckDlgButton(hdlg, IDC_CTSOUTCHK, FALSE);
1237   - CheckDlgButton(hdlg, IDC_DSROUTCHK, FALSE);
1238   - CheckDlgButton(hdlg, IDC_XONXOFFOUTCHK, wId == IDC_XOFFXONBTN);
1239   - CheckDlgButton(hdlg, IDC_XONXOFFINCHK, wId == IDC_XOFFXONBTN);
1240   - break;
1241   - }
1242   -
1243   - //
1244   - // settings that are disabled when any 'default' flow-control is used
1245   - //
1246   - CheckDlgButton(hdlg, IDC_DSRINCHK, FALSE);
1247   - CheckDlgButton(hdlg, IDC_TXAFTERXOFFSENTCHK, FALSE);
1248   -
1249   -
1250   - return;
1251   -}
1252   -
1253   -/*-----------------------------------------------------------------------------
1254   -
1255   -FUNCTION: FlowControlProc(HWND, UINT, WPARAM, LPARAM)
1256   -
1257   -PURPOSE: Dialog Procedure for Flow Control Settings Dialog
1258   -
1259   -PARAMETERS:
1260   - hdlg - Dialog window handle
1261   - uMessage - window message
1262   - wparam - message parameter (depends on message)
1263   - lparam - message parameter (depends on message)
1264   -
1265   -RETURN:
1266   - TRUE if message is handled
1267   - FALSE if message is not handled
1268   - Exception is WM_INITDIALOG: returns FALSE since focus is not set
1269   -
1270   -HISTORY: Date: Author: Comment:
1271   - 10/27/95 AllenD Wrote it
1272   -
1273   ------------------------------------------------------------------------------*/
1274   -BOOL CALLBACK FlowControlProc(HWND hdlg, UINT uMessage, WPARAM wparam, LPARAM lparam)
1275   -{
1276   - switch(uMessage)
1277   - {
1278   - case WM_INITDIALOG: // init controls
1279   - InitFlowControlDlg(hdlg);
1280   - break;
1281   -
1282   - case WM_COMMAND:
1283   - switch(LOWORD(wparam))
1284   - {
1285   - case IDOK:
1286   - SaveFlowControlDlg(hdlg);
1287   - //
1288   - // FALL THROUGH
1289   - //
1290   -
1291   - case IDCANCEL:
1292   - EndDialog(hdlg, LOWORD(wparam));
1293   - return TRUE;
1294   -
1295   - case IDC_RTSCTSBTN:
1296   - case IDC_DTRDSRBTN:
1297   - case IDC_XOFFXONBTN:
1298   - case IDC_NONEBTN:
1299   - FlowDefault(hdlg, LOWORD(wparam));
1300   - return TRUE;
1301   -
1302   - case IDC_XONCHAREDIT:
1303   - GetHexControl(hdlg, IDC_XONCHAREDIT, IDC_XONCHARDISP);
1304   - return TRUE;
1305   -
1306   - case IDC_XOFFCHAREDIT:
1307   - GetHexControl(hdlg, IDC_XOFFCHAREDIT, IDC_XOFFCHARDISP);
1308   - return TRUE;
1309   - }
1310   - break;
1311   - }
1312   -
1313   - return FALSE;
1314   -}
1315   -
1316   -/*-----------------------------------------------------------------------------
1317   -
1318   -FUNCTION: InitTimeoutsDlg(HWND, COMMTIMEOUTS)
1319   -
1320   -PURPOSE: Initializes timeouts dialog controls based on parameter
1321   -
1322   -PARAMETERS:
1323   - hdlg - Dialog window handle
1324   - ct - COMMTIMEOUTS used to set the dialog controls
1325   -
1326   -HISTORY: Date: Author: Comment:
1327   - 10/27/95 AllenD Wrote it
1328   -
1329   ------------------------------------------------------------------------------*/
1330   -void InitTimeoutsDlg(HWND hdlg, COMMTIMEOUTS ct)
1331   -{
1332   - SetDlgItemInt(hdlg, IDC_READINTERVALEDIT, ct.ReadIntervalTimeout, FALSE);
1333   - SetDlgItemInt(hdlg, IDC_READMULTIPLIEREDIT, ct.ReadTotalTimeoutMultiplier, FALSE);
1334   - SetDlgItemInt(hdlg, IDC_READCONSTANTEDIT, ct.ReadTotalTimeoutConstant, FALSE);
1335   - SetDlgItemInt(hdlg, IDC_WRITEMULTIPLIEREDIT, ct.WriteTotalTimeoutMultiplier, FALSE);
1336   - SetDlgItemInt(hdlg, IDC_WRITECONSTANTEDIT, ct.WriteTotalTimeoutConstant, FALSE);
1337   - CheckDlgButton(hdlg, IDC_DISPLAYTIMEOUTS, TTYInfo.fDisplayTimeouts);
1338   - return;
1339   -}
1340 778
1341   -/*-----------------------------------------------------------------------------
1342   -
1343   -FUNCTION: SaveTimeoutsDlg(HWND)
1344 779
1345   -PURPOSE: Saves values from controls into tty timeout settings
1346 780
1347   -PARAMETERS:
1348   - hdlg - Dialog window handle
1349   -
1350   -HISTORY: Date: Author: Comment:
1351   - 10/27/95 AllenD Wrote it
1352   -
1353   ------------------------------------------------------------------------------*/
1354   -void SaveTimeoutsDlg(HWND hdlg)
1355   -{
1356   - COMMTIMEOUTS ctNew;
1357   -
1358   - //
1359   - // get new timeouts from dialog controls
1360   - //
1361   - ctNew.ReadIntervalTimeout = GetDlgItemInt(hdlg, IDC_READINTERVALEDIT, NULL, FALSE);
1362   - ctNew.ReadTotalTimeoutMultiplier = GetDlgItemInt(hdlg, IDC_READMULTIPLIEREDIT, NULL, FALSE);
1363   - ctNew.ReadTotalTimeoutConstant = GetDlgItemInt(hdlg, IDC_READCONSTANTEDIT, NULL, FALSE);
1364   - ctNew.WriteTotalTimeoutMultiplier = GetDlgItemInt(hdlg, IDC_WRITEMULTIPLIEREDIT, NULL, FALSE);
1365   - ctNew.WriteTotalTimeoutConstant = GetDlgItemInt(hdlg, IDC_WRITECONSTANTEDIT, NULL, FALSE);
1366   -
1367   - TTYInfo.fDisplayTimeouts = IsDlgButtonChecked(hdlg, IDC_DISPLAYTIMEOUTS);
1368   -
1369   - //
1370   - // set new timeouts if they are different
1371   - //
1372   - if (memcmp(&ctNew, &(TTYInfo.timeoutsnew), sizeof(COMMTIMEOUTS))) {
1373   - //
1374   - // if connected, set new time outs and purge pending operations
1375   - //
1376   - if (TTYInfo.fConnected) {
1377   - if (!SetCommTimeouts(TTYInfo.hCommPort, &ctNew)) {
1378   - ErrorReporter("SetCommTimeouts");
1379   - return;
1380   - }
1381   -
1382   - if (!PurgeComm(TTYInfo.hCommPort, PURGE_TXABORT | PURGE_RXABORT))
1383   - ErrorReporter("PurgeComm");
1384   - }
1385   -
1386   - //
1387   - // save timeouts in the tty info structure
1388   - //
1389   - TTYInfo.timeoutsnew = ctNew;
1390   - }
1391   -
1392   - return;
1393   -}
1394   -
1395   -/*-----------------------------------------------------------------------------
1396   -
1397   -FUNCTION: TimeoutsProc(HWND, UINT, WPARAM, LPARAM)
1398   -
1399   -PURPOSE: Dialog Procedure for comm timeouts
1400   -
1401   -PARAMETERS:
1402   - hdlg - Dialog window handle
1403   - uMessage - window message
1404   - wparam - message parameter (depends on message)
1405   - lparam - message parameter (depends on message)
1406   -
1407   -RETURN:
1408   - TRUE if message is handled
1409   - FALSE if message is not handled
1410   - Exception is WM_INITDIALOG: returns FALSE since focus is not set
1411   -
1412   -HISTORY: Date: Author: Comment:
1413   - 10/27/95 AllenD Wrote it
1414   -
1415   ------------------------------------------------------------------------------*/
1416   -BOOL CALLBACK TimeoutsProc(HWND hdlg, UINT uMessage, WPARAM wparam, LPARAM lparam)
1417   -{
1418   - switch(uMessage)
1419   - {
1420   - case WM_INITDIALOG: // init controls
1421   - InitTimeoutsDlg(hdlg, TTYInfo.timeoutsnew);
1422   - break;
1423   -
1424   - case WM_COMMAND:
1425   - switch(LOWORD(wparam))
1426   - {
1427   - case IDOK:
1428   - SaveTimeoutsDlg(hdlg);
1429   -
1430   - //
1431   - // FALL THROUGH
1432   - //
1433   -
1434   - case IDCANCEL:
1435   - EndDialog(hdlg, LOWORD(wparam));
1436   - return TRUE;
1437   -
1438   - case IDC_DEFAULTSBTN:
1439   - InitTimeoutsDlg(hdlg, gTimeoutsDefault);
1440   - return TRUE;
1441   - }
1442   - break;
1443   - }
1444   -
1445   - return FALSE;
1446   -}
1447   -
1448   -BOOL CALLBACK GetADWORDProc(HWND hDlg, UINT uMessage, WPARAM wParam, LPARAM lParam)
1449   -{
1450   - int iRet = 0;
1451   -
1452   - if (uMessage == WM_COMMAND) {
1453   - switch(LOWORD(wParam)) {
1454   - case IDOK:
1455   - iRet = GetDlgItemInt(hDlg, IDC_DWORDEDIT, NULL, FALSE);
1456   - //
1457   - // FALL THROUGH
1458   - //
1459   -
1460   - case IDCANCEL:
1461   - EndDialog(hDlg, iRet);
1462   - return TRUE;
1463   - }
1464   - }
1465   -
1466   - return FALSE;
1467   -}
1468   -
1469   -DWORD GetAFrequency()
1470   -{
1471   - return ((DWORD) DialogBox(ghInst, MAKEINTRESOURCE(IDD_GETADWORD), ghwndMain, GetADWORDProc));
1472   -}
... ...
... ... @@ -137,24 +137,9 @@ BOOL CALLBACK StatusDlgProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
137 137 fRet = TRUE;
138 138 break;
139 139
140   - case IDC_STATCTS:
141   - case IDC_STATDSR:
142   - case IDC_STATRING:
143   - case IDC_STATRLSD:
144   - CheckModemStatus(TRUE);
145   - fRet = TRUE;
146   - break;
147   -
148   - case IDC_CTSHOLDCHK:
149   - case IDC_DSRHOLDCHK:
150   - case IDC_RLSDHOLDCHK:
151   - case IDC_XOFFHOLDCHK:
152   - case IDC_XOFFSENTCHK:
153   - case IDC_EOFSENTCHK:
154   - case IDC_TXIMCHK:
155   - CheckComStat(TRUE);
156   - fRet = TRUE;
157   - break;
  140 + //CheckModemStatus(TRUE);
  141 + //fRet = TRUE;
  142 + //break;
158 143
159 144 default:
160 145 break;
... ... @@ -375,8 +360,6 @@ void ReportModemStatus(DWORD dwModemStatus)
375 360 fRING = fStat[2] = MS_RING_ON & dwModemStatus;
376 361 fRLSD = fStat[3] = MS_RLSD_ON & dwModemStatus;
377 362
378   - for (i = IDC_STATCTS; i <= IDC_STATRLSD; i++)
379   - CheckDlgButton(ghWndStatusDlg, i, fStat[i-IDC_STATCTS] ? 1 : 0);
380 363
381 364 return;
382 365 }
... ... @@ -441,17 +424,6 @@ HISTORY: Date: Author: Comment:
441 424 -----------------------------------------------------------------------------*/
442 425 void ReportComStat(COMSTAT ComStat)
443 426 {
444   - CheckDlgButton(ghWndStatusDlg, IDC_CTSHOLDCHK, ComStat.fCtsHold);
445   - CheckDlgButton(ghWndStatusDlg, IDC_DSRHOLDCHK, ComStat.fDsrHold);
446   - CheckDlgButton(ghWndStatusDlg, IDC_RLSDHOLDCHK, ComStat.fRlsdHold);
447   - CheckDlgButton(ghWndStatusDlg, IDC_XOFFHOLDCHK, ComStat.fXoffHold);
448   - CheckDlgButton(ghWndStatusDlg, IDC_XOFFSENTCHK, ComStat.fXoffSent);
449   - CheckDlgButton(ghWndStatusDlg, IDC_EOFSENTCHK, ComStat.fEof);
450   - CheckDlgButton(ghWndStatusDlg, IDC_TXIMCHK, ComStat.fTxim);
451   -
452   - SetDlgItemInt(ghWndStatusDlg, IDC_TXCHAREDIT, ComStat.cbOutQue, FALSE);
453   - SetDlgItemInt(ghWndStatusDlg, IDC_RXCHAREDIT, ComStat.cbInQue, FALSE);
454   -
455 427 return;
456 428 }
457 429
... ...
... ... @@ -9,13 +9,9 @@
9 9 #define ID_TTYWINDOW 103
10 10 #define IDD_ABOUT 104
11 11 #define IDD_STATUSDIALOG 105
12   -#define IDD_COMMEVENTSDLG 107
13   -#define IDD_FLOWCONTROLDLG 108
14 12 #define IDI_APPICON2 109
15 13 #define IDI_APPICON3 110
16   -#define IDD_TIMEOUTSDLG 110
17 14 #define IDI_APPICON4 111
18   -#define IDD_GETADWORD 111
19 15 #define IDC_PORTCOMBO 1000
20 16 #define IDC_BAUDCOMBO 1001
21 17 #define IDC_PARITYCOMBO 1002
... ... @@ -32,48 +28,13 @@
32 28 #define IDC_TRANSFERPROGRESS 1013
33 29 #define IDC_MODEMSTATUSGRP 1018
34 30 #define IDC_COMMEVENTSBTN 1019
35   -#define IDC_EVBREAKBTN 1020
36   -#define IDC_EVCTSBTN 1021
37   -#define IDC_EVDSRBTN 1022
38   -#define IDC_EVERRBTN 1023
39   -#define IDC_EVRINGBTN 1024
40   -#define IDC_EVRLSDBTN 1025
41   -#define IDC_EVRXCHARBTN 1026
42   -#define IDC_EVRXFLAGBTN 1027
43   -#define IDC_EVTXEMPTYBTN 1028
44   -#define IDC_FLAGEDIT 1029
45   -#define IDC_DEFAULTSBTN 1030
46 31 #define IDC_LFBTN 1032
47 32 #define IDC_AUTOWRAPCHK 1033
48 33 #define IDC_STATUSEDIT 1034
49   -#define IDC_FLAGCHAR 1036
50 34 #define IDC_FLOWCONTROLBTN 1039
51   -#define IDC_CTSOUTCHK 1040
52   -#define IDC_DSROUTCHK 1041
53   -#define IDC_DTRCONTROLCOMBO 1043
54   -#define IDC_DSRINCHK 1044
55   -#define IDC_XONXOFFOUTCHK 1045
56   -#define IDC_XONXOFFINCHK 1046
57   -#define IDC_XONLIMITEDIT 1047
58   -#define IDC_XOFFLIMITEDIT 1048
59   -#define IDC_XONCHAREDIT 1049
60   -#define IDC_XOFFCHAREDIT 1050
61   -#define IDC_RTSCONTROLCOMBO 1051
62   -#define IDC_RTSCTSBTN 1052
63   -#define IDC_XOFFXONBTN 1053
64   -#define IDC_XONCHARDISP 1054
65   -#define IDC_XOFFCHARDISP 1055
66 35 #define IDC_PICTURE 1056
67   -#define IDC_DTRDSRBTN 1056
68 36 #define IDC_TIMEOUTSBTN 1057
69   -#define IDC_READINTERVALEDIT 1058
70   -#define IDC_READMULTIPLIEREDIT 1059
71   -#define IDC_READCONSTANTEDIT 1060
72   -#define IDC_WRITEMULTIPLIEREDIT 1061
73   -#define IDC_WRITECONSTANTEDIT 1062
74   -#define IDC_NONEBTN 1064
75 37 #define IDC_OSVERSIONINFO 1065
76   -#define IDC_TXAFTERXOFFSENTCHK 1066
77 38 #define IDC_CTSHOLDCHK 1067
78 39 #define IDC_DSRHOLDCHK 1068
79 40 #define IDC_RLSDHOLDCHK 1069
... ... @@ -87,9 +48,6 @@
87 48 #define IDC_NOWRITINGCHK 1077
88 49 #define IDC_NOSTATUSCHK 1078
89 50 #define IDC_NOEVENTSCHK 1079
90   -#define IDC_DWORDSTATIC 1081
91   -#define IDC_DWORDEDIT 1082
92   -#define IDC_DISPLAYTIMEOUTS 1083
93 51 #define IDC_BUTTON1 1085
94 52 #define IDC_BUTTON_CONNECT_UART 1085
95 53 #define IDC_BUTTON2 1086
... ...
Please register or login to post a comment