Example #1
0
def create_help_display(parent, docstring):
   """
   Creates a help window that contains the information specified by the *docstring*.

   :param parent: Window which should be the parent of the help window
   :param docstring: Content of the help window
   :return: help window
   """
   import wx
   if wx.VERSION >= (2, 5):
      import wx.html
      from gamera import util
      from gamera.gui.gui_util import docstring_to_html

      try:
         docstring = util.dedent(docstring)
         html = docstring_to_html(docstring)
         window = wx.html.HtmlWindow(parent, -1, size=wx.Size(50, 100))
         if "gtk2" in wx.PlatformInfo:
            window.SetStandardFonts()
         window.SetPage(html)
         window.SetBackgroundColour(wx.Colour(255, 255, 232))
         if wx.VERSION < (2, 8):
            window.SetBestFittingSize(wx.Size(50, 150))
         else:
            window.SetInitialSize(wx.Size(50, 150))
         return window
      except Exception, e:
         print e
Example #2
0
 def _create_help_display(self, docstring):
    try:
       docstring = util.dedent(docstring)
       html = gui_util.docstring_to_html(docstring)
       window = wx.html.HtmlWindow(self.window, -1, size=wx.Size(50, 100))
       if wx.VERSION >= (2, 5) and "gtk2" in wx.PlatformInfo:
          window.SetStandardFonts()
       window.SetPage(html)
       window.SetBackgroundColour(wx.Colour(255, 255, 232))
       if wx.VERSION < (2, 8):
          window.SetBestFittingSize(wx.Size(50, 150))
       else:
          window.SetInitialSize(wx.Size(50, 150))
       return window
    except Exception, e:
       print e
Example #3
0
 def _create_help_display(self, docstring):
     try:
         docstring = util.dedent(docstring)
         html = gui_util.docstring_to_html(docstring)
         window = wx.html.HtmlWindow(self.window,
                                     -1,
                                     size=wx.Size(50, 100))
         if wx.VERSION >= (2, 5) and "gtk2" in wx.PlatformInfo:
             window.SetStandardFonts()
         window.SetPage(html)
         window.SetBackgroundColour(wx.Colour(255, 255, 232))
         if wx.VERSION < (2, 8):
             window.SetBestFittingSize(wx.Size(50, 150))
         else:
             window.SetInitialSize(wx.Size(50, 150))
         return window
     except Exception, e:
         print e
Example #4
0
def create_help_display(parent, docstring):
    """
   Creates a help window that contains the information specified by the *docstring*.

   :param parent: Window which should be the parent of the help window
   :param docstring: Content of the help window
   :return: help window
   """
    import wx
    if wx.VERSION >= (2, 5):
        import wx.html
        from gamera import util
        from gamera.gui.gui_util import docstring_to_html

        try:
            docstring = util.dedent(docstring)
            html = docstring_to_html(docstring)
            window = wx.html.HtmlWindow(parent, -1, size=wx.Size(50, 100))
            if "gtk2" in wx.PlatformInfo:
                window.SetStandardFonts()
            window.SetPage(html)
            window.SetBackgroundColour(wx.Colour(255, 255, 232))
            if wx.VERSION < (2, 8):
                window.SetBestFittingSize(wx.Size(50, 150))
            else:
                window.SetInitialSize(wx.Size(50, 150))
            return window
        except Exception as e:
            print(e)
    else:
        from gamera import util

        docstring = util.dedent(docstring)
        style = (wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_RICH2)
        window = wx.TextCtrl(parent, -1, style=style, size=wx.Size(50, 100))
        window.SetValue(docstring)
        window.SetBackgroundColour(wx.Colour(255, 255, 232))
        return window
Example #5
0
 def display(self, calltip):
     from gamera.gui.gui_util import docstring_to_html
     """Receiver for Shell.calltip signal."""
     html = docstring_to_html(calltip)
     self.SetPage(html)
     self.SetBackgroundColour(wx.Colour(255, 255, 232))
Example #6
0
 def display(self, calltip):
    from gamera.gui.gui_util import docstring_to_html
    """Receiver for Shell.calltip signal."""
    html = docstring_to_html(calltip)
    self.SetPage(html)
    self.SetBackgroundColour(wx.Colour(255, 255, 232))
Example #7
0
 def display(self, calltip):
     """Receiver for Shell.calltip signal."""
     html = gui_util.docstring_to_html(calltip)
     self.SetPage(html)
     self.SetBackgroundColour(wx.Colour(255, 255, 232))
Example #8
0
File: gui.py Project: DDMAL/Gamera
 def display(self, calltip):
    """Receiver for Shell.calltip signal."""
    html = gui_util.docstring_to_html(calltip)
    self.SetPage(html)
    self.SetBackgroundColour(wx.Colour(255, 255, 232))