Esempio n. 1
0
    def on_image_choose(self, event):
        '''Choose an image from the image set'''
        dlg = wx.Dialog(self)
        dlg.Title = "Choose an image set"
        sizer = wx.BoxSizer(wx.VERTICAL)
        dlg.SetSizer(sizer)
        choose_sizer = wx.BoxSizer(wx.HORIZONTAL)
        sizer.Add(choose_sizer, 1, wx.EXPAND | wx.ALL, 5)
        choose_sizer.Add(wx.StaticText(dlg, -1, label="Image set:"), 0,
                         wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL)
        metadata_db = {}
        metadata_features = [
            x for x in self.measurements.get_feature_names(cpmeas.IMAGE)
            if x.startswith('Metadata')
        ]
        sel = None
        for i in self.measurements.get_image_numbers():
            metadata_key = ','.join([
                '%s=%s' %
                (feature,
                 self.measurements.get_measurement(cpmeas.IMAGE, feature, i))
                for feature in metadata_features
            ])
            metadata_db[i] = metadata_key
            if i == self.measurements.image_set_number:
                sel = i
        choices = [
            "%d: %s" % (i, metadata_db[i])
            for i in self.measurements.get_image_numbers()
        ]
        choice_ctl = wx.Choice(dlg, -1, choices=choices)
        # Select the current image set
        if sel is not None:
            choice_ctl.SetSelection(sel)
        choose_sizer.Add(choice_ctl, 1, wx.EXPAND | wx.LEFT, 5)
        button_sizer = wx.StdDialogButtonSizer()
        ok_button = wx.Button(dlg, wx.ID_OK)
        ok_button.SetDefault()
        ok_button.SetHelpText(
            "Press the OK button to change the current image to the one selected above"
        )
        button_sizer.AddButton(ok_button)

        cancel_button = wx.Button(dlg, wx.ID_CANCEL)
        cancel_button.SetHelpText(
            "Press the cancel button if you do not want to change the current image"
        )
        button_sizer.AddButton(cancel_button)
        button_sizer.Realize()
        sizer.Add(button_sizer, 0,
                  wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT | wx.ALL, 5)
        dlg.Fit()
        if dlg.ShowModal() == wx.ID_OK:
            index = choice_ctl.GetSelection()
            self.measurements.image_set_number = index + 1
Esempio n. 2
0
    def auth_handler(realm):
        """
        As for username,password
        """
        import wx
        import sys
        print >> sys.stderr, "Using GUI poa browser"

        pw = wx.Dialog(root_window, -1, "Authenticate")

        vert = wx.BoxSizer(wx.VERTICAL)
        label_1 = wx.StaticText(pw, -1,
                                "Authentication for %s reqired" % realm)
        vert.Add(label_1, 0, wx.EXPAND | wx.LEFT, 10)

        horiz = wx.BoxSizer(wx.HORIZONTAL)
        vert.Add(horiz, 0, 0, 0)
        label_2 = wx.StaticText(pw, -1, "Username")
        label_2.SetMinSize((70, 15))
        horiz.Add(label_2, 0, wx.LEFT, 0)
        pw.username = wx.TextCtrl(pw, -1, "")
        horiz.Add(pw.username, 0, wx.LEFT, 0)

        horiz = wx.BoxSizer(wx.HORIZONTAL)
        vert.Add(horiz, 0, 0, 0)
        pw.pwd = wx.TextCtrl(pw, -1, "", style=wx.TE_PASSWORD)
        label_3 = wx.StaticText(pw, -1, "Password")
        label_3.SetMinSize((70, 15))
        horiz.Add(label_3, 0, wx.LEFT, 0)
        horiz.Add(pw.pwd, 0, wx.LEFT, 0)

        horiz = wx.BoxSizer(wx.HORIZONTAL)
        vert.Add(horiz, 0, wx.LEFT, 0)

        horiz.Add(wx.Button(pw, wx.ID_CANCEL), 0, 0, 0)
        ok = wx.Button(pw, wx.ID_OK)
        ok.SetDefault()
        horiz.Add(ok, 0, 0, 0)

        pw.username.SetFocus()
        order = (pw.username, pw.pwd, ok)
        for i in xrange(len(order) - 1):
            order[i + 1].MoveAfterInTabOrder(order[i])

        pw.SetSizer(vert)
        vert.Fit(pw)
        pw.Layout()

        try:
            if pw.ShowModal() == wx.ID_OK:
                return (pw.username.GetValue(), pw.pwd.GetValue())
        finally:
            pw.Destroy()

        raise Exception("User aborted")
