Python wx.DefaultPosition() Examples

The following are 30 code examples of wx.DefaultPosition(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module wx , or try the search function .
Example #1
Source File: daily.py    From Bruno with MIT License 6 votes vote down vote up
def __init__(self):
        wx.Frame.__init__(self, None,
                          pos=wx.DefaultPosition, size=wx.Size(450, 100),
                          style=wx.MINIMIZE_BOX | wx.SYSTEM_MENU | wx.CAPTION |
                          wx.CLOSE_BOX | wx.CLIP_CHILDREN,
                          title="BRUNO")
        panel = wx.Panel(self)

        ico = wx.Icon('boy.ico', wx.BITMAP_TYPE_ICO)
        self.SetIcon(ico)

        my_sizer = wx.BoxSizer(wx.VERTICAL)
        lbl = wx.StaticText(panel,
                            label="Bienvenido Sir. How can I help you?")
        my_sizer.Add(lbl, 0, wx.ALL, 5)
        self.txt = wx.TextCtrl(panel, style=wx.TE_PROCESS_ENTER,
                               size=(400, 30))
        self.txt.SetFocus()
        self.txt.Bind(wx.EVT_TEXT_ENTER, self.OnEnter)
        my_sizer.Add(self.txt, 0, wx.ALL, 5)
        panel.SetSizer(my_sizer)
        self.Show()
        speak.Speak('''Welcome back Sir, Broono at your service.''') 
Example #2
Source File: frame_downloader.py    From iqiyi-parser with MIT License 6 votes vote down vote up
def initTotal(self, total):
        self.total = total if total > 0 else 0
        self.gauge_total = wx.Gauge(self, wx.ID_ANY, 10000, wx.DefaultPosition, wx.DefaultSize,
                                       wx.GA_HORIZONTAL)
        self.gauge_total.SetValue(0)
        self.text_percent = wx.StaticText(self, wx.ID_ANY, '0%', wx.DefaultPosition,
                                          wx.Size(42, -1), wx.ALIGN_RIGHT)
        self.text_speed = wx.StaticText(self, wx.ID_ANY, '0B/s', wx.DefaultPosition, wx.Size(65, -1),
                                        wx.ALIGN_RIGHT)

        self.text_percent.Wrap(-1)
        self.text_speed.Wrap(-1)

        self.sizer_total.Add(self.text_percent, 0, wx.ALL, 5)
        self.sizer_total.Add(self.gauge_total, 5, wx.ALL | wx.EXPAND, 5)
        self.sizer_total.Add(self.text_speed, 0, wx.ALL, 5) 
Example #3
Source File: sct_plugin.py    From spinalcordtoolbox with MIT License 6 votes vote down vote up
def __init__(self, parent):
        # TODO: try to use MessageBox instead, as they already include buttons, icons, etc.
        wx.Dialog.__init__(self, parent, title="SCT Processing")
        self.SetSize((300, 120))

        vbox = wx.BoxSizer(wx.VERTICAL)
        lbldesc = wx.StaticText(self, id=wx.ID_ANY, label="Processing, please wait...")
        vbox.Add(lbldesc, 0, wx.ALIGN_LEFT | wx.ALL, 10)

        btns = self.CreateSeparatedButtonSizer(wx.CANCEL)
        vbox.Add(btns, 0, wx.ALIGN_LEFT | wx.ALL, 5)

        hbox = wx.BoxSizer(wx.HORIZONTAL)

        # TODO: use a nicer image, showing two gears (similar to ID_EXECUTE)
        save_ico = wx.ArtProvider.GetBitmap(wx.ART_INFORMATION, wx.ART_TOOLBAR, (50, 50))
        img_info = wx.StaticBitmap(self, -1, save_ico, wx.DefaultPosition, (save_ico.GetWidth(), save_ico.GetHeight()))

        hbox.Add(img_info, 0, wx.ALL, 10)
        hbox.Add(vbox, 0, wx.ALL, 0)

        self.SetSizer(hbox)
        self.Centre()
        self.CenterOnParent()
        # TODO: retrieve action from the cancel button 
Example #4
Source File: dialog_copylink.py    From iqiyi-parser with MIT License 6 votes vote down vote up
def __init__(self, parent):
        wx.Dialog.__init__(self, parent, id=wx.ID_ANY, title=u"链接浏览窗口", pos=wx.DefaultPosition, size=wx.Size(500, 500),
                           style=wx.DEFAULT_DIALOG_STYLE)

        self.SetSizeHints(wx.DefaultSize, wx.DefaultSize)

        sizer_global = wx.BoxSizer(wx.VERTICAL)

        self.listctrl_links = ListCtrl_CopyLink(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LC_REPORT)
        sizer_global.Add(self.listctrl_links, 1, wx.ALL | wx.EXPAND, 5)

        self.SetSizer(sizer_global)
        self.Layout()

        self.Centre(wx.BOTH)
        self.Bind(wx.EVT_CLOSE, self.onClose) 
Example #5
Source File: HtmlWindow.py    From EventGhost with GNU General Public License v2.0 6 votes vote down vote up
def __init__(
        self,
        parent,
        id=-1,
        pos=wx.DefaultPosition,
        size=wx.DefaultSize,
        style=HW_DEFAULT_STYLE,
        name="htmlWindow"
    ):
        wxHtmlWindow.__init__(self, parent, id, pos, size, style, name)
        self.SetForegroundColour(parent.GetForegroundColour())
        self.SetBackgroundColour(parent.GetBackgroundColour())

        #if wx.html.HW_NO_SELECTION & style:
        #    self.Bind(wx.EVT_MOTION, self.OnIdle)
        #    self.handCursor = wx.StockCursor(wx.CURSOR_HAND)
        #    self.x1, self.y1 = self.GetScrollPixelsPerUnit()
        #    self.isSet = False
        self.Bind(EVT_HTML_LINK_CLICKED, self.OnHtmlLinkClicked) 
Example #6
Source File: ColourSelectButton.py    From EventGhost with GNU General Public License v2.0 6 votes vote down vote up
def __init__(
        self,
        parent,
        value=(255, 255, 255),
        pos=wx.DefaultPosition,
        size=(40, wx.Button.GetDefaultSize()[1]),
        style=wx.BU_AUTODRAW,
        validator=wx.DefaultValidator,
        name="ColourSelectButton",
        title = "Colour Picker"
    ):
        self.value = value
        self.title = title
        wx.BitmapButton.__init__(
            self, parent, -1, wx.NullBitmap, pos, size, style, validator, name
        )
        self.SetValue(value)
        self.Bind(wx.EVT_BUTTON, self.OnButton) 
Example #7
Source File: dialog_dllog.py    From iqiyi-parser with MIT License 6 votes vote down vote up
def __init__(self, parent):
        wx.Dialog.__init__(self, parent, id=wx.ID_ANY, title=u"控制台日志", pos=wx.DefaultPosition, size=wx.Size(500, 500),
                           style=wx.DEFAULT_DIALOG_STYLE)

        self.SetSizeHints(wx.DefaultSize, wx.DefaultSize)

        sizer_global = wx.BoxSizer(wx.VERTICAL)
        self.textctrl_log = wx.TextCtrl(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size(427, 381),
                                           wx.TE_AUTO_URL | wx.TE_MULTILINE | wx.TE_PROCESS_ENTER | wx.TE_PROCESS_TAB)

        # self.listctrl_log = ListCtrl_DLLog(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LC_REPORT)
        sizer_global.Add(self.textctrl_log, 1, wx.ALL | wx.EXPAND, 5)

        self.SetSizer(sizer_global)
        self.Layout()

        self.Centre(wx.BOTH)
        self.Bind(wx.EVT_CLOSE, self.onClose) 
Example #8
Source File: runsnake.py    From pyFileFixity with MIT License 6 votes vote down vote up
def __init__(
        self, parent=None, id=-1,
        title=_("Run Snake Run"),
        pos=wx.DefaultPosition,
        size=wx.DefaultSize,
        style=wx.DEFAULT_FRAME_STYLE|wx.CLIP_CHILDREN,
        name= _("RunSnakeRun"),
        config_parser=None,
    ):
        """Initialise the Frame"""
        wx.Frame.__init__(self, parent, id, title, pos, size, style, name)
        # TODO: toolbar for back, up, root, directory-view, percentage view
        self.adapter = pstatsadapter.PStatsAdapter()
        self.CreateControls(config_parser)
        self.history = [] # set of (activated_node, selected_node) pairs...
        icon = self.LoadRSRIcon()
        if icon:
            self.SetIcon( icon ) 
Example #9
Source File: xrced.py    From admin4 with Apache License 2.0 6 votes vote down vote up
def __init__(self, parent, msg, caption, pos = wx.DefaultPosition, size = (500,300)):
        from wx.lib.layoutf import Layoutf
        wx.Dialog.__init__(self, parent, -1, caption, pos, size)
        text = wx.TextCtrl(self, -1, msg, wx.DefaultPosition,
                             wx.DefaultSize, wx.TE_MULTILINE | wx.TE_READONLY)
        text.SetFont(g.modernFont())
        dc = wx.WindowDC(text)
        # !!! possible bug - GetTextExtent without font returns sysfont dims
        w, h = dc.GetFullTextExtent(' ', g.modernFont())[:2]
        ok = wx.Button(self, wx.ID_OK, "OK")
        text.SetConstraints(Layoutf('t=t5#1;b=t5#2;l=l5#1;r=r5#1', (self,ok)))
        text.SetSize((w * 80 + 30, h * 40))
        text.ShowPosition(1)
        ok.SetConstraints(Layoutf('b=b5#1;x%w50#1;w!80;h!25', (self,)))
        self.SetAutoLayout(True)
        self.Fit()
        self.CenterOnScreen(wx.BOTH)

################################################################################

# Event handler for using during location 
Example #10
Source File: listviews.py    From pyFileFixity with MIT License 6 votes vote down vote up
def __init__(
        self, parent,
        id=-1,
        pos=wx.DefaultPosition, size=wx.DefaultSize,
        style=wx.LC_REPORT|wx.LC_VIRTUAL|wx.LC_VRULES|wx.LC_SINGLE_SEL,
        validator=wx.DefaultValidator,
        columns=None,
        sortOrder=None,
        name=_("ProfileView"),
    ):
        wx.ListCtrl.__init__(self, parent, id, pos, size, style, validator,
                             name)

        if columns is not None:
            self.columns = columns

        if not sortOrder:
            sortOrder = [(x.defaultOrder,x) for x in self.columns if x.sortDefault]
        self.sortOrder = sortOrder or []
        self.sorted = []
        self.CreateControls() 
Example #11
Source File: PasswordCtrl.py    From EventGhost with GNU General Public License v2.0 6 votes vote down vote up
def __init__(
        self,
        parent,
        id=-1,
        value="",
        pos=wx.DefaultPosition,
        size=wx.DefaultSize,
    ):
        if isinstance(value, eg.Password):
            self.password = value
        else:
            self.password = eg.Password(content=value)
        wx.TextCtrl.__init__(
            self,
            parent,
            id,
            self.password.Get(),
            pos,
            size,
            style=wx.TE_PASSWORD,
        ) 
Example #12
Source File: rasterwindow.py    From spectral with MIT License 6 votes vote down vote up
def __init__(self, parent, index, rgb, **kwargs):
        if 'title' in kwargs:
            title = kwargs['title']
        else:
            title = 'SPy Image'
#        wxFrame.__init__(self, parent, index, "SPy Frame")
#        wxScrolledWindow.__init__(self, parent, index, style = wxSUNKEN_BORDER)

        img = wx.EmptyImage(rgb.shape[0], rgb.shape[1])
        img = wx.EmptyImage(rgb.shape[1], rgb.shape[0])
        img.SetData(rgb.tostring())
        self.bmp = img.ConvertToBitmap()
        self.kwargs = kwargs
        wx.Frame.__init__(self, parent, index, title,
                          wx.DefaultPosition)
        self.SetClientSizeWH(self.bmp.GetWidth(), self.bmp.GetHeight())
        wx.EVT_PAINT(self, self.on_paint)
        wx.EVT_LEFT_DCLICK(self, self.left_double_click) 
Example #13
Source File: FontSelectButton.py    From EventGhost with GNU General Public License v2.0 6 votes vote down vote up
def __init__(
        self,
        parent,
        id=-1,
        pos=wx.DefaultPosition,
        size=(40, wx.Button.GetDefaultSize()[1]),
        style=wx.BU_AUTODRAW,
        validator=wx.DefaultValidator,
        name="FontSelectButton",
        value=None
    ):
        self.value = value
        wx.BitmapButton.__init__(
            self,
            parent,
            id,
            GetInternalBitmap("font"),
            pos,
            size,
            style,
            validator,
            name
        )
        self.Bind(wx.EVT_BUTTON, self.OnButton) 
Example #14
Source File: GuiAbsBase.py    From Crypter with GNU General Public License v3.0 6 votes vote down vote up
def __init__( self, parent ):
		wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = u"Encrypted Files", pos = wx.DefaultPosition, size = wx.Size( 600,400 ), style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL )

		self.SetSizeHints( wx.DefaultSize, wx.DefaultSize )

		BodySizer = wx.BoxSizer( wx.VERTICAL )

		self.m_panel4 = wx.Panel( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
		TextCtrlSizer = wx.BoxSizer( wx.VERTICAL )

		self.EncryptedFilesTextCtrl = wx.TextCtrl( self.m_panel4, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.TE_DONTWRAP|wx.TE_MULTILINE|wx.TE_READONLY )
		TextCtrlSizer.Add( self.EncryptedFilesTextCtrl, 1, wx.ALL|wx.EXPAND, 5 )


		self.m_panel4.SetSizer( TextCtrlSizer )
		self.m_panel4.Layout()
		TextCtrlSizer.Fit( self.m_panel4 )
		BodySizer.Add( self.m_panel4, 1, wx.EXPAND |wx.ALL, 5 )


		self.SetSizer( BodySizer )
		self.Layout()

		self.Centre( wx.BOTH ) 
Example #15
Source File: CardAndReaderTreePanel.py    From pyscard with GNU Lesser General Public License v2.1 6 votes vote down vote up
def __init__(self,
                  parent,
                  ID=wx.NewId(),
                  pos=wx.DefaultPosition,
                  size=wx.DefaultSize,
                  style=0,
                  clientpanel=None):
        """Constructor. Create a smartcard tree control."""
        BaseCardTreeCtrl.__init__(self, parent, ID, pos, size,
                                   wx.TR_SINGLE | wx.TR_NO_BUTTONS,
                                   clientpanel)

        self.root = self.AddRoot("Smartcards")
        self.SetPyData(self.root, None)
        self.SetItemImage(self.root, self.fldrindex, wx.TreeItemIcon_Normal)
        self.SetItemImage(
            self.root, self.fldropenindex, wx.TreeItemIcon_Expanded)
        self.Expand(self.root) 
Example #16
Source File: pdfviewer(wx).py    From PyMuPDF-Utilities with GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, parent, **kwds):
        super(PDFViewer, self).__init__(parent, **kwds)

        paneCont = self.GetContentsPane()
        self.buttonpanel = pdfButtonPanel(paneCont, wx.NewId(),
                                wx.DefaultPosition, wx.DefaultSize, 0)
        self.buttonpanel.SetSizerProps(expand=True)
        self.viewer = pdfViewer(paneCont, wx.NewId(), wx.DefaultPosition,
                                wx.DefaultSize,
                                wx.HSCROLL|wx.VSCROLL|wx.SUNKEN_BORDER)

        self.viewer.SetSizerProps(expand=True, proportion=1)

        # introduce buttonpanel and viewer to each other
        self.buttonpanel.viewer = self.viewer
        self.viewer.buttonpanel = self.buttonpanel 
