示例#1
0
void CMakeHelpTab::ShowTopic(int topic)
{
    wxASSERT(!GetThread() || !GetThread()->IsRunning());

    const CMake* cmake = m_plugin->GetCMake();
    wxASSERT(cmake);

    switch(topic) {
    default:
        m_data = NULL;
        break;

    case 0:
        m_data = &cmake->GetModules();
        break;

    case 1:
        m_data = &cmake->GetCommands();
        break;

    case 2:
        m_data = &cmake->GetVariables();
        break;

    case 3:
        m_data = &cmake->GetProperties();
        break;
    }

    // Clear filter
    m_searchCtrlFilter->Clear();

    // List all items
    ListAll();
}
示例#2
0
void CMakeHelpTab::OnSearchCancel(wxCommandEvent& event)
{
    wxUnusedVar(event);

    // List all items
    ListAll();
}
示例#3
0
int main() { 
    int size = 127;
    long productIDList[size]; 
    long serialnumList[size];
    long localIDList[size];
    long powerList[size];
    long calMatrix[size][20];
    long numberFound = 0;
    long fcddMaxSize = 0;
    long hvcMaxSize = 0;
    long result;
    int k, l, m, n;

    for (k = 0; k<size; k++) {
        productIDList[k] = 0;
        serialnumList[k] = 0;
        localIDList[k] = 0;
        powerList[k] = 0;
        
        for(l = 0; l<20; l++) 
            calMatrix[k][l] = 0;
    }

    numberFound = 0;
    fcddMaxSize = 0;
    hvcMaxSize = 0;
    result = ListAll(productIDList, serialnumList, localIDList, powerList, calMatrix, &numberFound, &fcddMaxSize, &hvcMaxSize);
            
    if( result != 0) {
        printf("ListAll error, # %ld\n", result);
        return result;
    }
            
    printf("\nFound %ld LabJacks!\n ", numberFound);
    printf("\nInfo: \n\n");
    printf("productID, serialNum, localID, powerList, calMatrix\n");
            
    for(m = 0; m < numberFound; m++) {
        printf("\n%ld, %ld, %ld, %ld, \n", productIDList[m], serialnumList[m], localIDList[m], powerList[m]);
        printf(" (");
        
        for(n = 0; n < 20; n++)
            printf("%ld ", calMatrix[m][n]);
            printf(")\n");
       	}

    return 0;
}
示例#4
0
文件: event.c 项目: lincomcom/C_HW6
/* print eventNumber's event string, or all events' event strings if
 * -1
 */
