Populates the font scale sub menu with scale percentages based on input bounds. :param `lower`: The minimum scale represented as a decimal, e.g. 0.6 :param `upper`: The maximum scale represented as a decimal, e.g. 1.4
(self, lower, upper)
| 364 | self._stretchLastCol() |
| 365 | |
| 366 | def _fontScaleMenu(self, lower, upper): |
| 367 | ''' |
| 368 | Populates the font scale sub menu with scale percentages |
| 369 | based on input bounds. |
| 370 | |
| 371 | :param `lower`: The minimum scale represented as a decimal, e.g. 0.6 |
| 372 | |
| 373 | :param `upper`: The maximum scale represented as a decimal, e.g. 1.4 |
| 374 | ''' |
| 375 | for scale in range(lower, upper): |
| 376 | scale = scale / 10 |
| 377 | self.font_sub.AppendRadioItem(wx.ID_ANY, "{:.0%}".format(scale)) |
| 378 | self.font_sub.Bind( |
| 379 | wx.EVT_MENU, |
| 380 | lambda evt, scale=scale: self._setFontScale(scale, evt), |
| 381 | self.font_sub.MenuItems[-1] |
| 382 | ) |
| 383 | if scale == self.options.Get("FontScale", 1): |
| 384 | self.font_sub.MenuItems[-1].Check(True) |
| 385 | |
| 386 | def _setFontScale(self, scale, evt=None): |
| 387 | ''' |
no test coverage detected