Example #17
Source File: core.py    From wafer_map with GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, parent, id=-1, colour=wx.BLACK,
                         pos=wx.DefaultPosition, size=wx.DefaultSize,
                         style = CLRP_DEFAULT_STYLE,
                         validator = wx.DefaultValidator,
                         name = "colourpickerwidget"):
                
                wx.BitmapButton.__init__(self, parent, id, wx.Bitmap(1,1), 
                                         pos, size, style, validator, name)
                self.SetColour(colour)
                self.InvalidateBestSize()
                self.SetInitialSize(size)
                self.Bind(wx.EVT_BUTTON, self.OnButtonClick)
                
                global _colourData
                if _colourData is None:
                    _colourData = wx.ColourData()
                    _colourData.SetChooseFull(True)
                    grey = 0
                    for i in range(16):
                        c = wx.Colour(grey, grey, grey)
                        _colourData.SetCustomColour(i, c)
                        grey += 16 
Example #18
Source File: local_display.py    From Pigrow with GNU General Public License v3.0 6 votes vote down vote up
def __init__( self, parent ):
        # Settings
        wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = "Pigrow Data Display", pos = wx.DefaultPosition, style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL )
        self.Bind(wx.EVT_SIZE, self.resize_window)
        MainApp.display_panel = display_pnl(self)

        # Sizers
        main_sizer = wx.BoxSizer(wx.HORIZONTAL)
        main_sizer.Add(MainApp.display_panel, 0, wx.EXPAND)
        MainApp.window_sizer = wx.BoxSizer(wx.VERTICAL)
        MainApp.window_sizer.Add(main_sizer, 0, wx.EXPAND)
        #MainApp.window_sizer.Fit(self)
        self.SetSizer(MainApp.window_sizer)
        MainApp.window_self = self
        self.SetSizeHints( wx.DefaultSize, wx.DefaultSize )
        self.Layout()
        self.Centre( wx.BOTH ) 
