Пример #1
0
    def update(self):
        # Clean UI controls to be replaced
        utils.removeControls(self, self.month_view_controls, self.control_to_data)

        # Build the month view controls and save it for removal/update
        self.month_view_controls = utils.buildMonth(
            self.left,
            self.top,
            self.width,
            self.hight,
            self.selection_date.year,
            self.selection_date.month,
            self.getSelectedDate(),
            None,
        )

        # Build the time selection controls
        if type(self.selection_date) is date:
            _h = 0
            _m = 0
        else:
            _h = self.selection_date.hour
            _m = self.selection_date.minute

            self.month_view_controls.extend(
                utils.buildTime(
                    self.left + self.width - self.width / 2 - self.space,
                    self.top + self.hight + self.space,
                    self.width / 2,
                    30,
                    _h,
                    _m,
                )
            )

            # Add all controls to screen
        utils.addControls(self, self.month_view_controls, self.control_to_data)

        # Set the focus on the selected control
        self.focus_on_selected()
Пример #2
0
	def update(self):
		utils.removeControls(self, self.view_controls, self.control_to_data)
		ctrls = self.loadView()
		utils.addControls(self, ctrls, self.control_to_data)