Skip to content

Commit

Permalink
Improve console text control by specifying font size in pixels not po…
Browse files Browse the repository at this point in the history
…ints
  • Loading branch information
marcelstoer committed Feb 17, 2019
1 parent 29b7193 commit 4500d94
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Main.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def is_complete(self):
class NodeMcuFlasher(wx.Frame):

def __init__(self, parent, title):
wx.Frame.__init__(self, parent, -1, title, size=(700, 650),
wx.Frame.__init__(self, parent, -1, title, size=(725, 650),
style=wx.DEFAULT_FRAME_STYLE | wx.NO_FULL_REPAINT_ON_RESIZE)
self._config = FlashConfig.load(self._get_config_file_path())

Expand All @@ -158,11 +158,10 @@ def __init__(self, parent, title):

sys.stdout = RedirectText(self.console_ctrl)

self.SetMinSize((640, 480))
self.Centre(wx.BOTH)
self.Show(True)
print("Connect your device")
print("\nIf you chose the serial port auto-select feature you might want to ")
print("\nIf you chose the serial port auto-select feature you might need to ")
print("turn off Bluetooth")

def _init_ui(self):
Expand Down Expand Up @@ -271,10 +270,11 @@ def add_erase_radio_button(sizer, index, erase_before_flash, label, value):
button.Bind(wx.EVT_BUTTON, on_clicked)

self.console_ctrl = wx.TextCtrl(panel, style=wx.TE_MULTILINE | wx.TE_READONLY | wx.HSCROLL)
self.console_ctrl.SetFont(wx.Font(13, wx.FONTFAMILY_TELETYPE, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL))
self.console_ctrl.SetBackgroundColour(wx.BLACK)
self.console_ctrl.SetForegroundColour(wx.RED)
self.console_ctrl.SetDefaultStyle(wx.TextAttr(wx.RED))
self.console_ctrl.SetFont(wx.Font((0, 13), wx.FONTFAMILY_TELETYPE, wx.FONTSTYLE_NORMAL,
wx.FONTWEIGHT_NORMAL))
self.console_ctrl.SetBackgroundColour(wx.WHITE)
self.console_ctrl.SetForegroundColour(wx.BLUE)
self.console_ctrl.SetDefaultStyle(wx.TextAttr(wx.BLUE))

port_label = wx.StaticText(panel, label="Serial port")
file_label = wx.StaticText(panel, label="NodeMCU firmware")
Expand Down

0 comments on commit 4500d94

Please sign in to comment.