void ListEvent(int eventNumber) {
    /*check eventNumber range between -1(no input) and MAXEVENTS*/
    if(CheckEventNum(eventNumber)==0)
        printf("event #%d is out of range\n", eventNumber);

    /* check if eventNumber is -1. If so, do a for loop over all events,
	 * check if eventStr[i] is empty string; if not, print it. */
	else if(eventNumber==-1)
        ListAll();

    /* if eventNumber is not -1, then print the event string (of eventNumber) if
	 * it is not empty; otherwise, print "(no event)" instead of empty line.*/
	else
        printf(" %d: %s", eventNumber, eventStr[eventNumber]);

}
示例#5
0
void flat(void)
{
char iroom[80],iphone[80],add_quit;
char option,sortopt,exit_opt;
int phone_check,room_check,delete_check,sort_check,list_check;
int iroom_search,iroom_del;
int int_iroom,total_entries;
int error_iphone,error_iroom;
long int longint_iphone;
long int iphone_search;
long int iphone_del;


strcpy(dbload, "DATABASE ERROR...");

do
 {
  do
   { option = menu_flat();
     if (option == '1')
     {  current_e_add=0;
	for (i=total_entry; i < MAXDB; i++)
	{   clrscr();
	    remakescreen();
	    screen_draw_flat();
	    gotoxy(1,4);
	    printf("## ADD NEW ENTRY ##");
	    gotoxy(1,25);
	    cprintf("Please Add Your Entry, leave blank to reach to Main Menu..");
	    gotoxy(1,6);
	    printf("Enter Room  Number[%3d]: ",i+1);
	    gets(iroom);

	    if (iroom[0] == '\0' )
	    {  gotoxy(1,25);
	       cprintf("You chose to quit: Entry %d was not added to the database.",i+1);
	       getch();
	       break;
	    }
	    printf("Enter Phone Number[%3d]: ",i+1);
	    gets(iphone);

	    if (iphone[0] == '\0')
	    {  gotoxy(1,25);
	       cprintf("You chose to quit: Entry %d was not added to the database.",i+1);
	       getch();
	       break;
	    }

	    error_iroom = chkdig(iroom,4);
	    error_iphone = chkdig(iphone,8);

	    while(error_iroom != 0)
	    {	if (error_iroom == -1)
		{  clrscr();
		   remakescreen();
		   screen_draw_flat();
		   gotoxy(1,4);
		   printf("## ADD NEW ENTRY ##");
		   gotoxy(1,25);
		   cprintf("Error: Room  Number - out of Range, Your entry was greater than 4 digits. ");
		   gotoxy(1,6);
		   printf("Renter Room  Number[%3d]: ",i+1);
		   gets(iroom);
		}
		if (error_iroom == -2)
		{  clrscr();
		   remakescreen();
		   screen_draw_flat();
		   gotoxy(1,4);
		   printf("*** Add Entry ***");
		   gotoxy(1,25);
		   cprintf("Error: Room  Number - Character(s) detected, character(s) are not allowed.");
		   gotoxy(1,6);
		   printf("Renter Room  Number[%3d]: ",i+1);
		   gets(iroom);
		}
		error_iroom = chkdig(iroom,4);
	    }
	    while(error_iphone !=0)
		{	if (error_iphone == -1)
		{  clrscr();
		   remakescreen();
		   screen_draw_flat();
		   gotoxy(1,4);
		   printf("## ADD NEW ENTRY ##");
		   gotoxy(1,25);
		   cprintf("Error: Phone Number - out of Range, Your entry was greater than 8 digits. ");
		   gotoxy(1,6);
		   printf("Room  Number[%3d] Entry: %s",i+1,iroom);
		   gotoxy(1,7);
		   printf("Renter Phone Number[%3d]: ",i+1);
		   gets(iphone);
		}
		if (error_iphone == -2)
		{  clrscr();
		   remakescreen();
		   screen_draw_flat();
		   gotoxy(1,4);
		   printf("## ADD NEW ENTRY ##");
		   gotoxy(1,25);
		   cprintf("Error: Phone Number - Character(s) detected, character(s) are not allowed.");
		   gotoxy(1,6);
		   printf("Room  Number[%3d] Entry: %s",i+1,iroom);
		   gotoxy(1,7);
		   printf("Renter Phone Number[%3d]: ",i+1);
		   gets(iphone);
		}
		error_iphone = chkdig(iphone,8);
	    }
	    if (error_iroom == 0 && error_iphone == 0)
	    {  int_iroom = atoi(iroom);
	       longint_iphone = atol(iphone);

	       current_e_add++;
	       add_entry(int_iroom,longint_iphone);
	    }
	}
	if (total_entry == MAXDB)
	{  gotoxy(1,25);
	   cprintf("\aDatabase is full!: %d entries were added, ",total_entry);
	   cprintf("that is the Maximum No. I can hold.");
	   getch();
	}
     }
     else
     if (option == '2')
     {  del_entry = 0; 	clrscr();
	remakescreen();
	screen_draw_flat();
	gotoxy(1,4);
	printf("## Delete Entry ##");
	gotoxy(1,6);
	printf("Enter room  number to delete: ");
	scanf("%d",&iroom_del);
	flushall();

	printf("Enter phone number to delete: ");
	scanf("%ld",&iphone_del);
	flushall();

	delete_check = delete_entry(iroom_del,iphone_del);

	if (delete_check == 0)
	{  gotoxy(1,25);
	   cprintf("Successful: There are presently %d entries in the database, ",total_entry);
	   cprintf("deleted %d.",del_entry);
	   getch();
	}
	if (delete_check == -1) 
	{  gotoxy(1,25);
	   cprintf("Error: The Room No./Phone No. Your looking for was Not Found.                  ");
	   getch();
	}

     }
     else
     if (option == '3')
     {  phone_found = 0;
	clrscr();
	remakescreen();
	screen_draw_flat();
	gotoxy(1,4);
	printf("## Find Room Number ##");

	gotoxy(1,6);
	printf("Enter the phone number to search for: ");
	scanf("%ld",&iphone_search);
	flushall(); 

	phone_check = find_phone_number(iphone_search);

	if (phone_check == 0)
	{  gotoxy(1,25);
	   cprintf("Successful: There are presently %d entries in the database, ",total_entry);

	   printf("found %d.",phone_found);
	   getch();
	}
	if (phone_check == -1) 
	{  gotoxy(1,25);
	   cprintf("Error: The Phone No. Your looking for was Not Found.");
	   getch();
	}
     }
     else
     if (option == '4')
     {  room_found = 0;
	clrscr();
	remakescreen();
	screen_draw_flat();
	gotoxy(1,4);
	printf("## Find Phone Number ##");

	gotoxy(1,6);
	printf("Enter the room number to search for: ");
	scanf("%d",&iroom_search);
	flushall();

	room_check = FindRoom(iroom_search);

	if (room_check == 0) 
	{  gotoxy(1,25);
	   cprintf("Successful: There are presently %d entries in the database, ",total_entry);
	   cprintf("found %d.",room_found);
	   getch();
	}
	if (room_check == -1) 
	{  gotoxy(1,25);
	   cprintf("Error: The Room No. Your looking for was Not Found.");
	   getch();
	}

     }
     else
     if (option == '5')
     {  clrscr();
	remakescreen();
	screen_draw_flat();
	gotoxy(1,4);
	printf("## ListAll ##\n\n");

	list_check = ListAll();

	if (list_check == 0)
	{  gotoxy(1,25);
	   cprintf("List Sucuessful");
	   getch();
	}
	if (list_check == -1)
	{
	   gotoxy(1,25);
	   cprintf("Empty List");
	   getch();
	}
     }
     else
     if (option == '6')
     {  total_entries = GeTotalEntries();
	gotoxy(1,25);
	cprintf("There are presently %d entries stored in the Database.",total_entries);
	getch();
     }
     else
     if (option == '7') 
   {  clrscr();
	remakescreen();
	screen_draw_flat();
	gotoxy(1,4);
	printf("## Sort All Entries ##");
	gotoxy(1,6);
	printf("Press 'A' to sort database in [A]scending order");
	gotoxy(1,7);
	printf("Press 'D' to sort database in [D]escending order.");
	gotoxy(1,9);
	printf("Note: Database is sorted by phone no. entries.");
	sortopt = getch();
	flushall();

	sort_check = sort_entries(sortopt);
	getch();
	if (sort_check == 0)
	{  gotoxy(1,25);
	   cprintf("Database was successfully Sorted.                                      ");
	   getch();
	}
	if (sort_check == -1)
	{  gotoxy(1,25);
	   cprintf("Database was not sorted - Database is empty!");
	   getch();
	}
     }
     else
     if (option == '8') 
     {  clrscr();
	remakescreen();
	screen_draw_flat();
	gotoxy(1,4);
	printf("## Load Database ##");
	loaddatabase();
     }
     else
     if (option == '9')
     {  gotoxy(1,25);
	cprintf("Do you really want to exit?, Press 'Y' to confirm, anykey to cancel");
	exit_opt = getch();
	flushall();
	if (exit_opt == 'y' || exit_opt == 'Y')
	{  clrscr();
	   remakescreen();
	   screen_draw_flat();
	   gotoxy(1,4);
	   printf("## Exit To system ##\n\n");
	   menu_exit();
	}
     }
     else 
     {  gotoxy(1,25);
	cprintf("Error: Invalid option! Select an option between 1 and 9");
	getch();
	flushall();
     }
   }while  (option > '9' || option < '1' );
 }while (option != '`'); 
}