コード例 #1
0
ファイル: fileutil.c プロジェクト: DrItanium/maya
void AppendDribble(
  Environment *theEnv,
  const char *str)
  {
   int i;

   if (! DribbleActive(theEnv)) return;
   
   for (i = 0 ; str[i] != EOS ; i++)
     { PutcDribbleBuffer(theEnv,str[i]); }
  }
コード例 #2
0
ファイル: menucmds.c プロジェクト: ahmed-masud/FuzzyCLIPS
/*******************************************************************
* OpenDribbleFile: Function will display the common file dialog and
*    will open a dribble file.
******************************************************************/
void OpenDribbleFile ( HWND hMain, WORD wParam )
{  extern HANDLE hInst;
   OPENFILENAME ofn;
   char File[256], FileTitle[256], Filter[256];
   UINT i, cbString;
   char Replace;
   HMENU hMenu = GetMenu(hMain);

   if ( !DribbleActive() )
   {  File[0] = '\0';
      memset ( &ofn,0, sizeof (OPENFILENAME));
      ofn.lpstrTitle = "Select CLIPS Dribble File";
      if ((cbString = LoadString ( (HINSTANCE) hInst, IDS_DRIBBLE, Filter, sizeof (Filter))) == 0 )
         return;

      Replace = Filter[cbString-1];
      for (i=0; Filter[i] != '\0'; i++)
         if ( Filter[i] == Replace)
	    Filter[i] = '\0';

      ofn.lStructSize = sizeof ( OPENFILENAME );
      ofn.hwndOwner = hMain;
      ofn.lpstrFilter = Filter;
      ofn.nFilterIndex = 1;
      ofn.lpstrFile = File;
      ofn.nMaxFile = sizeof (File );
      ofn.lpstrFileTitle = FileTitle;
      ofn.nMaxFileTitle = sizeof (FileTitle);
      ofn.lpstrInitialDir = NULL;
      ofn.Flags = OFN_OVERWRITEPROMPT;

      if ( GetSaveFileName ( &ofn ) )
      {  UpdateCursor ( WAIT_CURSOR );
         ModifyMenu (hMenu, wParam, MF_BYCOMMAND, wParam, "Turn Dribble Off");
         DribbleOn ( ofn.lpstrFile );
      }
   }
   else
   {  UpdateCursor ( WAIT_CURSOR );
      ModifyMenu (hMenu, wParam, MF_BYCOMMAND, wParam, "Turn Dribble On...");
      DribbleOff( );
   }
}