Example #19
Source File: ConfTreeNodeEditor.py    From OpenPLC_Editor with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, parent, ID, bitmapname,
                 pos=wx.DefaultPosition, size=wx.DefaultSize,
                 style=0,
                 name="genstatbmp"):

        bitmap = GetBitmap(bitmapname)
        if bitmap is None:
            bitmap = wx.EmptyBitmap(0, 0)

        wx.StaticBitmap.__init__(self, parent, ID,
                                 bitmap,
                                 pos, size,
                                 style,
                                 name) 
Example #20
Source File: params.py    From admin4 with Apache License 2.0 5 votes vote down vote up
def __init__(self, parent, id, choices,
                 pos=wx.DefaultPosition, name='radiobox'):
        PPanel.__init__(self, parent, name)
        self.choices = choices
        topSizer = wx.BoxSizer()
        for i in choices:
            button = wx.RadioButton(self, -1, i, size=(-1,buttonSize[1]), name=i)
            topSizer.Add(button, 0, wx.RIGHT, 5)
            wx.EVT_RADIOBUTTON(self, button.GetId(), self.OnRadioChoice)
        self.SetAutoLayout(True)
        self.SetSizerAndFit(topSizer) 
Example #21
Source File: SFCStepNameDialog.py    From OpenPLC_Editor with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, parent, message, caption=_("Please enter text"), defaultValue="",
                 style=wx.OK | wx.CANCEL | wx.CENTRE, pos=wx.DefaultPosition):
        wx.TextEntryDialog.__init__(self, parent, message, caption, defaultValue, style, pos)

        self.PouNames = []
        self.Variables = []
        self.StepNames = []

        self.Bind(wx.EVT_BUTTON, self.OnOK,
                  self.GetSizer().GetItem(2).GetSizer().GetItem(1).GetSizer().GetAffirmativeButton()) 
