示例#1
0
    def __init__(self, parent, root):
        ScrolledPanel.__init__(self, parent = parent, id = wx.ID_ANY)

        self.model = parent.model # Create a reference to model.

        numberOfItems = len(root.items)
        get = OS_GET in root.capabilities
        set_ = OS_SET in root.capabilities
        info = OS_INFO in root.capabilities
        #print "Number of Item in '%s' panel: %u" % (root.name, len(root.items))

        self.controlMap = {}

        sizer = wx.GridBagSizer(2, 2 + numberOfItems)
        self.addLabels(sizer, "Get", "Set", "Info")
        for idx, item in enumerate(root.items, 2):
            st = wx.StaticText(self, label = item.name)
            sizer.Add(st, (idx, 0), wx.DefaultSpan, wx.ALL, 5)
            st.SetToolTip(wx.ToolTip(item.note))
            if get:
                newId = self.addCheckBox(sizer, idx, 1)
                self.controlMap[newId] = Control(OS_GET, item)
            if set_:
                newId = self.addCheckBox(sizer, idx, 2)
                self.controlMap[newId] = Control(OS_SET, item)
            if info:
                newId = self.addCheckBox(sizer, idx, 3)
                self.controlMap[newId] = Control(OS_INFO, item)

        self.SetSizerAndFit(sizer)
        self.SetupScrolling()
	def __init__(self, parent, global_store, prog, *args, **kwargs):
		ScrolledPanel.__init__(self, parent, *args, **kwargs)

		self.global_store = global_store
		self.prog = prog

		self.values = prog.values
		self.resource_labels = prog.resource_labels
		self.resources = prog.resources

		self.last_variable = None
		self.cur_row, self.cur_col = 0, 0

		parameters = self.extract_parameters(prog)

		# Panel.
		self.parameter_sizer = wx.GridBagSizer(5)

		self.parameter_sizer.AddGrowableCol(self.input_col, 1)
		if self.use_resource_labels:
			self.parameter_sizer.AddGrowableCol(self.input_col + 1, 1)

		## Headings.
		self.add_headings()

		## Parameter inputs.
		for parameter in parameters:
			self.add_row(parameter)

		self.SetSizer(self.parameter_sizer)
		self.SetupScrolling()
示例#3
0
    def __init__(self, parent, palettes, viewwin, size=wx.DefaultSize):
        ScrolledPanel.__init__(self, parent, size=size)
        ListeningWindowMixin.__init__(self)

        self.viewwin = viewwin
        self.palettes = palettes
        self.pal_height = 30
        self.selected = -1

        self.palwins = []
        self.sizer = wx.FlexGridSizer(rows=len(self.palettes),
                                      cols=1,
                                      vgap=0,
                                      hgap=0)
        for i, pal in enumerate(self.palettes):
            palwin = PaletteWin(self,
                                pal,
                                i,
                                viewwin,
                                size=(200, self.pal_height))
            self.sizer.Add(palwin, flag=wx.EXPAND)
            self.palwins.append(palwin)

        self.sizer.AddGrowableCol(0)
        self.sizer.SetFlexibleDirection(wx.HORIZONTAL)
        self.SetSizer(self.sizer)
        self.SetAutoLayout(True)
        self.SetupScrolling()

        self.register_listener(self.on_coloring_changed,
                               EVT_APTUS_COLORING_CHANGED, self.viewwin)
        self.on_coloring_changed(None)
示例#4
0
文件: switcher.py 项目: pbrod/pyface
    def __init__(self, parent, id, model, label=None, cache=True, **kw):

        # Base-class constructor.
        wxScrolledPanel.__init__(self, parent, id, **kw)
        self.SetupScrolling()

        # The switcher model that we are a panel for.
        self.model = model

        # Should we cache pages as we create them?
        self.cache = cache

        # The page cache (if caching was requested).
        self._page_cache = {}

        # The currently displayed page.
        self.current = None

        # Create the widget!
        self._create_widget(model, label)

        # Listen for when the selected item in the model is changed.
        model.on_trait_change(self._on_selected_changed, "selected")

        return
    def __init__(self, parent, global_store, prog, *args, **kwargs):
        ScrolledPanel.__init__(self, parent, *args, **kwargs)

        self.global_store = global_store
        self.prog = prog

        self.values = prog.values
        self.resource_labels = prog.resource_labels
        self.resources = prog.resources

        self.last_variable = None
        self.cur_row, self.cur_col = 0, 0

        parameters = self.extract_parameters(prog)

        # Panel.
        self.parameter_sizer = wx.GridBagSizer(hgap=5)

        self.parameter_sizer.AddGrowableCol(self.input_col, 1)
        if self.use_resource_labels:
            self.parameter_sizer.AddGrowableCol(self.input_col + 1, 1)

        ## Headings.
        self.add_headings()

        ## Parameter inputs.
        for parameter in parameters:
            self.add_row(parameter)

        self.SetSizer(self.parameter_sizer)
        self.SetupScrolling()
示例#6
0
	def __init__(self, parent ):
		ScrolledPanel.__init__(self, parent, -1)
		sizer = wx.BoxSizer( wx.VERTICAL )
		self.SetupScrolling( False, True, 10, 10)
		self.SetSizer( sizer )
		self.Bind(wx.EVT_SIZE, self.LayoutVirtualSize)
		self.SetDoubleBuffered(True)
