コード例 #1
0
 def onBrowseImagesTool(self, evt):
         icon = wx.EmptyIcon()
         icon.CopyFromBitmap(leginon.gui.wx.Icons.icon("imagebrowser"))
         frame = wx.Frame(None, -1, 'Image Browser')
         frame.node = self.node
         frame.SetIcon(icon)
         panel = ImageBrowserPanel(frame)
         frame.Fit()
         frame.Show()
コード例 #2
0
    def __init__(self, parent, titre, world_filename):
        wx.Frame.__init__(self,
                          None,
                          -1,
                          _(titre),
                          size=(510, 550),
                          style=wx.DEFAULT_FRAME_STYLE)
        self.parent = parent
        self.world_filename = world_filename
        icon = wx.EmptyIcon()
        icon.CopyFromBitmap(images.ICON)
        self.SetIcon(icon)
        self.statusbar = self.CreateStatusBar()
        self.Show(True)
        self.window = RURPanel(self)
        self.world = self.WorldDisplay.world
        if self.world_filename != None:
            try:
                txt = open(self.world_filename, 'r').read()
            except:
                rD.rurMessageDialog(
                    _("Fichier monde %s inexistant\nIl ne sera pas chargé") %
                    _(self.world_filename), _("Fichier monde"))
                return
            try:
                txt = parser.FixLineEnding(txt)
                flag = parser.ParseWorld(txt)
                if not flag:
                    raise IOError
                self.backup_dict = {}  # used to 'reset' the world
                exec txt in self.backup_dict  # extracts avenues, streets, robot,
                # walls and beepers

                av = self.backup_dict['avenues']
                st = self.backup_dict['streets']
                self.SetSize((120 + 40 * av, 130 + 40 * st))
                self.world.resetDimensions(av, st)
                for corner in self.world.beepers_dict:
                    del self.world.beepers_dict[
                        corner]  # empty, but keep reference
                for corner in self.backup_dict['beepers']:
                    self.world.beepers_dict[corner] = self.backup_dict[
                        'beepers'][corner]
                for col, row in self.world.walls_list:
                    self.world.walls_list.remove(
                        (col, row))  # empty, but keep ref.
                for col, row in self.backup_dict['walls']:
                    self.world.walls_list.append((col, row))
            except:
                rD.rurMessageDialog(
                    _("Erreurs dans le fichier monde %s\nIl ne sera pas chargé"
                      ) % _(self.world_filename), _("Fichier monde"))
        self.window.SetFocus()
        self.SendSizeEvent()  # added to attempt to solve problem on MacOS
        wx.EVT_CLOSE(self, self.OnClose)
        self.onExit = False
コード例 #3
0
ファイル: dialog.py プロジェクト: italomaia/spe
 def set_icon(self, value):
     self.icon = value.strip()
     if self.widget:
         if self.icon and not (self.icon.startswith('var:')
                               or self.icon.startswith('code:')):
             icon = misc.get_relative_path(self.icon)
             bmp = wx.Bitmap(icon, wx.BITMAP_TYPE_ANY)
             if not bmp.Ok():
                 self.set_icon("")
             else:
                 icon = wx.EmptyIcon()
                 icon.CopyFromBitmap(bmp)
                 self.widget.SetIcon(icon)
         else:
             import os
             icon = wx.EmptyIcon()
             xpm = os.path.join(common.wxglade_path, 'icons', 'dialog.xpm')
             icon.CopyFromBitmap(misc.get_xpm_bitmap(xpm))
             self.widget.SetIcon(icon)
コード例 #4
0
ファイル: Bitblocks.py プロジェクト: UltraBrett/hipbit
 def __set_properties(self):
     # begin wxGlade: MainConsole.__set_properties
     self.SetTitle("Hip Bit")
     _icon = wx.EmptyIcon()
     _icon.CopyFromBitmap(
         wx.Bitmap("/home/aperture/hipbit/folder_music.ico",
                   wx.BITMAP_TYPE_ANY))
     self.SetIcon(_icon)
     self.SetSize((210, 148))
     self.TitleGreet.SetMinSize((127, 17))
コード例 #5
0
ファイル: sub.py プロジェクト: vighneshbirodkar/autosubtitles
    def __init__(self, parent):

        wx.TaskBarIcon.__init__(self)
        icon = wx.EmptyIcon()
        b = wx.Bitmap('graphics/icon.png')
        icon.CopyFromBitmap(b)
        self.SetIcon(icon, settings['name'])
        self.Bind(wx.EVT_MENU, self.About, id=self.TB_ABOUT)
        self.Bind(wx.EVT_MENU, self.ShutDown, id=self.TB_CLOSE)
        self.Bind(wx.EVT_MENU, self.Setting, id=self.TB_SETTINGS)
コード例 #6
0
    def __init__(self, frame, status_frame):
        wx.TaskBarIcon.__init__(self)
        self.frame = frame

        self.icon = wx.EmptyIcon()
        self.icon.CopyFromBitmap(wx.Bitmap("quack.ico", wx.BITMAP_TYPE_ANY))
        self.SetIcon(self.icon)

        self.SetIcon(self.icon, "Restore")
        self.Bind(wx.EVT_TASKBAR_LEFT_DOWN, self.OnTaskBarLeftClick)
コード例 #7
0
 def setIcon(self):
     ib = wx.IconBundle()
     if current.outputMode:
         bmp = self.make_grad_image(32, 32, (255, 255, 0), (0, 0, 0))
     else:
         bmp = self.make_grad_image(32, 32, (0, 0, 0), (0, 0, 0))
     icon = wx.EmptyIcon()
     icon.CopyFromBitmap(bmp)
     ib.AddIcon(icon)
     self.mainWindow.SetIcons(ib)
コード例 #8
0
 def __set_properties(self):
     # begin wxGlade: gui_agreement.__set_properties
     self.SetTitle("Spring Agreement")
     _icon = wx.EmptyIcon()
     _icon.CopyFromBitmap(wx.Bitmap("resource/spring-redlogo.png", wx.BITMAP_TYPE_ANY))
     self.SetIcon(_icon)
     self.SetSize((629, 389))
     self.text_agreement_data.SetMinSize((486, 265))
     self.radio_agreement_disagree.SetValue(1)
     self.button_agreement_continue.SetDefault()
コード例 #9
0
 def __set_properties(self):
     # begin wxGlade: GladeMainWindow.__set_properties
     self.SetTitle("Pieberry II")
     _icon = wx.EmptyIcon()
     _icon.CopyFromBitmap(
         wx.Bitmap(
             "/home/raif/development/v2Pieberry/pieberry/ui/pieberry.ico",
             wx.BITMAP_TYPE_ANY))
     self.SetIcon(_icon)
     self.SetSize((862, 546))
コード例 #10
0
ファイル: frame.py プロジェクト: NonPlayerCtrl/FreePLC_IDE
    def _set_widget_icon(self):
        if self.icon:
            bitmap = self.get_preview_obj_bitmap(self.icon.strip())
        else:
            xpm = os.path.join(config.icons_path, 'frame.xpm')
            bitmap = misc.get_xpm_bitmap(xpm)

        icon = wx.EmptyIcon()
        icon.CopyFromBitmap(bitmap)
        self.widget.SetIcon(icon)
コード例 #11
0
ファイル: mainwindow.py プロジェクト: romannamor9/outwiker
    def __setIcon(self):
        """
        Установки иконки главного окна
        """
        icon = wx.EmptyIcon()
        icon.CopyFromBitmap(
            wx.Bitmap(os.path.join(getImagesDir(), "outwiker.ico"),
                      wx.BITMAP_TYPE_ANY))

        self.SetIcon(icon)
コード例 #12
0
 def _init_infos(self):
     wx.GetApp().SetAppName("trsinfo")
     # icon
     _icon = wx.EmptyIcon()
     _icon.CopyFromBitmap(spBitmap(APP_ICON))
     self.SetIcon(_icon)
     # colors
     self.SetBackgroundColour(self.preferences.GetValue('M_BG_COLOUR'))
     self.SetForegroundColour(self.preferences.GetValue('M_FG_COLOUR'))
     self.SetFont(self.preferences.GetValue('M_FONT'))
コード例 #13
0
ファイル: bitfling.py プロジェクト: deosai/bitpim
 def windowsinit(self, iconfile):
     bitmap = wx.Bitmap(guihelper.getresourcefile(iconfile),
                        wx.BITMAP_TYPE_PNG)
     icon = wx.EmptyIcon()
     icon.CopyFromBitmap(bitmap)
     self.SetIcon(icon, "BitFling")
     wx.EVT_TASKBAR_RIGHT_UP(self, self.OnRButtonUp)
     wx.EVT_TASKBAR_LEFT_UP(self, self.OnLButtonUp)
     #wx.EVT_TASKBAR_MOVE(self, self.OnMouseMotion)
     wx.EVT_TASKBAR_LEFT_DOWN(self, self.OnLeftDown)
コード例 #14
0
    def __init__(self, parent, id, title, cf):
        wx.Frame.__init__(self,
                          parent,
                          id,
                          title,
                          wx.DefaultPosition,
                          wx.Size(900, 600),
                          name=u'EasyAccout',
                          style=wx.DEFAULT_FRAME_STYLE)
        config.cf = cf
        self.rundir = os.path.dirname(os.path.abspath(sys.argv[0]))
        self.bmpdir = os.path.join(self.rundir, 'images')
        icon = wx.EmptyIcon()
        iconpath = os.path.join(self.bmpdir, 'small.png')
        icon.CopyFromBitmap(
            wx.BitmapFromImage(wx.Image(iconpath, wx.BITMAP_TYPE_PNG)))
        self.SetIcon(icon)
        self.CenterOnScreen()

        if config.cf:
            self.conf = config.cf
        else:
            raise ValueError, 'config.cf is None'

        self.lang2id = {}
        self.id2lang = {}

        self.make_menu()
        self.make_toolbar()
        self.make_statusbar()

        self.initdb()
        self.load()
        self.book = panels.ContentTab(self)
        self.book.load_category(self.category)

        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(self.book, 1, wx.EXPAND | wx.ALL)
        self.SetSizer(sizer)
        self.SetAutoLayout(True)

        self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
        self.check_password()

        self.Bind(event.EVT_UPDATE_NOTIFY, self.OnUpdateNotify)
        self.Bind(event.EVT_MYALERT, self.OnMyAlert)
        wx.CallLater(100, self.notify)

        self.initcate()

        # start server
        th = threading.Thread(target=task.start_server, args=(self, ))
        th.start()
        # start check update
        task.taskq.put({'id': 1, 'type': 'update', 'frame': self})
コード例 #15
0
ファイル: SchermResultaat.py プロジェクト: 27343sven/Scrabble
 def __init__(self, parent, id, title):
     wx.Frame.__init__(self, parent, id, title, size=(600, 400),
                       style=wx.DEFAULT_FRAME_STYLE ^ wx.RESIZE_BORDER ^ wx.MAXIMIZE_BOX ^ wx.MINIMIZE_BOX)
     boxje = wx.BoxSizer()
     boxje.Add(Schermpje(self, id), 1, wx.EXPAND | wx.ALL, 1)
     icon = wx.EmptyIcon()
     icon.CopyFromBitmap(wx.Bitmap("../Media/scrabble.ico", wx.BITMAP_TYPE_ANY))
     self.SetIcon(icon)
     self.SetSizer(boxje)
     self.Centre()
     self.Show(True)
コード例 #16
0
ファイル: TriathlonBreeder.py プロジェクト: dror-g/nnfbc5
 def __init__(self, redirect=False):
     wx.App.__init__(self)
     ib = wx.IconBundle()
     bmp = self.make_grad_image(32, 32, (0, 0, 0), (0, 0, 0))
     icon = wx.EmptyIcon()
     icon.CopyFromBitmap(bmp)
     ib.AddIcon(icon)
     self.mainWindow = GUIMain()
     self.setIcon(0, 0, 0, 0, 0, 0)
     self.mainWindow.Center()
     self.mainWindow.Show(True)
コード例 #17
0
 def __set_properties(self):
     # begin wxGlade: AddDisplayUI.__set_properties
     self.SetTitle(_("Add Display"))
     _icon = wx.EmptyIcon()
     _icon.CopyFromBitmap(wx.Bitmap("xibo.ico", wx.BITMAP_TYPE_ANY))
     self.SetIcon(_icon)
     self.txtClientName.SetToolTipString(
         _("The name of the client to add as it will appear on the server"))
     self.btnCreateDisplay.Enable(False)
     self.btnGenerateKey.SetToolTipString(
         _("Generate a random client license key"))
コード例 #18
0
ファイル: readHardwareGUI.py プロジェクト: avyou/myscript
 def __init__(self, parent, id, title,size, pos=wx.DefaultPosition,
         style=wx.DEFAULT_FRAME_STYLE |wx.SUNKEN_BORDER |wx.CLIP_CHILDREN):
     wx.Frame.__init__(self, parent,id, title,size=size,pos=pos,style=style)
     self.encrypt_define_str = b64encode(str_key)
     logo_icon = wx.EmptyIcon()
     img = wx.Bitmap("D:\\PyInstaller-3.0\\favicon.ico",wx.BITMAP_TYPE_ANY)
     logo_icon.CopyFromBitmap(img)
     self.SetIcon(logo_icon)
     self.InitUI()
     self.MenuBarUI()
     self.StatusBarUI()
コード例 #19
0
ファイル: dialogs.py プロジェクト: Hellysonrp/phatch
 def _icon(self, name='information'):
     name = 'ART_%s' % name.upper()
     #title icon
     bitmap = graphics.bitmap(name, (16, 16))
     _ic = wx.EmptyIcon()
     _ic.CopyFromBitmap(bitmap)
     self.SetIcon(_ic)
     #dialog icon
     bitmap = graphics.bitmap(name, self._icon_size)
     self.icon.SetBitmap(bitmap)
     self.icon.Show(True)
コード例 #20
0
 def __init__(self, letters=('d', 'e', 'f', 'a', 'u', 'l', 't')):
     wx.Dialog.__init__(self, None, -1, title="Scrabble!", size=(400, 300))
     self.weggooiLetters = []
     self.buttonList, self.board = self.make_board(letters)
     self.SetSizer(self.board)
     for x in self.buttonList:
         x.Bind(wx.EVT_TOGGLEBUTTON, self.onButton)
     self.backButton.Bind(wx.EVT_BUTTON, self.onBackButton)
     icon = wx.EmptyIcon()
     icon.CopyFromBitmap(wx.Bitmap("scrabble.ico", wx.BITMAP_TYPE_ANY))
     self.SetIcon(icon)
コード例 #21
0
    def __init__(self, parent):
        self._init_ctrls(parent)

        icon = wx.EmptyIcon()
        icon.CopyFromBitmap(Preferences.IS.load('Images/ModuleFinder.png'))
        self.SetIcon(icon)

        # adjust sizes for different platforms
        resetMinSize(self)
        self.SetMinSize(wx.Size(309, 106))
        self.SetSizerAndFit(self.mainSizer)
コード例 #22
0
 def __set_properties(self):
     # begin wxGlade: gui_channel.__set_properties
     self.SetTitle("Omni - Join Channel")
     _icon = wx.EmptyIcon()
     _icon.CopyFromBitmap(
         wx.Bitmap("resource/spring-redlogo.png", wx.BITMAP_TYPE_ANY))
     self.SetIcon(_icon)
     self.SetSize((429, 265))
     self.list_channel_channels.SetToolTipString(
         "Double-click a channel to join it")
     self.button_channel_join.SetDefault()
コード例 #23
0
    def __init__(self, parent, IDmodele=None):
        wx.Dialog.__init__(self,
                           parent,
                           -1,
                           style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER
                           | wx.MAXIMIZE_BOX | wx.MINIMIZE_BOX)
        self.parent = parent
        self.IDmodele = IDmodele

        dlgAttente = wx.BusyInfo(_(u"Veuillez patienter..."), self.parent)

        self.ctrl_image = CTRL(self, IDmodele=IDmodele)
        self.ctrl_image.SetMinSize((700, 600))

        self.bouton_aide = CTRL_Bouton_image.CTRL(
            self, texte=_(u"Aide"), cheminImage="Images/32x32/Aide.png")
        self.bouton_fermer = CTRL_Bouton_image.CTRL(
            self, texte=_(u"Fermer"), cheminImage="Images/32x32/Fermer.png")

        # Binds
        self.Bind(wx.EVT_CLOSE, self.OnBoutonAnnuler)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonAnnuler, self.bouton_fermer)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonAide, self.bouton_aide)

        # Logo
        _icon = wx.EmptyIcon()
        _icon.CopyFromBitmap(
            wx.Bitmap(
                Chemins.GetStaticPath("Images/16x16/Image_interactive.png"),
                wx.BITMAP_TYPE_ANY))
        self.SetIcon(_icon)
        self.SetTitle(u"Visualiseur d'images interactives")

        sizer_base = wx.BoxSizer(wx.VERTICAL)
        sizer_base.Add(self.ctrl_image, 1, wx.EXPAND, 0)

        # Layout
        grid_sizer_boutons = wx.FlexGridSizer(rows=1, cols=3, vgap=10, hgap=10)
        grid_sizer_boutons.Add(self.bouton_aide, 0, 0, 0)
        grid_sizer_boutons.Add((20, 20), 0, wx.EXPAND, 0)
        grid_sizer_boutons.Add(self.bouton_fermer, 0, 0, 0)
        grid_sizer_boutons.AddGrowableCol(1)
        sizer_base.Add(grid_sizer_boutons, 0, wx.ALL | wx.EXPAND, 10)

        self.SetSizer(sizer_base)
        sizer_base.Fit(self)
        self.Layout()
        self.SetMinSize(self.GetSize())
        UTILS_Dialogs.AjusteSizePerso(self, __file__)
        self.CenterOnScreen()

        # Init
        self.ctrl_image.MAJ()
        del dlgAttente