Esempio n. 3
0
def test_dialog_contextmanager():
    return
    n = len(wx.GetTopLevelWindows())
    with wx.Dialog(None, -1, 'test') as diag:
        diag.Bind(wx.EVT_SHOW, lambda e: wx.CallAfter(diag.Close)
                  if e.GetShow() else None)
        diag.ShowModal()

    wx.GetApp().ProcessIdle()
    assert n == len(wx.GetTopLevelWindows()), repr(
        (n, len(wx.GetTopLevelWindows())))
Esempio n. 4
0
    def pop_dialog(self, name, string):
        """Shows a new text dialog with name equal to name and text equal to string.

        :param name: Name of dialog.
        :param string: Text to display.
        :return: None
        """
        dialog = wx.Dialog(self, wx.NewId(), name)
        textSizer = dialog.CreateTextSizer(string)
        dialog.SetSizer(textSizer)
        dialog.Show(True)
Esempio n. 5
0
 def othersp(self, event):
     dg = wx.Dialog(self)
     txt2 = [
         u"کد پرسنل", u"<کد>", u"<نام>", u"<نام خانوادگی>",
         u"مشخصات استخدامي/کاري"
     ]
     pnlgr = MyPanel4(dg, txt2)
     dg.SetSize((307, 300))
     dg.ShowModal()
     self.Refresh()
     self.Layout()
Esempio n. 6
0
    def OnEditionAdherent(self, event):
        adherent = self.liste_adherents.GetSelectedObject()

        dialog_adherent = wx.Dialog(self, title=adherent.nom_prenom)
        FicheAdherent(dialog_adherent, adherent)
        dialog_adherent.Fit()
        dialog_adherent.ShowModal()
        dialog_adherent.Destroy()

        self.liste_adherents.RefreshObject(self.liste_adherents.GetSelectedObject())
        self.liste_adherents.AutoSizeColumns()
Esempio n. 7
0
 def SetLanguage(self, event):
     dlg = wx.Dialog(self, -1, '', size=(230, 300))
     l_dir = os.path.join(SYSLOC, 'locale')
     langs_arr = []
     for f in os.listdir(l_dir):
         if os.path.isdir(os.path.join(l_dir, f)):
             try:
                 yy= wx.Locale.FindLanguageInfo(f)
                 langs_arr.append(yy.Language)
             except Exception, expt:
                 pass
 def OnDisplaySetting(self, event):
     dissetting = wx.Dialog(self.parent, -1, '数据仓库-Json格式化显示设置',
                            size=(400, 300), pos=(250, 50))
     wx.Button(dissetting, wx.ID_OK, '确定', pos=(50, 150))
     wx.Button(dissetting, wx.ID_CANCEL, '取消', pos=(250, 150))
     indentList = ["0", "1", "2", "3", "4", "5", ]
     wx.StaticText(dissetting, -1, "缩进空格数:", (20, 20))
     choice = wx.Choice(dissetting, -1, (100, 18), choices=indentList)
     choice.SetSelection(self.indent)
     if wx.ID_OK == dissetting.ShowModal():
         self.indent = choice.GetSelection()
Esempio n. 9
0
def ensureWxApp():
    # make sure there's a wxApp prior to showing a gui, e.g., for expInfo
    # dialog
    try:
        wx.Dialog(None, -1)  # not shown; FileDialog gives same exception
        return True
    except wx._core.PyNoAppError:
        if wx.version() < '2.9':
            return wx.PySimpleApp()
        else:
            return wx.App(False)
Esempio n. 10
0
    def __init__(self, parent, **kwds):
        """The controller for persons"""

        self.view = wx.Dialog(parent, wx.ID_ANY,
              style=wx.DEFAULT_DIALOG_STYLE,
              title="Maintain person information")
        self.view.SetName("dPersons")
        super(Persons, self).__init__(view=self.view, model="Person", **kwds)

        scats = ["Person", ]
        self.initDlgListBase(scats)