示例#7
0
    def __init__(self, parent):
        ScrolledPanel.__init__(self, parent = parent, id = wx.ID_ANY)

        sizer = self.addValues()
        self.btnSetRefValues = wx.Button(self, label = "Set Reference Values", id = controlids.ID_SET_REFERENCE_VALUES)

        static_box = wx.StaticBox(self, label = 'Control-Mode')
        groupSizer = wx.StaticBoxSizer(static_box, wx.HORIZONTAL)
        btnConstPressure = wx.ToggleButton(self, label = 'Constant Pressure', id = controlids.ID_CMD_CONST_PRESS)
        groupSizer.Add(btnConstPressure, 1, wx.ALL, 5)
        btnPropPressure = wx.ToggleButton(self, label = 'Proportional Pressure', id = controlids.ID_CMD_PROP_PRESS)
        groupSizer.Add(btnPropPressure, 1, wx.ALL, 5)
        btnConstFreq = wx.ToggleButton(self, label = 'Constant Frequency', id = controlids.ID_CMD_CONST_FREQ)
        groupSizer.Add(btnConstFreq, 1, wx.ALL, 5)
        btnAutomatic = wx.ToggleButton(self, label = 'Automatic', id = controlids.ID_CMD_AUTOMATIC)
        self.btnBgColor = btnAutomatic.GetBackgroundColour()
        groupSizer.Add(btnAutomatic, 1, wx.ALL, 5)
        self.setControlMode(CONTROL_MODE_AUTOMATIC)

        btnConstPressure.controlMode = CONTROL_MODE_CONSTANT_PRESSURE
        btnPropPressure.controlMode = CONTROL_MODE_PROPORTIONAL_PRESSURE
        btnConstFreq.controlMode = CONTROL_MODE_CONSTANT_FREQUENCY
        btnAutomatic.controlMode = CONTROL_MODE_AUTOMATIC

        self.Bind(wx.EVT_TOGGLEBUTTON, self.choiceButton, btnConstPressure)
        self.Bind(wx.EVT_TOGGLEBUTTON, self.choiceButton, btnPropPressure)
        self.Bind(wx.EVT_TOGGLEBUTTON, self.choiceButton, btnConstFreq)
        self.Bind(wx.EVT_TOGGLEBUTTON, self.choiceButton, btnAutomatic)

        sizer.Add(groupSizer, (len(DataitemConfiguration['ReferenceValues']), 0), (1, 3), wx.ALL | wx.GROW, 5)
        sizer.Add(self.btnSetRefValues, ((len(DataitemConfiguration['ReferenceValues']) + 1), 0), wx.DefaultSpan, wx.ALL | wx.ALIGN_RIGHT, 5)

        self.SetSizerAndFit(sizer)
	self.SetupScrolling()
示例#8
0
    def __init__(self, parent, model, controller):
        ScrolledPanel.__init__(self, parent, wx.ID_ANY, size=(245, -1))

        # Sizer
        sizer = wx.BoxSizer(wx.VERTICAL)
        self.SetSizer(sizer)

        # Parameters expander {{{
        self.cpp = ParametersExpander(self, model, controller)
        sizer.Add(self.cpp, 0, wx.ALL | wx.EXPAND, 1)
        #}}}

        # Line-of-sight axis expander {{{
        self.cpa = LineOfSightExpander(self, model, controller)
        sizer.Add(self.cpa, 0, wx.ALL | wx.EXPAND, 1)
        #}}}

        # Magnifying glass expander {{{
        self.cpg = MagGlassExpander(self, model, controller)
        sizer.Add(self.cpg, 0, wx.ALL | wx.EXPAND, 1)
        #}}}

        self.SetupScrolling(scroll_x=False)

        # Left Panel
        size = self.GetSize()
        self.SetMinSize((size[0], -1))
        self.SetMaxSize((size[0], -1))
    def __init__(self, parent):
        ScrolledPanel.__init__(self, parent)
        self.SetupScrolling(True, True)
        self.parent = parent
        self.user_profile = self.parent.user_profile
        self.user_settings = self.parent.user_settings

        self.SetBackgroundColour(self.user_settings.get_background_color())
        self.SetFont(
            wx.Font(
                self.user_settings.get_general_font_size() if
                self.user_settings.get_is_general_font_size_enabled() else 15,
                wx.MODERN, wx.NORMAL, wx.NORMAL, False, u'Consolas'))

        self.title_font = self.GetFont()
        self.title_font.SetUnderlined(True)

        self.help_labels = list()

        self.sizer = wx.BoxSizer(wx.VERTICAL)

        for cat in HELP_STRINGS.keys():
            self.add_help(cat)

        self.SetSizer(self.sizer)
        self.Layout()
示例#10
0
    def __init__(self, parent, CellClass=None, CellBitmapClass=None,
                 rows=12, cols=2, cellheight=400, *args, **kwargs):
        ScrolledPanel.__init__(self, parent, *args, **kwargs)
        self.parent = parent

        self.num_rows = rows
        self.num_cols = cols

        self.cell_width = None    # set by display_page
        self.cell_height = cellheight

        self.imgpaths = []
        self.cur_page = 0

        self.CellClass = CellClass if CellClass != None else CellPanel

        # A 2-D array containing all CellPanels. self.cells[i][j]
        # is the CellPanel at row i, col j.
        self.cells = [[None for _ in range(self.num_cols)] for _ in range(self.num_rows)]
        self.gridsizer = wx.GridSizer(self.num_rows, self.num_cols)

        # A fn: (x1,y1,x2,y2)->(x1,y1,x2,y2)'
        self.transfn = None

        # Pre-populate the gridsizer with StaticBitmaps
        for i in range(self.num_rows):
            for j in range(self.num_cols):
                cellpanel = self.CellClass(self, i, j, CellBitmapClass=CellBitmapClass)
                self.cells[i][j] = cellpanel
                self.gridsizer.Add(cellpanel)
        self.sizer = wx.BoxSizer(wx.VERTICAL)

        self.sizer.Add(self.gridsizer)

        self.SetSizer(self.sizer)
示例#11
0
 def __init__(self, parent, base=None, *args, **kwds):
     """
     """
     ScrolledPanel.__init__(self, parent, *args, **kwds)
     PanelBase.__init__(self)
     self.SetupScrolling()
     # Font size
     self.SetWindowVariant(variant=FONT_VARIANT)
     # Object that receive status event
     self.base = base
     self.parent = parent
     # chemeical formula, string
     self.compound = ""
     # value of the density/volume, float
     self.input = None
     # text controls
     self.compound_ctl = None
     self.input_ctl = None
     self.molar_mass_ctl = None
     self.output_ctl = None
     self.ctr_color = self.GetBackgroundColour()
     # button
     self.button_calculate = None
     # list
     self._input_list = _INPUTS
     self._input = self._input_list[1]
     self._output = self._input_list[0]
     self._unit_list = _UNITS
     # Draw the panel
     self._do_layout()
     self.SetAutoLayout(True)
     self.Layout()
示例#12
0
    def __init__(self, parent, id, model, label=None, cache=True, **kw):

        # Base-class constructor.
        wxScrolledPanel.__init__(self, parent, id, **kw)
        self.SetupScrolling()

        # The switcher model that we are a panel for.
        self.model = model

        # Should we cache pages as we create them?
        self.cache = cache

        # The page cache (if caching was requested).
        self._page_cache = {}

        # The currently displayed page.
        self.current = None

        # Create the widget!
        self._create_widget(model, label)

        # Listen for when the selected item in the model is changed.
        model.on_trait_change(self._on_selected_changed, 'selected')

        return
