00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 import Qt 4.7
00041 import com.nokia.symbian 1.1
00042
00043
00044
00045
00046 Rectangle {
00047 id: vkeyboard
00048 width: parent.width;
00049 height: parent.height/3
00050 radius: 10
00051 smooth: true
00052 color: "black"
00053 opacity: 1
00054 visible: true
00055 property string numberText : ""
00056 signal send( string phonenumber)
00057
00058
00059
00060 function keyPressed(operation) {
00061 if ( operation == "+" ) {
00062 numberText = "+" + numberText
00063 }
00064 else if ( operation == "C" ) {
00065 numberText = numberText.toString().slice(0, -1)
00066 }
00067 else {
00068 numberText = numberText + operation.toString()
00069 }
00070 vkeyboard.send(numberText)
00071 }
00072
00073
00074
00075 Grid {
00076 id: grid; rows: 4; columns: 3; spacing: 6
00077 property real w: (vkeyboard.width / columns) - ((spacing * (columns - 1)) / columns)
00078 property real h: (vkeyboard.height / rows) - ((spacing * (rows - 1)) / rows)
00079 Button { objectName: "vkb1"; width: grid.w; height: grid.h; text: "1"; onClicked: keyPressed(text); }
00080 Button { objectName: "vkb2"; width: grid.w; height: grid.h; text: "2"; onClicked: keyPressed(text); }
00081 Button { objectName: "vkb3"; width: grid.w; height: grid.h; text: "3"; onClicked: keyPressed(text); }
00082 Button { objectName: "vkb4"; width: grid.w; height: grid.h; text: "4"; onClicked: keyPressed(text); }
00083 Button { objectName: "vkb5"; width: grid.w; height: grid.h; text: "5"; onClicked: keyPressed(text); }
00084 Button { objectName: "vkb6"; width: grid.w; height: grid.h; text: "6"; onClicked: keyPressed(text); }
00085 Button { objectName: "vkb7"; width: grid.w; height: grid.h; text: "7"; onClicked: keyPressed(text); }
00086 Button { objectName: "vkb8"; width: grid.w; height: grid.h; text: "8"; onClicked: keyPressed(text); }
00087 Button { objectName: "vkb9"; width: grid.w; height: grid.h; text: "9"; onClicked: keyPressed(text); }
00088 Button { objectName: "vkb0"; width: grid.w; height: grid.h; text: "+"; onClicked: keyPressed(text); }
00089 Button { objectName: "vkb0"; width: grid.w; height: grid.h; text: "0"; onClicked: keyPressed(text); }
00090 Button { objectName: "vkbC"; width: grid.w; height: grid.h; text: "C"; onClicked: keyPressed(text); }
00091 }
00092 }