Esempio n. 11
0
 def on_topology_faces(self, event):
     r"""Display another viewer with faces topology"""
     dialog = wx.Dialog(self, title="Topology - Faces")
     panel = Wx3dViewer(dialog,
                        viewer_background_color=self.background_color,
                        show_topology_menu=False)
     for shape in self._shapes:
         aocutils.display.topology.faces(panel.viewer_display,
                                         shape,
                                         transparency=0.5)
     dialog.ShowModal()
Esempio n. 12
0
    def Initialize(self, parent, ttl):
        """タイトルを指定して、ウィンドウを初期化し、親の中央に配置するように設定。"""
        self.wnd = wx.Dialog(parent,
                             -1,
                             ttl,
                             style=wx.DEFAULT_DIALOG_STYLE | wx.BORDER_DEFAULT)
        _winxptheme.SetWindowTheme(self.wnd.GetHandle(), "", "")

        self.panel = wx.Panel(self.wnd, wx.ID_ANY)
        self.sizer = wx.BoxSizer(wx.VERTICAL)
        self.panel.SetSizer(self.sizer)
Esempio n. 13
0
 def finger(self, event):
     dg = wx.Dialog(self)
     txt1 = [
         u"کد پرسنل", u"<کد>", u"<نام>", u"<نام خانوادگی>",
         u"مشخصات فردی/پرسنلی "
     ]
     pnlgr = MyPanel4(dg, txt1)
     dg.SetSize((307, 300))
     dg.ShowModal()
     self.Refresh()
     self.Layout()
Esempio n. 14
0
 def StoriaCIC(*args):
     scc = wx.Dialog(parent,
                     title="Utilizzo credito iva compensabile",
                     size=(750, 300),
                     style=wx.DEFAULT_DIALOG_STYLE)
     GridUtiCIC(scc, liq._liqeff)
     scc.Fit()
     scc.Layout()
     scc.CenterOnScreen()
     scc.Show()
     scc.SetFocus()
Esempio n. 15
0
 def main():
     app = wx.App()
     translation_manager = PyMCTranslate.new_translation_manager()
     dialog = wx.Dialog(None,
                        style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER)
     sizer = wx.BoxSizer()
     dialog.SetSizer(sizer)
     sizer.Add(MultiBlockDefine(dialog, translation_manager), 1, wx.EXPAND)
     dialog.Show()
     dialog.Fit()
     app.MainLoop()
Esempio n. 16
0
    def showEditWindow(self, entry):
        #create dialog
        self.editingEntry = entry
        self.editDialog = wx.Dialog(self,
                                    id=wx.ID_ANY,
                                    title="Edit Entry",
                                    pos=wx.DefaultPosition,
                                    size=wx.Size(-1, -1),
                                    style=wx.DEFAULT_DIALOG_STYLE)

        #create widgets
        self.txtEntry = wx.TextCtrl(self.editDialog, wx.ID_ANY, wx.EmptyString,
                                    wx.DefaultPosition, wx.DefaultSize,
                                    wx.TE_MULTILINE)
        self.txtEntry.SetMinSize(wx.Size(400, 200))
        self.txtTags = wx.TextCtrl(self.editDialog, wx.ID_ANY, wx.EmptyString,
                                   wx.DefaultPosition, wx.DefaultSize, 0)
        self.chkStarred = wx.CheckBox(self.editDialog, wx.ID_ANY, u"Starred",
                                      wx.DefaultPosition, wx.DefaultSize, 0)
        self.m_sdbSizer1OK = wx.Button(self.editDialog, wx.ID_OK)
        self.m_sdbSizer1Cancel = wx.Button(self.editDialog, wx.ID_CANCEL)

        #create sizers
        bSizer1 = wx.BoxSizer(wx.VERTICAL)
        bSizer2 = wx.BoxSizer(wx.HORIZONTAL)
        m_sdbSizer1 = wx.StdDialogButtonSizer()

        #add widgets
        m_sdbSizer1.AddButton(self.m_sdbSizer1OK)
        m_sdbSizer1.AddButton(self.m_sdbSizer1Cancel)
        m_sdbSizer1.Realize()
        bSizer1.Add(self.txtEntry, 0, wx.ALL, 5)
        bSizer2.Add(self.txtTags, 1, wx.ALL | wx.EXPAND, 5)
        bSizer2.Add(self.chkStarred, 0, wx.ALL, 5)
        bSizer1.Add(bSizer2, 1, wx.EXPAND, 5)
        bSizer1.Add(m_sdbSizer1, 1, wx.EXPAND, 5)

        #setlayout
        self.editDialog.SetSizer(bSizer1)
        self.editDialog.Layout()
        bSizer1.Fit(self.editDialog)

        #setValues
        if entry.getEntryText(): self.txtEntry.SetValue(entry.getEntryText())
        if entry.getEntryTags():
            self.txtTags.SetValue(','.join(entry.getEntryTags()))
        if entry.getEntryStarred(): self.chkStarred.SetValue(True)

        #bind events
        self.m_sdbSizer1OK.Bind(wx.EVT_BUTTON, self.onEditSave)
        self.m_sdbSizer1Cancel.Bind(wx.EVT_BUTTON, self.onEditCancel)

        self.editDialog.ShowModal()