Example #22
Source File: PouNameDialog.py    From OpenPLC_Editor with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, parent, message, caption=_("Please enter text"), defaultValue="",
                 style=wx.OK | wx.CANCEL | wx.CENTRE, pos=wx.DefaultPosition):
        wx.TextEntryDialog.__init__(self, parent, message, caption, defaultValue, style, pos)

        self.PouNames = []

        self.Bind(wx.EVT_BUTTON, self.OnOK,
                  self.GetSizer().GetItem(2).GetSizer().GetItem(1).GetSizer().GetAffirmativeButton()) 
Example #23
Source File: ControlProviderMixin.py    From EventGhost with GNU General Public License v2.0 5 votes vote down vote up
def ComboBox(
        self,
        value,
        choices,
        pos=wx.DefaultPosition,
        size=wx.DefaultSize,
        *args,
        **kwargs
    ):
        return wx.ComboBox(
            self, -1, value, pos, size, choices, *args, **kwargs
        ) 
Example #24
Source File: dialog_gettool.py    From iqiyi-parser with MIT License 5 votes vote down vote up
def __init__(self, parent, title, total_byte, dlm):
        wx.Dialog.__init__(self, parent, id=wx.ID_ANY, title=title, pos=wx.DefaultPosition, size=wx.DefaultSize,
                           style=wx.DEFAULT_DIALOG_STYLE)
        self.SetSizeHints(wx.DefaultSize, wx.DefaultSize)

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

        self.gauge_progress = wx.Gauge(self, wx.ID_ANY, 10000, wx.DefaultPosition, wx.DefaultSize, wx.GA_HORIZONTAL)
        self.gauge_progress.SetValue(524)
        self.global_sizer.Add(self.gauge_progress, 0, wx.ALL | wx.EXPAND, 5)

        sizer_info = wx.BoxSizer(wx.HORIZONTAL)

        self.text_percent = wx.StaticText(self, wx.ID_ANY, u"0.0%", wx.DefaultPosition, wx.DefaultSize,
                                            wx.ALIGN_LEFT)
        self.text_percent.Wrap(-1)

        sizer_info.Add(self.text_percent, 1, wx.ALL, 5)

        self.total_byte = total_byte
        self.format_int = '%0' + str(len(str(self.total_byte))) + 'd/%0' + str(len(str(self.total_byte))) + 'd'

        self.text_progress = wx.StaticText(self, wx.ID_ANY, self.format_int % (0, self.total_byte), wx.DefaultPosition, wx.DefaultSize,
                                            wx.ALIGN_RIGHT)
        self.text_progress.Wrap(-1)

        sizer_info.Add(self.text_progress, 1, wx.ALIGN_RIGHT | wx.ALL, 5)

        self.global_sizer.Add(sizer_info, 1, wx.EXPAND, 5)

        self.SetSizer(self.global_sizer)
        self.Layout()
        self.global_sizer.Fit(self)

        self.Centre(wx.BOTH)
        self.Bind(wx.EVT_CLOSE, self.onClose)

        self.timer = wx.Timer()

        self.timer.SetOwner(self, wx.ID_ANY)
        self.dlm = dlm 
