self._historyView = qhistory.QCalcHistory(self._errorDisplay)
self._userEntry = QValueEntry()
self._userEntry.entry.returnPressed.connect(self._on_push)
+ self._userEntryLayout = QtGui.QHBoxLayout()
+ self._userEntryLayout.addWidget(self._userEntry.toplevel)
self._controlLayout = QtGui.QVBoxLayout()
self._controlLayout.addLayout(self._errorDisplay.toplevel)
self._controlLayout.addWidget(self._historyView.toplevel)
- self._controlLayout.addWidget(self._userEntry.toplevel)
+ self._controlLayout.addLayout(self._userEntryLayout)
self._inputLayout = QtGui.QVBoxLayout()
self._builtinPlugin = self._keyboardPlugins.keyboards["Builtin"].construct_keyboard()
self._builtinKeyboard = self._builtinPlugin.setup(self._history, self._handler)
+ entryKeyboardId = self._keyboardPlugins.lookup_plugin("Entry")
+ self._keyboardPlugins.enable_plugin(entryKeyboardId)
+ entryPlugin = self._keyboardPlugins.keyboards["Entry"].construct_keyboard()
+ entryKeyboard = entryPlugin.setup(self._history, self._handler)
+ self._userEntryLayout.addLayout(entryKeyboard.toplevel)
+
# Plugins
self.enable_plugin(self._keyboardPlugins.lookup_plugin("Trigonometry"))
self.enable_plugin(self._keyboardPlugins.lookup_plugin("Computer"))
--- /dev/null
+{
+ "name": "Entry",
+ "dimensions": (1, 1),
+ "keys": {
+ (0, 0): {
+ "CENTER": {"action": "[push]", "type": "image", "path": "newline.png", },
+ "NORTH": {"action": "[unpush]", "type": "text", "text": "Undo", },
+ "NORTH_WEST": {"action": "[clear]", "type": "image", "path": "clear.png", },
+ "WEST": {"action": "[backspace]", "type": "image", "path": "backspace.png", },
+ "showAllSlices": False,
+ },
+ },
+}
--- /dev/null
+from __future__ import division
+
+import os
+
+import sys
+sys.path.append("../")
+import plugin_utils
+
+
+_NAME = "Entry"
+_MAP = {
+ "name": _NAME,
+ "keys": {
+ (0, 0): {
+ "CENTER": {"action": "[push]", "type": "image", "path": "newline.png", },
+ "NORTH": {"action": "[unpush]", "type": "text", "text": "Undo", },
+ "NORTH_WEST": {"action": "[clear]", "type": "image", "path": "clear.png", },
+ "WEST": {"action": "[backspace]", "type": "image", "path": "backspace.png", },
+ "showAllSlices": False,
+ },
+ },
+}
+_ICON_PATH = [os.path.join(os.path.dirname(__file__), "images")]
+PLUGIN = plugin_utils.PieKeyboardPluginFactory(_NAME, _MAP, _ICON_PATH)
{
"name": "Builtins",
- "dimensions": (4, 3),
+ "dimensions": (3, 3),
"keys": {
(0, 0): {
"CENTER": {"action": "7", "type": "text", "text": "7", },
},
(2, 0): {
"CENTER": {"action": "1", "type": "text", "text": "1", },
+ "EAST": {"action": "0", "type": "text", "text": "0", },
"showAllSlices": True,
},
(2, 1): {
"CENTER": {"action": "2", "type": "text", "text": "2", },
- "NORTH": {"action": "[abs]", "type": "text", "text": "abs", },
+ "EAST": {"action": "[abs]", "type": "text", "text": "abs", },
+ "NORTH": {"action": ".", "type": "text", "text": ".", },
+ "WEST": {"action": "[+-]", "type": "text", "text": "+/-", },
"showAllSlices": True,
},
(2, 2): {
"CENTER": {"action": "3", "type": "text", "text": "3", },
- "WEST": {"action": "[!]", "type": "text", "text": "!", },
- "showAllSlices": True,
- },
- (3, 0): {
- "CENTER": {"action": "[push]", "type": "image", "path": "newline.png", },
- "NORTH": {"action": "[unpush]", "type": "text", "text": "Undo", },
- "NORTH_WEST": {"action": "[clear]", "type": "image", "path": "clear.png", },
- "WEST": {"action": "[backspace]", "type": "image", "path": "backspace.png", },
- "showAllSlices": False,
- },
- (3, 1): {
- "CENTER": {"action": "0", "type": "text", "text": "0", },
- "showAllSlices": True,
- },
- (3, 2): {
- "CENTER": {"action": ".", "type": "text", "text": ".", },
- "NORTH": {"action": "j", "type": "text", "text": "j", },
- "WEST": {"action": "[+-]", "type": "text", "text": "+/-", },
+ "NORTH": {"action": "[!]", "type": "text", "text": "!", },
+ "WEST": {"action": "j", "type": "text", "text": "j", },
"showAllSlices": True,
},
},