Пример #1
0
void executeKeyPress(int choice) {

	if (globalCurrentPage->keyboard.isNum == 0) {

		//Alpha keys
		if (choice <= 30) {

			Key k = globalCurrentPage->keyboard.currentKeyset[choice];
			updateBuffer(k, globalCurrentPage);

		}

		//Delete Key
		if (choice == 31) {

			decrementBuffer(globalCurrentPage);
		}

		//Uppercase/Lowercase Key
		if (choice == 32) {

			if (globalCurrentPage->keyboard.isUpper == 1) {
				globalCurrentPage->keyboard.isUpper = 0;
				globalCurrentPage->keyboard.currentKeyset =
						globalCurrentPage->keyboard.keyset_lowercase;
			} else {
				globalCurrentPage->keyboard.isUpper = 1;
				globalCurrentPage->keyboard.currentKeyset =
						globalCurrentPage->keyboard.keyset_uppercase;

			}
		}

		//Numbers Key
		if (choice == 33) {

			globalCurrentPage->keyboard.isNum = 1;
			globalCurrentPage->keyboard.currentKeyset =
					globalCurrentPage->keyboard.numberset1;
		}

		//Done Key
		if (choice == 34) {

			int k;
			k = globalCurrentPage->keyboard.curInputBoxIndex;

			strcpy(globalCurrentPage->keyboard.caller->inputBoxes[k].inputBuf,
					globalCurrentPage->keyboard.buffer);
			clearBuffer(globalCurrentPage);

			globalCurrentPage = globalCurrentPage->keyboard.caller;
			updateInputBox(&(globalCurrentPage->inputBoxes[k]));

		}

	} else {

		//Number Keys
		if (choice < 10) {

			Key k = globalCurrentPage->keyboard.currentKeyset[choice];
			updateBuffer(k, globalCurrentPage);

		}
		//Delete Key
		if (choice == 10) {

			decrementBuffer(globalCurrentPage);

		}
		//Return to letters key
		if (choice == 11) {

			globalCurrentPage->keyboard.isNum = 0;
			globalCurrentPage->keyboard.currentKeyset =
					globalCurrentPage->keyboard.keyset_lowercase;
		}

		//Done Key
		if (choice == 12) {

			int k;
			k = globalCurrentPage->keyboard.curInputBoxIndex;

			strcpy(globalCurrentPage->keyboard.caller->inputBoxes[k].inputBuf,
					globalCurrentPage->keyboard.buffer);
			clearBuffer(globalCurrentPage);

			globalCurrentPage = globalCurrentPage->keyboard.caller;
			updateInputBox(&(globalCurrentPage->inputBoxes[k]));

		}

	}

}
Пример #2
0
void BioXASZebraInputView::refresh()
{
	updateInputBox();
	updateInputLabel();
	updateInputStatusLabel();
}