Example #25
Source File: control.py    From atbswp with GNU General Public License v3.0 5 votes vote down vote up
def language(self, event):
        """Manage the language among the one available."""
        menu = event.EventObject
        item = menu.FindItemById(event.Id)
        settings.CONFIG['DEFAULT']['Language'] = item.Name
        dialog = wx.MessageDialog(None,
                                  message="Restart the program to apply modifications",
                                  pos=wx.DefaultPosition)
        dialog.ShowModal() 
Example #26
Source File: gui.py    From atbswp with GNU General Public License v3.0 5 votes vote down vote up
def on_close_dialog(self, event):
        """Confirm exit."""
        dialog = wx.MessageDialog(self,
                                  message="Are you sure you want to quit?",
                                  caption="Confirm Exit",
                                  style=wx.YES_NO,
                                  pos=wx.DefaultPosition)
        response = dialog.ShowModal()

        if (response == wx.ID_YES):
            self.on_exit_app(event)
        else:
            event.StopPropagation() 
Example #27
Source File: dialogs.py    From wxGlade with MIT License 5 votes vote down vote up
def __init__(self, dlg_title, box_label, choices, options=None, defaults=None):
        """Initialise the dialog and draw the content

        dlg_title: Dialog title
        box_label: Label of the draw around the listed choices
        choices: Choices to select one (string list)"""
        pos = wx.GetMousePosition()
        wx.Dialog.__init__(self, None, -1, dlg_title, pos)

        szr = wx.BoxSizer(wx.VERTICAL)

        self.box = wx.RadioBox( self, wx.ID_ANY, box_label, wx.DefaultPosition, wx.DefaultSize,choices.split('|'),
                                1, style=wx.RA_SPECIFY_COLS )
        self.box.SetSelection(0)
        szr.Add(self.box, 5, wx.ALL | wx.EXPAND, 10)

        if options:
            self.options = []
            for o, option in enumerate(options):
                cb = wx.CheckBox(self, -1, option)
                cb.SetValue(defaults and defaults[o])
                szr.Add(cb, 0, wx.ALL, 10)
                self.options.append(cb)

        # buttons
        btnbox = wx.StdDialogButtonSizer()
        btnOK = wx.Button(self, wx.ID_OK)
        btnOK.SetDefault()
        btnCANCEL = wx.Button(self, wx.ID_CANCEL)
        btnbox.AddButton(btnOK)
        btnbox.AddButton(btnCANCEL)
        btnbox.Realize()
        szr.Add(btnbox, 0, wx.ALL|wx.ALIGN_CENTER, 5)

        self.SetAutoLayout(True)
        self.SetSizer(szr)
        szr.Fit(self) 