Esempio n. 17
0
    def OnEditionTypeCotisation(self, event):
        cotisation_type = self.liste_cotisation_types.GetSelectedObject()

        dialog_cotisation_type = wx.Dialog(self, title=cotisation_type.nom)
        FicheCotisationType(dialog_cotisation_type, cotisation_type)
        dialog_cotisation_type.Fit()
        dialog_cotisation_type.ShowModal()
        dialog_cotisation_type.Destroy()

        if dialog_cotisation_type.GetReturnCode() == wx.ID_OK:
            self.liste_cotisation_types.RefreshObject(self.liste_cotisation_types.GetSelectedObject())
            self.liste_cotisation_types.AutoSizeColumns()
Esempio n. 18
0
    def OnMenuDownLoad(self, event):
        self.dialog_download = wx.Dialog(None,
                                         -1,
                                         title="Down  Load",
                                         pos=(150, 150),
                                         size=(500, 350))
        self.dialog_download.SetTransparent(200)  #透明度
        self.text_download = wx.ListCtrl(self.dialog_download,
                                         -1,
                                         pos=(10, 10),
                                         size=(460, 140),
                                         style=wx.LC_REPORT)
        self.text_download.InsertColumn(0, "Name", 200)
        self.text_download.InsertColumn(1, "Number", 400)
        #self.text_download.InsertColumn(2,"comment",100)
        self.button_download_currently = wx.Button(self.dialog_download,
                                                   -1,
                                                   "Down Load Currently",
                                                   pos=(10, 150),
                                                   size=(140, 50))
        self.button_download_all = wx.Button(self.dialog_download,
                                             -1,
                                             "Down Load All",
                                             pos=(10, 210),
                                             size=(140, 50))

        self.button_download_currently.Bind(wx.EVT_BUTTON,
                                            self.Ondownloadcurrently)
        self.button_download_all.Bind(wx.EVT_BUTTON, self.Ondownloadall)

        get_text_from_combobox = self.combobox_select.GetItems(
        )  #得到下拉列表(combobox)中所有的选项值
        print(get_text_from_combobox)
        num_digital_monster = len(get_text_from_combobox)
        """转化为中文显示"""
        en = Show_Card_Name(get_text_from_combobox, num_digital_monster)
        temcardname = en.Turn_English_To_Chinese()
        temlist = list(temcardname)
        cardcount = int(temlist[1])
        cardname = temlist[0]
        temp_no_file = 'Some Name No Such File !count: '
        no_file_num = temp_no_file + str(cardcount)
        sps = [no_file_num, 'All File Have Shown! COUNT: 2/Name']
        if cardcount == 0:
            for iq in range(len(cardname)):
                index = self.text_download.InsertStringItem(11, cardname[iq])
                self.text_download.SetStringItem(index, 1, sps[1])
        else:
            for iq in range(len(cardname)):
                index = self.text_download.InsertStringItem(11, cardname[iq])
                self.text_download.SetStringItem(index, 1, sps[0])

        self.dialog_download.ShowModal()
Esempio n. 19
0
 def main():
     app = wx.App()
     translation_manager = PyMCTranslate.new_translation_manager()
     dialog = wx.Dialog(None)
     sizer = wx.BoxSizer()
     dialog.SetSizer(sizer)
     sizer.Add(
         BlockSelect(dialog, translation_manager, "java", (1, 16, 0),
                     False))
     dialog.Show()
     dialog.Fit()
     app.MainLoop()
Esempio n. 20
0
def ReplayLog(event):
    'replay the logged actions'
    LogInfo[
        'LastPaintAction'] = None  # clear the pointed to the last data window
    # is this really needed? -- probably not.
    commandList = []
    for item in G2logList:
        if item:  # skip over 1st item in list (None)
            commandList.append(str(item))
    if not commandList:
        dlg = wx.MessageDialog(LogInfo['Tree'],
                               'No actions found in log to replay',
                               'Empty Log', wx.OK)
        dlg.CenterOnParent()
        dlg.ShowModal()
        dlg.Destroy()
        return
    dlg = wx.Dialog(LogInfo['Tree'],
                    wx.ID_ANY,
                    'Replay actions from log',
                    style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER
                    | wx.CENTRE)
    mainSizer = wx.BoxSizer(wx.VERTICAL)
    mainSizer.Add((5, 5))
    clb = wx.ListBox(dlg,
                     wx.ID_ANY, (30, 100),
                     wx.DefaultSize,
                     commandList,
                     style=wx.LB_EXTENDED)
    LogInfo['clb'] = clb
    mainSizer.Add(clb, 1, wx.EXPAND, 1)
    mainSizer.Add((5, 5))
    btn = wx.Button(dlg, wx.ID_ANY, 'Replay selected')
    btn.Bind(wx.EVT_BUTTON, OnReplayPress)
    mainSizer.Add(btn, 0, wx.ALIGN_CENTER, 0)
    btnsizer = wx.StdDialogButtonSizer()
    OKbtn = wx.Button(dlg, wx.ID_OK, 'Close')
    #OKbtn = wx.Button(dlg, wx.ID_CLOSE)
    OKbtn.SetDefault()
    OKbtn.Bind(wx.EVT_BUTTON, lambda event: dlg.EndModal(wx.ID_OK))
    btnsizer.AddButton(OKbtn)
    btnsizer.Realize()
    mainSizer.Add((-1, 5), 1, wx.EXPAND, 1)
    mainSizer.Add(btnsizer, 0, wx.ALIGN_CENTER, 0)
    mainSizer.Add((-1, 5))
    dlg.SetSizer(mainSizer)
    dlg.CenterOnParent()
    clb.SetSelection(0)
    dlg.ShowModal()
    dlg.Destroy()
    LogInfo['Tree'].G2frame.OnMacroRecordStatus(
        None)  # sync the menu checkmark(s)
    return
Esempio n. 21
0
	def StupidMacOSWorkaround(self):
		"""
		On MacOS for some magical reason opening new frames does not work until you opened a new modal dialog and closed it.
		If we do this from software, then, as if by magic, the bug which prevents opening extra frames is gone.
		"""
		dlg = wx.Dialog(None)
		wx.PostEvent(dlg, wx.CommandEvent(wx.EVT_CLOSE.typeId))
		dlg.ShowModal()
		dlg.Destroy()

		if self.new_version_dialog is not None:
			self.new_version_dialog.Show()
Esempio n. 22
0
    def OnEditionProduit(self, event):
        produit = self.liste_produits.GetSelectedObject()

        dialog_produit = wx.Dialog(self, title=u"Produit : " + produit.nom)
        FicheProduit(dialog_produit, produit)
        dialog_produit.Fit()
        dialog_produit.ShowModal()
        dialog_produit.Destroy()

        if dialog_produit.GetReturnCode() == wx.ID_OK:
            self.liste_produits.RefreshObject(self.liste_produits.GetSelectedObject())
            self.liste_produits.AutoSizeColumns()
Esempio n. 23
0
    def find(self,event):

        import sys
        self.findDialog = wx.Dialog(parent=None,id=wx.ID_ANY,pos=(10,30),size=(430,700),title='Localizar Paciente')
        self.findDialog.Centre(wx.BOTH)

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

        self.hUserBox1 = wx.BoxSizer(wx.HORIZONTAL)
        self.listUser = wx.ListCtrl(self.findDialog,-1,size=(430,280),style=wx.LC_REPORT)
        self.listUser.InsertColumn(0, u'Nome', width=150)
        self.listUser.InsertColumn(1, u'Login', width=200)
        self.listUser.InsertColumn(2, u'Administrador', width=75)
        self.listUser.InsertColumn(3,'',width=0)

        self.hUserBox1.Add(self.listUser, 1,wx.EXPAND)
        self.vUserBox1.Add(self.hUserBox1,0,wx.ALL | wx.EXPAND, 5)
        self.vUserBox1.Add((-1,10))

        users = User.query.order_by('name').all()

        for user in users:
            index = self.listUser.InsertStringItem(sys.maxint, user.name)
            self.listUser.SetStringItem(index, 1, user.login)
            if user.level == 0:
                self.listUser.SetStringItem(index, 2, u"Sim")
            else:
                self.listUser.SetStringItem(index, 2, u"Não")
            self.listUser.SetStringItem(index, 3, str(user.id))

        self.listUser.Bind(wx.EVT_LIST_ITEM_ACTIVATED,self.getSelectedItem,id=-1)

        self.hUserBox2 = wx.BoxSizer(wx.HORIZONTAL)
        findOptions = ["Nome"]
        self.findRadioBox = wx.RadioBox(self.findDialog, -1, u"Localizar por:", (10, 300), wx.DefaultSize,findOptions,2, wx.RA_SPECIFY_COLS)
        self.hUserBox2.Add(self.findRadioBox,0,wx.RIGHT,8)
        self.vUserBox1.Add(self.hUserBox2,0,wx.ALL | wx.EXPAND,5)

        self.hUserBox3 = wx.BoxSizer(wx.HORIZONTAL)
        self.findTextCtrl = wx.TextCtrl(self.findDialog,-1,pos=(-1,-1),size=(140,-1))

        self.searchBtn = wx.BitmapButton(self.findDialog,ID_FIND_SEARCH,wx.Bitmap('./imagens/search.png'))

        self.hUserBox3.Add(self.findTextCtrl,1, wx.LEFT,0)
        self.hUserBox3.Add(self.searchBtn,0,5)
        self.vUserBox1.Add(self.hUserBox3,0,wx.ALL | wx.EXPAND, 5)

        self.findDialog.Bind(wx.EVT_BUTTON,self.search,self.searchBtn)
        self.findDialog.SetSizerAndFit(self.vUserBox1)

        self.findDialog.ShowModal()
        self.findDialog.SetFocus()
        self.findDialog.Destroy()
Esempio n. 24
0
    def run_contract(self, event):
        if (Property.node_started == True):
            trx_drg = wx.Dialog(None, title='Run Contract')
            trx_drg.SetSize((500, 450))
            trx_drg.SetTitle('Sending Transaction')

            pnl = wx.Panel(trx_drg)
            vbox = wx.BoxSizer(wx.VERTICAL)

            wx.StaticText(pnl, 1, 'Receiver IP', (5, 5), style=wx.LEFT)
            receiver_text = wx.TextCtrl(pnl, pos=(5, 25))
            wx.StaticText(pnl, 2, 'Amount', (5, 60), style=wx.LEFT)
            amount_text = wx.TextCtrl(pnl, pos=(5, 80))
            wx.StaticText(pnl, 3, 'Message', (5, 120), style=wx.LEFT)
            message_text = wx.TextCtrl(pnl, pos=(5, 140), size=(200, 25))
            wx.StaticText(pnl, 4, 'Contract Address', (5, 180), style=wx.LEFT)
            address_text = wx.TextCtrl(pnl, pos=(5, 200), size=(200, 25))
            wx.StaticText(pnl, 5, 'Function Name', (5, 240), style=wx.LEFT)
            function_text = wx.TextCtrl(pnl, pos=(5, 260), size=(200, 25))
            wx.StaticText(pnl,
                          6, 'Arguments (split by '
                          ', ex : 1 b)', (5, 300),
                          style=wx.LEFT)
            arg_text = wx.TextCtrl(pnl, pos=(5, 320), size=(200, 25))

            hbox2 = wx.BoxSizer(wx.HORIZONTAL)
            okButton = wx.Button(trx_drg, wx.ID_OK)
            hbox2.Add(okButton)

            vbox.Add(pnl, proportion=1, flag=wx.ALL | wx.EXPAND, border=5)
            vbox.Add(hbox2,
                     flag=wx.ALIGN_CENTER | wx.TOP | wx.BOTTOM,
                     border=10)

            trx_drg.SetSizer(vbox)

            if trx_drg.ShowModal() == wx.ID_OK:
                from SeChainController import FunctionAPIs
                contract_data = {
                    'contractAddr': address_text.GetValue(),
                    'function': function_text.GetValue(),
                    'args': arg_text.GetValue()
                }
                trx_json = FunctionAPIs.run_contract(
                    Property.myNode['public_key'],
                    Property.myNode['private_key'], 'RT',
                    receiver_text.GetValue(), amount_text.GetValue(),
                    message_text.GetValue(), contract_data)

            trx_drg.Destroy()
        else:
            print("Node is not started, Start node first")
            self.write_console("Node is not started, Start node first")