示例#13
0
 def __init__(self, parent, base=None, *args, **kwds):
     """
     """
     ScrolledPanel.__init__(self, parent, *args, **kwds)
     PanelBase.__init__(self)
     self.SetupScrolling()
     #Font size
     self.SetWindowVariant(variant=FONT_VARIANT)
     # Object that receive status event
     self.base = base
     self.parent = parent
     # chemeical formula, string
     self.compound = ''
     # value of the density/volume, float
     self.input = None
     # text controls
     self.compound_ctl = None
     self.input_ctl = None
     self.molar_mass_ctl = None
     self.output_ctl = None
     self.ctr_color = self.GetBackgroundColour()
     # button
     self.button_calculate = None
     # list
     self._input_list = _INPUTS
     self._input = self._input_list[1]
     self._output = self._input_list[0]
     self._unit_list = _UNITS
     #Draw the panel
     self._do_layout()
     self.SetAutoLayout(True)
     self.Layout()
示例#14
0
 def __init__(self, parent):
     ScrolledPanel.__init__(self, parent, wx.ID_ANY, size=dims_wh)
     self.sizer = wx.BoxSizer(wx.VERTICAL)
     self.sizer.Add(self._create_table(), 1, wx.EXPAND | wx.ALL, 5)
     self.SetSizer(self.sizer)
     self.SetupScrolling()
     self.SetAutoLayout(1)
示例#15
0
    def __init__(self, parent, main):
        ScrolledPanel.__init__(self, parent)
        self.main = main
        self.control_to_key = {}
        self.immediate = True

        bbox = wx.BoxSizer(wx.HORIZONTAL)

        if not self.immediate:
            b_save = wx.Button(self, -1, "Save")
            b_reset = wx.Button(self, -1, "Reset")
            self.Bind(wx.EVT_BUTTON, self.OnSave, b_save)
            self.Bind(wx.EVT_BUTTON, self.OnReset, b_reset)
            bbox.Add(b_save, 1, wx.EXPAND)
            bbox.Add(b_reset, 1, wx.EXPAND)

        box = wx.BoxSizer(wx.VERTICAL)

        self.lc_grid = wx.FlexGridSizer(0, 2)
        self.lc_grid.AddGrowableCol(1)

        box.Add(self.lc_grid, 1, wx.EXPAND)
        box.Add(bbox, 0, wx.EXPAND)
        #box.Add(del_setup, 0, wx.EXPAND)

        self.SetSizer(box)
        self.Layout()

        self.update()
示例#16
0
    def __init__(self, parent, root):
        ScrolledPanel.__init__(self, parent=parent, id=wx.ID_ANY)

        self.model = parent.model  # Create a reference to model.

        numberOfItems = len(root.items)
        get = OS_GET in root.capabilities
        set_ = OS_SET in root.capabilities
        info = OS_INFO in root.capabilities
        #print("Number of Item in '%s' panel: %u" % (root.name, len(root.items)))

        self.controlMap = {}

        sizer = wx.GridBagSizer(2, 2 + numberOfItems)
        self.addLabels(sizer, "Get", "Set", "Info")
        for idx, item in enumerate(root.items, 2):
            st = wx.StaticText(self, label=item.name)
            sizer.Add(st, (idx, 0), wx.DefaultSpan, wx.ALL, 5)
            st.SetToolTip(wx.ToolTip(item.note))
            if get:
                newId = self.addCheckBox(sizer, idx, 1)
                self.controlMap[newId] = Control(OS_GET, item)
            if set_:
                newId = self.addCheckBox(sizer, idx, 2)
                self.controlMap[newId] = Control(OS_SET, item)
            if info:
                newId = self.addCheckBox(sizer, idx, 3)
                self.controlMap[newId] = Control(OS_INFO, item)

        self.SetSizerAndFit(sizer)
        self.SetupScrolling()
示例#17
0
    def __init__(self, parent, id=-1, plots=None, standalone=False, **kwargs):
        """
        """
        ScrolledPanel.__init__(self, parent, id=id, **kwargs)
        PanelBase.__init__(self, parent)
        self.SetupScrolling()
        #Set window's font size
        self.SetWindowVariant(variant=FONT_VARIANT)

        self.plots = plots
        self.radio_buttons = {}
        self.parent = parent.parent

        ## Data file TextCtrl
        self.data_file = None
        self.plot_data = None
        self.nfunc_ctl = None
        self.alpha_ctl = None
        self.dmax_ctl = None
        self.time_ctl = None
        self.chi2_ctl = None
        self.osc_ctl = None
        self.file_radio = None
        self.plot_radio = None
        self.label_sugg = None
        self.qmin_ctl = None
        self.qmax_ctl = None
        self.swidth_ctl = None
        self.sheight_ctl = None

        self.rg_ctl = None
        self.iq0_ctl = None
        self.bck_chk = None
        self.bck_ctl = None

        # TextCtrl for fraction of positive P(r)
        self.pos_ctl = None

        # TextCtrl for fraction of 1 sigma positive P(r)
        self.pos_err_ctl = None

        ## Estimates
        self.alpha_estimate_ctl = None
        self.nterms_estimate_ctl = None
        ## D_max distance explorator
        self.distance_explorator_ctl = None
        ## Data manager
        self._manager = None
        ## Standalone flage
        self.standalone = standalone
        ## Default file location for save
        self._default_save_location = os.getcwd()
        if self.parent is not None:
            self._default_save_location = \
                        self.parent._default_save_location

        # Default width
        self._default_width = 350
        self._do_layout()
