def __init__(self, model, label_text, unit_text, initial='0', accept=None,
		cancel=None, has_auto=False, allow_negative=False):
		self.value = str(initial)
		self.unit_text = unit_text
		self.model = model
		self.accept = accept
		self.cancel = cancel
		# Initialize button grid.
		self.buttons = ui.ButtonGrid(model.width, model.height, 4, 5)
		self.buttons.add(0, 1, '1', font_size=freqshow.NUM_FONT, click=self.number_click)
		self.buttons.add(1, 1, '2', font_size=freqshow.NUM_FONT, click=self.number_click)
		self.buttons.add(2, 1, '3', font_size=freqshow.NUM_FONT, click=self.number_click)
		self.buttons.add(0, 2, '4', font_size=freqshow.NUM_FONT, click=self.number_click)
		self.buttons.add(1, 2, '5', font_size=freqshow.NUM_FONT, click=self.number_click)
		self.buttons.add(2, 2, '6', font_size=freqshow.NUM_FONT, click=self.number_click)
		self.buttons.add(0, 3, '7', font_size=freqshow.NUM_FONT, click=self.number_click)
		self.buttons.add(1, 3, '8', font_size=freqshow.NUM_FONT, click=self.number_click)
		self.buttons.add(2, 3, '9', font_size=freqshow.NUM_FONT, click=self.number_click)
		self.buttons.add(1, 4, '0', font_size=freqshow.NUM_FONT, click=self.number_click)
		self.buttons.add(2, 4, '.', font_size=freqshow.NUM_FONT, click=self.decimal_click)
		self.buttons.add(0, 4, 'DELETE', click=self.delete_click)
		if not allow_negative:
			# Render a clear button if only positive values are allowed.
			self.buttons.add(3, 1, 'CLEAR', click=self.clear_click)
		else:
			# Render a +/- toggle if negative values are allowed.
			self.buttons.add(3, 1, '+/-', click=self.posneg_click)
		self.buttons.add(3, 3, 'CANCEL', click=self.cancel_click,
			bg_color=freqshow.CANCEL_BG)
		self.buttons.add(3, 4, 'ACCEPT', click=self.accept_click,
			bg_color=freqshow.ACCEPT_BG) 
		if has_auto:
			self.buttons.add(3, 2, 'AUTO', click=self.auto_click)
		# Build label text for faster rendering.
		self.input_rect = (0, 0, self.model.width, self.buttons.row_size)
		self.label = ui.render_text(label_text, size=freqshow.MAIN_FONT, 
			fg=freqshow.INPUT_FG, bg=freqshow.INPUT_BG)
		self.label_pos = ui.align(self.label.get_rect(), self.input_rect,
			horizontal=ui.ALIGN_LEFT, hpad=10)
Create number dialog for provided model and with given label and unit
dataset/ETHPy150Open adafruit/FreqShow/views.py/NumberDialog.__init__