[Dda-cvs] ntdda/src/win32gui winmain.c,1.42,1.43
Status: Beta
Brought to you by:
doolin
From: David M. D. <do...@us...> - 2006-07-01 14:58:10
|
Update of /cvsroot/dda/ntdda/src/win32gui In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv32509 Modified Files: winmain.c Log Message: Geometry file is now automatically loaded after being read from dxf import. Index: winmain.c =================================================================== RCS file: /cvsroot/dda/ntdda/src/win32gui/winmain.c,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** winmain.c 1 Jul 2006 14:51:25 -0000 1.42 --- winmain.c 1 Jul 2006 14:58:07 -0000 1.43 *************** *** 1716,1720 **** // This subroutine is wrote by Roozbeh to read the .dxf // format and to create the .geo format ! static int handleDxfBrowse(HWND hwMain, LPARAM lParam) //Added by Roozbeh { --- 1716,1720 ---- // This subroutine is wrote by Roozbeh to read the .dxf // format and to create the .geo format ! int handleDxfBrowse(HWND hwMain, LPARAM lParam) //Added by Roozbeh { *************** *** 1727,1764 **** fileBrowse(hwMain, &ofn, szFilter, filepath.gpath, filepath.gfile, "dxf"); ! if( !GetOpenFileName(&ofn) ) { ! strcpy(filepath.gpath, filepath.oldpath); return 0; /* user pressed cancel */ - } ! ! //else { ! ! ! sprintf(mainWinTitle, "%s for Windows --- Geometry = %s", (LPSTR) szAppName, (LPSTR) filepath.gfile); ! ! SetWindowText(hwMain, (LPCTSTR) mainWinTitle); ! ! dda_set_menu_state(dda,GEOM_STATE); ! /* Initialize the path. Note that the .dxf file is already loaded into ! * the struct, so it doesn't have to be reloaded. ! */ ! strcpy(temp, filepath.gfile); ! strcpy (filepath.rootname, strtok(temp, ".")); ! // dda_set_output_directory("output",sizeof("output")); //Disabled By Roozbeh ! // The dxf file will be read from this line and lines, polylines ! // and arcs will be recognized from dxf file ! fp1 = fopen(filepath.gfile,"r"); ! strcpy (filepath.gfile, strcat (filepath.rootname, ".geo")); ! // Pass everything in to readDXF. ! dxf_read_file(fp1,filepath.gfile); ! // Send message to GeomApply to have geometry automatically loaded. ! ! //} return 1; --- 1727,1756 ---- fileBrowse(hwMain, &ofn, szFilter, filepath.gpath, filepath.gfile, "dxf"); ! if(!GetOpenFileName(&ofn)) { strcpy(filepath.gpath, filepath.oldpath); return 0; /* user pressed cancel */ } ! ! sprintf(mainWinTitle, "%s for Windows --- Geometry = %s", (LPSTR) szAppName, (LPSTR) filepath.gfile); ! SetWindowText(hwMain, (LPCTSTR) mainWinTitle); ! dda_set_menu_state(dda,GEOM_STATE); ! /* Initialize the path. Note that the .dxf file is already loaded into ! * the struct, so it doesn't have to be reloaded. ! */ ! strcpy(temp, filepath.gfile); ! strcpy (filepath.rootname, strtok(temp, ".")); ! //dda_set_output_directory("output",sizeof("output")); //Disabled By Roozbeh ! // The dxf file will be read from this line and lines, polylines ! // and arcs will be recognized from dxf file ! fp1 = fopen(filepath.gfile,"r"); ! // WARNING: This overwrites the name of the currently open file fp1! ! strcpy (filepath.gfile, strcat (filepath.rootname, ".geo")); ! dxf_read_file(fp1,filepath.gfile); ! // Send message to GeomApply to have geometry automatically loaded. ! SendMessage(hwMain, WM_COMMAND, GEOM_APPLY, lParam); return 1; |