Example #28
Source File: ctl_adm.py    From admin4 with Apache License 2.0 5 votes vote down vote up
def __init__(self, parentWin, id=-1, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0):
    wx.ComboBox.__init__(self, parentWin, id, "", pos, size, style=style | wx.CB_DROPDOWN|wx.CB_READONLY)
    self.keys={} 
Example #29
Source File: ctl_adm.py    From admin4 with Apache License 2.0 5 votes vote down vote up
def __init__(self, parentWin, defaultImageName="", id=-1, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.LC_REPORT):
    unused=style
    style=wx.LC_REPORT
    wx.ListView.__init__(self, parentWin, id, pos, size, style)
    if adm:
      self.SetImageList(adm.images, wx.IMAGE_LIST_SMALL)
      self.defaultImageId=adm.images.GetId(defaultImageName)
    self.Bind(wx.EVT_MOTION, self.OnMouseMove)
    self.getToolTipTextProc=None
    self.getToolTipCol=None
    self.colInfos=[] 
Example #30
Source File: params.py    From admin4 with Apache License 2.0 5 votes vote down vote up
def __init__(self, parent, name):
        PPanel.__init__(self, parent, name)
        self.ID_TEXT_CTRL = wx.NewId()
        self.ID_BUTTON = wx.NewId()
        sizer = wx.BoxSizer()
        self.text = wx.TextCtrl(self, self.ID_TEXT_CTRL, size=(80,-1))
        sizer.Add(self.text, 0, wx.ALIGN_CENTER_VERTICAL | wx.TOP | wx.BOTTOM, 2)
        self.button = wx.Panel(self, self.ID_BUTTON, wx.DefaultPosition, wx.Size(20, 20))
        sizer.Add(self.button, 0, wx.ALIGN_CENTER_VERTICAL | wx.LEFT, 5)
        self.SetAutoLayout(True)
        self.SetSizerAndFit(sizer)
        self.textModified = False
        wx.EVT_PAINT(self.button, self.OnPaintButton)
        wx.EVT_TEXT(self, self.ID_TEXT_CTRL, self.OnChange)
        wx.EVT_LEFT_DOWN(self.button, self.OnLeftDown)