Exemple #1
0
int main() {

	int flag = 1;

	while(flag) {

		printf("\n\nUS Military Encryption Service\n");
		printf("Please input your branch of service:\n");
		printf("0-Exit\t1-Army\t2-Navy\t3-Air Force\n");
		kbhit();
		fflush(stdout);
		char in = getch();

		switch(in) {
			case '0':
				flag = 0;
				break;
			case '1':
				army();
				break;
			case '2':
				navy();
				break;
			case '3':
				airForce();
				break;
			default:
				printf("Error, please enter a valid military branch.\n");
				break;
		}
	}
	return 0;
}
Exemple #2
0
    QPalette create_default_palette()
    {
	QColor white( 0xff, 0xff, 0xff, 0xff );

	// Shades of navy...

	QColor navy_light(     0x00, 0x00, 0xa0, 0xff );
	QColor navy_mid_light( 0x00, 0x00, 0x90, 0xff );
	QColor navy(           0x00, 0x00, 0x70, 0xff );
	QColor navy_mid_dark(  0x00, 0x00, 0x90, 0xff );
	QColor navy_dark(      0x00, 0x00, 0xb0, 0xff );


	QColor windowText;
	QColor button;
	QColor light;
	QColor dark;
	QColor mid;
	QColor text;
	QColor bright_text;
	QColor base;
	QColor window;

	// Active colors                Qt's description
	windowText =  white;         // Text on top of 'window' color.
	button =      navy_mid_light;// Color for a button.
	light =       navy_light;    // lighter than 'button'
	dark =        dark;          // Darker than 'button'
	mid =         navy_mid_dark; // between button and dark
	text =        white;         // foreground color for 'base'
	bright_text = white;         // diff from windowText and contrasts with dark
	base =        navy_light;    // e.g. background for text entry
	window =      navy;          // Gen'l purpose background color

	// Get a head start...
	QPalette pal = QApplication::palette();

	pal.setColorGroup( QPalette::Active,
			   windowText,
			   button,
			   light,
			   dark,
			   mid,
			   text,
			   bright_text,
			   base,
			   window
	    );

	pal.setColorGroup( QPalette::Disabled,
			   windowText,
			   button,
			   light,
			   dark,
			   mid,
			   text,
			   bright_text,
			   base,
			   window
	    );

	pal.setColorGroup( QPalette::Inactive,
			   windowText,
			   button,
			   light,
			   dark,
			   mid,
			   text,
			   bright_text,
			   base,
			   window
	    );

	pal.setColorGroup( QPalette::Normal,
			   windowText,
			   button,
			   light,
			   dark,
			   mid,
			   text,
			   bright_text,
			   base,
			   window
	    );

	return pal;
    }