示例#18
0
    def __init__(self, parent, *args, **kwds):
        kwds["style"] = wx.DEFAULT_DIALOG_STYLE

        ScrolledPanel.__init__(self, parent, **kwds)
        self.SetupScrolling()
        image = os.path.join(config._welcome_image)
        self.SetWindowVariant(variant=FONT_VARIANT)
        self.bitmap_logo = wx.StaticBitmap(self, -1, wx.Bitmap(image))

        self.label_copyright = wx.StaticText(self, -1, config._copyright)
        self.static_line_1 = wx.StaticLine(self, -1)
        self.label_acknowledgement = wx.StaticText(self, -1,
                                                   config._acknowledgement)

        self.hyperlink_license = wx.StaticText(self, -1,
                                               "Comments? Bugs? Requests?")
        send_ticket = "Send us a ticket at: "
        send_ticket += "*****@*****.**"
        self.hyperlink_paper = \
            wx.lib.hyperlink.HyperLinkCtrl(self, -1,
                                           send_ticket, URL=config._license)

        self.label_title = \
            wx.StaticText(self, -1,
                          config.__appname__ + " " + str(config.__version__))
        try:
            build_num = str(config.__build__)
        except:
            build_num = str(config.__version__)
        self.label_build = wx.StaticText(self, -1, "Build: " + build_num)

        sizer_main = wx.BoxSizer(wx.VERTICAL)
        sizer_header = wx.BoxSizer(wx.HORIZONTAL)
        sizer_build = wx.BoxSizer(wx.VERTICAL)

        sizer_header.Add(self.bitmap_logo, 0, wx.EXPAND | wx.LEFT, 5)

        sizer_build.Add(self.label_acknowledgement, 0,
                        wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15)
        sizer_build.Add((5, 5))
        sizer_build.Add(self.label_title, 0,
                        wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15)
        sizer_build.Add(self.label_build, 0,
                        wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15)
        sizer_build.Add(self.label_copyright, 0,
                        wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15)
        sizer_build.Add((5, 5))
        sizer_build.Add(self.hyperlink_license, 0,
                        wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15)
        sizer_build.Add(self.hyperlink_paper, 0,
                        wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15)

        sizer_main.Add(sizer_header, 0, wx.TOP | wx.EXPAND, 3)
        sizer_main.Add(self.static_line_1, 0, wx.EXPAND, 0)
        sizer_main.Add(sizer_build, 0, wx.BOTTOM | wx.EXPAND, 3)

        self.SetAutoLayout(True)
        self.SetSizer(sizer_main)
        self.Fit()
示例#19
0
    def __init__(self, parent, *args, **kwds):
        kwds["style"] = wx.DEFAULT_DIALOG_STYLE

        ScrolledPanel.__init__(self, parent, **kwds)
        self.SetupScrolling()
        image = os.path.join(config._welcome_image)
        self.SetWindowVariant(variant=FONT_VARIANT)
        self.bitmap_logo = wx.StaticBitmap(self, -1, wx.Bitmap(image))

        self.label_copyright = wx.StaticText(self, -1, config._copyright)
        self.static_line_1 = wx.StaticLine(self, -1)
        self.label_acknowledgement = wx.StaticText(self, -1,
                                                   config._acknowledgement)

        self.hyperlink_license = wx.StaticText(self, -1,
                                               "Comments? Bugs? Requests?")
        send_ticket = "Send us a ticket at: "
        send_ticket += "*****@*****.**"
        self.hyperlink_paper = \
            wx.lib.hyperlink.HyperLinkCtrl(self, -1,
                                           send_ticket, URL=config._license)

        self.label_title = \
            wx.StaticText(self, -1,
                          config.__appname__ + " " + str(config.__version__))
        try:
            build_num = str(config.__build__)
        except:
            build_num = str(config.__version__)
        self.label_build = wx.StaticText(self, -1, "Build: " + build_num)

        sizer_main = wx.BoxSizer(wx.VERTICAL)
        sizer_header = wx.BoxSizer(wx.HORIZONTAL)
        sizer_build = wx.BoxSizer(wx.VERTICAL)

        sizer_header.Add(self.bitmap_logo, 0, wx.EXPAND | wx.LEFT, 5)

        sizer_build.Add(self.label_acknowledgement, 0,
                        wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15)
        sizer_build.Add((5, 5))
        sizer_build.Add(self.label_title, 0,
                        wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15)
        sizer_build.Add(self.label_build, 0,
                        wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15)
        sizer_build.Add(self.label_copyright, 0,
                        wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15)
        sizer_build.Add((5, 5))
        sizer_build.Add(self.hyperlink_license, 0,
                        wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15)
        sizer_build.Add(self.hyperlink_paper, 0,
                        wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15)

        sizer_main.Add(sizer_header, 0, wx.TOP | wx.EXPAND, 3)
        sizer_main.Add(self.static_line_1, 0, wx.EXPAND, 0)
        sizer_main.Add(sizer_build, 0, wx.BOTTOM | wx.EXPAND, 3)

        self.SetAutoLayout(True)
        self.SetSizer(sizer_main)
        self.Fit()
示例#20
0
    def __init__(self, prnt, size=1, title='Default'):
	ScrolledPanel.__init__(self, prnt)
	self.sizer = wx.GridSizer(16,16)
	self.SetSizer(self.sizer)	
        	
	colorBox = wx.Button(self, id=-1)
	colorBox.Bind(wx.EVT_RIGHT_UP, self.OnRightUp, colorBox)
	self.sizer.Add(colorBox, 0, wx.ALL, 1)
示例#21
0
    def __init__(self, engine, config, parent):
        """Create a configuration component based on the given ConfigParser.

        Arguments:

        config -- A Config object.

        parent -- This component's parent component.

        """
        ScrolledPanel.__init__(self, parent)
        self.engine = engine
        self.config = config

        self.up_bitmap = wx.Bitmap(UP_IMAGE_FILE, wx.BITMAP_TYPE_PNG)
        self.down_bitmap = wx.Bitmap(DOWN_IMAGE_FILE, wx.BITMAP_TYPE_PNG)
        self.remove_bitmap = wx.Bitmap(REMOVE_IMAGE_FILE, wx.BITMAP_TYPE_PNG)

        main_sizer = wx.BoxSizer(wx.VERTICAL)

        button_sizer = wx.BoxSizer(wx.HORIZONTAL)

        button = wx.Button(self, wx.ID_ANY, EDIT_BUTTON_NAME)
        button_sizer.Add(button, border=UI_BORDER, flag=wx.ALL)
        button.Bind(wx.EVT_BUTTON, self.show_edit)

        button = wx.Button(self, wx.ID_ANY, ADD_TRANSLATION_BUTTON_NAME)
        button_sizer.Add(button, border=UI_BORDER, flag=wx.ALL)
        button.Bind(wx.EVT_BUTTON, self.show_add_translation)

        button = wx.Button(self, wx.ID_ANY, ADD_DICTIONARY_BUTTON_NAME)
        button_sizer.Add(button, border=UI_BORDER, flag=wx.ALL)
        button.Bind(wx.EVT_BUTTON, self.add_dictionary)

        button = wx.Button(self, wx.ID_ANY, LOOKUP_BUTTON_NAME)
        button_sizer.Add(button, border=UI_BORDER, flag=wx.ALL)
        button.Bind(wx.EVT_BUTTON, self.show_lookup)

        main_sizer.Add(button_sizer)

        self.dictionary_controls = []
        self.dicts_sizer = wx.BoxSizer(wx.VERTICAL)

        main_sizer.Add(self.dicts_sizer)

        self.mask = 'Json files (*%s)|*%s|RTF/CRE files (*%s)|*%s' % (
            conf.JSON_EXTENSION,
            conf.JSON_EXTENSION,
            conf.RTF_EXTENSION,
            conf.RTF_EXTENSION,
        )

        self.SetSizerAndFit(main_sizer)
        self.SetupScrolling()

        # Fill in dictionaries *after* setting the minimum client size.
        for filename in config.get_dictionary_file_names():
            self.add_row(filename)
