Commits

windwiny committed 18f94fc

log dialog change

Comments (0)

Files changed (1)

     def _init_ctrls(self, prnt):
         # generated method, don't edit
         wx.Frame.__init__(self, id=wxID_MYGRSYNC, name=u'mygrsync', parent=prnt,
-              pos=wx.Point(630, 0), size=wx.Size(341, 148),
+              pos=wx.Point(580, 0), size=wx.Size(341, 148),
               style=wx.DEFAULT_FRAME_STYLE, title=u'mygrsync')
         self.SetClientSize(wx.Size(325, 110))
 
         self.initlogwin(ff)
 
     def initlogwin(self, ff):
+        dc = wx.ScreenDC()
+        sz = dc.GetSize()
+        dc.Destroy()
         self._logdlg = wx.Dialog(self, title=u"mygrsync log", size=wx.Size(440,640),
-                              style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER)
+                                 pos = (sz.x-440, 0),
+                                 style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER)
         self._logstc = wx.stc.StyledTextCtrl(self._logdlg)
         self._logstc.StyleSetFont(wx.stc.STC_STYLE_DEFAULT, ff)
         self._logstc.SetMarginType(1, wx.stc.STC_MARGIN_NUMBER)
-        self._logstc.SetMarginWidth(1, 38)
+        self._logstc.SetMarginWidth(1, 24)
         self._logstc.SetSize(self._logdlg.GetClientSize())
         self._logstc.AppendText('%s\n%s\n\n' % (
             time.strftime('  %Y-%m-%d %H:%M:%S\n'), os.getcwdu()))
 
     def OnBtnShowLogButton(self, event):
         event.Skip()
-        self._logdlg.Show()
+        if self._logdlg.IsShown():
+            self._logdlg.Hide()
+        else:
+            self._logdlg.Show()