home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / vos2-121.zip / v / vide / projdlg.cpp < prev    next >
C/C++ Source or Header  |  1999-02-23  |  24KB  |  734 lines

  1. //=======================================================================
  2. //@V@:Note: This file generated by vgen V1.02 (23:23:26 06 Apr 1998).
  3. //    mymdlg.cpp:    Source for projectDialog class
  4. //=======================================================================
  5. #include<v/vapp.h>
  6.  
  7. #include "projdlg.h"
  8. #include <v/vutil.h>
  9.  
  10. #include <v/vapp.h>
  11. //extern vApp *theApp;
  12.  
  13.  
  14.   void Dos2UxFName(char *dosFileName, char *uxFileName, BOOL trimfile)
  15.   {
  16.     //makes things working with gnu-win32/ming32
  17.     //translates a MSDOS file name into a unix like file name
  18.     //*  Only necessary for gnu-win32: Win95 fileSelect gives a DOS filename
  19.     //*                                and file manipulation needs unix style
  20.     //*                                names
  21.     char *np, *p=dosFileName+2;
  22.  
  23.     np = uxFileName;
  24.  
  25.     for( ; *p!=0; p++, np++)
  26.       {
  27.     *np = (*p=='\\') ? '/' : *p;
  28.       }
  29.     *np=0;
  30.     if (trimfile)
  31.       {
  32.     int lim = strlen(uxFileName);
  33.     for (int ix = lim ; ix >= 0 ; --ix)
  34.       {
  35.         if (uxFileName[ix] == '/' || uxFileName[ix] == '\\')
  36.           {
  37.         uxFileName[ix] = 0;    // zap rest
  38.         break;
  39.           }
  40.       }
  41.       }
  42.   }
  43.  
  44. //************************************************************************
  45.  
  46. //@V@:BeginIDs
  47.   enum
  48.     {
  49.     frmTogBtns = 1000,
  50.     tbtFiles, tbtFlags, tbtPaths, tbtDefs, tbtOpts,
  51.  
  52.     frmMain,
  53.  
  54.     frmNames,
  55.     lblExeName, txiExeName,lblMkfName,txiMkfName,
  56.     lblCC, txiCC, lblCFlags, txiCFlags,
  57.     lblLibs, txiLibs,
  58.  
  59.     frmObj,
  60.     lblObj, objList, btnAddSrcFile, btnDelSrcFile,
  61.     btnEditSrcFile, chkMakeMkf,
  62.  
  63.     frmPaths,
  64.     lblObjPath, txiObjPath, btnBrwObjD, lblBinPath,
  65.     txiBinPath, lblSrcPath, txiSrcPath,  btnBrwSrcD,
  66.     btnBrwBinD, 
  67.  
  68.     frmIncl,
  69.     lblIncl, lstIncl, btnAddInclPath, btnDelInclPath,
  70.     btnEditInclPath,
  71.  
  72.     frmLibs,
  73.     lblLibP, lstLibs, btnAddLibsPath, btnDelLibsPath,
  74.     btnEditLibsPath,
  75.  
  76.     frmDefs,
  77.     lblDefPool, lstDefPool, btnAddDef, btnDelDef, blkBlank1,
  78.     blkBlank2, blkBlank3, btnAdd, btnDel, lblDef, lstDef,
  79.     btnEditDef,
  80.  
  81.     frmOpts,
  82.     lblUOpt, UOptList, btnAddUOpt, btnDelUOpt, btnEditUOpt,
  83.  
  84.     xyzzyLast
  85.  
  86.    };
  87. //@V@:EndIds
  88.  
  89. //stub vector for listDialogs
  90.  static char* vtmp[1] = { 0 };
  91.  
  92. //@V@:BeginDialogCmd PCmds
  93.   static DialogCmd PCmds[] =
  94.     {
  95.       // This borderless frame makes the toggle buttons tightly spaced
  96.     {C_Frame,frmTogBtns,0,"",NoList,CA_NoSpace | CA_NoBorder,isSens,NoFrame,0,0},
  97.     {C_ToggleButton,tbtFlags,1,"Names",NoList, CA_None, isSens, frmTogBtns, 0, 0,0,"Set Names and Flags"},
  98.     {C_ToggleButton,tbtFiles,0,"Files",NoList, CA_None, isSens, frmTogBtns, tbtFlags, 0, 0, "Set Source Files"},
  99.     {C_ToggleButton,tbtPaths,0,"Paths",NoList, CA_None, isSens, frmTogBtns, tbtFiles, 0, 0,"Set various paths"},
  100.     {C_ToggleButton,tbtDefs,0,"Defines",NoList, CA_None, isSens, frmTogBtns, tbtPaths, 0,0, "Set Defines"},
  101.     {C_ToggleButton,tbtOpts,0,"Options",NoList, CA_None, isSens, frmTogBtns, tbtDefs, 0, 0, "Add User Makefile Options"},
  102.     // A Master frame to give uniform border to toggle frames
  103.     {C_Frame,frmMain,0, "", NoList,CA_None,isSens,frmTogBtns,0,tbtFiles},
  104.  
  105.     // This is the default frame - on initially
  106.     {C_ToggleFrame, frmNames, 1, "",NoList,CA_NoBorder,isSens, frmMain, 0, 0},
  107.  
  108.     {C_Label, lblExeName, 0," Target File Name:", NoList, CA_None, isSens,frmNames,0, 0},
  109.     {C_TextIn, txiExeName, 0, " ", NoList, CA_Large, isSens,frmNames,lblExeName, 0,0,
  110.             "Name of executable file"},
  111.  
  112.     {C_Label, lblMkfName, 0," Makefile Name:", NoList, CA_None, isSens,frmNames,0, txiExeName},
  113.     {C_TextIn, txiMkfName, 0, " ", NoList, CA_Large, isSens,frmNames,lblExeName, txiExeName, 0,
  114.             "Name of makefile"},
  115.  
  116.     {C_Label, lblCC, 0, " Compiler:             ", NoList, CA_None, isSens,frmNames, 0, lblMkfName},
  117.     {C_TextIn, txiCC, 0, " ", NoList, CA_Large, isSens,frmNames,lblCC, txiMkfName, 0,"Compiler name"},
  118.     {C_Label, lblCFlags, 0," Compiler Flags:   ", NoList, CA_Large, isSens,frmNames,0, lblCC},
  119.     {C_TextIn, txiCFlags, 0, " ", NoList, CA_Large, isSens,frmNames,lblCFlags, txiCC,0,"Compiler flags"},
  120.     {C_Label, lblLibs, 0,  " Linker Flags:       ", NoList, CA_Large, isSens,frmNames,0, lblCFlags},
  121.     {C_TextIn, txiLibs, 0, " ", NoList, CA_Large, isSens,frmNames,lblLibs, txiCFlags,0,"Linker flags"},
  122.  
  123.     {C_ToggleFrame, frmObj, 0, "", NoList, CA_NoBorder | CA_Hidden, isSens, frmMain, 0, 0},
  124.  
  125.     {C_Label, lblObj, 0," Source Files:", NoList, CA_None, isSens, frmObj,0, 0},
  126.     {C_List, objList, 160, " ", (void *) vtmp, 
  127.         CA_ListWidth | CA_Size, isSens, frmObj,0, lblObj, 12, "List of source Files" },
  128.     {C_Button, btnAddSrcFile, 0, "Add", NoList,CA_None,
  129.         isSens,frmObj,0, objList, 0, "Add source file with File Dialog"},
  130.     {C_Button, btnDelSrcFile, 0, "Del", NoList,CA_None,
  131.         isSens,frmObj, btnAddSrcFile, objList,0,"Delete selected file"},
  132.     {C_Button, btnEditSrcFile, 0, "Edit", NoList,CA_None,
  133.         isSens,frmObj, btnDelSrcFile, objList,0,"Edit selected file"},
  134.  
  135.  
  136.     {C_ToggleFrame, frmPaths, 0, "",NoList,CA_NoBorder | CA_Hidden,isSens,frmMain, 0, 0},
  137.     {C_Label, lblSrcPath, 0, " Src path: ", NoList, CA_None, isSens,frmPaths,0, 0},
  138.     {C_TextIn, txiSrcPath, 0, " ", NoList, CA_Large, isSens,frmPaths, lblSrcPath, 0,0,
  139.         "Path for source files"},
  140.     {C_Button, btnBrwSrcD, 0, " Browse ", NoFrame,CA_None, isSens,frmPaths,txiSrcPath, 0, 0,
  141.         "Select with File Dialog"},
  142.     {C_Label, lblObjPath, 0, " Obj path: ", NoList, CA_None, isSens,frmPaths,0, txiSrcPath},
  143.     {C_TextIn, txiObjPath, 0, " ", NoList, CA_Large, isSens,frmPaths, lblObjPath, txiSrcPath,0,
  144.         "Path to write obj files"},
  145.     {C_Button, btnBrwObjD, 0, " Browse ", NoFrame,CA_None, isSens,frmPaths,txiObjPath, txiSrcPath, 0,
  146.         "Select with File Dialog"},
  147.     {C_Label, lblBinPath, 0, " Bin path: ", NoList, CA_None, isSens,frmPaths, 0, lblObjPath},
  148.     {C_TextIn, txiBinPath, 0, " ", NoList, CA_Large, isSens,frmPaths,lblBinPath, txiObjPath,0,
  149.         "Path to write exectuable"},
  150.     {C_Button, btnBrwBinD, 0, " Browse ", NoFrame,CA_None, isSens,frmPaths,txiBinPath, btnBrwObjD,0,
  151.         "Select with File Dialog"},
  152.  
  153.     {C_Frame, frmIncl, 0, "", NoList, CA_None, isSens, frmPaths, 0, btnBrwBinD},
  154.     {C_Label, lblIncl, 0, "Include Paths:", NoList, CA_None, isSens, frmIncl,0, 0},
  155.     {C_List,  lstIncl, 130, " ",  ( void * ) vtmp,
  156.         CA_ListWidth,isSens, frmIncl,0, lblIncl,0,"Paths to search for includes"},
  157.     {C_Button, btnAddInclPath, 0, "Add", NoFrame,CA_None,
  158.         isSens,frmIncl,0, lstIncl,0,"Add path with file dialog"},
  159.     {C_Button, btnDelInclPath, 0, "Del", NoFrame,CA_None,
  160.         isSens,frmIncl, btnAddInclPath, lstIncl,0,"Delete selected path"},
  161.     {C_Button, btnEditInclPath, 0, "Edit", NoList,CA_None,
  162.         isSens,frmIncl, btnDelInclPath, lstIncl,0,"Edit selected item"},
  163.  
  164.     {C_Frame, frmLibs, 0, "", NoList, CA_None, isSens, frmPaths, frmIncl, btnBrwBinD},
  165.     {C_Label, lblLibP, 0, "Library Paths:", NoList, CA_None, isSens, frmLibs,0, 0},
  166.     {C_List,  lstLibs, 130, " ",  (void * ) vtmp, 
  167.         CA_ListWidth, isSens, frmLibs,0, lblLibP,0,"Paths for libraries"},
  168.     {C_Button, btnAddLibsPath, 0, "Add", NoFrame,CA_None,
  169.         isSens,frmLibs,0, lstLibs,0,"Add path with File Dialog"},
  170.     {C_Button, btnDelLibsPath, 0, "Del", NoFrame,CA_None,
  171.         isSens,frmLibs, btnAddLibsPath, lstLibs,0,"Delete selected path"},
  172.     {C_Button, btnEditLibsPath, 0, "Edit", NoList,CA_None,
  173.         isSens,frmLibs, btnDelLibsPath, lstLibs,0,"Edit selected item"},
  174.  
  175.     {C_ToggleFrame, frmDefs, 0, "",NoList,CA_NoBorder | CA_Hidden,isSens,frmMain, 0, 0},
  176.      {C_Label, lblDefPool, 0, " Definition Pool", NoList, CA_None, isSens,frmDefs,0, 0},
  177.      {C_List,  lstDefPool, 124, " ",  (void *) vtmp, 
  178.     CA_ListWidth | CA_Size, isSens, frmDefs, 0, lblDefPool, 12,"Defines available, but not used" },
  179.      {C_Button, btnAddDef, 0, "Add", NoFrame,CA_None,
  180.        isSens,frmDefs, 0, lstDefPool,0,"Add define to pool"},
  181.      {C_Button, btnDelDef, 0, "Del", NoFrame,CA_None,
  182.        isSens,frmDefs, btnAddDef, lstDefPool,0,"Delete selected define"},
  183.     {C_Button, btnEditDef, 0, "Edit", NoList,CA_None,
  184.         isSens,frmDefs, btnDelDef, lstDefPool,0,"Edit selected item"},
  185.  
  186.      {C_Blank, blkBlank1, 0, " ", NoList, CA_None, isSens,frmDefs,lstDefPool, 0},
  187.      {C_Blank, blkBlank2, 0, " ", NoList, CA_None, isSens,frmDefs,lstDefPool, blkBlank1},
  188.      {C_Blank, blkBlank3, 0, " ", NoList, CA_None, isSens,frmDefs,lstDefPool, blkBlank2},
  189.      {C_Button, btnAdd, 0,   ">", NoFrame,CA_None,
  190.        isSens,frmDefs, lstDefPool, blkBlank3,0,"Add to active defines"},
  191.  
  192.      {C_Label, lblDef, 0, " Active Definitions ", NoList, CA_None,
  193.        isSens,frmDefs, btnAdd, 0},
  194.      {C_List,  lstDef, 124, " ",  (void *)vtmp,
  195.     CA_ListWidth| CA_Size, isSens, frmDefs,btnAdd, lblDef, 12,"Defines used to build makefile"},
  196.      {C_Button, btnDel, 0,   "Del", NoFrame,CA_None,
  197.        isSens,frmDefs, btnAdd, lstDef,0,"Delete from active defines"},
  198.  
  199.     {C_ToggleFrame, frmOpts, 0, "",NoList,CA_NoBorder | CA_Hidden,isSens,frmMain, 0, 0},
  200.     {C_Label, lblUOpt, 0," User Makefile Options:", NoList, CA_None, isSens, frmOpts,0, 0},
  201.     {C_List, UOptList, 160, " ", (void *) vtmp, 
  202.         CA_ListWidth | CA_Size, isSens, frmOpts, 0, lblUOpt, 12, "Options included in Makefile" },
  203.     {C_Button, btnAddUOpt, 0, "Add", NoList,CA_None,
  204.         isSens,frmOpts,0, UOptList, 0, "Add User Option"},
  205.     {C_Button, btnDelUOpt, 0, "Del", NoList,CA_None,
  206.         isSens,frmOpts, btnAddUOpt, UOptList,0,"Delete selected item"},
  207.     {C_Button, btnEditUOpt, 0, "Edit", NoList,CA_None,
  208.         isSens,frmOpts, btnDelUOpt, UOptList,0,"Edit selected item"},
  209.  
  210.     {C_Button, M_OK, 0, "   OK   ", NoList, CA_DefaultButton,
  211.         isSens, NoFrame, 0, frmTogBtns,0,"Save project file"},
  212.  
  213.     {C_Button, M_Cancel, 0, " Cancel ",NoList,CA_None,
  214.         isSens,NoFrame, M_OK, frmTogBtns,0,"Abort Project Edit"},
  215.     {C_CheckBox, chkMakeMkf, 1,"Make Makefile",NoList,CA_None,isSens,NoFrame, M_Cancel, frmTogBtns,
  216.         0,"Write Makefile if checked"},
  217.  
  218.     {C_EndOfList,0,0,0,0,CA_None,0,0,0}
  219.       };
  220. //@V@:EndDialogCmd
  221.  
  222. //===================>>> projectDialog::projectDialog <<<====================
  223.   projectDialog::projectDialog(makefileMaker& m, 
  224.     vBaseWindow* bw, char* title)
  225.        : mm(m), vModalDialog(bw, title)
  226.   {
  227.     cmdw = (videCmdWindow*) bw;
  228.       ta = 0;
  229.       AddDialogCmds(PCmds);
  230.   }
  231.   
  232. //===================>>> projectDialog::projectDialog <<<=====================
  233.   projectDialog::projectDialog(makefileMaker& m, vApp *aw, char* title)
  234.     : mm(m), vModalDialog(aw, title)
  235.   {
  236.    ta = 0;
  237.    AddDialogCmds(PCmds);
  238.   }
  239.  
  240. //===================>>> projectDialog::~projectDialog <<<====================
  241.   projectDialog::~projectDialog()
  242.   {
  243.     //IMPORTANT: set objList back to original status!
  244.     //has to be fixed in a new cmdList version
  245.  
  246.     PCmds[vGetcmdIdIndex(objList, PCmds)].itemList = (void * ) vtmp;
  247.     SetValue(objList,-1,ChangeListPtr);
  248.  
  249.     PCmds[vGetcmdIdIndex(lstIncl, PCmds)].itemList = (void * ) vtmp;
  250.     SetValue(lstIncl,-1,ChangeListPtr);
  251.  
  252.     PCmds[vGetcmdIdIndex(lstLibs, PCmds)].itemList = (void * ) vtmp;
  253.     SetValue(lstLibs,-1,ChangeListPtr);
  254.  
  255.     PCmds[vGetcmdIdIndex(lstDefPool, PCmds)].itemList = (void * ) vtmp;
  256.     SetValue(lstDefPool,-1,ChangeListPtr);
  257.  
  258.     PCmds[vGetcmdIdIndex(lstDef, PCmds)].itemList = (void * ) vtmp;
  259.     SetValue(lstDef,-1,ChangeListPtr);
  260.  
  261.     PCmds[vGetcmdIdIndex(UOptList, PCmds)].itemList = (void * ) vtmp;
  262.     SetValue(UOptList,-1,ChangeListPtr);
  263.   }
  264.  
  265. //====================>>> projectDialog::DialogDisplayed <<<====================
  266.   void projectDialog::DialogDisplayed()
  267.   {
  268.  
  269.     // Display only the top frame
  270.  
  271.     SetValue(frmNames, 1, Value);    SetValue(frmObj, 0, Value);
  272.     SetValue(frmPaths, 0, Value);    SetValue(frmDefs, 0, Value);
  273.     SetValue(frmOpts, 0, Value);
  274.  
  275.     // set dialog values to the ones from the mm object
  276.  
  277.     SetString(txiExeName, mm.exeName);
  278.     SetString(txiMkfName, mm.makeName);
  279.     SetString(txiCC, mm.cc);
  280.     SetString(txiCFlags, mm.cFlags);
  281.     SetString(txiLibs, mm.Libs);
  282.     SetString(txiObjPath, mm.ObjDir);
  283.     SetString(txiBinPath, mm.BinDir);
  284.     SetString(txiSrcPath, mm.SrcDir);
  285.  
  286.     // set to current lists
  287.     PCmds[vGetcmdIdIndex(lstIncl, PCmds)].itemList = 
  288.     (void *)(mm.incDirs.list);
  289.     SetValue(lstIncl,-1,ChangeListPtr);    // change the whole list & unselect!
  290.  
  291.     PCmds[vGetcmdIdIndex(objList, PCmds)].itemList = 
  292.     (void *)mm.objFiles.list;
  293.     SetValue(objList,-1,ChangeListPtr);    // change the whole list!
  294.  
  295.     PCmds[vGetcmdIdIndex(lstLibs, PCmds)].itemList = 
  296.     (void *)(mm.libDirs.list);
  297.     SetValue(lstLibs,-1,ChangeListPtr);    // change the whole list & unselect!
  298.  
  299.     PCmds[vGetcmdIdIndex(lstDefPool, PCmds)].itemList = (void *)mm.defsPool.list;
  300.     SetValue(lstDefPool, -1, ChangeListPtr);    // change the whole list & unselect!
  301.  
  302.     PCmds[vGetcmdIdIndex(lstDef, PCmds)].itemList = (void *)mm.curDefs.list;
  303.     SetValue(lstDef,-1,ChangeListPtr);    // change the whole list & unselect!
  304.  
  305.     PCmds[vGetcmdIdIndex(UOptList, PCmds)].itemList = (void *)mm.curOpts.list;
  306.     SetValue(UOptList,-1,ChangeListPtr);    // change the whole list & unselect!
  307.   }
  308.  
  309. //====================>>> projectDialog::editProject <<<====================
  310.   int projectDialog::editProject()
  311.   {
  312.     ItemVal dans, rval;
  313.  
  314.     dans = ShowModalDialog("Project Manager",rval);
  315.  
  316.     if (dans == M_Cancel)
  317.     return Cancel;
  318.  
  319.     // have to retrieve values now...
  320.  
  321.     GetTextIn(txiExeName, mm.exeName, 255);
  322.     GetTextIn(txiCC, mm.cc,255);
  323.     GetTextIn(txiCFlags, mm.cFlags, 255);
  324.     GetTextIn(txiLibs, mm.Libs, 255);
  325.     GetTextIn(txiObjPath, mm.ObjDir, 255);
  326.     GetTextIn(txiSrcPath, mm.SrcDir, 255);
  327.     GetTextIn(txiBinPath, mm.BinDir, 255);
  328.     GetTextIn(txiMkfName, mm.makeName, 255);
  329.  
  330.     if (GetValue(chkMakeMkf))
  331.     mm.saveMakefile();
  332.     return NoBuild;
  333.   }
  334.  
  335. //====================>>> projectDialog::DialogCommand <<<====================
  336.   void projectDialog::DialogCommand(ItemVal id, ItemVal retval, CmdType ctype)
  337.   {
  338.     UserDebug2(CmdEvents,"projectDialog::DialogCommand(id:%d, val:%d)\n",id, retval)
  339.  
  340.     switch (id)        // We will do some things depending on value
  341.       {
  342.  
  343.     case tbtFiles:
  344.       {
  345.         SetValue(tbtFiles,1,Value);        SetValue(tbtFlags,0,Value);
  346.         SetValue(tbtPaths,0,Value);        SetValue(tbtDefs,0,Value);
  347.         SetValue(tbtOpts,0,Value);
  348.  
  349.         SetValue(frmNames, 0, Value);    SetValue(frmObj, 1, Value);
  350.         SetValue(frmPaths, 0, Value);    SetValue(frmDefs, 0, Value);
  351.         SetValue(frmOpts, 0, Value);
  352.         break;
  353.       }
  354.  
  355.     case tbtFlags:
  356.       {
  357.         SetValue(tbtFiles,0,Value);        SetValue(tbtFlags,1,Value);
  358.         SetValue(tbtPaths,0,Value);        SetValue(tbtDefs,0,Value);
  359.         SetValue(tbtOpts,0,Value);
  360.  
  361.         SetValue(frmNames, 1, Value);    SetValue(frmObj, 0, Value);
  362.         SetValue(frmPaths, 0, Value);    SetValue(frmDefs, 0, Value);
  363.         SetValue(frmOpts, 0, Value);
  364.         break;
  365.       }
  366.  
  367.     case tbtPaths:
  368.       {
  369.         SetValue(tbtFiles,0,Value);        SetValue(tbtFlags,0,Value);
  370.         SetValue(tbtPaths,1,Value);        SetValue(tbtDefs,0,Value);
  371.         SetValue(tbtOpts,0,Value);
  372.  
  373.         SetValue(frmNames, 0, Value);    SetValue(frmObj, 0, Value);
  374.         SetValue(frmPaths, 1, Value);    SetValue(frmDefs, 0, Value);
  375.         SetValue(frmOpts, 0, Value);
  376.         break;
  377.       }
  378.  
  379.     case tbtDefs:
  380.       {
  381.         SetValue(tbtFiles,0,Value);        SetValue(tbtFlags,0,Value);
  382.         SetValue(tbtPaths,0,Value);        SetValue(tbtDefs,1,Value);
  383.         SetValue(tbtOpts,0,Value);
  384.  
  385.         SetValue(frmNames, 0, Value);    SetValue(frmObj, 0, Value);
  386.         SetValue(frmPaths, 0, Value);    SetValue(frmDefs, 1, Value);
  387.         SetValue(frmOpts, 0, Value);
  388.         break;
  389.       }
  390.  
  391.     case tbtOpts:
  392.       {
  393.         SetValue(tbtFiles,0,Value);        SetValue(tbtFlags,0,Value);
  394.         SetValue(tbtPaths,0,Value);        SetValue(tbtDefs, 0,Value);
  395.         SetValue(tbtOpts,1,Value);
  396.  
  397.         SetValue(frmNames, 0, Value);    SetValue(frmObj, 0, Value);
  398.         SetValue(frmPaths, 0, Value);    SetValue(frmDefs, 0, Value);
  399.         SetValue(frmOpts, 1, Value);
  400.         break;
  401.       }
  402.  
  403.         case btnAddSrcFile:
  404.       {
  405.         char MSDOSpath[100]= "";
  406.         int fi = 0;
  407.         static char* makeFilter[] = {"*.cpp", "*.*", 0};
  408.         vFileSelect fsel(this);
  409.  
  410.         int oans = fsel.FileSelect("Add a Source File",
  411.                                      MSDOSpath,99, makeFilter,fi);
  412.         if (oans && *MSDOSpath) //filename picked
  413.           {
  414.         ta=1; // target file added!
  415.         char uxfn[100]="";
  416.         Dos2UxFName(MSDOSpath, uxfn, 0);
  417.         if (!mm.addFile(uxfn))
  418.           {
  419.             vNoticeDialog note(this);
  420.             note.Notice("File already selected for this Project");
  421.           }
  422.           }
  423.         SetValue(objList,-1,ChangeList); // update list & unselect!
  424.  
  425.         break;
  426.       }    //@V@:EndCase
  427.  
  428.         case btnDelSrcFile:
  429.       {
  430.             int lval = GetValue(objList); 
  431.             if (lval < 0)
  432.         break;
  433.         mm.objFiles.deleteItem(lval);
  434.         SetValue(objList,-1,ChangeList); // update list & unselect!
  435.  
  436.       }    //@V@:EndCase
  437.  
  438.     case btnEditSrcFile:
  439.       {
  440.             vReplyDialog newDefDlg(this);
  441.             int ans;
  442.             char r[100];
  443.  
  444.             int lval = GetValue(objList);
  445.             if (lval < 0)
  446.         break;
  447.  
  448.             ans=newDefDlg.Reply("Edit Source filename", r, 99,
  449.         mm.objFiles.list[lval]);
  450.             if (ans==M_Cancel)
  451.          break;
  452.             if (*r)
  453.               {
  454.         mm.objFiles.replace(lval,r);
  455.               }
  456.             SetValue(objList,-1,ChangeListPtr); //update list & unselect!
  457.         break;
  458.       }
  459.     case btnBrwSrcD:
  460.       {
  461.         char MSDOSpath[100]= "";
  462.         int fi = 0;
  463.         static char* makeFilter[] = {"*.o", "*.*", 0};
  464.         vFileSelect fsel(this);
  465.  
  466.         fsel.FileSelect("Select a file in the Src Directory",
  467.                                      MSDOSpath,99, makeFilter,fi);
  468.             char uxfn[100]="";
  469.             Dos2UxFName(MSDOSpath, uxfn, 1);
  470.             SetString(txiSrcPath, uxfn);
  471.             break;
  472.           }
  473.  
  474.     case btnBrwObjD:
  475.       {
  476.         char MSDOSpath[100]= "";
  477.         int fi = 0;
  478.         static char* makeFilter[] = {"*.o", "*.*", 0};
  479.         vFileSelect fsel(this);
  480.  
  481.         fsel.FileSelect("Select a file in the Obj Directory",
  482.                                      MSDOSpath,99, makeFilter,fi);
  483.             char uxfn[100]="";
  484.             Dos2UxFName(MSDOSpath, uxfn, 1);
  485.             SetString(txiObjPath, uxfn);
  486.             break;
  487.           }
  488.  
  489.     case btnBrwBinD:
  490.       {
  491.         char MSDOSpath[100]= "";
  492.         int fi = 0;
  493.         static char* makeFilter[] = {"*.exe", "*.*", 0};
  494.         vFileSelect fsel(this);
  495.  
  496.         fsel.FileSelect("Select file in Bin Directory",
  497.                                      MSDOSpath,99, makeFilter,fi);
  498.             char uxfn[100]="";
  499.             Dos2UxFName(MSDOSpath, uxfn, 1);
  500.             SetString(txiBinPath, uxfn);
  501.             break;
  502.           }
  503.  
  504.     case btnAddInclPath:
  505.       {
  506.         char MSDOSpath[100]= "";
  507.         int fi = 0;
  508.         static char* makeFilter[] = {"*.h", "*.*", 0};
  509.         vFileSelect fsel(this);
  510.  
  511.         int oans = fsel.FileSelect("Select file in Include Path",
  512.                                      MSDOSpath,99, makeFilter,fi);
  513.  
  514.             char uxfn[100]="";
  515.             Dos2UxFName(MSDOSpath, uxfn, 1);
  516.            
  517.             //@@@ Add inc dirs only once!
  518.         mm.incDirs.insert(-1,uxfn);
  519.         SetValue(lstIncl,-1,ChangeListPtr); //update list & unselect!
  520.  
  521.         break;
  522.       }    //@V@:EndCase
  523.  
  524.     case btnDelInclPath:
  525.       {
  526.         int lval=GetValue(lstIncl); 
  527.         if (lval < 0)
  528.         break;
  529.         mm.incDirs.deleteItem(lval);
  530.         SetValue(lstIncl,-1,ChangeListPtr); //update list & unselect!
  531.         break;
  532.       }    //@V@:EndCase
  533.  
  534.     case btnEditInclPath:
  535.       {
  536.             vReplyDialog newDefDlg(this);
  537.             int ans;
  538.             char r[100];
  539.  
  540.             int lval = GetValue(lstIncl);
  541.             if (lval < 0)
  542.         break;
  543.  
  544.             ans=newDefDlg.Reply("Edit Include Path", r, 99,
  545.         mm.incDirs.list[lval]);
  546.             if (ans==M_Cancel)
  547.          break;
  548.             if (*r)
  549.               {
  550.         mm.incDirs.replace(lval,r);
  551.               }
  552.             SetValue(lstIncl,-1,ChangeListPtr); //update list & unselect!
  553.         break;
  554.       }
  555.  
  556.     case btnAddLibsPath:
  557.       {
  558.         char MSDOSpath[100]= "";
  559.         int fi = 0;
  560.         static char* makeFilter[] = {"*.a", "*.*", 0};
  561.         vFileSelect fsel(this);
  562.  
  563.         int oans = fsel.FileSelect("Select file in Library Path",
  564.             MSDOSpath,99, makeFilter,fi);
  565.             char uxfn[100]="";
  566.             Dos2UxFName(MSDOSpath, uxfn, 1);
  567.             // @@ Add dirs only once!
  568.         mm.libDirs.insert(-1,uxfn);
  569.         SetValue(lstLibs,-1,ChangeListPtr); // update list & unselect!
  570.  
  571.         break;
  572.       }    //@V@:EndCase
  573.  
  574.     case btnDelLibsPath:
  575.       {
  576.         int lval=GetValue(lstLibs); 
  577.         if (lval < 0)
  578.         break;
  579.         mm.libDirs.deleteItem(lval);
  580.         SetValue(lstLibs,-1,ChangeListPtr); //update list & unselect!
  581.         break;
  582.       }    //@V@:EndCase
  583.  
  584.     case btnEditLibsPath:
  585.       {
  586.             vReplyDialog newDefDlg(this);
  587.             int ans;
  588.             char r[100];
  589.  
  590.             int lval = GetValue(lstLibs);
  591.             if (lval < 0)
  592.         break;
  593.  
  594.             ans=newDefDlg.Reply("Edit Lib Path", r, 99,
  595.         mm.libDirs.list[lval]);
  596.             if (ans==M_Cancel)
  597.          break;
  598.             if (*r)
  599.               {
  600.         mm.libDirs.replace(lval,r);
  601.               }
  602.             SetValue(lstLibs,-1,ChangeListPtr); //update list & unselect!
  603.         break;
  604.       }
  605.  
  606.       case btnAddDef:
  607.         {
  608.             vReplyDialog newDefDlg(this);
  609.             int ans;
  610.             char r[100];
  611.  
  612.             ans=newDefDlg.Reply("Enter define/undefine (including -D or -U):", r, 99);
  613.             if (ans==M_Cancel)
  614.          break;
  615.             if (*r)
  616.               {
  617.         mm.defsPool.insert(-1,r);
  618.               }
  619.             SetValue(lstDefPool,-1,ChangeListPtr); //update list & unselect!
  620.             break;
  621.           }
  622.  
  623.  
  624.         case btnDelDef:
  625.           {
  626.             int lval = GetValue(lstDefPool); 
  627.             if (lval < 0)
  628.         break;
  629.         mm.defsPool.deleteItem(lval);
  630.             SetValue(lstDefPool,-1,ChangeListPtr); //update list & unselect!
  631.             break;
  632.           } //@V@:EndCase
  633.  
  634.  
  635.     case btnEditDef:
  636.       {
  637.             vReplyDialog newDefDlg(this);
  638.             int ans;
  639.             char r[100];
  640.  
  641.             int lval = GetValue(lstDefPool);
  642.             if (lval < 0)
  643.         break;
  644.  
  645.             ans=newDefDlg.Reply("Edit Definition", r, 99,
  646.         mm.defsPool.list[lval]);
  647.             if (ans==M_Cancel)
  648.          break;
  649.             if (*r)
  650.               {
  651.         mm.defsPool.replace(lval,r);
  652.               }
  653.             SetValue(lstDefPool,-1,ChangeListPtr); //update list & unselect!
  654.         break;
  655.       }
  656.  
  657.         case btnAdd:        // add to def pool
  658.         {
  659.             int lval=GetValue(lstDefPool); 
  660.             if (lval < 0)
  661.         break;
  662.         mm.curDefs.insert(-1,mm.defsPool.list[lval]);    // add to def list
  663.             SetValue(lstDef,-1,ChangeListPtr); //update list & unselect!
  664.             SetValue(lstDefPool,-1,ChangeListPtr); // unselect!
  665.             break;
  666.         }    //@V@:EndCase
  667.  
  668.         case btnDel:        // delete from active defs
  669.         {
  670.             int lval=GetValue(lstDef); 
  671.             if (lval < 0)
  672.         break;
  673.         mm.curDefs.deleteItem(lval);    // add to def list
  674.             SetValue(lstDef, -1, ChangeListPtr); //update list & unselect!
  675.  
  676.             break;
  677.         }    //@V@:EndCase
  678.  
  679.     case btnAddUOpt:
  680.       {
  681.             vReplyDialog newDefDlg(this);
  682.             int ans;
  683.             char r[100];
  684.  
  685.             ans=newDefDlg.Reply("Enter Makefile user define:", r, 99);
  686.             if (ans==M_Cancel)
  687.          break;
  688.             if (*r)
  689.               {
  690.         mm.curOpts.insert(-1,r);
  691.               }
  692.             SetValue(UOptList,-1,ChangeListPtr); //update list & unselect!
  693.         break;
  694.       }
  695.  
  696.     case btnDelUOpt:
  697.       {
  698.             int lval=GetValue(UOptList);
  699.             if (lval < 0)
  700.         break;
  701.         mm.curOpts.deleteItem(lval);    // add to def list
  702.             SetValue(UOptList, -1, ChangeListPtr); //update list & unselect!
  703.         break;
  704.       }
  705.  
  706.     case btnEditUOpt:
  707.       {
  708.             vReplyDialog newDefDlg(this);
  709.             int ans;
  710.             char r[100];
  711.  
  712.             int lval = GetValue(UOptList);
  713.             if (lval < 0)
  714.         break;
  715.  
  716.             ans=newDefDlg.Reply("Edit User Makefile definition", r, 99,
  717.         mm.curOpts.list[lval]);
  718.             if (ans==M_Cancel)
  719.          break;
  720.             if (*r)
  721.               {
  722.         mm.curOpts.replace(lval,r);
  723.               }
  724.             SetValue(UOptList,-1,ChangeListPtr); //update list & unselect!
  725.         break;
  726.       }
  727.  
  728.       }//switch
  729.  
  730.     vModalDialog::DialogCommand(id,retval,ctype);
  731.   }
  732.  
  733. //------------------------------------------------------------------------
  734.