示例#22
0
    def __init__(self, parent, id=-1, plots=None, **kwargs):
        """
        """
        ScrolledPanel.__init__(self, parent, id=id, **kwargs)
        PanelBase.__init__(self, parent)
        self.SetupScrolling()
        #Set window's font size
        self.SetWindowVariant(variant=FONT_VARIANT)
        self._set_analysis(False)

        self.plots = plots
        self.radio_buttons = {}
        self.parent = parent.parent

        ## Data file TextCtrl
        self.data_file = None
        self.plot_data = None
        self.nfunc_ctl = None
        self.alpha_ctl = None
        self.dmax_ctl = None
        self.time_ctl = None
        self.chi2_ctl = None
        self.osc_ctl = None
        self.file_radio = None
        self.plot_radio = None
        self.label_sugg = None
        self.qmin_ctl = None
        self.qmax_ctl = None
        self.swidth_ctl = None
        self.sheight_ctl = None

        self.rg_ctl = None
        self.iq0_ctl = None
        self.bck_chk = None
        self.bck_ctl = None

        # TextCtrl for fraction of positive P(r)
        self.pos_ctl = None

        # TextCtrl for fraction of 1 sigma positive P(r)
        self.pos_err_ctl = None

        ## Estimates
        self.alpha_estimate_ctl = None
        self.nterms_estimate_ctl = None
        ## D_max distance explorator
        self.distance_explorator_ctl = None
        ## Data manager
        self._manager = None
        ## Default file location for save
        self._default_save_location = os.getcwd()
        if self.parent is not None:
            self._default_save_location = \
                        self.parent._default_save_location

        # Default width
        self._default_width = 350
        self._do_layout()
示例#23
0
文件: config.py 项目: Cat-Ion/plover
    def __init__(self, engine, config, parent):
        """Create a configuration component based on the given ConfigParser.

        Arguments:

        config -- A Config object.

        parent -- This component's parent component.

        """
        ScrolledPanel.__init__(self, parent)
        self.engine = engine
        self.config = config

        self.up_bitmap = wx.Bitmap(UP_IMAGE_FILE, wx.BITMAP_TYPE_PNG)
        self.down_bitmap = wx.Bitmap(DOWN_IMAGE_FILE, wx.BITMAP_TYPE_PNG)
        self.remove_bitmap = wx.Bitmap(REMOVE_IMAGE_FILE, wx.BITMAP_TYPE_PNG)

        main_sizer = wx.BoxSizer(wx.VERTICAL)

        button_sizer = wx.BoxSizer(wx.HORIZONTAL)

        button = wx.Button(self, wx.ID_ANY, EDIT_BUTTON_NAME)
        button_sizer.Add(button, border=UI_BORDER, flag=wx.ALL)
        button.Bind(wx.EVT_BUTTON, self.show_edit)

        button = wx.Button(self, wx.ID_ANY, ADD_TRANSLATION_BUTTON_NAME)
        button_sizer.Add(button, border=UI_BORDER, flag=wx.ALL)
        button.Bind(wx.EVT_BUTTON, self.show_add_translation)

        button = wx.Button(self, wx.ID_ANY, ADD_DICTIONARY_BUTTON_NAME)
        button_sizer.Add(button, border=UI_BORDER, flag=wx.ALL)
        button.Bind(wx.EVT_BUTTON, self.add_dictionary)

        button = wx.Button(self, wx.ID_ANY, LOOKUP_BUTTON_NAME)
        button_sizer.Add(button, border=UI_BORDER, flag=wx.ALL)
        button.Bind(wx.EVT_BUTTON, self.show_lookup)

        main_sizer.Add(button_sizer)

        self.dictionary_controls = []
        self.dicts_sizer = wx.BoxSizer(wx.VERTICAL)

        main_sizer.Add(self.dicts_sizer)

        self.mask = "Json files (*%s)|*%s|RTF/CRE files (*%s)|*%s" % (
            conf.JSON_EXTENSION,
            conf.JSON_EXTENSION,
            conf.RTF_EXTENSION,
            conf.RTF_EXTENSION,
        )

        self.SetSizerAndFit(main_sizer)
        self.SetupScrolling()

        # Fill in dictionaries *after* setting the minimum client size.
        for filename in config.get_dictionary_file_names():
            self.add_row(filename)
示例#24
0
    def __init__(self, place, **args):
        ScrolledPanel.__init__(self, place[0], -1)#, style=wx.SUNKEN_BORDER)
        Widget.__init__(self, place, **args)
        Container.__init__(self)

        self.layout = wx.BoxSizer(wx.VERTICAL)
        self.SetSizer(self.layout)
        self.SetAutoLayout(True)
        self.SetupScrolling()
示例#25
0
    def __init__(self, parent, widget):
        ScrolledPanel.__init__(self, parent)
        self.SetupScrolling(scroll_x=False)

        sizer = wx.BoxSizer(wx.VERTICAL)
        self.widget = widget

        sizer.Add(self.widget.build(self), 0, wx.EXPAND)
        self.SetSizer(sizer)
示例#26
0
 def __init__(self,
              parent,
              id,
              pos=wx.DefaultPosition,
              size=wx.DefaultSize,
              style=0,
              name=''):
     ScrolledPanel.__init__(self, parent, id, pos, size, style, name)
     self.Bind(wx.EVT_CHILD_FOCUS, self.skipEvent)
示例#27
0
 def __init__(self, parent, **kwargs):
     ScrolledPanel.__init__(self, parent, -1, style=wx.BORDER_STATIC)    
     self._splitter = MultiSplitterWindow(self)      
     hbox = wx.BoxSizer(wx.HORIZONTAL)
     self.item = hbox.Add(self._splitter , 0, wx.EXPAND)
     hbox.Layout()
     self.SetSizer(hbox)
     self.ShowScrollbars(wx.SHOW_SB_NEVER, wx.SHOW_SB_ALWAYS)
     self.SetupScrolling()
