Exemple #1
0
 def keyDown_(self, event) -> None:
     # any time this table is in focus and a key is pressed, this method will be called
     if toga_key(event) == {'key': Key.A, 'modifiers': {Key.MOD_1}}:
         if self.interface.multiple_select:
             self.selectAll(self)
     else:
         # forawrd call to super
         send_super(__class__, self, 'keyDown:', event)
Exemple #2
0
 def computeRect_(self, input: NSRect) -> NSRect:
     results['rect'] = True
     sup = send_super(__class__, self, 'computeRect:', input, restype=NSRect, argtypes=[NSRect])
     return NSMakeRect(
         input.origin.y + self.value, sup.origin.x,
         input.size.height + self.value, sup.size.width
     )
Exemple #3
0
 def computeRect_(self, input: NSRect) -> NSRect:
     results['rect'] = True
     sup = send_super(__class__, self, 'computeRect:', input, restype=NSRect, argtypes=[NSRect])
     return NSMakeRect(
         input.origin.y + self.value, sup.origin.x,
         input.size.height + self.value, sup.size.width
     )
Exemple #4
0
 def computeSize_(self, input: NSSize) -> NSSize:
     results['size'] = True
     sup = send_super(__class__,
                      self,
                      'computeSize:',
                      input,
                      restype=NSSize,
                      argtypes=[NSSize])
     return NSSize(input.width + self.value, sup.height)
Exemple #5
0
        def initWithRootViewController_(self, rootController):
            self = objc.ObjCInstance(
                objc.send_super(__class__, self, "initWithRootViewController:",
                                rootController))  # pylint: disable=undefined-variable
            if self:
                self.MQVDelegate = None
                self.modalPresentationStyle = 0

                stopButton = objc.ObjCClass(
                    "UIBarButtonItem").alloc().initWithBarButtonSystemItem(
                        14, target=self, action=objc.SEL("closeAction"))
                reloadButton = objc.ObjCClass(
                    "UIBarButtonItem").alloc().initWithTitle(
                        "Reload",
                        style=0,
                        target=self,
                        action=objc.SEL("reloadAction"))
                shuffleButton = objc.ObjCClass(
                    "UIBarButtonItem").alloc().initWithTitle(
                        "Shuffle",
                        style=0,
                        target=self,
                        action=objc.SEL("shuffleAction"))
                doneButton = objc.ObjCClass(
                    "UIBarButtonItem").alloc().initWithTitle(
                        "Done",
                        style=2,
                        target=self,
                        action=objc.SEL("doneAction"))

                self.navigationBar.topItem.leftBarButtonItem = stopButton
                self.navigationBar.topItem.rightBarButtonItems = [
                    doneButton, shuffleButton, reloadButton
                ]
                pass
            return self
Exemple #6
0
 def computeSize_(self, input: NSSize) -> NSSize:
     results['size'] = True
     sup = send_super(__class__, self, 'computeSize:', input, restype=NSSize, argtypes=[NSSize])
     return NSSize(input.width + self.value, sup.height)
Exemple #7
0
 def keyDown_(self, event) -> None:
     if self.interface.on_key_down:
         self.interface.on_key_down(self.interface, **toga_key(event))
     send_super(__class__, self, 'keyDown:', event)