Commit 0759487a authored by LYMB Demo's avatar LYMB Demo
Browse files

some improvements

parent 477e84da
This diff is collapsed.
......@@ -72,43 +72,46 @@ IDR_MAINFRAME ICON DISCARDABLE "res\\pcmaker.ico"
// Dialog
//
IDD_PCMAKER_DIALOG DIALOGEX 0, 0, 185, 227
IDD_PCMAKER_DIALOG DIALOGEX 0, 0, 185, 261
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW
CAPTION "pcmaker"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK",IDOK,31,206,50,14
PUSHBUTTON "Cancel",IDCANCEL,97,206,50,14
GROUPBOX "What Compiler",IDC_COMPILER,7,92,171,25,WS_TABSTOP
DEFPUSHBUTTON "OK",IDOK,31,240,50,14
PUSHBUTTON "Cancel",IDCANCEL,97,240,50,14
GROUPBOX "What Compiler",IDC_COMPILER,7,125,171,25,WS_TABSTOP
EDITTEXT IDC_WHEREVTK,16,15,155,14,ES_AUTOHSCROLL
LTEXT "Where is vtk installed",IDC_STATIC,7,7,65,8
LTEXT "Where do you want to build the vtk libraries",
IDC_STATIC,7,33,139,8
EDITTEXT IDC_WHEREBUILD,16,45,154,14,ES_AUTOHSCROLL
CONTROL "Microsoft",IDC_MSCOMP,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,16,103,43,10
WS_TABSTOP,16,136,43,10
CONTROL "Borland",IDC_BORLANDCOMP,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,66,103,40,10
GROUPBOX "Additional Toolkits",IDC_STATIC,7,156,171,46
WS_TABSTOP,66,136,40,10
GROUPBOX "Additional Toolkits",IDC_STATIC,7,189,171,46
CONTROL "Graphics",IDC_Graphics,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,15,169,48,10
WS_TABSTOP,15,202,48,10
CONTROL "Imaging",IDC_Imaging,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,68,169,41,10
WS_TABSTOP,68,202,41,10
CONTROL "Contrib",IDC_Contrib,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,117,169,38,10
WS_TABSTOP,117,202,38,10
LTEXT "Where is your compiler",IDC_STATIC,7,63,148,13
EDITTEXT IDC_WHERECOMPILER,16,75,153,13,ES_AUTOHSCROLL
EDITTEXT IDC_WHERECOMPILER,16,75,153,14,ES_AUTOHSCROLL
CONTROL "Build a Debug Version",IDC_Debug,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,50,125,85,10
BS_AUTOCHECKBOX | WS_TABSTOP,50,158,85,10
CONTROL "GemsIO",IDC_GEMSIO,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,15,186,41,10
WS_TABSTOP,15,219,41,10
CONTROL "GemsIP",IDC_GEMSIP,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,68,186,41,10
WS_TABSTOP,68,219,41,10
CONTROL "GemsVolume",IDC_GEMSVOLUME,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,117,186,57,10
WS_TABSTOP,117,219,57,10
CONTROL "Include Patented Algorithms",IDC_PATENTED,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,43,141,99,10
BS_AUTOCHECKBOX | WS_TABSTOP,43,174,99,10
LTEXT "Where is your Java JDK (this is optional)",IDC_STATIC,
10,93,141,13
EDITTEXT IDC_WHEREJDK,16,105,153,15,ES_AUTOHSCROLL
END
......@@ -168,7 +171,7 @@ BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 178
TOPMARGIN, 7
BOTTOMMARGIN, 220
BOTTOMMARGIN, 254
END
END
#endif // APSTUDIO_INVOKED
......
......@@ -23,6 +23,7 @@ CPcmakerDlg::CPcmakerDlg(CWnd* pParent /*=NULL*/)
//{{AFX_DATA_INIT(CPcmakerDlg)
m_WhereVTK = _T("");
m_WhereBuild = _T("");
m_WhereJDK = _T("");
m_BorlandComp = FALSE;
m_MSComp = FALSE;
m_Contrib = TRUE;
......@@ -47,13 +48,15 @@ void CPcmakerDlg::DoDataExchange(CDataExchange* pDX)
DDV_MaxChars(pDX, m_WhereVTK, 80);
DDX_Text(pDX, IDC_WHEREBUILD, m_WhereBuild);
DDV_MaxChars(pDX, m_WhereBuild, 80);
DDX_Check(pDX, IDC_BORLANDCOMP, m_BorlandComp);
DDX_Text(pDX, IDC_WHERECOMPILER, m_WhereCompiler);
DDV_MaxChars(pDX, m_WhereCompiler, 40);
DDX_Text(pDX, IDC_WHEREJDK, m_WhereJDK);
DDV_MaxChars(pDX, m_WhereJDK, 40);
DDX_Check(pDX, IDC_MSCOMP, m_MSComp);
DDX_Check(pDX, IDC_BORLANDCOMP, m_BorlandComp);
DDX_Check(pDX, IDC_Contrib, m_Contrib);
DDX_Check(pDX, IDC_Graphics, m_Graphics);
DDX_Check(pDX, IDC_Imaging, m_Imaging);
DDX_Text(pDX, IDC_WHERECOMPILER, m_WhereCompiler);
DDV_MaxChars(pDX, m_WhereCompiler, 40);
DDX_Check(pDX, IDC_Debug, m_Debug);
DDX_Check(pDX, IDC_GEMSIO, m_GEMSIO);
DDX_Check(pDX, IDC_GEMSIP, m_GEMSIP);
......@@ -77,6 +80,7 @@ BOOL CPcmakerDlg::OnInitDialog()
this->m_WhereBuild = "C:\\vtkbin";
this->m_WhereVTK = "C:\\vtk";
this->m_WhereCompiler = "C:\\msdev";
this->m_WhereJDK = "C:\\JDK1.1";
CDialog::OnInitDialog();
// Set the icon for this dialog. The framework does this automatically
......@@ -132,13 +136,13 @@ void CPcmakerDlg::OnOK()
FILE *fp;
char fname[128];
char msg[256];
struct _stat statBuff;
struct stat statBuff;
// TODO: Add extra validation here
CWnd::UpdateData();
// make sure we can find vtk
sprintf(fname,"%s\\pcmaker\\getclasses.cxx",this->m_WhereVTK);
sprintf(fname,"%s\\targets.c",this->m_WhereVTK);
fp = fopen(fname,"r");
if (!fp)
{
......@@ -147,7 +151,9 @@ void CPcmakerDlg::OnOK()
return;
}
fclose(fp);
// make sure we can find the include files
sprintf(fname,"%s\\include\\stdio.h",this->m_WhereCompiler);
fp = fopen(fname,"r");
......@@ -160,6 +166,8 @@ void CPcmakerDlg::OnOK()
}
fclose(fp);
if (!this->m_BorlandComp)
{
// make sure we can find opengl.lib files
sprintf(fname,"%s\\lib\\opengl32.lib",this->m_WhereCompiler);
fp = fopen(fname,"r");
......@@ -170,7 +178,18 @@ void CPcmakerDlg::OnOK()
return;
}
fclose(fp);
}
// make sure we can find JDK
sprintf(fname,"%s\\include\\jni.h",this->m_WhereJDK);
fp = fopen(fname,"r");
if (!fp)
{
sprintf(msg, "Unable to find JDK1.1 at: %s",this->m_WhereJDK);
AfxMessageBox(msg);
return;
}
fclose(fp);
// make sure only one compile is specified
if ((this->m_MSComp + this->m_BorlandComp) > 1)
{
......@@ -185,28 +204,34 @@ void CPcmakerDlg::OnOK()
// make sure we can get to build directory
//does it already exists?
if (_stat(this->m_WhereBuild,&statBuff) == -1)
if (stat(this->m_WhereBuild,&statBuff) == -1)
{
// it didn't exist should we create it
sprintf(msg,"The build directory %s does not exist.\nWould you like me to create it ?",
this->m_WhereBuild);
if (AfxMessageBox(msg,MB_YESNO) == IDNO) return;
if (_mkdir(this->m_WhereBuild) == -1)
if (mkdir(this->m_WhereBuild) == -1)
{
sprintf(msg,"There was an error trying to create the directory %s.",this->m_WhereBuild);
AfxMessageBox(msg);
return;
}
}
// make the subdirectories if they don't exist
sprintf(fname,"%s\\vtkdll",this->m_WhereBuild);
if (_stat(fname,&statBuff) == -1) _mkdir(fname);
if (stat(fname,&statBuff) == -1) mkdir(fname);
sprintf(fname,"%s\\vtktcl",this->m_WhereBuild);
if (_stat(fname,&statBuff) == -1) _mkdir(fname);
if (stat(fname,&statBuff) == -1) mkdir(fname);
sprintf(fname,"%s\\vtktcl\\src",this->m_WhereBuild);
if (_stat(fname,&statBuff) == -1) _mkdir(fname);
if (stat(fname,&statBuff) == -1) mkdir(fname);
sprintf(fname,"%s\\vtkjava",this->m_WhereBuild);
if (stat(fname,&statBuff) == -1) mkdir(fname);
sprintf(fname,"%s\\vtkjava\\src",this->m_WhereBuild);
if (stat(fname,&statBuff) == -1) mkdir(fname);
sprintf(fname,"%s\\vtkjava\\vtk",this->m_WhereBuild);
if (stat(fname,&statBuff) == -1) mkdir(fname);
makeMakefile(this);
CDialog::OnOK();
}
......@@ -15,6 +15,7 @@ public:
enum { IDD = IDD_PCMAKER_DIALOG };
CString m_WhereVTK;
CString m_WhereBuild;
CString m_WhereJDK;
BOOL m_BorlandComp;
BOOL m_MSComp;
BOOL m_Contrib;
......
......@@ -9,6 +9,7 @@
#define IDC_WHEREVTK 1003
#define IDC_COMPILER 1004
#define IDC_WHERECOMPILER 1005
#define IDC_WHEREJDK 1006
#define IDC_WHEREBUILD 1009
#define IDC_MSCOMP 1010
#define IDC_BORLANDCOMP 1011
......@@ -29,7 +30,7 @@
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 129
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1023
#define _APS_NEXT_CONTROL_VALUE 1024
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment