static void QuitProc (void) { Boolean dirty; Int2 j; Int2 num; ObjMgrPtr omp; ObjMgrDataPtr PNTR omdpp; ObjMgrDataPtr tmp; dirty = FALSE; omp = ObjMgrGet (); num = omp->currobj; for (j = 0, omdpp = omp->datalist; j < num && omdpp != NULL; j++, omdpp++) { tmp = *omdpp; if (tmp->parentptr == NULL) { if (tmp->dirty) { dirty = TRUE; } } } if (dirty) { if (Message (MSG_YN, "Some data have not been saved.\nAre you sure you want to exit?") == ANS_YES) { QuitProgram (); } } else { QuitProgram (); } }
int CaptureInput() { boolCaptureIO = 1; while( boolCaptureIO ) { //While there's an event to handle while( SDL_PollEvent( &event ) ) { //If a key was pressed if( event.type == SDL_KEYDOWN ) { //Process key press } else if( event.type == SDL_KEYUP) { //Process key up } else if( event.type == SDL_QUIT ) { //Quit the program QuitProgram(); } //If there's an event to handle } } }
BOOLEAN QuitProgram(void) { BOOLEAN return_value; //Declare return value variable BOOLEAN error; char buff[255]; if(!filename[0]) //If database closed quit { printf("\nGood-bye\n"); return_value = TRUE; } else //If database open ask to close { do { error = FALSE; printf("\nA database is open.\nDo you want to save before quitting? (Y/N): "); fgets(buff, 255, stdin); buff[0] = tolower(buff[0]); if((buff[0] != 'y' && buff[0] != 'n') || buff[1] != '\n') { printf("\nError\nPlease enter a valid response\n"); error = TRUE; } else { if(buff[0] == 'y') { CloseData(); return_value = QuitProgram(); } else { filename[0] = '\0'; return_value = QuitProgram(); } } }while(error); } return(return_value); }
static void CloseConsignParentProc (WindoW w) { XOSPtr xosp; if ((xosp = (XOSPtr) GetObjectExtra (w)) != NULL) { CleanUpXOS (xosp); MemFree (xosp->pattern_file); MemFree (xosp); } Remove (w); QuitProgram (); return; }
static void StandaloneFormMessage (ForM f, Int2 mssg) { BaseFormPtr bfp; bfp = (BaseFormPtr) GetObjectExtra (f); if (bfp != NULL) { switch (mssg) { case VIB_MSG_QUIT: QuitProgram (); break; default: break; } } }
static void CloseConsortParentProc (WindoW w) { XOSPtr xosp; if ((xosp = (XOSPtr) GetObjectExtra (w)) != NULL) { xosp->gsp = NULL; /* is static */ MemFree (xosp->filename); xosp->sep = SeqEntryFree (xosp->sep); xosp->bsp = NULL; /* should be in seqentry */ MemFree (xosp); } Remove (w); QuitProgram (); return; }
void main(void) { char choice; //Declare Variables int i = 0; BOOLEAN quit = FALSE; FIRST = NULL; //Initialize variables LAST = NULL; for(i = 0; i < 256; i++) InitializeRec(&array[i]); filename[0] = '\0'; i = 0; do //menu open until quit = TRUE { choice = DisplayMainMenu(); //Display Main Menu and Get Main Menu Choice switch(choice) //Menu swithc { case 'o': OpenData(); break; case 'a': AddRec(); break; case 's': SearchData(); break; case 'b': BrowseData(); break; case 'd': printf("\nDelete Record\n"); break; case 'c': CloseData(); break; case 'q': quit = QuitProgram(); break; default: printf("\nError\nPlease enter a valid response.\n"); break; } }while(!quit); return; //Exit the program. }
static void ConfigCancelled (void) { QuitProgram (); }
static void ConfigAccepted (void) { QuitProgram (); }
static void ConfigCancelled (void) { Message (MSG_OK, "Entrez cannot run without ncbi configuration file"); QuitProgram (); }
static void ConfigAccepted (void) { Message (MSG_OK, "Please rerun Entrez now that it is configured"); QuitProgram (); }
static void DoQuit (ButtoN b) { QuitProgram (); }
/*>HandleEvent(APTR object) ------------------------ Dispatch menu events. 12.03.92 Original. 30.03.92 Modified MenuEdit to call OpenFile() directly. 31.03.92 Modified MenuSave to call SaveAsFile() directly. 05.05.92 Added Rexx menu handling 12.06.92 Removed fill grey/hatch items and replaced with requester 02.07.92 Added MenuPalette 13.07.92 Added MenuScrBack 20.07.92 Added DEMO_VERSION conditional 07.08.92 Added RemoveFills() */ HandleEvent(APTR object) { if(object == (APTR)MenuOpen) { OpenFile(object); return(0); } if(object == (APTR)MenuSave) { SaveAsFile(object); return(0); } if(object == (APTR)MenuSaveAs) { SaveAsFile(object); return(0); } if(object == (APTR)MenuEdit) { OpenFile(object); return(0); } if(object == (APTR)MenuPaper) { SetPaper(object); return(0); } if(object == (APTR)MenuSetPens) { SetPens(object); return(0); } if(object == (APTR)MenuPalette) { SetPalette(object); return(0); } if(object == (APTR)MenuScrBack) { ScreenToBack(MyScreen); return(0); } if(object == (APTR)MenuAbout) { About(object); return(0); } if(object == (APTR)MenuQuit) { QuitProgram(object); return(0); } #ifndef DEMO_VERSION if(object == (APTR)MenuPS) { PlotPS(object); return(0); } if(object == (APTR)MenuHPGL) { PlotHPGL(object); return(0); } if(object == (APTR)MenuDR2D) { PlotDR2D(object); return(0); } #endif if(object == (APTR)MenuXY) { StyleXY(object); return(0); } if(object == (APTR)MenuScatter) { StyleScatter(object); return(0); } if(object == (APTR)MenuBar) { StyleBar(object); return(0); } if(object == (APTR)MenuPie) { StylePie(object); return(0); } if(object == (APTR)MenuErrors) { ToggleErrors(object); return(0); } if(object == (APTR)MenuEject) { EjectSlice(object); return(0); } if(object == (APTR)MenuLineSet) { SetLine(object); return(0); } if(object == (APTR)MenuBarSet) { SetBar(object); return(0); } if(object == (APTR)MenuPieSet) { SetPie(object); return(0); } if(object == (APTR)MenuLogX) { ToggleLogX(object); return(0); } if(object == (APTR)MenuLogY) { ToggleLogY(object); return(0); } if(object == (APTR)MenuBoxed) { ToggleBoxed(object); return(0); } if(object == (APTR)MenuGrid) { ToggleGrid(object); return(0); } if(object == (APTR)MenuAxes) { SetAxes(object); return(0); } if(object == (APTR)MenuFZero) { ToggleFZero(object); return(0); } if(object == (APTR)MenuTitle) { SetTitle(object); return(0); } if(object == (APTR)MenuAxTitle) { SetAxTitle(object); return(0); } if(object == (APTR)MenuAxLabel) { SetAxLabel(object); return(0); } if(object == (APTR)MenuKey) { SetKey(object); return(0); } if(object == (APTR)MenuLabel) { SetLabel(object); return(0); } if(object == (APTR)MenuPen) { ChangePen(object); return(0); } if(object == (APTR)MenuFillType) { FillControl(object); return(0); } if(object == (APTR)MenuRegress) { SetRegress(object); return(0); } if(object == (APTR)MenuRobust) { ToggleRobust(object); return(0); } if(object == (APTR)MenuFourier) { SetFourier(object); return(0); } if(object == (APTR)MenuRexxFit) { RexxFit(object); return(0); } if(object == (APTR)MenuRexx) { InstallMacro(object); return(0); } if(object == (APTR)MenuRunRexx) { RunMacro(object); return(0); } if(object == (APTR)MenuDebRexx) { ToggleRexxDeb(object); return(0); } if(object == (APTR)MenuLS1) { SetLineDash(object); return(0); } if(object == (APTR)MenuLS2) { SetLineDash(object); return(0); } if(object == (APTR)MenuLS3) { SetLineDash(object); return(0); } if(object == (APTR)MenuLS4) { SetLineDash(object); return(0); } if(object == (APTR)MenuLS5) { SetLineDash(object); return(0); } if(object == (APTR)MenuLS6) { SetLineDash(object); return(0); } if(object == (APTR)MenuFT1) { SetFillType(object); return(0); } if(object == (APTR)MenuFT2) { SetFillType(object); return(0); } if(object == (APTR)MenuFT3) { SetFillType(object); return(0); } if(object == (APTR)MenuFT4) { SetFillType(object); return(0); } if(object == (APTR)MenuFT5) { SetFillType(object); return(0); } if(object == (APTR)MenuFT6) { SetFillType(object); return(0); } if(object == (APTR)MenuNoFills) { RemoveFills(object); return(0); } return(0); }
static void OnQuit ( ButtoN b ) { ExitMuskStyles(); QuitProgram(); }
static void DOT_quitProgram(ButtoN b) { QuitProgram(); }