Esempio n. 25
0
 def OnButton(self,event):
     self.name = str(self.login.input_2.GetValue())
     self.passwd = str(self.login.input_3.GetValue())
     if self.name == "bumen" and self.passwd == "123" and self.ID == u"检测部门":
         depart = frame_depart()
         self.Hide()
         depart.Show()
         depart.Maximize()
     else:
         self.dialogue = wx.Dialog(self,-1,"提示框",size = (200,150))
         self.errorlabel = wx.StaticText(self.dialogue,-1,"\n\n您输入的用户名或密码有误\n请输入正确的用户名与密码\n如果没有请选用访客模式",style = wx.ALIGN_CENTER)
         self.dialogue.ShowModal()
    def OnAjoutTypeAdhesion(self, event):
        dialog_adhesion_type = wx.Dialog(self,
                                         title=u"Nouveau type d'adhésion")
        fiche_adhesion_type = FicheAdhesionType(dialog_adhesion_type)
        dialog_adhesion_type.Fit()
        dialog_adhesion_type.ShowModal()
        dialog_adhesion_type.Destroy()

        if dialog_adhesion_type.GetReturnCode() == wx.ID_OK:
            self.liste_adhesion_types.AddObject(
                fiche_adhesion_type.GetTypeAdhesion())
            self.liste_adhesion_types.AutoSizeColumns()
Esempio n. 27
0
 def show_dialog(self, title, content, size):
     """
     显示错误信息提示对话框
     :param title: [string] 对话框标题
     :param content: [string] 要显示的错误信息
     :param size: [tuple] 对话框大小
     :return:
     """
     dialog = wx.Dialog(self, title=title, size=size)
     dialog.Center()
     wx.StaticText(dialog, label=content)
     dialog.ShowModal()
Esempio n. 28
0
    def Initialize(self,
                   parent,
                   ttl,
                   style=wx.CAPTION | wx.SYSTEM_MENU | wx.BORDER_DEFAULT):
        """タイトルを指定して、ウィンドウを初期化し、親の中央に配置するように設定。"""
        self.wnd = wx.Dialog(parent, -1, ttl, style=style)
        _winxptheme.SetWindowTheme(self.wnd.GetHandle(), "", "")
        self.wnd.SetEscapeId(wx.ID_NONE)
        self.wnd.Bind(wx.EVT_CLOSE, self.OnClose)

        self.panel = wx.Panel(self.wnd, wx.ID_ANY)
        self.sizer = wx.BoxSizer(wx.VERTICAL)
        self.panel.SetSizer(self.sizer)
Esempio n. 29
0
    def OnEditNodes(self,_):       
        self.pref_dlg = wx.Dialog(self, size = (800,600),
            style=wx.DEFAULT_DIALOG_STYLE|wx.THICK_FRAME)
        self.pref_panel = medipy.gui.network.dicom.PreferencesDialog(self.pref_dlg)

        sizer = wx.BoxSizer()
        sizer.Add(self.pref_panel, 1, wx.EXPAND)
        self.pref_dlg.SetSizer(sizer)
        
        self.pref_dlg.ShowModal()
        self.pref_dlg.Destroy()
        
        self._update_choice()
Esempio n. 30
0
 def on_help(self, event):
     dialog = wx.Dialog(self,-1,size=(600,600),style=wx.DEFAULT_DIALOG_STYLE)
     sizer = wx.BoxSizer(wx.VERTICAL)
     textwin = wx.TextCtrl(dialog,-1,size=(600,600),style=wx.TE_MULTILINE|
                           wx.TE_PROCESS_ENTER|
                           wx.RAISED_BORDER|wx.VSCROLL)
     if textwin.LoadFile('./README.txt',0):
         pass
     else:
         textwin.WriteText("OOPS, can't find README.txt, see source files")
     sizer.Add(textwin,-1,flag=wx.EXPAND)
     dialog.SetSizer(sizer)
     dialog.ShowModal()