1 // TextViewDlg.cpp : implementation file
6 #include "textviewdlg.h"
12 static char THIS_FILE[] = __FILE__;
15 /////////////////////////////////////////////////////////////////////////////
16 // text_view_dlg dialog
18 text_view_dlg::text_view_dlg(CWnd* pParent /*=NULL*/)
19 : CDialog(text_view_dlg::IDD, pParent)
21 //{{AFX_DATA_INIT(text_view_dlg)
26 void text_view_dlg::DoDataExchange(CDataExchange* pDX)
28 CDialog::DoDataExchange(pDX);
29 //{{AFX_DATA_MAP(text_view_dlg)
30 DDX_Text(pDX, IDC_EDIT1, m_edit);
34 BEGIN_MESSAGE_MAP(text_view_dlg, CDialog)
35 //{{AFX_MSG_MAP(text_view_dlg)
36 ON_EN_SETFOCUS(IDC_EDIT1, OnSetfocusEdit1)
40 /////////////////////////////////////////////////////////////////////////////
41 // text_view_dlg message handlers
43 void text_view_dlg::set(int ship_class)
45 char line[256], line2[256];
46 int i, j, found = 0, comment = 0;
52 fp = cfopen("ships.tbl", "r");
55 while (cfgets(line, 255, fp)) {
56 while (line[strlen(line) - 1] == '\n')
57 line[strlen(line) - 1] = 0;
59 for (i=j=0; line[i]; i++) {
60 if (line[i] == '/' && line[i+1] == '/')
63 if (line[i] == '/' && line[i+1] == '*') {
69 if (line[i] == '*' && line[i+1] == '/') {
80 if (!strnicmp(line2, "$Name:", 6)) {
83 while (line2[i] == ' ' || line2[i] == '\t')
86 if (!stricmp(line2 + i, Ship_info[ship_class].name))
99 void text_view_dlg::OnSetfocusEdit1()
101 ((CEdit *) GetDlgItem(IDC_EDIT1)) -> SetSel(-1, -1);