コード例 #24
0
ファイル: TindeRobot.py プロジェクト: diexel64/TinderBot
 def __init__(self, parent, title): 
     super(Global, self).__init__(parent, title=title, size=(900, 500))
     self.InitUI()
     self.Centre()
     self.SetTitle("Tinder Robot")
     try:
         icon = wx.EmptyIcon()
         icon.CopyFromBitmap(wx.Bitmap("img\\logo.ico", wx.BITMAP_TYPE_ANY))
         self.SetIcon(icon)
     except Exception as e:
         print("The favicon was not found, please save the favicon in the img directory as icon.png")
コード例 #25
0
 def __set_properties(self):
     # begin wxGlade: LogFrame.__set_properties
     self.SetTitle(Messages.LOG_DIALOG_TITLE)
     _icon = wx.EmptyIcon()
     pathname = os.path.join(IMAGE_PATH, "other/FileRock.ico")
     _icon.CopyFromBitmap(wx.Bitmap(pathname, wx.BITMAP_TYPE_ICO))
     self.SetIcon(_icon)
     self.SetSize((750, 550))
     # end wxGlade
     _icon = wx.Icon(pathname, wx.BITMAP_TYPE_ICO)
     self.SetIcon(_icon)
コード例 #26
0
 def __init__(self, redirect=False):
     wx.App.__init__(self)
     ib = wx.IconBundle()
     bmp = self.make_grad_image(32, 32, (0, 0, 0), (0, 0, 0))
     icon = wx.EmptyIcon()
     icon.CopyFromBitmap(bmp)
     ib.AddIcon(icon)
     self.mainWindow = GUIMain()
     self.mainWindow.SetIcons(ib)
     self.mainWindow.Center()
     self.mainWindow.Show(True)
     self.mainWindow.timer.Start(int(1000.0 / profile.niaFPS))
コード例 #27
0
    def __init__(self, parent, id, title):
        wx.Frame.__init__(self,
                          parent,
                          id,
                          title,
                          size=(500, 700),
                          style=wx.DEFAULT_FRAME_STYLE)
        p = wx.Panel(self, wx.ID_ANY)
        layout = wx.BoxSizer(wx.VERTICAL)

        label = wx.StaticText(p,
                              wx.ID_ANY,
                              'ここにファイルをドロップしてください',
                              style=wx.SIMPLE_BORDER | wx.TE_CENTER)
        label.SetBackgroundColour("#e0ffff")
        label.SetDropTarget(FileDropTarget(self))
        layout.Add(label, flag=wx.EXPAND | wx.ALL, border=10, proportion=1)

        self.button1 = wx.Button(p, wx.ID_ANY, 'ダウンロードフォルダをチェック')
        self.button1.Bind(wx.EVT_BUTTON, self.btn1push)
        layout.Add(self.button1, flag=wx.EXPAND | wx.ALL, border=15)
        self.button2 = wx.Button(p, wx.ID_ANY, 'ダウンロードフォルダをチェック(再帰)')
        self.button2.Bind(wx.EVT_BUTTON, self.btn2push)
        layout.Add(self.button2, flag=wx.EXPAND | wx.ALL, border=10)
        self.button3 = wx.Button(p, wx.ID_ANY, 'convert')
        self.button3.Bind(wx.EVT_BUTTON, self.btn3push)
        layout.Add(self.button3, flag=wx.EXPAND | wx.ALL, border=10)
        self.button4 = wx.Button(p, wx.ID_ANY, 'DLフォルダの変換済フォルダへすべて移動')
        self.button4.Bind(wx.EVT_BUTTON, self.btn4push)
        layout.Add(self.button4, flag=wx.EXPAND | wx.ALL, border=10)

        self.text_entry = wx.TextCtrl(p,
                                      wx.ID_ANY,
                                      size=(400, 200),
                                      style=wx.TE_MULTILINE)
        layout.Add(self.text_entry, flag=wx.EXPAND | wx.ALL, border=10)
        self.text2 = wx.TextCtrl(p,
                                 wx.ID_ANY,
                                 size=(400, 100),
                                 style=wx.TE_MULTILINE)
        layout.Add(self.text2, flag=wx.EXPAND | wx.ALL, border=10)

        p.SetSizer(layout)
        try:
            icon = wx.EmptyIcon()
            icon_source = wx.Image('ignore/icon.jpg', wx.BITMAP_TYPE_JPEG)
            icon.CopyFromBitmap(icon_source.ConvertToBitmap())
            self.SetIcon(icon)
        except:
            pass
        #self.taskbar = wx.adv.TaskBarIcon()
        #self.taskbar.SetIcon(icon, '')
        self.Show()