示例#28
0
 def __init__(self,
              parent,
              id=wx.ID_ANY,
              pos=wx.DefaultPosition,
              size=wx.DefaultSize,
              style=wx.TAB_TRAVERSAL):
     WindowBase.__init__(self)
     ScrolledPanel.__init__(self, parent, id, pos, size, style)
     self.Bind(wx.EVT_LEFT_DOWN, self.onMouseLeftDown)
示例#29
0
 def __init__(self, parent, *args, **kwargs):
     ScrolledPanel.__init__(self, parent, style=wx.SIMPLE_BORDER, *args, **kwargs)
     
     self.sizer = wx.BoxSizer(wx.HORIZONTAL)
     self.results = wx.StaticText(self, label="")
     self.sizer.Add(self.results, flag=wx.EXPAND)
     
     self.SetSizer(self.sizer)
     self.Fit()
示例#30
0
  def __init__(self, parent, widget):
    ScrolledPanel.__init__(self, parent)
    self.SetupScrolling(scroll_x=False)

    sizer = wx.BoxSizer(wx.VERTICAL)
    self.widget = widget

    sizer.Add(self.widget.build(self), 0, wx.EXPAND)
    self.SetSizer(sizer)
示例#31
0
    def __init__(self, place, **args):
        ScrolledPanel.__init__(self, place[0], -1)  #, style=wx.SUNKEN_BORDER)
        Widget.__init__(self, place, **args)
        Container.__init__(self)

        self.layout = wx.BoxSizer(wx.VERTICAL)
        self.SetSizer(self.layout)
        self.SetAutoLayout(True)
        self.SetupScrolling()
示例#32
0
文件: view.py 项目: bmattern/minixs
  def __init__(self, *args, **kwargs):
    ScrolledPanel.__init__(self, *args, **kwargs)

    self.grid = wx.FlexGridSizer(cols=4, vgap=VPAD, hgap=HPAD)
    #self.grid.AddGrowableCol(2, 1)
    self.SetSizer(self.grid)

    self.filter_views = []
    self.SetAutoLayout(True)
    self.SetupScrolling(True, True)
示例#33
0
 def __init__(self, parent, funcparent=None, *args, **kwargs):
     """
     Notebook page dummy with methods
     """
     ScrolledPanel.__init__(self, parent, *args, **kwargs)
     self.SetupScrolling(scroll_y=True)
     self.SetupScrolling(scroll_x=True)
     self.analysis = None
     self.key = None
     self.funcparent = funcparent
示例#34
0
    def __init__(self, *args, **kwargs):
        ScrolledPanel.__init__(self, args[0], wx.ID_ANY, size=kwargs['size'])

        box = wx.BoxSizer()
        image_view = ImageView(self, *args[1:], **kwargs)
        self.image_view = image_view
        self.SetSizer(box)

        self.SetAutoLayout(True)
        self.SetupScrolling()
示例#35
0
    def __init__(self, *args, **kwargs):
        ScrolledPanel.__init__(self, args[0], wx.ID_ANY, size=kwargs["size"])

        box = wx.BoxSizer()
        image_view = ImageView(self, *args[1:], **kwargs)
        self.image_view = image_view
        self.SetSizer(box)

        self.SetAutoLayout(True)
        self.SetupScrolling()
示例#36
0
    def __init__(self, parent):
        ScrolledPanel.__init__(self, parent = parent, id = wx.ID_ANY)

        sizer = self.addValues()
        self.btnParameters = wx.Button(self, label = "Set Parameters", id = controlids.ID_SET_REFERENCE_VALUES)

        sizer.Add(self.btnParameters, ((len(DataitemConfiguration['Parameters']) + 1), 0), wx.DefaultSpan, wx.ALL | wx.ALIGN_LEFT, 5)

        self.SetSizerAndFit(sizer)
        self.SetupScrolling()
示例#37
0
    def __init__(self,
                 parent,
                 id=-1,
                 pos=wx.DefaultPosition,
                 size=wx.DefaultSize,
                 style=wx.HSCROLL | wx.VSCROLL):
        ScrolledPanel.__init__(self, parent, id, pos, size, style)

        self.bitmap = None
        wx.EVT_PAINT(self, self.OnPaint)
示例#38
0
 def __init__(self, parent: wx.Window, sizer_dir=wx.VERTICAL, **kwargs):
     ScrolledPanel.__init__(
         self,
         parent,
         **kwargs
     )
     SimpleSizer.__init__(self, sizer_dir)
     self.SetSizer(self.sizer)
     self.SetupScrolling()
     self.SetAutoLayout(1)
示例#39
0
文件: view.py 项目: pushkarlab/minixs
    def __init__(self, *args, **kwargs):
        ScrolledPanel.__init__(self, *args, **kwargs)

        self.grid = wx.FlexGridSizer(cols=4, vgap=VPAD, hgap=HPAD)
        #self.grid.AddGrowableCol(2, 1)
        self.SetSizer(self.grid)

        self.filter_views = []
        self.SetAutoLayout(True)
        self.SetupScrolling(True, True)
示例#40
0
    def __init__(self, parent, editor):
                
        ScrolledPanel.__init__(self, parent)      
        self.parent = parent
        self.editor = editor

        
        self.sizer = wx.FlexGridSizer()
        self.sizer.SetRows(8)
        
        self.basePane = pyPane.PyCollapsiblePane(self, -1, style =  pyPane.CP_GTK_EXPANDER | wx.CP_NO_TLW_RESIZE)
        self.materialPane = pyPane.PyCollapsiblePane(self, -1, style =  pyPane.CP_GTK_EXPANDER | wx.CP_NO_TLW_RESIZE)
        self.renderEffectPane = pyPane.PyCollapsiblePane(self, -1, style =  pyPane.CP_GTK_EXPANDER | wx.CP_NO_TLW_RESIZE )
        self.fogPane = pyPane.PyCollapsiblePane(self, -1, style =  pyPane.CP_GTK_EXPANDER | wx.CP_NO_TLW_RESIZE)
        self.staticMeshPane = pyPane.PyCollapsiblePane(self, -1, style =  pyPane.CP_GTK_EXPANDER | wx.CP_NO_TLW_RESIZE)
        self.actorPane = pyPane.PyCollapsiblePane(self, -1, style =  pyPane.CP_GTK_EXPANDER | wx.CP_NO_TLW_RESIZE)
        self.lightPane = pyPane.PyCollapsiblePane(self, -1, style =  pyPane.CP_GTK_EXPANDER | wx.CP_NO_TLW_RESIZE)
        self.cameraPane = pyPane.PyCollapsiblePane(self, -1, style =  pyPane.CP_GTK_EXPANDER | wx.CP_NO_TLW_RESIZE)
        
        panes = [self.basePane, self.materialPane, self.renderEffectPane, 
                 self.fogPane, self.staticMeshPane, self.actorPane, 
                 self.lightPane, self.cameraPane]
        
        self.basePane.SetLabel("General")
        self.materialPane.SetLabel("Material")
        self.renderEffectPane.SetLabel("Effects")
        self.fogPane.SetLabel("Fog")
        self.staticMeshPane.SetLabel("Static Mesh")
        self.actorPane.SetLabel("Actor")
        self.lightPane.SetLabel("Lights")
        self.cameraPane.SetLabel("Camera")
        
        
        self.sizer.Add(self.basePane, wx.EXPAND)
        self.sizer.Add(self.materialPane, wx.EXPAND)
        self.sizer.Add(self.renderEffectPane, wx.EXPAND)
        self.sizer.Add(self.fogPane, wx.EXPAND)
        self.sizer.Add(self.staticMeshPane, wx.EXPAND)
        self.sizer.Add(self.actorPane, wx.EXPAND)
        self.sizer.Add(self.lightPane, wx.EXPAND)
        self.sizer.Add(self.cameraPane,wx.EXPAND)
        
        self.basePane.Bind(wx.EVT_COLLAPSIBLEPANE_CHANGED, self.onPaneChanged)
        self.materialPane.Bind(wx.EVT_COLLAPSIBLEPANE_CHANGED, self.onPaneChanged)
        self.renderEffectPane.Bind(wx.EVT_COLLAPSIBLEPANE_CHANGED, self.onPaneChanged)
        self.fogPane.Bind(wx.EVT_COLLAPSIBLEPANE_CHANGED, self.onPaneChanged)
        self.staticMeshPane.Bind(wx.EVT_COLLAPSIBLEPANE_CHANGED,self.onPaneChanged)
        self.actorPane.Bind(wx.EVT_COLLAPSIBLEPANE_CHANGED,self.onPaneChanged)
        self.lightPane.Bind(wx.EVT_COLLAPSIBLEPANE_CHANGED,self.onPaneChanged)
        self.cameraPane.Bind(wx.EVT_COLLAPSIBLEPANE_CHANGED,self.onPaneChanged)
        
        self.loadPanels()

        self.SetSizerAndFit(self.sizer)
        self.Layout()
示例#41
0
    def __init__(self, parent, metadata, base=None, *args, **kwargs):
        ScrolledPanel.__init__(self, parent, *args, **kwargs)
        PanelBase.__init__(self)
        self.SetupScrolling()
        self.SetWindowVariant(variant=FONT_VARIANT)

        self.base = base
        self.parent = parent
        self._to_validate = []  # An list of inputs that should contain floats
        self._vectors = []  # A list of VectorInputs to be validated
        self.metadata = metadata
示例#42
0
 def __init__(self, parent, player, text="Choose a song to listen"):
     ScrolledPanel.__init__(self, parent, style=wx.BORDER_SUNKEN)
     self.parent = parent
     self.objects_list = None
     self.buttons = []
     self.sizer = wx.BoxSizer(wx.VERTICAL)
     t = wx.StaticText(self, -1, text)
     self.sizer.Add(t)
     self.SetSizer(self.sizer)
     self.SetupScrolling()
     self.player = player
示例#43
0
    def __init__(self, parent, metadata, base=None, *args, **kwargs):
        ScrolledPanel.__init__(self, parent, *args, **kwargs)
        PanelBase.__init__(self)
        self.SetupScrolling()
        self.SetWindowVariant(variant=FONT_VARIANT)

        self.base = base
        self.parent = parent
        self._to_validate = [] # An list of inputs that should contain floats
        self._vectors = [] # A list of VectorInputs to be validated
        self.metadata = metadata
示例#44
0
    def __init__(self,parent,id):    
        ScrolledPanel.__init__(self, parent, -1, style=wx.BORDER_SUNKEN)
        self.SetBackgroundColour('white')

        #the sizer to which all items are added
        self.sizer = wx.BoxSizer(wx.VERTICAL)
        self.SetSizer(self.sizer)

        #item attributes
        self.items = []
        self.lines = []
        self.iconsize = 22
    def __init__(self,parent):
        ScrolledPanel.__init__(self, parent, -1)

        self.panel_sizer = wx.BoxSizer( wx.VERTICAL )
        self.filters = []
        filt = MeasurementFilter(self, False)
        self.panel_sizer.Add(filt, 0, wx.EXPAND)
        self.filters.append(filt)

        self.SetSizer(self.panel_sizer)
        self.SetAutoLayout(1)
        self.SetupScrolling(False,True)
示例#46
0
文件: form.py 项目: notepadnine/wxpos
 def __init__(self, parent, id, validator=None):
     #wx.PyPanel.__init__(self, parent, id, style=wx.TAB_TRAVERSAL | wx.WS_EX_VALIDATE_RECURSIVELY)
     ScrolledPanel.__init__(self, parent, id, style=wx.TAB_TRAVERSAL | wx.WS_EX_VALIDATE_RECURSIVELY)
     
     if validator is not None:
         self.validator = base_validator.validator(validator)
     else:
         self.validator = None
     
     self.fields = {}
     self.field_order = []
     self.data = {}
示例#47
0
    def __init__(self, parent):
        # originally made by Todd Parsons
        ScrolledPanel.__init__(self,
                               parent,
                               size=wx.Size(120, -1),
                               style=wx.VSCROLL | wx.BORDER_NONE)

        self.parent = parent
        self.sizer = wx.BoxSizer(wx.VERTICAL)
        self._createColorButtons()
        self.SetSizer(self.sizer)
        self.SetupScrolling()
    def __init__(self, parent, editor):
        self.editor = editor
        self.colorPicker = None
        self.lastColorPickerPos = None
        self.lastPropTab = None
        ScrolledPanel.__init__(self, parent)

        parentSizer = wx.BoxSizer(wx.VERTICAL)
        parentSizer.Add(self, 1, wx.EXPAND, 0)
        parent.SetSizer(parentSizer); parent.Layout()

        self.SetDropTarget(AnimFileDrop(self.editor))
示例#49
0
    def __init__(self,parent,id,label,size=wx.DefaultSize,pos=wx.DefaultPosition,style=wx.BORDER_NONE):
        ScrolledPanel.__init__(self,parent,id,size=size,pos=pos,style=style)

        self.label = label

        sizer = wx.BoxSizer(wx.VERTICAL)
        self.text = wx.StaticText(self,-1,label)
        sizer.Add(self.text,1,wx.EXPAND)
        self.SetSizer(sizer)

        self.Bind(wx.EVT_SIZE, self.OnSize, self)
        self.SetupScrolling()