コード例 #28
0
 def __set_properties(self):
     # begin wxGlade: WareboxDialog.__set_properties
     self.SetTitle(Messages.WAREBOX_DIALOG_TITLE)
     _icon = wx.EmptyIcon()
     pathname = os.path.join(IMAGE_PATH, "other/FileRock.ico")
     _icon.CopyFromBitmap(wx.Bitmap(pathname, wx.BITMAP_TYPE_ANY))
     self.SetIcon(_icon)
     # end wxGlade
     _icon = wx.Icon(pathname, wx.BITMAP_TYPE_ICO)
     self.SetIcon(_icon)
     self.SetMinSize((400, -1))
     self.SetMaxSize((600, -1))
コード例 #29
0
ファイル: Triathlon.py プロジェクト: dror-g/nnfbc5
 def __init__(self, redirect=False):
     wx.App.__init__(self)
     ib = wx.IconBundle()
     bmp = wx.Image('icons' + os.sep + 'triathlon.png',
                    wx.BITMAP_TYPE_ANY).ConvertToBitmap()
     icon = wx.EmptyIcon()
     icon.CopyFromBitmap(bmp)
     ib.AddIcon(icon)
     self.mainWindow = StarterMain()
     self.mainWindow.SetIcons(ib)
     self.mainWindow.Center()
     self.mainWindow.Show(True)
コード例 #30
0
    def __init__(self, parent, title):
        """
			Constructor.
		"""
        wx.Frame.__init__(self,
                          parent,
                          wx.NewIdRef(),
                          title,
                          style=wx.DEFAULT_FRAME_STYLE | wx.CLIP_CHILDREN)

        _icon = wx.EmptyIcon() if wx.VERSION_STRING < '4.0' else wx.Icon()
        _icon.CopyFromBitmap(
            wx.Bitmap(os.path.join(ICON_PATH_16_16, "preferences.png"),
                      wx.BITMAP_TYPE_ANY))
        self.SetIcon(_icon)

        self.SetMinSize((400, 500))

        ### Panel
        panel = wx.Panel(self, wx.NewIdRef())
        self.pref = Preferences(panel)

        ### Buttons
        self.cancel = wx.Button(panel, wx.ID_CANCEL)
        self.apply = wx.Button(panel, wx.ID_OK)
        if wx.VERSION_STRING >= '4.0':
            self.apply.SetToolTipString = self.apply.SetToolTip
            self.cancel.SetToolTipString = self.cancel.SetToolTip

        self.apply.SetToolTipString(_("Apply all changing"))
        self.cancel.SetToolTipString(_("Cancel without changing"))
        self.apply.SetDefault()

        ### Sizers
        vsizer = wx.BoxSizer(wx.VERTICAL)
        hsizer = wx.BoxSizer(wx.HORIZONTAL)

        hsizer.Add(self.cancel, 0)
        hsizer.Add(self.apply, 0)
        vsizer.Add(self.pref, 1, wx.ALL | wx.EXPAND, 5)
        vsizer.Add(hsizer, 0,
                   wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL | wx.ALL, 5)

        panel.SetSizer(vsizer)
        vsizer.Fit(panel)

        ### Binding
        self.Bind(wx.EVT_BUTTON, self.OnApply, id=wx.ID_OK)
        self.Bind(wx.EVT_BUTTON, self.OnCancel, id=wx.ID_CANCEL)
        self.Bind(wx.EVT_BUTTON, self.OnClose, id=wx.ID_CLOSE)

        self.Layout()
        self.Center()