示例#50
0
    def __init__(self, parent, editor):
        self.editor = editor
        self.colorPicker = None
        self.lastColorPickerPos = None
        self.lastPropTab = None
        ScrolledPanel.__init__(self, parent)

        parentSizer = wx.BoxSizer(wx.VERTICAL)
        parentSizer.Add(self, 1, wx.EXPAND, 0)
        parent.SetSizer(parentSizer); parent.Layout()

        self.SetDropTarget(AnimFileDrop(self.editor))
示例#51
0
    def __init__(self, parent, id):
        ScrolledPanel.__init__(self, parent, id, size=(300, 150))
        self.index = -1
        self.__contacts = {}
        self.name_choices = ('email', 'phone', 'mobile', 'fax')
        self.mainSizer = wx.BoxSizer(orient=wx.VERTICAL)

        addBtn = wx.Button(self, -1, '+')
        addBtn.Bind(wx.EVT_BUTTON, self.OnAddButton)
        self.mainSizer.Add(addBtn)

        self.SetSizer(self.mainSizer)
        self.SetupScrolling()
示例#52
0
 def __init__(self, parent, size, name, musicPath=relative_music_path + "TwoMandolins.mp3", sender=None):
     ScrolledPanel.__init__(self, size = size, parent=parent, style=wx.SIMPLE_BORDER)
     # wx.Panel.__init__(self, size=size, parent=parent)
     self.Bind(wx.EVT_SHOW, self.onShow, self)
     self.SetupScrolling()
     self.parent = parent
     self.name = name
     self.size = size
     self.sender = sender
     self.ackMsgs = {}
     self.musicPath = musicPath
     self.initMainSizer()
     self.SetBackgroundColour((0, 0, 0))
示例#53
0
    def __init__(self, parent, *args, **kwargs):
        ScrolledPanel.__init__(self,
                               parent,
                               style=wx.SIMPLE_BORDER,
                               *args,
                               **kwargs)

        self.sizer = wx.BoxSizer(wx.HORIZONTAL)
        self.results = wx.StaticText(self, label="")
        self.sizer.Add(self.results, flag=wx.EXPAND)

        self.SetSizer(self.sizer)
        self.Fit()
示例#54
0
  def __init__(self, parent, req_cols=1, opt_cols=3, title=None, **kwargs):
    ScrolledPanel.__init__(self, parent, **kwargs)
    self.SetupScrolling(scroll_x=False, scrollToTop=False)
    self.SetDoubleBuffered(True)

    self.title = title
    self._num_req_cols = req_cols
    self._num_opt_cols = opt_cols
    self.required_section = WidgetContainer(self, i18n._("required_args_msg"))
    self.optional_section = WidgetContainer(self, i18n._("optional_args_msg"))

    self._do_layout()
    self.Bind(wx.EVT_SIZE, self.OnResize)
示例#55
0
    def __init__(self, parent ):
        ScrolledPanel.__init__(self, parent, -1)
        sizer = wx.BoxSizer( wx.VERTICAL )
        self.SetupScrolling( False, True, 10, 10)
        self.SetSizer( sizer )
        self.SetDoubleBuffered(True)

    #     self.Bind(wx.EVT_SIZE, self.LayoutVirtualSize)
        

    # def LayoutVirtualSize( self, event ):
    #     self.SetVirtualSizeHints(-1, -1, self.GetClientSize().GetWidth() - 32)
        
示例#56
0
    def __init__(self, parent, paths, pattern, pos=(0, 0), size=(50, 18)):
        ScrolledPanel.__init__(self, parent, wx.ID_ANY, pos, size, wx.RAISED_BORDER)
        self.SetBackgroundColour((255, 255, 255))
        self.lib = Library(paths, pattern)

        self.q = []

        Sizer = wx.BoxSizer(wx.VERTICAL)
        self.SetSizer(Sizer)
        self.SetupScrolling()
        self.Bind(wx.EVT_MOUSEWHEEL, self.OnScroll)
        self.Bind(wx.EVT_ENTER_WINDOW, self.onMouseMove)
        self.Bind(wx.EVT_LEAVE_WINDOW, self.onMouseMoveO)
    def __init__(self, parent, emojis=[]):
        ScrolledPanel.__init__(self, parent)
        self.parent = parent
        self.sizer = wx.GridSizer(0, 0, 0, 0)
        self.sizer.SetCols(2)
        self.sizer.SetRows(len(emojis) / 2 + 1)
        self.SetSizer(self.sizer)

        self.emoji_images_ui = dict()
        self.populate_with_emojis(emojis)

        self.SetupScrolling(scroll_y=True)
        self.Layout()
示例#58
0
 def __init__(self, parent, id):
     ScrolledPanel.__init__(self, parent, id, size=(300, 150))
     self.index = -1
     self.__contacts = {}
     self.name_choices = ('email', 'phone', 'mobile', 'fax')
     self.mainSizer = wx.BoxSizer(orient=wx.VERTICAL)
     
     addBtn = wx.Button(self, -1, '+')
     addBtn.Bind(wx.EVT_BUTTON, self.OnAddButton)
     self.mainSizer.Add(addBtn)
     
     self.SetSizer(self.mainSizer)
     self.SetupScrolling()
示例#59
0
 def __init__(self, parent, sizer_dir=wx.VERTICAL):
     ScrolledPanel.__init__(
         self,
         parent,
         wx.ID_ANY,
         wx.DefaultPosition,
         wx.DefaultSize,
         wx.TAB_TRAVERSAL,
     )
     SimpleSizer.__init__(self, sizer_dir)
     self.SetSizer(self.sizer)
     self.SetupScrolling()
     self.SetAutoLayout(1)
示例#60
0
 def __init__(self, parent, text=None):
     """
     """
     ScrolledPanel.__init__(self, parent, id=-1)
     self.SetupScrolling()
     self.parent = parent
     self.text = text
     sizer = wx.BoxSizer(wx.VERTICAL)
     self.textctl = wx.TextCtrl(self, -1, size=(-1, -1), style=STYLE)
     self.textctl.SetValue(self.text)
     sizer.Add(self.textctl, proportion=1, flag=wx.EXPAND)
     self.SetSizer(sizer)
     self.SetAutoLayout(True)
     wx.EVT_CLOSE(self.parent, self.OnClose)