Ejemplo n.º 1
0
 def __init_mainsizer_items(self, parent):
     parent.AddSizer(self.staticBoxSizer1, 0, border=20, flag=wx.ALL)
     parent.AddSpacer(wx.Size(8, 8), border=0, flag=wx.ALL)
     parent.AddSizer(self.staticBoxSizer2, 0, border=20, flag=wx.ALL)
Ejemplo n.º 2
0
    def _init_ctrls(self, prnt):
        # generated method, don't edit
        wx.Frame.__init__(
            self,
            id=wxID_FRAMEEDICAOALUNO,
            name=u'frameEdicaoAluno',
            parent=prnt,
            pos=wx.Point(700, 273),
            size=wx.Size(1040, 614),
            style=wx.DEFAULT_FRAME_STYLE,
            title=u'Est\xe1gio Curricular - Edi\xe7\xe3o Cadastral de Alunos')
        self.SetClientSize(wx.Size(1024, 576))
        self.Center(wx.BOTH)
        self.SetIcon(wx.Icon(u'./Graficos/icone.ico', wx.BITMAP_TYPE_ICO))
        self.SetMaxSize(wx.Size(1040, 614))
        self.SetMinSize(wx.Size(1040, 614))

        self.painelEdicao = wx.Panel(id=wxID_FRAMEEDICAOALUNOPAINELEDICAO,
                                     name=u'painelEdicao',
                                     parent=self,
                                     pos=wx.Point(0, 0),
                                     size=wx.Size(1024, 576),
                                     style=wx.TAB_TRAVERSAL)
        self.painelEdicao.SetBackgroundColour(wx.Colour(255, 255, 255))

        self.logoIFPE = wx.StaticBitmap(bitmap=wx.Bitmap(
            u'./Graficos/logo.png', wx.BITMAP_TYPE_PNG),
                                        id=wxID_FRAMEEDICAOALUNOLOGOIFPE,
                                        name=u'logoIFPE',
                                        parent=self.painelEdicao,
                                        pos=wx.Point(8, 8),
                                        size=wx.Size(175, 70),
                                        style=0)

        self.linhaEdicaoAlunos = wx.StaticBitmap(
            bitmap=wx.Bitmap(u'./Graficos/LinhaEdicaoAlunos.png',
                             wx.BITMAP_TYPE_PNG),
            id=wxID_FRAMEEDICAOALUNOLINHAEDICAOALUNOS,
            name=u'linhaEdicaoAlunos',
            parent=self.painelEdicao,
            pos=wx.Point(0, 80),
            size=wx.Size(1024, 25),
            style=0)

        self.dadosDosAlunos = wx.Notebook(
            id=wxID_FRAMEEDICAOALUNODADOSDOSALUNOS,
            name=u'dadosDosAlunos',
            parent=self.painelEdicao,
            pos=wx.Point(20, 120),
            size=wx.Size(984, 424),
            style=0)
        self.dadosDosAlunos.SetBackgroundColour(wx.Colour(255, 255, 255))
        self.dadosDosAlunos.SetForegroundColour(wx.Colour(255, 255, 255))
        self.dadosDosAlunos.SetThemeEnabled(True)

        self.abaPessoal = wx.Window(id=wxID_FRAMEEDICAOALUNOABAPESSOAL,
                                    name=u'abaPessoal',
                                    parent=self.dadosDosAlunos,
                                    pos=wx.Point(0, 0),
                                    size=wx.Size(976, 398),
                                    style=wx.TAB_TRAVERSAL)

        self.campoCPF = wx.lib.masked.textctrl.TextCtrl(
            id=wxID_FRAMEEDICAOALUNOCAMPOCPF,
            name=u'campoCPF',
            parent=self.abaPessoal,
            pos=wx.Point(24, 34),
            size=wx.Size(104, 21),
            style=0,
            value=u'')
        self.campoCPF.SetMask(u'XXX.XXX.XXX-XX')
        self.campoCPF.SetAutoformat('')
        self.campoCPF.SetFormatcodes('')
        self.campoCPF.SetDescription('')
        self.campoCPF.SetExcludeChars('')
        self.campoCPF.SetValidRegex('')
        self.campoCPF.SetMaxLength(14)
        self.campoCPF.SetFont(
            wx.Font(8, wx.SWISS, wx.NORMAL, wx.NORMAL, False, u'Tahoma'))
        self.campoCPF.SetDefaultEncoding(u'latin1')
        self.campoCPF.SetFillChar(u' ')

        self.nomeCPF = wx.StaticText(id=wxID_FRAMEEDICAOALUNONOMECPF,
                                     label=u'CPF:',
                                     name=u'nomeCPF',
                                     parent=self.abaPessoal,
                                     pos=wx.Point(11, 15),
                                     size=wx.Size(24, 13),
                                     style=0)

        self.cpfNaoEncontrado = wx.StaticBitmap(
            bitmap=wx.Bitmap(u'./Graficos/botao_invalido.png',
                             wx.BITMAP_TYPE_PNG),
            id=wxID_FRAMEEDICAOALUNOCPFNAOENCONTRADO,
            name=u'cpfNaoEncontrado',
            parent=self.abaPessoal,
            pos=wx.Point(170, 36),
            size=wx.Size(14, 14),
            style=0)
        self.cpfNaoEncontrado.Show(False)

        self.cpfEncontrado = wx.StaticBitmap(
            bitmap=wx.Bitmap(u'./Graficos/botao_valido.png',
                             wx.BITMAP_TYPE_PNG),
            id=wxID_FRAMEEDICAOALUNOCPFENCONTRADO,
            name=u'cpfEncontrado',
            parent=self.abaPessoal,
            pos=wx.Point(170, 36),
            size=wx.Size(14, 14),
            style=0)
        self.cpfEncontrado.Show(False)

        self.BuscarCPF = wx.BitmapButton(bitmap=wx.Bitmap(
            u'./Graficos/botao_carregar.png', wx.BITMAP_TYPE_PNG),
                                         id=wxID_FRAMEEDICAOALUNOBUSCARCPF,
                                         name=u'BuscarCPF',
                                         parent=self.abaPessoal,
                                         pos=wx.Point(134, 30),
                                         size=wx.Size(26, 26),
                                         style=wx.BU_AUTODRAW)
        self.BuscarCPF.Bind(wx.EVT_BUTTON,
                            self.OnBuscarCPFButton,
                            id=wxID_FRAMEEDICAOALUNOBUSCARCPF)

        self.dataNascimento = wx.StaticText(
            id=wxID_FRAMEEDICAOALUNODATANASCIMENTO,
            label=u'Data de nascimento:',
            name=u'dataNascimento',
            parent=self.abaPessoal,
            pos=wx.Point(196, 14),
            size=wx.Size(100, 13),
            style=0)

        self.campoAniversario = wx.lib.masked.textctrl.TextCtrl(
            id=wxID_FRAMEEDICAOALUNOCAMPOANIVERSARIO,
            name=u'campoAniversario',
            parent=self.abaPessoal,
            pos=wx.Point(209, 33),
            size=wx.Size(104, 21),
            style=0,
            value=u'')
        self.campoAniversario.SetMask(u'XX/XX/XXXX')
        self.campoAniversario.SetAutoformat('')
        self.campoAniversario.SetFormatcodes('')
        self.campoAniversario.SetDescription('')
        self.campoAniversario.SetExcludeChars('')
        self.campoAniversario.SetValidRegex('')
        self.campoAniversario.SetMaxLength(10)
        self.campoAniversario.SetFont(
            wx.Font(8, wx.SWISS, wx.NORMAL, wx.NORMAL, False, u'Tahoma'))
        self.campoAniversario.SetDatestyle('MDY')

        self.selecionaSexo = wx.RadioBox(choices=['Feminino', 'Masculino'],
                                         id=wxID_FRAMEEDICAOALUNOSELECIONASEXO,
                                         label=u'Sexo:',
                                         majorDimension=1,
                                         name=u'selecionaSexo',
                                         parent=self.abaPessoal,
                                         pos=wx.Point(338, 14),
                                         size=wx.Size(176, 41),
                                         style=wx.RA_SPECIFY_ROWS)

        self.nomeNomeAluno = wx.StaticText(
            id=wxID_FRAMEEDICAOALUNONOMENOMEALUNO,
            label=u'Nome Completo:',
            name=u'nomeNomeAluno',
            parent=self.abaPessoal,
            pos=wx.Point(11, 70),
            size=wx.Size(80, 13),
            style=0)

        self.campoNomeAluno = wx.TextCtrl(
            id=wxID_FRAMEEDICAOALUNOCAMPONOMEALUNO,
            name=u'campoNomeAluno',
            parent=self.abaPessoal,
            pos=wx.Point(24, 89),
            size=wx.Size(496, 21),
            style=0,
            value=u'')
        self.campoNomeAluno.SetMaxLength(50)

        self.nomeNomeMae = wx.StaticText(id=wxID_FRAMEEDICAOALUNONOMENOMEMAE,
                                         label=u'Nome da M\xe3e:',
                                         name=u'nomeNomeMae',
                                         parent=self.abaPessoal,
                                         pos=wx.Point(11, 125),
                                         size=wx.Size(70, 14),
                                         style=0)

        self.campoNomeMae = wx.TextCtrl(id=wxID_FRAMEEDICAOALUNOCAMPONOMEMAE,
                                        name=u'campoNomeMae',
                                        parent=self.abaPessoal,
                                        pos=wx.Point(24, 145),
                                        size=wx.Size(496, 21),
                                        style=0,
                                        value=u'')
        self.campoNomeMae.SetMaxLength(50)

        self.nomeNomePai = wx.StaticText(id=wxID_FRAMEEDICAOALUNONOMENOMEPAI,
                                         label=u'Nome do Pai:',
                                         name=u'nomeNomePai',
                                         parent=self.abaPessoal,
                                         pos=wx.Point(11, 181),
                                         size=wx.Size(64, 13),
                                         style=0)

        self.campoNomePai = wx.TextCtrl(id=wxID_FRAMEEDICAOALUNOCAMPONOMEPAI,
                                        name=u'campoNomePai',
                                        parent=self.abaPessoal,
                                        pos=wx.Point(24, 202),
                                        size=wx.Size(496, 21),
                                        style=0,
                                        value=u'')
        self.campoNomePai.SetMaxLength(50)

        self.nomeCEP = wx.StaticText(id=wxID_FRAMEEDICAOALUNONOMECEP,
                                     label=u'CEP:',
                                     name=u'nomeCEP',
                                     parent=self.abaPessoal,
                                     pos=wx.Point(11, 237),
                                     size=wx.Size(24, 13),
                                     style=0)

        self.campoCEP = wx.lib.masked.textctrl.TextCtrl(
            id=wxID_FRAMEEDICAOALUNOCAMPOCEP,
            name=u'campoCEP',
            parent=self.abaPessoal,
            pos=wx.Point(24, 256),
            size=wx.Size(104, 21),
            style=0,
            value=u'  .   -   ')
        self.campoCEP.SetMask(u'XX.XXX-XXX')
        self.campoCEP.SetAutoformat('')
        self.campoCEP.SetFormatcodes('')
        self.campoCEP.SetDescription('')
        self.campoCEP.SetExcludeChars('')
        self.campoCEP.SetValidRegex('')
        self.campoCEP.SetMaxLength(10)
        self.campoCEP.SetFont(
            wx.Font(8, wx.SWISS, wx.NORMAL, wx.NORMAL, False, u'Tahoma'))
        self.campoCEP.SetDatestyle('MDY')

        self.botaoBuscarCEP = wx.BitmapButton(
            bitmap=wx.Bitmap(u'./Graficos/botao_buscar.png',
                             wx.BITMAP_TYPE_PNG),
            id=wxID_FRAMEEDICAOALUNOBOTAOBUSCARCEP,
            name=u'botaoBuscarCEP',
            parent=self.abaPessoal,
            pos=wx.Point(136, 253),
            size=wx.Size(26, 26),
            style=wx.BU_AUTODRAW)
        self.botaoBuscarCEP.Bind(wx.EVT_BUTTON,
                                 self.OnBotaoBuscarCEPButton,
                                 id=wxID_FRAMEEDICAOALUNOBOTAOBUSCARCEP)

        self.nomeNumero = wx.StaticText(id=wxID_FRAMEEDICAOALUNONOMENUMERO,
                                        label=u'N\xfamero:',
                                        name=u'nomeNumero',
                                        parent=self.abaPessoal,
                                        pos=wx.Point(160, 237),
                                        size=wx.Size(42, 13),
                                        style=0)

        self.campoNumero = wx.TextCtrl(id=wxID_FRAMEEDICAOALUNOCAMPONUMERO,
                                       name=u'campoNumero',
                                       parent=self.abaPessoal,
                                       pos=wx.Point(173, 256),
                                       size=wx.Size(100, 21),
                                       style=0,
                                       value=u'')

        self.nomeComplemento = wx.StaticText(
            id=wxID_FRAMEEDICAOALUNONOMECOMPLEMENTO,
            label=u'Complemento:',
            name=u'nomeComplemento',
            parent=self.abaPessoal,
            pos=wx.Point(293, 237),
            size=wx.Size(70, 13),
            style=0)

        self.campoComplemento = wx.TextCtrl(
            id=wxID_FRAMEEDICAOALUNOCAMPOCOMPLEMENTO,
            name=u'campoComplemento',
            parent=self.abaPessoal,
            pos=wx.Point(306, 256),
            size=wx.Size(214, 21),
            style=0,
            value=u'')

        self.nomeEndereco = wx.StaticText(id=wxID_FRAMEEDICAOALUNONOMEENDERECO,
                                          label=u'Endere\xe7o:',
                                          name=u'nomeEndereco',
                                          parent=self.abaPessoal,
                                          pos=wx.Point(11, 292),
                                          size=wx.Size(50, 13),
                                          style=0)

        self.campoEndereco = wx.TextCtrl(id=wxID_FRAMEEDICAOALUNOCAMPOENDERECO,
                                         name=u'campoEndereco',
                                         parent=self.abaPessoal,
                                         pos=wx.Point(24, 313),
                                         size=wx.Size(496, 21),
                                         style=0,
                                         value=u'')

        self.abaProfissional = wx.Window(
            id=wxID_FRAMEEDICAOALUNOABAPROFISSIONAL,
            name=u'abaProfissional',
            parent=self.dadosDosAlunos,
            pos=wx.Point(0, 0),
            size=wx.Size(976, 398),
            style=wx.TAB_TRAVERSAL)

        self.nomeMatricula = wx.StaticText(
            id=wxID_FRAMEEDICAOALUNONOMEMATRICULA,
            label=u'Matr\xedcula:',
            name=u'nomeMatricula',
            parent=self.abaProfissional,
            pos=wx.Point(16, 15),
            size=wx.Size(48, 13),
            style=0)

        self.campoMatricula = wx.TextCtrl(
            id=wxID_FRAMEEDICAOALUNOCAMPOMATRICULA,
            name=u'campoMatricula',
            parent=self.abaProfissional,
            pos=wx.Point(29, 34),
            size=wx.Size(144, 21),
            style=0,
            value=u'')

        self.abaContato = wx.Window(id=wxID_FRAMEEDICAOALUNOABACONTATO,
                                    name=u'abaContato',
                                    parent=self.dadosDosAlunos,
                                    pos=wx.Point(0, 0),
                                    size=wx.Size(976, 398),
                                    style=wx.TAB_TRAVERSAL)

        self.campoEmail = wx.TextCtrl(id=wxID_FRAMEEDICAOALUNOCAMPOEMAIL,
                                      name=u'campoEmail',
                                      parent=self.abaContato,
                                      pos=wx.Point(24, 35),
                                      size=wx.Size(312, 21),
                                      style=0,
                                      value=u'')
        self.campoEmail.SetFont(
            wx.Font(8, wx.SWISS, wx.NORMAL, wx.NORMAL, False, u'Tahoma'))

        self.nomeEmail = wx.StaticText(id=wxID_FRAMEEDICAOALUNONOMEEMAIL,
                                       label=u'E-Mail:',
                                       name=u'nomeEmail',
                                       parent=self.abaContato,
                                       pos=wx.Point(11, 16),
                                       size=wx.Size(33, 13),
                                       style=0)

        self.nomeTelefone = wx.StaticText(id=wxID_FRAMEEDICAOALUNONOMETELEFONE,
                                          label=u'Telefone:',
                                          name=u'nomeTelefone',
                                          parent=self.abaContato,
                                          pos=wx.Point(11, 68),
                                          size=wx.Size(47, 13),
                                          style=0)

        self.campoTelefone = wx.lib.masked.textctrl.TextCtrl(
            id=wxID_FRAMEEDICAOALUNOCAMPOTELEFONE,
            name=u'campoTelefone',
            parent=self.abaContato,
            pos=wx.Point(24, 87),
            size=wx.Size(136, 21),
            style=0,
            value=u'(  )    -    ')
        self.campoTelefone.SetAutoformat('')
        self.campoTelefone.SetMask(u'(XX)XXXX-XXXX')
        self.campoTelefone.SetFormatcodes('')
        self.campoTelefone.SetDescription('')
        self.campoTelefone.SetExcludeChars('')
        self.campoTelefone.SetValidRegex('')
        self.campoTelefone.SetMaxLength(13)
        self.campoTelefone.SetFont(
            wx.Font(8, wx.SWISS, wx.NORMAL, wx.NORMAL, False, u'Tahoma'))

        self.campoCelular = wx.lib.masked.textctrl.TextCtrl(
            id=wxID_FRAMEEDICAOALUNOCAMPOCELULAR,
            name=u'campoCelular',
            parent=self.abaContato,
            pos=wx.Point(24, 144),
            size=wx.Size(136, 21),
            style=0,
            value=u'')
        self.campoCelular.SetAutoformat('')
        self.campoCelular.SetMask(u'(XX)XXXX-XXXX')
        self.campoCelular.SetFormatcodes('')
        self.campoCelular.SetDescription('')
        self.campoCelular.SetExcludeChars('')
        self.campoCelular.SetValidRegex('')
        self.campoCelular.SetMaxLength(13)
        self.campoCelular.SetFont(
            wx.Font(8, wx.SWISS, wx.NORMAL, wx.NORMAL, False, u'Tahoma'))

        self.nomeBairro = wx.StaticText(id=wxID_FRAMEEDICAOALUNONOMEBAIRRO,
                                        label=u'Bairro:',
                                        name=u'nomeBairro',
                                        parent=self.abaPessoal,
                                        pos=wx.Point(11, 346),
                                        size=wx.Size(33, 13),
                                        style=0)

        self.nomeDepartamento = wx.StaticText(
            id=wxID_FRAMEEDICAOALUNONOMEDEPARTAMENTO,
            label=u'Departamento:',
            name=u'nomeDepartamento',
            parent=self.abaProfissional,
            pos=wx.Point(200, 15),
            size=wx.Size(74, 13),
            style=0)

        self.nomeCelular = wx.StaticText(id=wxID_FRAMEEDICAOALUNONOMECELULAR,
                                         label=u'Celular:',
                                         name=u'nomeCelular',
                                         parent=self.abaContato,
                                         pos=wx.Point(11, 125),
                                         size=wx.Size(38, 13),
                                         style=0)

        self.nomeCidade = wx.StaticText(id=wxID_FRAMEEDICAOALUNONOMECIDADE,
                                        label=u'Cidade:',
                                        name=u'nomeCidade',
                                        parent=self.abaPessoal,
                                        pos=wx.Point(265, 346),
                                        size=wx.Size(38, 13),
                                        style=0)

        self.campoBairro = wx.TextCtrl(id=wxID_FRAMEEDICAOALUNOCAMPOBAIRRO,
                                       name=u'campoBairro',
                                       parent=self.abaPessoal,
                                       pos=wx.Point(24, 365),
                                       size=wx.Size(224, 21),
                                       style=0,
                                       value=u'')

        self.campoCidade = wx.TextCtrl(id=wxID_FRAMEEDICAOALUNOCAMPOCIDADE,
                                       name=u'campoCidade',
                                       parent=self.abaPessoal,
                                       pos=wx.Point(278, 365),
                                       size=wx.Size(186, 21),
                                       style=0,
                                       value=u'')

        self.nomeUF = wx.StaticText(id=wxID_FRAMEEDICAOALUNONOMEUF,
                                    label=u'UF:',
                                    name=u'nomeUF',
                                    parent=self.abaPessoal,
                                    pos=wx.Point(480, 346),
                                    size=wx.Size(18, 13),
                                    style=0)

        self.campoUF = wx.TextCtrl(id=wxID_FRAMEEDICAOALUNOCAMPOUF,
                                   name=u'campoUF',
                                   parent=self.abaPessoal,
                                   pos=wx.Point(493, 365),
                                   size=wx.Size(27, 21),
                                   style=0,
                                   value=u'')

        self.botaoLimparPessoal = wx.Button(
            id=wxID_FRAMEEDICAOALUNOBOTAOLIMPARPESSOAL,
            label=u'Limpar',
            name=u'botaoLimparPessoal',
            parent=self.abaPessoal,
            pos=wx.Point(880, 20),
            size=wx.Size(75, 23),
            style=0)
        self.botaoLimparPessoal.Bind(
            wx.EVT_BUTTON,
            self.OnBotaoLimparPessoalButton,
            id=wxID_FRAMEEDICAOALUNOBOTAOLIMPARPESSOAL)

        self.comboBoxDepartamento = wx.ComboBox(
            choices=[],
            id=wxID_FRAMEEDICAOALUNOCOMBOBOXDEPARTAMENTO,
            name=u'comboBoxDepartamento',
            parent=self.abaProfissional,
            pos=wx.Point(217, 34),
            size=wx.Size(130, 21),
            style=wx.CB_READONLY,
            value=u'Selecione o Departamento')
        self.comboBoxDepartamento.SetLabel(u'')
        self.comboBoxDepartamento.SetStringSelection(
            u'Selecione o departamento')

        self.nomeCurso = wx.StaticText(id=wxID_FRAMEEDICAOALUNONOMECURSO,
                                       label=u'Curso:',
                                       name=u'nomeCurso',
                                       parent=self.abaProfissional,
                                       pos=wx.Point(373, 15),
                                       size=wx.Size(33, 13),
                                       style=0)

        self.comboBoxCursos = wx.ComboBox(
            choices=[],
            id=wxID_FRAMEEDICAOALUNOCOMBOBOXCURSOS,
            name=u'comboBoxCursos',
            parent=self.abaProfissional,
            pos=wx.Point(390, 34),
            size=wx.Size(130, 21),
            style=wx.CB_READONLY,
            value=u'')
        self.comboBoxCursos.SetLabel(u'Selecione o Curso')

        self.nomeAnoConclusao = wx.StaticText(
            id=wxID_FRAMEEDICAOALUNONOMEANOCONCLUSAO,
            label=u'Ano que concluiu (ou concluir\xe1) o curso:',
            name=u'nomeAnoConclusao',
            parent=self.abaProfissional,
            pos=wx.Point(16, 75),
            size=wx.Size(192, 13),
            style=0)

        self.campoAnoConclusao = wx.lib.masked.textctrl.TextCtrl(
            id=wxID_FRAMEEDICAOALUNOCAMPOANOCONCLUSAO,
            name=u'campoAnoConclusao',
            parent=self.abaProfissional,
            pos=wx.Point(40, 96),
            size=wx.Size(56, 21),
            style=0,
            value=u'    . ')
        self.campoAnoConclusao.SetAutoformat('')
        self.campoAnoConclusao.SetMask(u'XXXX.X')
        self.campoAnoConclusao.SetDatestyle('MDY')
        self.campoAnoConclusao.SetFormatcodes('')
        self.campoAnoConclusao.SetDescription('')
        self.campoAnoConclusao.SetExcludeChars('')
        self.campoAnoConclusao.SetValidRegex('')
        self.campoAnoConclusao.SetMaxLength(6)
        self.campoAnoConclusao.SetFont(
            wx.Font(8, wx.SWISS, wx.NORMAL, wx.NORMAL, False, u'Tahoma'))

        self.botaoLimparProfissional = wx.Button(
            id=wxID_FRAMEEDICAOALUNOBOTAOLIMPARPROFISSIONAL,
            label=u'Limpar',
            name=u'botaoLimparProfissional',
            parent=self.abaProfissional,
            pos=wx.Point(880, 20),
            size=wx.Size(75, 23),
            style=0)
        self.botaoLimparProfissional.Bind(
            wx.EVT_BUTTON,
            self.OnBotaoLimparProfissionalButton,
            id=wxID_FRAMEEDICAOALUNOBOTAOLIMPARPROFISSIONAL)

        self.botaoVoltar = wx.BitmapButton(bitmap=wx.Bitmap(
            u'./Graficos/botao_voltar.png', wx.BITMAP_TYPE_PNG),
                                           id=wxID_FRAMEEDICAOALUNOBOTAOVOLTAR,
                                           name=u'botaoVoltar',
                                           parent=self.painelEdicao,
                                           pos=wx.Point(952, 13),
                                           size=wx.Size(57, 57),
                                           style=wx.BU_AUTODRAW)
        self.botaoVoltar.Bind(wx.EVT_BUTTON,
                              self.OnBotaoVoltarButton,
                              id=wxID_FRAMEEDICAOALUNOBOTAOVOLTAR)

        self.botaoSalvar = wx.Button(id=wxID_FRAMEEDICAOALUNOBOTAOSALVAR,
                                     label=u'Salvar',
                                     name=u'botaoSalvar',
                                     parent=self.abaContato,
                                     pos=wx.Point(885, 360),
                                     size=wx.Size(75, 23),
                                     style=0)
        self.botaoSalvar.Bind(wx.EVT_BUTTON,
                              self.OnBotaoSalvarButton,
                              id=wxID_FRAMEEDICAOALUNOBOTAOSALVAR)

        self.campoSenha = wx.TextCtrl(id=wxID_FRAMEEDICAOALUNOCAMPOSENHA,
                                      name=u'campoSenha',
                                      parent=self.abaContato,
                                      pos=wx.Point(24, 197),
                                      size=wx.Size(312, 21),
                                      style=wx.TE_PASSWORD,
                                      value=u'')

        self.nomeErro = wx.StaticText(id=wxID_FRAMEEDICAOALUNONOMEERRO,
                                      label=u'',
                                      name=u'nomeErro',
                                      parent=self.abaPessoal,
                                      pos=wx.Point(456, 40),
                                      size=wx.Size(0, 13),
                                      style=wx.ALIGN_CENTRE)
        self.nomeErro.SetFont(
            wx.Font(8, wx.SWISS, wx.NORMAL, wx.NORMAL, True, u'Tahoma'))
        self.nomeErro.SetAutoLayout(True)

        self.verificarEstagio = wx.RadioBox(
            choices=['Sim', 'N\xe3o'],
            id=wxID_FRAMEEDICAOALUNOVERIFICARESTAGIO,
            label=u'Estagiando:',
            majorDimension=1,
            name=u'verificarEstagio',
            parent=self.abaProfissional,
            pos=wx.Point(234, 75),
            size=wx.Size(94, 44),
            style=wx.RA_SPECIFY_ROWS)
        self.verificarEstagio.SetStringSelection(u'N\xe3o')
        self.verificarEstagio.Bind(wx.EVT_RADIOBOX,
                                   self.OnVerificarEstagioRadiobox,
                                   id=wxID_FRAMEEDICAOALUNOVERIFICARESTAGIO)

        self.nomeDisponibilidade = wx.StaticText(
            id=wxID_FRAMEEDICAOALUNONOMEDISPONIBILIDADE,
            label=u'Disponibilidade:',
            name=u'nomeDisponibilidade',
            parent=self.abaProfissional,
            pos=wx.Point(351, 76),
            size=wx.Size(75, 13),
            style=0)

        self.opcaoManha = wx.CheckBox(id=wxID_FRAMEEDICAOALUNOOPCAOMANHA,
                                      label=u'Manh\xe3',
                                      name=u'opcaoManha',
                                      parent=self.abaProfissional,
                                      pos=wx.Point(372, 98),
                                      size=wx.Size(53, 13),
                                      style=0)
        self.opcaoManha.SetValue(False)

        self.opcaoTarde = wx.CheckBox(id=wxID_FRAMEEDICAOALUNOOPCAOTARDE,
                                      label=u'Tarde',
                                      name=u'opcaoTarde',
                                      parent=self.abaProfissional,
                                      pos=wx.Point(428, 98),
                                      size=wx.Size(49, 13),
                                      style=0)
        self.opcaoTarde.SetValue(False)
        self.opcaoTarde.SetToolTipString(u'opcaoTarde')

        self.opcaoNoite = wx.CheckBox(id=wxID_FRAMEEDICAOALUNOOPCAONOITE,
                                      label=u'Noite',
                                      name=u'opcaoNoite',
                                      parent=self.abaProfissional,
                                      pos=wx.Point(479, 98),
                                      size=wx.Size(40, 13),
                                      style=0)
        self.opcaoNoite.SetValue(False)

        self.nomeConfirmarSenha = wx.StaticText(
            id=wxID_FRAMEEDICAOALUNONOMECONFIRMARSENHA,
            label=u'Confirmar Senha:',
            name=u'nomeConfirmarSenha',
            parent=self.abaContato,
            pos=wx.Point(11, 231),
            size=wx.Size(85, 13),
            style=0)

        self.campoConfirmarSenha = wx.TextCtrl(
            id=wxID_FRAMEEDICAOALUNOCAMPOCONFIRMARSENHA,
            name=u'campoConfirmarSenha',
            parent=self.abaContato,
            pos=wx.Point(24, 250),
            size=wx.Size(312, 21),
            style=wx.TE_PASSWORD,
            value=u'')

        self.botaoLimparContato = wx.Button(
            id=wxID_FRAMEEDICAOALUNOBOTAOLIMPARCONTATO,
            label=u'Limpar',
            name=u'botaoLimparContato',
            parent=self.abaContato,
            pos=wx.Point(880, 20),
            size=wx.Size(75, 23),
            style=0)
        self.botaoLimparContato.Bind(
            wx.EVT_BUTTON,
            self.OnBotaoLimparContatoButton,
            id=wxID_FRAMEEDICAOALUNOBOTAOLIMPARCONTATO)

        self.nomeSenha = wx.StaticText(id=wxID_FRAMEEDICAOALUNONOMESENHA,
                                       label=u'Senha:',
                                       name=u'nomeSenha',
                                       parent=self.abaContato,
                                       pos=wx.Point(11, 178),
                                       size=wx.Size(35, 13),
                                       style=0)

        self._init_coll_dadosDosAlunos_Pages(self.dadosDosAlunos)
Ejemplo n.º 3
0
    def _element_setup(self):
        self.figure = Figure((8.5, 3))
        self.canvas = FigureCanvas(self, wx.ID_ANY, self.figure)
        self.temperature_plot = LiveCoffeeGraph(self.canvas)

        self.coffee_img = wx.StaticBitmap(
            self, wx.ID_ANY, wx.Bitmap("./cslogo.png", wx.BITMAP_TYPE_ANY))
        self.temp_readout = wx.TextCtrl(self,
                                        id=wx.ID_ANY,
                                        value='',
                                        size=(220, 220),
                                        style=wx.VSCROLL | wx.TE_MULTILINE
                                        | wx.EXPAND)

        self.temperature_label = wx.StaticText(self,
                                               wx.ID_ANY,
                                               "Temperature:",
                                               style=wx.ALIGN_LEFT)
        self.max_temperature_label = wx.StaticText(self,
                                                   wx.ID_ANY,
                                                   "Max temperature:",
                                                   style=wx.ALIGN_LEFT)
        self.Rate_of_change_label = wx.StaticText(self,
                                                  wx.ID_ANY,
                                                  "Rate of Change:",
                                                  style=wx.ALIGN_LEFT)
        self.elapsed_time_label = wx.StaticText(self,
                                                wx.ID_ANY,
                                                "Elapsed time:",
                                                style=wx.ALIGN_LEFT)
        self.current_temp = wx.StaticText(self,
                                          wx.ID_ANY,
                                          "212.4",
                                          style=wx.ALIGN_RIGHT)
        self.maximum_temp = wx.StaticText(self,
                                          wx.ID_ANY,
                                          "250.4",
                                          style=wx.ALIGN_RIGHT)
        self.rate_of_change = wx.StaticText(self,
                                            wx.ID_ANY,
                                            ".04C/min",
                                            style=wx.ALIGN_RIGHT)
        self.elapsed_time = wx.StaticText(self,
                                          wx.ID_ANY,
                                          "00:00",
                                          style=wx.ALIGN_RIGHT)

        self.auto_power_chkbx = wx.CheckBox(self,
                                            id=wx.ID_ANY,
                                            label="Auto Power")
        self.power_slider = wx.Slider(self,
                                      wx.ID_ANY,
                                      value=67,
                                      minValue=0,
                                      maxValue=100,
                                      pos=wx.DefaultPosition,
                                      size=(250, -1),
                                      style=wx.SL_AUTOTICKS | wx.SL_HORIZONTAL
                                      | wx.SL_LABELS)

        self.first_crack_btn = wx.Button(self,
                                         wx.ID_ANY,
                                         label=" First \nCrack",
                                         size=wx.Size(90, 50))
        self.rolling_first_crack_btn = wx.Button(
            self,
            wx.ID_ANY,
            label="  Rolling \nFirst Crack",
            size=wx.Size(90, 50))
        self.second_crack_btn = wx.Button(self,
                                          wx.ID_ANY,
                                          label="Second \n  Crack",
                                          size=wx.Size(90, 50))
        self.rolling_second_crack_btn = wx.Button(
            self,
            wx.ID_ANY,
            label="     Rolling \nSecond Crack",
            size=wx.Size(90, 50))
        self.unload_btn = wx.Button(self,
                                    wx.ID_ANY,
                                    label="Unload",
                                    size=wx.Size(90, 50))

        self.file_name_label = wx.StaticText(self, wx.ID_ANY, "File Name:")
        self.file_entry_box = wx.TextCtrl(self,
                                          wx.ID_ANY,
                                          "20091203.csv",
                                          size=(200, 28))
        self.vTarget_label = wx.StaticText(self, wx.ID_ANY, "Target:")
        self.vTarget = wx.SpinCtrlDouble(self,
                                         wx.ID_ANY,
                                         "0.0",
                                         size=(150, 28),
                                         min=0,
                                         max=250,
                                         inc=0.5)

        self.reset_btn = wx.Button(self,
                                   wx.ID_ANY,
                                   label="Reset",
                                   size=wx.Size(90, 50))
        self.save_btn = wx.Button(self,
                                  wx.ID_ANY,
                                  label="Save",
                                  size=wx.Size(90, 50))
        self.save_as_btn = wx.Button(self,
                                     wx.ID_ANY,
                                     label="Save As",
                                     size=wx.Size(90, 50))
        self.load_profile_btn = wx.Button(self,
                                          wx.ID_ANY,
                                          label="Load Profile",
                                          size=wx.Size(90, 50))
        self.quit_btn = wx.Button(self,
                                  wx.ID_ANY,
                                  label="Quit",
                                  size=wx.Size(90, 50))
Ejemplo n.º 4
0
    def __init__(self, parent):
        wx.Panel.__init__(self,
                          parent,
                          id=wx.ID_ANY,
                          pos=wx.DefaultPosition,
                          size=wx.Size(255, 0),
                          style=wx.TAB_TRAVERSAL)

        bSizer1 = wx.BoxSizer(wx.VERTICAL)

        self.histpan = HistCanvas(self)
        bSizer1.Add(self.histpan, 0, wx.ALL | wx.EXPAND, 5)

        self.sli_high = FloatSlider(self, (0, 255), 0)
        self.sli_high.SetValue(255)
        bSizer1.Add(self.sli_high, 0, wx.ALL | wx.EXPAND, 5)

        self.sli_low = FloatSlider(self, (0, 255), 0)
        self.sli_low.SetValue(0)
        bSizer1.Add(self.sli_low, 0, wx.ALL | wx.EXPAND, 5)

        bSizer2 = wx.BoxSizer(wx.HORIZONTAL)
        self.btn_8bit = wx.Button(self,
                                  wx.ID_ANY, u"0-255", wx.DefaultPosition,
                                  wx.Size(-1, -1), wx.BU_EXACTFIT)
        self.btn_8bit.SetMaxSize(wx.Size(-1, 40))

        bSizer2.Add(self.btn_8bit, 0, wx.ALIGN_CENTER | wx.ALL, 0)

        bSizer2.AddStretchSpacer(prop=1)

        self.btn_minmax = wx.Button(self, wx.ID_ANY,
                                    u"min-max", wx.DefaultPosition,
                                    wx.Size(-1, -1), wx.BU_EXACTFIT)
        self.btn_minmax.SetMaxSize(wx.Size(-1, 40))
        bSizer2.Add(self.btn_minmax, 0, wx.ALIGN_CENTER | wx.ALL, 0)

        bSizer2.AddStretchSpacer(prop=1)

        self.btn_slice = wx.Button(self,
                                   wx.ID_ANY, u"slice", wx.DefaultPosition,
                                   wx.Size(-1, -1), wx.BU_EXACTFIT)
        self.btn_slice.SetMaxSize(wx.Size(-1, 40))
        bSizer2.Add(self.btn_slice, 0, wx.ALIGN_CENTER | wx.ALL, 0)

        bSizer2.AddStretchSpacer(prop=1)

        self.btn_stack = wx.Button(self,
                                   wx.ID_ANY, u"stack", wx.DefaultPosition,
                                   wx.Size(-1, -1), wx.BU_EXACTFIT)
        self.btn_stack.SetMaxSize(wx.Size(-1, 40))
        bSizer2.Add(self.btn_stack, 0, wx.ALIGN_CENTER | wx.ALL, 0)

        bSizer1.Add(bSizer2, 0, wx.EXPAND | wx.ALL, 5)

        #line = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
        #txtlut = wx.StaticText( self, wx.ID_ANY, 'Look Up Table', wx.DefaultPosition, wx.DefaultSize)
        #bSizer1.Add( line, 0, wx.EXPAND |wx.ALL, 5 )
        #bSizer1.Add( txtlut, 0, wx.EXPAND |wx.ALL, 5 )

        self.cmapsel = CMapSelPanel(self)
        luts = ColorManager.luts
        self.cmapsel.SetItems(list(luts.keys()), list(luts.values()))
        bSizer1.Add(self.cmapsel, 0, wx.ALL | wx.EXPAND, 5)

        self.cmap = CMapPanel(self)
        bSizer1.Add(self.cmap, 0, wx.ALL | wx.EXPAND, 5)

        self.SetSizer(bSizer1)
        self.Layout()

        # Connect Events
        self.sli_high.Bind(wx.EVT_SCROLL, self.on_low)
        self.sli_low.Bind(wx.EVT_SCROLL, self.on_high)
        self.btn_8bit.Bind(wx.EVT_BUTTON, self.on_8bit)
        self.btn_minmax.Bind(wx.EVT_BUTTON, self.on_minmax)
        self.btn_slice.Bind(wx.EVT_BUTTON, self.on_slice)
        self.btn_stack.Bind(wx.EVT_BUTTON, self.on_stack)
        self.cmap.set_handle(self.on_cmap)
        self.cmapsel.set_handle(self.on_cmapsel)

        self.range = (0, 255)
Ejemplo n.º 5
0
    def __init__(self, parent):
        self._init_ctrls(parent)

        self.hyperlink = wx.HyperlinkCtrl(self, 100, "http://www.morcavon.com", "http://morcavon.com/1178440402", size=wx.Size(390,30))
        self.hyperlink.Center(wx.BOTH)
        self.hyperlink.SetCursor(wx.CROSS_CURSOR)
        self.hyperlink.SetToolTipString('\xba\xed\xb7\xce\xb1\xd7\xb7\xce GoGo~')
        self.hyperlink.SetForegroundColour(wx.Colour(255, 0, 0))
        self.hyperlink.SetFont(wx.Font(20, wx.SWISS, wx.NORMAL, wx.BOLD,
              False, 'Tahoma'))
        self.hyperlink.SetVisitedColour(wx.Colour(0,0,0))
Ejemplo n.º 6
0
 def DoGetBestSize(self):
     # Just pull a number out of the air.  If there is a way to
     # calculate this then it should be done...
     size = wx.Size(50, 50)
     self.CacheBestSize(size)
     return size
Ejemplo n.º 7
0
    def __init__(self, parent):
        wx.Frame.__init__(self, parent, -1, "pythonOCC Interactive Console %s" % VERSION, style=wx.DEFAULT_FRAME_STYLE,
                          size=(1024, 768))

        self._mgr = wx.aui.AuiManager()
        self._mgr.SetManagedWindow(self)

        self._recentfiles = GetRecentFiles(os.path.join(THISPATH, "recentfiles"))
        self.canva = GraphicsCanva3D(self)
        self._mgr.AddPane(self.canva, wx.aui.AuiPaneInfo().Name("Canvas").Caption("Canvas").MaximizeButton().BestSize(
            wx.Size(300, 100)).MinSize(wx.Size(300, 100)).CenterPane())

        nb = wx.aui.AuiNotebook(self, -1)
        self.notebook = nb
        self._createbrowser()
        self._createpythonshell()
        nb.SetSelection(0)

        start_help_height = self.GetSize()[1] / 3
        self._mgr.AddPane(nb, wx.aui.AuiPaneInfo().Name("Help").BestSize(wx.Size(500, 500)).MinSize(
            wx.Size(400, start_help_height)).Right())

        self.tb = self.CreateRightToolbar()
        self._mgr.AddPane(self.tb, wx.aui.AuiPaneInfo().Name("View").Caption("View").ToolbarPane().Top().TopDockable(
            True).BottomDockable(True))

        self._mgr.Update()
        self._mgr.GetPane("Help").MinSize((-1, -1))  # now make it so that the help pane can be resized

        self.DefaultPerspective = self._mgr.SavePerspective()
        # Load Layout
        tmp = LoadLayout(os.path.join(THISPATH, "layout"))
        if tmp:
            maximised, position, size, perspective = tmp
            self.LoadedPerspective = perspective
            self._mgr.LoadPerspective(self.LoadedPerspective)
            self._mgr.Update()
            self.SetSize(size)
            self.SetPosition(position)
            if maximised:
                self.Maximize()
        self.statusbar = self.CreateStatusBar(1, wx.ST_SIZEGRIP)

        # Creating Menu
        menuBar = wx.MenuBar()
        FileMenu = wx.Menu()

        file_id = wx.NewId()
        FileMenu.Append(file_id, "&Open", "Open a STEP file")
        self.Bind(wx.EVT_MENU, self.OnOpen, id=file_id)

        FileMenu.AppendSeparator()
        saveasbmp_id = wx.NewId()
        FileMenu.Append(saveasbmp_id, "Save as &image\tAlt-I", "Saves the current view as an image.")
        self.Bind(wx.EVT_MENU, self.SaveAsImage, id=saveasbmp_id)
        FileMenu.AppendSeparator()

        execpy_id = wx.NewId()
        FileMenu.Append(execpy_id, "Execute Script", "Execute a Python script in the current session.")
        self.Bind(wx.EVT_MENU, self.ExecPyFile, id=execpy_id)
        FileMenu.AppendSeparator()

        exit_id = wx.NewId()
        FileMenu.Append(exit_id, "&Exit", "Exit application")
        self.Bind(wx.EVT_MENU, self.OnExit, id=exit_id)

        self.filehistory = wx.FileHistory()
        self.filehistory.UseMenu(FileMenu)
        print
        self._recentfiles
        if len(self._recentfiles) > 0:
            for f in reversed(self._recentfiles):
                self.filehistory.AddFileToHistory(f)
        self.Bind(wx.EVT_MENU_RANGE, self.OnClickRecentFile, id=wx.ID_FILE1, id2=wx.ID_FILE9)

        menuBar.Append(FileMenu, "&File")
        # View menu
        viewmenu = wx.Menu()
        restoreperspectiveID = wx.NewId()
        viewmenu.Append(restoreperspectiveID, u'Restore default layout', 'Restore the UI to the default layout.')
        self.Bind(wx.EVT_MENU, self.OnRestoreDefaultPerspective, id=restoreperspectiveID)
        viewmenu.AppendSeparator()
        v_Top = wx.NewId()
        viewmenu.Append(v_Top, "Top\tAlt-1", "Top View")
        self.Bind(wx.EVT_MENU, self.View_Top, id=v_Top)
        v_Bottom = wx.NewId()
        viewmenu.Append(v_Bottom, "Bottom\tAlt-2", "Bottom View")
        self.Bind(wx.EVT_MENU, self.View_Bottom, id=v_Bottom)
        v_Left = wx.NewId()
        viewmenu.Append(v_Left, "Left\tAlt-3", "Left View")
        self.Bind(wx.EVT_MENU, self.View_Left, id=v_Left)
        v_Right = wx.NewId()
        viewmenu.Append(v_Right, "Right\tAlt-4", "Right View")
        self.Bind(wx.EVT_MENU, self.View_Right, id=v_Right)
        v_Front = wx.NewId()
        viewmenu.Append(v_Front, "Front\tAlt-5", "Front View")
        self.Bind(wx.EVT_MENU, self.View_Front, id=v_Front)
        v_Rear = wx.NewId()
        viewmenu.Append(v_Rear, "Rear\tAlt-6", "Rear View")
        self.Bind(wx.EVT_MENU, self.View_Rear, id=v_Rear)
        v_Iso = wx.NewId()
        viewmenu.Append(v_Iso, "Iso\tAlt-7", "Iso View")
        self.Bind(wx.EVT_MENU, self.View_Iso, id=v_Iso)
        z = wx.NewId()
        viewmenu.Append(z, "Zoom &All\tAlt-A", "Zoom All")
        self.Bind(wx.EVT_MENU, self._zoomall, id=z)
        menuBar.Append(viewmenu, "&View")

        # Selection menu
        selection_menu = wx.Menu()
        s_vertex = wx.NewId()
        selection_menu.Append(s_vertex, u'Vertex', 'Select vertices.')
        self.Bind(wx.EVT_MENU, self.OnSelectionVertex, id=s_vertex)
        s_edge = wx.NewId()
        selection_menu.Append(s_edge, u'Edge', 'Select edges.')
        self.Bind(wx.EVT_MENU, self.OnSelectionEdge, id=s_edge)
        s_face = wx.NewId()
        selection_menu.Append(s_face, u'Face', 'Select faces.')
        self.Bind(wx.EVT_MENU, self.OnSelectionFace, id=s_face)
        s_neutral = wx.NewId()
        selection_menu.Append(s_neutral, u'Neutral', 'Switch back to global shapes selction.')
        self.Bind(wx.EVT_MENU, self.OnSelectionNeutral, id=s_neutral)
        menuBar.Append(selection_menu, "&Selection")

        # DisplayMode menu
        displaymode_menu = wx.Menu()
        d_wireframe = wx.NewId()
        displaymode_menu.Append(d_wireframe, u'Wireframe', 'Switch to wireframe mode.')
        self.Bind(wx.EVT_MENU, self.OnDisplayModeWireframe, id=d_wireframe)
        d_shaded = wx.NewId()
        displaymode_menu.Append(d_shaded, u'Shaded', 'Switch to shaded mode.')
        self.Bind(wx.EVT_MENU, self.OnDisplayModeShaded, id=d_shaded)
        displaymode_menu.AppendSeparator()
        d_qhlr = wx.NewId()
        displaymode_menu.Append(d_qhlr, u'Quick HLR', 'Switch to Quick Hidden Line Removal mode.')
        self.Bind(wx.EVT_MENU, self.OnDisplayModeQHLR, id=d_qhlr)
        d_ehlr = wx.NewId()
        displaymode_menu.Append(d_ehlr, u'Exact HLR', 'Switch to Exact Hidden Line Removal mode.')
        self.Bind(wx.EVT_MENU, self.OnDisplayModeEHLR, id=d_ehlr)
        displaymode_menu.AppendSeparator()
        d_aon = wx.NewId()
        displaymode_menu.Append(d_aon, u'AntiAliasing On', 'Enable antialiasing.')
        self.Bind(wx.EVT_MENU, self.OnAntialiasingOn, id=d_aon)
        d_aoff = wx.NewId()
        displaymode_menu.Append(d_aoff, u'Antialiasing Off', 'Disable antialiasing.')
        self.Bind(wx.EVT_MENU, self.OnAntialiasingOff, id=d_aoff)
        menuBar.Append(displaymode_menu, "&Display mode")

        # About menu
        about_menu = wx.Menu()
        a_id = wx.NewId()
        about_menu.Append(a_id, "&About", "")
        self.Bind(wx.EVT_MENU, self.OnAbout, id=a_id)
        menuBar.Append(about_menu, "&Help")

        self.SetMenuBar(menuBar)
        self.Bind(wx.EVT_CLOSE, self.OnClose)
        self._refreshui()
Ejemplo n.º 8
0
	def __init__( self, parent ):
		wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = u"BinaKarir", pos = wx.DefaultPosition, size = wx.Size( 300,100 ), style = wx.DEFAULT_DIALOG_STYLE|wx.STAY_ON_TOP )

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

		bSizer6 = wx.BoxSizer( wx.VERTICAL )

		self.m_panel3 = wx.Panel( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
		bSizer6.Add( self.m_panel3, 1, wx.EXPAND |wx.ALL, 5 )

		self.m_textCtrl1 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 200,-1 ), wx.TE_PASSWORD )
		bSizer6.Add( self.m_textCtrl1, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 )

		self.Okay = wx.Button( self, wx.ID_ANY, u"Okay", wx.DefaultPosition, wx.DefaultSize, 0 )
		bSizer6.Add( self.Okay, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 )


		self.SetSizer( bSizer6 )
		self.Layout()

		self.Centre( wx.BOTH )

		# Connect Events
		self.Okay.Bind( wx.EVT_BUTTON, self.btn_passwd )
Ejemplo n.º 9
0
	def __init__( self, parent ):
		wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = u"BinaKarir", pos = wx.DefaultPosition, size = wx.Size( 450,300 ), style = wx.FRAME_NO_TASKBAR|wx.STAY_ON_TOP|wx.TAB_TRAVERSAL )

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

		bSizer7 = wx.BoxSizer( wx.VERTICAL )

		fgSizer4 = wx.FlexGridSizer( 3, 1, 0, 0 )
		fgSizer4.AddGrowableCol( 0 )
		fgSizer4.AddGrowableRow( 2 )
		fgSizer4.SetFlexibleDirection( wx.BOTH )
		fgSizer4.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )

		self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, u"Konfigurasi", wx.DefaultPosition, wx.DefaultSize, 0 )
		self.m_staticText1.Wrap( -1 )

		self.m_staticText1.SetFont( wx.Font( 16, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "Sans" ) )

		fgSizer4.Add( self.m_staticText1, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 )

		self.m_panel4 = wx.Panel( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
		fgSizer31 = wx.FlexGridSizer( 0, 3, 0, 0 )
		fgSizer31.AddGrowableCol( 2 )
		fgSizer31.SetFlexibleDirection( wx.BOTH )
		fgSizer31.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )

		self.m_panel5 = wx.Panel( self.m_panel4, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
		fgSizer3 = wx.FlexGridSizer( 0, 3, 0, 0 )
		fgSizer3.AddGrowableCol( 1 )
		fgSizer3.AddGrowableCol( 2 )
		fgSizer3.SetFlexibleDirection( wx.BOTH )
		fgSizer3.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )

		self.m_staticText5 = wx.StaticText( self.m_panel5, wx.ID_ANY, u"Batas Tanggal Aktif", wx.DefaultPosition, wx.DefaultSize, 0 )
		self.m_staticText5.Wrap( -1 )

		fgSizer3.Add( self.m_staticText5, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )

		self.m_datePicker1 = wx.adv.DatePickerCtrl( self.m_panel5, wx.ID_ANY, wx.DefaultDateTime, wx.DefaultPosition, wx.Size( -1,-1 ), wx.adv.DP_DEFAULT )
		fgSizer3.Add( self.m_datePicker1, 0, wx.ALL|wx.EXPAND, 5 )

		fgSizer2 = wx.FlexGridSizer( 0, 2, 0, 0 )
		fgSizer2.AddGrowableCol( 1 )
		fgSizer2.AddGrowableRow( 0 )
		fgSizer2.SetFlexibleDirection( wx.BOTH )
		fgSizer2.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )

		self.m_staticText51 = wx.StaticText( self.m_panel5, wx.ID_ANY, u"Tanggal Aktif :", wx.DefaultPosition, wx.Size( -1,-1 ), 0 )
		self.m_staticText51.Wrap( -1 )

		fgSizer2.Add( self.m_staticText51, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )

		self.tanggal_aktif = wx.StaticText( self.m_panel5, wx.ID_ANY, u"tanggal_aktif", wx.DefaultPosition, wx.DefaultSize, 0 )
		self.tanggal_aktif.Wrap( -1 )

		fgSizer2.Add( self.tanggal_aktif, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )


		fgSizer3.Add( fgSizer2, 1, wx.EXPAND, 5 )

		self.m_staticText3 = wx.StaticText( self.m_panel5, wx.ID_ANY, u"Password", wx.Point( -1,-1 ), wx.Size( -1,-1 ), 0 )
		self.m_staticText3.Wrap( -1 )

		fgSizer3.Add( self.m_staticText3, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )

		self.password = wx.StaticText( self.m_panel5, wx.ID_ANY, u"Belum ada", wx.DefaultPosition, wx.DefaultSize, 0 )
		self.password.Wrap( -1 )

		self.password.SetBackgroundColour( wx.Colour( 148, 245, 51 ) )

		fgSizer3.Add( self.password, 1, wx.ALL|wx.EXPAND, 5 )


		fgSizer3.Add( ( 0, 0), 1, wx.EXPAND, 5 )

		self.m_staticText4 = wx.StaticText( self.m_panel5, wx.ID_ANY, u"Ubah Password", wx.DefaultPosition, wx.DefaultSize, 0 )
		self.m_staticText4.Wrap( -1 )

		fgSizer3.Add( self.m_staticText4, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )

		self.ubah_password = wx.TextCtrl( self.m_panel5, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
		fgSizer3.Add( self.ubah_password, 0, wx.ALL|wx.EXPAND, 5 )

		self.Ubah = wx.Button( self.m_panel5, wx.ID_ANY, u"Ubah", wx.DefaultPosition, wx.DefaultSize, 0 )
		fgSizer3.Add( self.Ubah, 0, wx.ALL, 5 )


		self.m_panel5.SetSizer( fgSizer3 )
		self.m_panel5.Layout()
		fgSizer3.Fit( self.m_panel5 )
		fgSizer31.Add( self.m_panel5, 0, wx.ALL|wx.EXPAND, 5 )


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

		fgSizer7 = wx.FlexGridSizer( 1, 3, 0, 0 )
		fgSizer7.AddGrowableCol( 2 )
		fgSizer7.AddGrowableRow( 0 )
		fgSizer7.SetFlexibleDirection( wx.BOTH )
		fgSizer7.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )

		self.m_button6 = wx.Button( self, wx.ID_ANY, u"Non Aktifkan", wx.DefaultPosition, wx.DefaultSize, 0 )
		fgSizer7.Add( self.m_button6, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )

		self.m_button7 = wx.Button( self, wx.ID_ANY, u"Aktifkan", wx.DefaultPosition, wx.DefaultSize, 0 )
		fgSizer7.Add( self.m_button7, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )

		self.m_staticText8 = wx.StaticText( self, wx.ID_ANY, u"DisAktif", wx.DefaultPosition, wx.DefaultSize, 0 )
		self.m_staticText8.Wrap( -1 )

		self.m_staticText8.SetFont( wx.Font( 26, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "Sans" ) )
		self.m_staticText8.SetBackgroundColour( wx.Colour( 21, 182, 21 ) )

		fgSizer7.Add( self.m_staticText8, 1, wx.ALL|wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_CENTER_HORIZONTAL, 5 )


		fgSizer4.Add( fgSizer7, 1, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 5 )


		bSizer7.Add( fgSizer4, 1, wx.EXPAND, 5 )

		m_sdbSizer1 = wx.StdDialogButtonSizer()
		self.m_sdbSizer1OK = wx.Button( self, wx.ID_OK )
		m_sdbSizer1.AddButton( self.m_sdbSizer1OK )
		self.m_sdbSizer1Cancel = wx.Button( self, wx.ID_CANCEL )
		m_sdbSizer1.AddButton( self.m_sdbSizer1Cancel )
		m_sdbSizer1.Realize();

		bSizer7.Add( m_sdbSizer1, 0, wx.EXPAND, 5 )


		self.SetSizer( bSizer7 )
		self.Layout()

		self.Centre( wx.BOTH )

		# Connect Events
		self.m_datePicker1.Bind( wx.adv.EVT_DATE_CHANGED, self.m_datechange )
		self.Ubah.Bind( wx.EVT_BUTTON, self.btn_ubah )
		self.m_button6.Bind( wx.EVT_BUTTON, self.btn_non_aktifkan )
		self.m_button7.Bind( wx.EVT_BUTTON, self.btn_aktifkan )
		self.m_sdbSizer1Cancel.Bind( wx.EVT_BUTTON, self.btn_cancel )
		self.m_sdbSizer1OK.Bind( wx.EVT_BUTTON, self.btn_lanjut )
    def __init__(self, parent):
        wx.Frame.__init__(self, parent, size=wx.Size(520, 520))

        self.mainPanel = wx.Panel(self)

        self.SetTitle("Convert shape.zip to *.mdb for HAZUS")

        self.sb = self.CreateStatusBar()
        self.sb.SetStatusText("Please select your output directory.")

        # the welcome box
        self.welcome_sizerbox = wx.StaticBox(self.mainPanel,
                                             -1,
                                             pos=wx.Point(8, 6),
                                             size=wx.Size(476, 135))

        # the file picker box
        self.output_directory_staticbox = wx.StaticBox(
            self.mainPanel,
            -1,
            "Choose the output directory",
            pos=wx.Point(8, 145),
            size=wx.Size(476, 55))

        # earthquake name box
        self.earthquakename_staticbox = wx.StaticBox(
            self.mainPanel,
            -1,
            "Type the earthquake name",
            pos=wx.Point(8, 205),
            size=wx.Size(476, 60))

        # the shape.zip box
        self.serverinfo_staticbox = wx.StaticBox(
            self.mainPanel,
            -1,
            "Select the location of the shape.zip file",
            pos=wx.Point(8, 270),
            size=wx.Size(476, 75))

        # the go button box
        self.go_button_staticbox = wx.StaticBox(self.mainPanel,
                                                -1,
                                                pos=wx.Point(8, 350),
                                                size=wx.Size(476, 100))

        # welcome text
        welcomemessage = "The hazus.zip file that comes with a standard USGS ShakeMap product has average ground" \
                         " motions instead of peak ground motions.  This tool converts the shape.zip file and its" \
                         " peak ground motions into a *.mdb file that you can then import into HAZUS for your own" \
                         " HAZUS earthquake scenario.  For more information on the differences between shape.zip" \
                         " and hazus.zip, follow this link: http://earthquake.usgs.gov/research/shakemap/formats.php"

        self.welcome_label = wx.StaticText(self.mainPanel,
                                           -1,
                                           welcomemessage,
                                           pos=wx.Point(20, 30),
                                           size=wx.Size(460, 95))

        # Set up the menu to choose a directory from the system
        self.output_directory_dialog_button = wx.Button(
            self.mainPanel,
            label="Choose Output Directory",
            pos=wx.Point(20, 165),
            size=wx.Size(200, -1))
        self.output_directory = ""
        self.output_directory_dialog_button.Bind(wx.EVT_BUTTON,
                                                 self.select_output_directory)

        # Set up a text control for the earthquake name
        self.earthquake_name_box = wx.TextCtrl(self.mainPanel,
                                               -1,
                                               pos=wx.Point(20, 230),
                                               size=wx.Size(300, -1))
        self.earthquake_name = ""

        # Create a file picker to choose the location of the shape.zip file
        self.input_file_button = wx.FilePickerCtrl(self.mainPanel,
                                                   pos=wx.Point(20, 300),
                                                   size=wx.Size(450, -1),
                                                   wildcard="*.zip")
        self.input_file = ""
        self.input_file_button.Bind(wx.EVT_FILEPICKER_CHANGED,
                                    self.select_input_file)

        # Create a button that executes the process to extract the shape.zip file
        self.extract_file_button = wx.Button(self.mainPanel,
                                             label="Go!",
                                             pos=wx.Point(20, 370),
                                             size=wx.Size(150, 60))
        self.Bind(wx.EVT_BUTTON, self.extract_file, self.extract_file_button)

        self.Show()
Ejemplo n.º 11
0
    def __init__(self, parent, wn, quote):
        #debug('iTrade_wxLive::__init__')
        wx.Panel.__init__(self, parent, -1)
        self.m_parent = wn
        self.m_quote = quote
        self.m_live = quote.liveconnector()

        self.m_font = wx.Font(8, wx.MODERN, wx.NORMAL, wx.NORMAL)
        self.SetFont(self.m_font)

        # column mapping
        #    nb qt ach ven qt  nb  hou qte price clock
        X = (10, 60, 130, 190, 250, 320, 380, 450, 520, 380)
        W = (50, 70, 60, 60, 70, 50, 70, 70, 60, 70)

        # notebook
        title = wx.StaticText(self,
                              -1,
                              message('live_notebook'),
                              wx.Point(X[0], 5),
                              wx.Size(W[0] + W[1] + W[2] + W[3] + W[4] + W[5],
                                      15),
                              style=wx.ALIGN_CENTRE)
        title.SetBackgroundColour('sea green')
        nb = wx.StaticText(self,
                           -1,
                           message('live_number'),
                           wx.Point(X[0], 20),
                           wx.Size(W[0], 15),
                           style=wx.ALIGN_RIGHT)
        qte = wx.StaticText(self,
                            -1,
                            message('live_qty'),
                            wx.Point(X[1], 20),
                            wx.Size(W[1], 15),
                            style=wx.ALIGN_RIGHT)
        price = wx.StaticText(self,
                              -1,
                              message('live_buy'),
                              wx.Point(X[2], 20),
                              wx.Size(W[2], 15),
                              style=wx.ALIGN_RIGHT)
        price = wx.StaticText(self,
                              -1,
                              message('live_sell'),
                              wx.Point(X[3], 20),
                              wx.Size(W[3], 15),
                              style=wx.ALIGN_RIGHT)
        qte = wx.StaticText(self,
                            -1,
                            message('live_qty'),
                            wx.Point(X[4], 20),
                            wx.Size(W[4], 15),
                            style=wx.ALIGN_RIGHT)
        nb = wx.StaticText(self,
                           -1,
                           message('live_number'),
                           wx.Point(X[5], 20),
                           wx.Size(W[5], 15),
                           style=wx.ALIGN_RIGHT)

        y = 35
        self.nba = {}
        self.qtea = {}
        self.pricea = {}
        self.pricev = {}
        self.qtev = {}
        self.nbv = {}
        for i in range(0, NBLINES):
            self.nba[i] = wx.StaticText(self,
                                        -1,
                                        "-",
                                        wx.Point(X[0], y),
                                        wx.Size(W[0], 15),
                                        style=wx.ALIGN_RIGHT
                                        | wx.ST_NO_AUTORESIZE)
            self.qtea[i] = wx.StaticText(self,
                                         -1,
                                         "-",
                                         wx.Point(X[1], y),
                                         wx.Size(W[1], 15),
                                         style=wx.ALIGN_RIGHT
                                         | wx.ST_NO_AUTORESIZE)
            self.pricea[i] = wx.StaticText(self,
                                           -1,
                                           "-",
                                           wx.Point(X[2], y),
                                           wx.Size(W[2], 15),
                                           style=wx.ALIGN_RIGHT
                                           | wx.ST_NO_AUTORESIZE)
            self.pricev[i] = wx.StaticText(self,
                                           -1,
                                           "-",
                                           wx.Point(X[3], y),
                                           wx.Size(W[3], 15),
                                           style=wx.ALIGN_RIGHT
                                           | wx.ST_NO_AUTORESIZE)
            self.qtev[i] = wx.StaticText(self,
                                         -1,
                                         "-",
                                         wx.Point(X[4], y),
                                         wx.Size(W[4], 15),
                                         style=wx.ALIGN_RIGHT
                                         | wx.ST_NO_AUTORESIZE)
            self.nbv[i] = wx.StaticText(self,
                                        -1,
                                        "-",
                                        wx.Point(X[5], y),
                                        wx.Size(W[5], 15),
                                        style=wx.ALIGN_RIGHT
                                        | wx.ST_NO_AUTORESIZE)
            y = y + 15

        fmp = wx.StaticText(self,
                            -1,
                            message('live_FMP'),
                            wx.Point(X[1], y),
                            wx.Size(W[1], 15),
                            style=wx.ALIGN_RIGHT | wx.ST_NO_AUTORESIZE)
        self.fmpa = wx.StaticText(self,
                                  -1,
                                  "-",
                                  wx.Point(X[2], y),
                                  wx.Size(W[2], 15),
                                  style=wx.ALIGN_RIGHT | wx.ST_NO_AUTORESIZE)
        self.fmpv = wx.StaticText(self,
                                  -1,
                                  "-",
                                  wx.Point(X[3], y),
                                  wx.Size(W[3], 15),
                                  style=wx.ALIGN_RIGHT | wx.ST_NO_AUTORESIZE)

        # last trades
        title = wx.StaticText(self,
                              -1,
                              message('live_lasttrades'),
                              wx.Point(X[6], 5),
                              wx.Size(W[6] + W[7] + W[8], 15),
                              style=wx.ALIGN_CENTRE)
        title.SetBackgroundColour('sea green')
        hours = wx.StaticText(self,
                              -1,
                              message('live_hours'),
                              wx.Point(X[6], 20),
                              wx.Size(W[6], 15),
                              style=wx.ALIGN_RIGHT)
        qte = wx.StaticText(self,
                            -1,
                            message('live_qty'),
                            wx.Point(X[7], 20),
                            wx.Size(W[7], 15),
                            style=wx.ALIGN_RIGHT)
        price = wx.StaticText(self,
                              -1,
                              message('live_price'),
                              wx.Point(X[8], 20),
                              wx.Size(W[8], 15),
                              style=wx.ALIGN_RIGHT)

        y = 35
        self.qtelt = {}
        self.hourlt = {}
        self.pricelt = {}
        for i in range(0, LTLINES):
            self.hourlt[i] = wx.StaticText(self,
                                           -1,
                                           "::",
                                           wx.Point(X[6], y),
                                           wx.Size(W[6], 15),
                                           style=wx.ALIGN_RIGHT
                                           | wx.ST_NO_AUTORESIZE)
            self.qtelt[i] = wx.StaticText(self,
                                          -1,
                                          "-",
                                          wx.Point(X[7], y),
                                          wx.Size(W[7], 15),
                                          style=wx.ALIGN_RIGHT
                                          | wx.ST_NO_AUTORESIZE)
            self.pricelt[i] = wx.StaticText(self,
                                            -1,
                                            "-",
                                            wx.Point(X[8], y),
                                            wx.Size(W[8], 15),
                                            style=wx.ALIGN_RIGHT
                                            | wx.ST_NO_AUTORESIZE)
            y = y + 15

        cmp = wx.StaticText(self,
                            -1,
                            message('live_CMP'),
                            wx.Point(X[7], y),
                            wx.Size(W[7], 15),
                            style=wx.ALIGN_RIGHT | wx.ST_NO_AUTORESIZE)
        self.cmplt = wx.StaticText(self,
                                   -1,
                                   "-",
                                   wx.Point(X[8], y),
                                   wx.Size(W[8], 15),
                                   style=wx.ALIGN_RIGHT | wx.ST_NO_AUTORESIZE)

        self.m_sclock = wx.StaticText(self,
                                      -1,
                                      " ",
                                      wx.Point(X[9], y),
                                      wx.Size(W[9], 15),
                                      style=wx.ALIGN_CENTRE
                                      | wx.ST_NO_AUTORESIZE)

        self.refresh()
Ejemplo n.º 12
0
    def createWidget(self):

        buttonBoxSize = [120, 50]

        size = wx.Size(buttonBoxSize[0], buttonBoxSize[1])

        functionPanel1 = wx.Panel(self, -1, size=size, pos=(10, 10))
        functionPanel2 = wx.Panel(self,
                                  -1,
                                  size=size,
                                  pos=(10, buttonBoxSize[1] + 10))
        miMitionPanel = wx.Panel(self,
                                 -1,
                                 size=size,
                                 pos=(10, buttonBoxSize[1] * 2 + 10))
        functionPanel3 = wx.Panel(self,
                                  -1,
                                  size=size,
                                  pos=(10, buttonBoxSize[1] * 3 + 10))

        self.functionBotton1 = wx.Button(functionPanel1,
                                         -1,
                                         label='获取时间',
                                         size=functionPanel1.GetSize(),
                                         pos=self.calculatePosPoint(
                                             buttonBoxSize, buttonBoxSize))
        self.encryptButton = wx.Button(functionPanel2,
                                       -1,
                                       label='加密',
                                       size=functionPanel2.GetSize(),
                                       pos=self.calculatePosPoint(
                                           buttonBoxSize, buttonBoxSize))
        self.loginLibButton = wx.Button(functionPanel3,
                                        -1,
                                        label='登录学校图书馆',
                                        size=functionPanel3.GetSize(),
                                        pos=self.calculatePosPoint(
                                            buttonBoxSize, buttonBoxSize))
        self.miMotionButton = wx.Button(miMitionPanel,
                                        -1,
                                        label='小米运动',
                                        size=miMitionPanel.GetSize(),
                                        pos=self.calculatePosPoint(
                                            buttonBoxSize, buttonBoxSize))

        self.encryptButton.SetDefault()
        self.miMotionButton.SetDefault()
        self.loginLibButton.SetDefault()
        self.functionBotton1.SetDefault()

        inputTextPanel = wx.Panel(self, size=(600, 60), pos=(350, 20))
        self.inputText = wx.TextCtrl(inputTextPanel,
                                     -1,
                                     value='',
                                     pos=(0, 0),
                                     size=inputTextPanel.GetSize())

        outputTextPanel = wx.Panel(self, size=(600, 400), pos=(350, 80))
        self.outputText = wx.TextCtrl(outputTextPanel,
                                      -1,
                                      value='',
                                      pos=(0, 0),
                                      size=outputTextPanel.GetSize(),
                                      style=wx.TE_READONLY | wx.TE_MULTILINE)
        # outputTextPanel.SetFont(self.outputTextPanel)

        self.Bind(wx.EVT_BUTTON,
                  lambda msg: self.pushText(self.outputText, self.getTime()),
                  self.functionBotton1)
        self.Bind(wx.EVT_BUTTON,
                  lambda msg: self.RSAEncDec(self.inputText.GetValue()),
                  self.encryptButton)
        self.Bind(wx.EVT_BUTTON, lambda user: self.hutLib(),
                  self.loginLibButton)
        self.Bind(wx.EVT_BUTTON, lambda param: self.miMotion('param'),
                  self.miMotionButton)
Ejemplo n.º 13
0
if __name__ == "__main__":
    # with open("./config.json", 'r', encoding='utf-8') as f:
    #     # json.dump(menu_title, f, ensure_ascii=False)
    #     menu_title = json.load(f)

    # 设备显示器信息
    sys_windows_size = [1920, 1080]
    # 主窗口大小 像素
    main_frame_size = [1000, 600]
    # 主窗口位置 像素
    main_frame_pos = [
        int((sys_windows_size[0] - main_frame_size[0]) / 2),
        int((sys_windows_size[1] - main_frame_size[1]) / 2)
    ]

    # 主窗口的大小-<-赋值
    main_size = wx.Size(int(main_frame_size[0]), int(main_frame_size[1]))
    # 主窗口的位置-<-赋值
    main_pos = wx.Point(main_frame_pos[0], main_frame_pos[1])

    app = wx.App()
    frame = MainFrame(None,
                      title="My App",
                      size=main_size,
                      pos=main_pos,
                      name='mainFrame')

    frame.Show()
    app.MainLoop()
Ejemplo n.º 14
0
    def __init_ctrls(self, prnt):
        wx.Panel.__init__(self, id=wxID_SORTINGPANEL, name=u'sortingPanel',
                          parent=prnt, style=wx.TAB_TRAVERSAL)

        self.basicBox = wx.StaticBox(id=wxID_SORTINGPANELBASICBOX,
                                     label=_(u"Basic Options"), name=u'basicBox', parent=self,
                                     style=0)

        self.advancedBox = wx.StaticBox(id=wxID_SORTINGPANELADVANCEDBOX,
                                        label=_(u"Advanced Options"), name=u'advancedBox', parent=self,
                                        style=0)

        self.ascending = wx.RadioButton(id=wxID_SORTINGPANELASCENDING,
                                        label=_("Ascending (0 - 9)"), name='ascending', parent=self,
                                        style=wx.RB_GROUP)
        self.ascending.Bind(wx.EVT_RADIOBUTTON, self.setSortingOptions,
                            id=wxID_SORTINGPANELASCENDING)

        self.descending = wx.RadioButton(id=wxID_SORTINGPANELDESCENDING,
                                         label=_("Descending (9 - 0)"), name='descending', parent=self,
                                         style=0)
        self.descending.Bind(wx.EVT_RADIOBUTTON, self.setSortingOptions,
                             id=wxID_SORTINGPANELDESCENDING)

        self.manually = wx.RadioButton(id=wxID_SORTINGPANELMANUALLY,
                                       label=_(u"Manually Adjust"), name=u'manually', parent=self,
                                       style=0)
        self.manually.SetValue(False)
        self.manually.Bind(wx.EVT_RADIOBUTTON, self.setSortingOptions,
                           id=wxID_SORTINGPANELMANUALLY)

        self.downButton = wx.BitmapButton(bitmap=wx.Bitmap(utils.icon_path(u'down.png'),
                                          wx.BITMAP_TYPE_PNG), id=wxID_SORTINGPANELDOWNBUTTON,
                                          name=u'downButton', parent=self, style=wx.BU_AUTODRAW)
        self.downButton.Bind(wx.EVT_BUTTON, self.change_item_order,
                             id=wxID_SORTINGPANELDOWNBUTTON)

        self.upButton = wx.BitmapButton(bitmap=wx.Bitmap(utils.icon_path(u'up.png'),
                                        wx.BITMAP_TYPE_PNG), id=wxID_SORTINGPANELUPBUTTON,
                                        name=u'upButton', parent=self, style=wx.BU_AUTODRAW)
        self.upButton.Bind(wx.EVT_BUTTON, self.change_item_order,
                           id=wxID_SORTINGPANELUPBUTTON)

        self.upTop = wx.BitmapButton(bitmap=wx.Bitmap(utils.icon_path(u'upAll.ico'),
                                     wx.BITMAP_TYPE_ICO), id=wxID_SORTINGPANELUPTOP, name=u'upTop',
                                     parent=self, style=wx.BU_AUTODRAW)
        self.upTop.SetToolTipString(_(u"move to top"))
        self.upTop.Bind(wx.EVT_BUTTON, self.change_item_order,
                        id=wxID_SORTINGPANELUPTOP)

        self.downBottom = wx.BitmapButton(bitmap=wx.Bitmap(utils.icon_path(u'downAll.ico'),
                                          wx.BITMAP_TYPE_ICO), id=wxID_SORTINGPANELDOWNBOTTOM,
                                          name=u'downBottom', parent=self, style=wx.BU_AUTODRAW)
        self.downBottom.SetToolTipString(_(u"move to bottom"))
        self.downBottom.Bind(wx.EVT_BUTTON, self.change_item_order,
                             id=wxID_SORTINGPANELDOWNBOTTOM)

        self.upMore = wx.BitmapButton(bitmap=wx.Bitmap(utils.icon_path(u'up5.png'),
                                      wx.BITMAP_TYPE_PNG), id=wxID_SORTINGPANELUPMORE, name=u'upMore',
                                      parent=self, style=wx.BU_AUTODRAW)
        self.upMore.SetToolTipString(_(u"move by 5"))
        self.upMore.Bind(wx.EVT_BUTTON, self.change_item_order,
                         id=wxID_SORTINGPANELUPMORE)

        self.downMore = wx.BitmapButton(bitmap=wx.Bitmap(utils.icon_path(u'down5.png'),
                                        wx.BITMAP_TYPE_PNG), id=wxID_SORTINGPANELDOWNMORE,
                                        name=u'downMore', parent=self, style=wx.BU_AUTODRAW)
        self.downMore.SetToolTipString(_(u"move by 5"))
        self.downMore.Bind(wx.EVT_BUTTON, self.change_item_order,
                           id=wxID_SORTINGPANELDOWNMORE)

        self.dirsPlace = wx.Choice(choices=[_(u"Directories before files"),
                                   _(u"Directories after files"),
                                   _(u"Directories mixed with files")],
                                   id=wxID_SORTINGPANELDIRSPLACE, name=u'dirsPlace', parent=self)
        self.dirsPlace.SetSelection(0)
        self.dirsPlace.Bind(wx.EVT_CHOICE, self.show_preview)

        self.normalSort = wx.RadioButton(id=wxID_SORTINGPANELNORMALSORT,
                                         label=_(u"Sort normally"), name=u'normalSort',
                                         parent=self, style=wx.RB_GROUP)
        self.normalSort.SetToolTipString(_(u"Standard sorting by item name."))
        self.normalSort.SetValue(True)
        self.normalSort.Bind(wx.EVT_RADIOBUTTON, self.setSortingOptions,
                             id=wxID_SORTINGPANELNORMALSORT)

        self.intelySort = wx.RadioButton(id=wxID_SORTINGPANELINTELYSORT,
                                         label=_(u"Sort numbers intelligently"), name=u'intelySort',
                                         parent=self, style=0)
        self.intelySort.SetToolTipString(_(u"Order these types of items: ...19, 2, 20...\nMay have unpredictable results!"))
        self.intelySort.Bind(wx.EVT_RADIOBUTTON, self.setStatOptions,
                             id=wxID_SORTINGPANELINTELYSORT)

        self.byPosition = wx.RadioButton(id=wxID_SORTINGPANELBYPOSITION,
                                         label=_(u"Sort on a section of the name:"), name=u'byPosition',
                                         parent=self, style=0)
        self.byPosition.Bind(wx.EVT_RADIOBUTTON, self.setStatOptions,
                             id=wxID_SORTINGPANELBYPOSITION)

        self.staticText1 = wx.StaticText(id=wxID_SORTINGPANELSTATICTEXT1,
                                         label=_(u"Starting at:"), name='staticText1', parent=self,
                                         style=0)

        self.PosStart = wx.SpinCtrl(id=wxID_SORTINGPANELPOSSTART, initial=0,
                                    max=255, min=-255, name=u'PosStart', parent=self, size=wx.Size(50,
                                    -1), style=wx.SP_ARROW_KEYS, value='0')
        self.PosStart.Bind(wx.EVT_SPINCTRL, self.show_preview,
                           id=wxID_SORTINGPANELPOSSTART)

        self.staticText2 = wx.StaticText(id=wxID_SORTINGPANELSTATICTEXT2,
                                         label=_(u"Selection length:"), name='staticText2', parent=self,
                                         style=0)

        self.PosLength = wx.SpinCtrl(id=wxID_SORTINGPANELPOSLENGTH, initial=1,
                                     max=255, min=1, name=u'PosLength', parent=self, size=wx.Size(50,
                                     -1), style=wx.SP_ARROW_KEYS, value='1')
        self.PosLength.Bind(wx.EVT_SPINCTRL, self.show_preview,
                            id=wxID_SORTINGPANELPOSLENGTH)

        self.statSortChoice = wx.Choice(choices=[self.ctime,
                                        _(u"last modification time"), _(u"last access time"),
                                        _(u"file size"), _(u"mode (protection bits)"),
                                        _(u"user ID of owner"), _(u"group ID of owner"),
                                        _(u"Exif : picture taken"),
                                        _(u"Exif : image modified"),
                                        ],
                                        id=wxID_SORTINGPANELSTATSORTCHOICE, name=u'statSortChoice',
                                        parent=self, style=0)
        self.statSortChoice.SetSelection(0)
        self.statSortChoice.Bind(wx.EVT_CHOICE, self.show_preview,
                                 id=wxID_SORTINGPANELSTATSORTCHOICE)

        self.statSort = wx.RadioButton(id=wxID_SORTINGPANELSTATSORT,
                                       label=_(u"Sort by item attributes, using:"), name=u'statSort',
                                       parent=self, style=0)
        self.statSort.Bind(wx.EVT_RADIOBUTTON, self.setStatOptions,
                           id=wxID_SORTINGPANELSTATSORT)

        self.__init_sizers()
Ejemplo n.º 15
0
    def setup_gui(self):
        self.SetPosition(wx.Point(75, 0))
        self.SetSize(wx.Size(1240, 720))
        self.SetIcon(wx.Icon(core.ICON_MAIN, wx.BITMAP_TYPE_ICO))
        self.SetBackgroundColour(core.COLOR_DEFAULT_BACKGROUND)
        # first
        self.panel_top = wx.Panel(self, -1, pos=(10, 5), size=(1220, 50), style=wx.TAB_TRAVERSAL)
        self.panel_top.SetBackgroundColour(core.COLOR_DEFAULT_BACKGROUND)
        static_text_fechamento = wx.StaticText(self.panel_top, -1, u"Fechamento de:", pos=(300, 15))
        static_text_fechamento.SetFont(wx.Font(11, wx.SWISS, wx.NORMAL, wx.BOLD))
        self.setup_options()

        panel_top_buttons = wx.Panel(self.panel_top, -1, pos=(750, 5), size=(440, 40),
                                     style=wx.TAB_TRAVERSAL | wx.SIMPLE_BORDER)

        fupdate = GenBitmapTextButton(panel_top_buttons, -1,
                                      wx.Bitmap(core.directory_paths['icons'] + 'Reset.png', wx.BITMAP_TYPE_PNG),
                                      u'Atualizar janela', pos=(0, 0), size=(140, 40))
        fupdate.Bind(wx.EVT_BUTTON, self.reopen)
        pol = GenBitmapTextButton(panel_top_buttons, -1,
                                  wx.Bitmap(core.directory_paths['icons'] + 'Tools.png', wx.BITMAP_TYPE_PNG),
                                  u"Recuperação de registros", pos=(140, 0), size=(200, 40))
        pol.Bind(wx.EVT_BUTTON, self.open_record_editor)
        button_save = GenBitmapTextButton(panel_top_buttons, -1,
                                          wx.Bitmap(core.directory_paths['icons'] + 'Save.png', wx.BITMAP_TYPE_PNG),
                                          u"Salvar", pos=(340, 0), size=(100, 40))
        button_save.Bind(wx.EVT_BUTTON, self.save)

        # Painel das vendas
        panel1 = wx.Panel(self, -1, pos=(10, 65), size=(810, 260), style=wx.SUNKEN_BORDER | wx.TAB_TRAVERSAL)
        panel1.SetBackgroundColour(core.COLOR_DEFAULT_BACKGROUND)
        self.list_sales = wx.gizmos.TreeListCtrl(panel1, -1, pos=(10, 5), size=(620, 250),
                                                 style=wx.SIMPLE_BORDER | wx.TR_DEFAULT_STYLE |
                                                 wx.TR_FULL_ROW_HIGHLIGHT)
        self.list_sales.AddColumn(u"Descrição", width=250)
        self.list_sales.AddColumn(u"Quantidade", width=90)
        self.list_sales.AddColumn(u"Pagamento", width=150)
        self.list_sales.AddColumn(u"Valor", width=120)
        self.list_sales.SetMainColumn(0)
        panel1b = wx.Panel(panel1, pos=(650, 50), size=(145, 160), style=wx.SIMPLE_BORDER)
        plus = GenBitmapTextButton(panel1b, -1,
                                   wx.Bitmap(core.directory_paths['icons'] + 'Add.png', wx.BITMAP_TYPE_PNG),
                                   u"Nova venda",
                                   pos=(0, 0), size=(145, 40))
        plus.Bind(wx.EVT_BUTTON, self.open_sale_register)
        edit = GenBitmapTextButton(panel1b, -1,
                                   wx.Bitmap(core.directory_paths['icons'] + 'Edit.png', wx.BITMAP_TYPE_PNG),
                                   u"Editar venda", pos=(0, 40), size=(145, 40))
        edit.Bind(wx.EVT_BUTTON, self.open_sale_edit)
        remove = GenBitmapTextButton(panel1b, -1,
                                     wx.Bitmap(core.directory_paths['icons'] + 'Trash.png', wx.BITMAP_TYPE_PNG),
                                     u'Apagar venda', pos=(0, 80), size=(145, 40))
        remove.Bind(wx.EVT_BUTTON, self.ask_delete_sale)
        update = GenBitmapTextButton(panel1b, -1,
                                     wx.Bitmap(core.directory_paths['icons'] + 'Reset.png', wx.BITMAP_TYPE_PNG),
                                     u'Atualizar', pos=(0, 120), size=(145, 40))
        update.Bind(wx.EVT_BUTTON, self.setup)

        # Painel dos gastos
        panel2 = wx.Panel(self, 53, pos=(10, 335), size=(810, 170), style=wx.SUNKEN_BORDER | wx.TAB_TRAVERSAL)
        panel2.SetBackgroundColour(core.COLOR_DEFAULT_BACKGROUND)
        self.list_expenses = wx.gizmos.TreeListCtrl(panel2, -1, pos=(10, 5), size=(620, 160),
                                                    style=wx.SIMPLE_BORDER | wx.TR_DEFAULT_STYLE |
                                                    wx.TR_FULL_ROW_HIGHLIGHT)
        self.list_expenses.AddColumn(u"Data/Horário", width=130)
        self.list_expenses.AddColumn(u"Descrição", width=280)
        self.list_expenses.AddColumn(u"Quantidade", width=90)
        self.list_expenses.AddColumn(u"Valor", width=110)
        self.list_expenses.SetMainColumn(0)
        panel2b = wx.Panel(panel2, pos=(650, 5), size=(145, 160), style=wx.SIMPLE_BORDER)
        splus = GenBitmapTextButton(panel2b, -1,
                                    wx.Bitmap(core.directory_paths['icons'] + 'Add.png', wx.BITMAP_TYPE_PNG),
                                    u'Adicionar gasto', pos=(0, 0), size=(145, 40))
        splus.Bind(wx.EVT_BUTTON, self.open_expense_register)
        sedit = GenBitmapTextButton(panel2b, -1,
                                    wx.Bitmap(core.directory_paths['icons'] + 'Edit.png', wx.BITMAP_TYPE_PNG),
                                    u'Editar gasto', pos=(0, 40), size=(145, 40))
        sedit.Bind(wx.EVT_BUTTON, self.open_expense_edit)
        sremove = GenBitmapTextButton(panel2b, -1,
                                      wx.Bitmap(core.directory_paths['icons'] + 'Trash.png', wx.BITMAP_TYPE_PNG),
                                      u'Apagar gasto', pos=(0, 80), size=(145, 40))
        sremove.Bind(wx.EVT_BUTTON, self.ask_delete_expense)
        supdate = GenBitmapTextButton(panel2b, -1,
                                      wx.Bitmap(core.directory_paths['icons'] + 'Reset.png', wx.BITMAP_TYPE_PNG),
                                      u'Atualizar', pos=(0, 120), size=(145, 40))
        supdate.Bind(wx.EVT_BUTTON, self.setup)

        # Painel dos desperdicios
        panel_last = wx.Panel(self, 56, pos=(10, 515), size=(810, 170), style=wx.SUNKEN_BORDER | wx.TAB_TRAVERSAL)
        panel_last.SetBackgroundColour(core.COLOR_DEFAULT_BACKGROUND)
        self.list_wastes = wx.gizmos.TreeListCtrl(panel_last, -1, pos=(10, 5), size=(620, 160),
                                                  style=wx.SIMPLE_BORDER | wx.TR_DEFAULT_STYLE |
                                                  wx.TR_FULL_ROW_HIGHLIGHT)
        self.list_wastes.AddColumn(u"Descrição", width=280)
        self.list_wastes.AddColumn(u"Quantidade", width=90)
        self.list_wastes.AddColumn(u"Valor", width=110)
        self.list_wastes.SetMainColumn(0)
        panel_last_buttons = wx.Panel(panel_last, pos=(650, 5), size=(145, 160), style=wx.SIMPLE_BORDER)
        wplus = GenBitmapTextButton(panel_last_buttons, -1,
                                    wx.Bitmap(core.directory_paths['icons'] + 'Add.png', wx.BITMAP_TYPE_PNG),
                                    u'Adicionar registro', pos=(0, 0), size=(145, 40))
        wplus.Bind(wx.EVT_BUTTON, self.open_waste_register)
        wedit = GenBitmapTextButton(panel_last_buttons, -1,
                                    wx.Bitmap(core.directory_paths['icons'] + 'Edit.png', wx.BITMAP_TYPE_PNG),
                                    u'Editar registro', pos=(0, 40), size=(145, 40))
        wedit.Bind(wx.EVT_BUTTON, self.open_waste_edit)
        wremove = GenBitmapTextButton(panel_last_buttons, -1,
                                      wx.Bitmap(core.directory_paths['icons'] + 'Trash.png', wx.BITMAP_TYPE_PNG),
                                      u'Apagar registro', pos=(0, 80), size=(145, 40))
        wremove.Bind(wx.EVT_BUTTON, self.ask_delete_waste)
        wupdate = GenBitmapTextButton(panel_last_buttons, -1,
                                      wx.Bitmap(core.directory_paths['icons'] + 'Reset.png', wx.BITMAP_TYPE_PNG),
                                      'Atualizar', pos=(0, 120), size=(145, 40))
        wupdate.Bind(wx.EVT_BUTTON, self.setup, wupdate)

        self.available_lists = [self.list_sales, self.list_expenses, self.list_wastes]

        # Painel com o resulmo do dia
        panel3 = wx.Panel(self, -1, pos=(830, 65), size=(400, 620), style=wx.SUNKEN_BORDER | wx.TAB_TRAVERSAL)
        panel3.SetBackgroundColour(core.COLOR_DEFAULT_BACKGROUND)
        part1 = wx.Panel(panel3, -1, pos=(5, 50), size=(390, 265), style=wx.SUNKEN_BORDER | wx.TAB_TRAVERSAL)
        part2 = wx.Panel(panel3, -1, pos=(5, 320), size=(390, 85), style=wx.SUNKEN_BORDER | wx.TAB_TRAVERSAL)
        part3 = wx.Panel(panel3, -1, pos=(5, 410), size=(390, 200), style=wx.SUNKEN_BORDER | wx.TAB_TRAVERSAL)

        static_money_texts = []
        static_number_texts = []

        self.textbox_day_total = wx.TextCtrl(panel3, -1, "0,00", pos=(315, 10), size=(70, 30), style=wx.TE_READONLY)
        self.textbox_sales_value = wx.TextCtrl(part1, -1, "0,00", pos=(310, 5), size=(70, 30), style=wx.TE_READONLY)
        self.textbox_sales_amount = wx.TextCtrl(part1, -1, "0", pos=(310, 50), size=(70, 30), style=wx.TE_READONLY)
        self.textbox_money_value = wx.TextCtrl(part1, -1, "0,00", pos=(310, 95), size=(70, 30), style=wx.TE_READONLY)
        self.textbox_money_amount = wx.TextCtrl(part1, -1, "0", pos=(310, 140), size=(70, 30), style=wx.TE_READONLY)
        self.textbox_card_value = wx.TextCtrl(part1, -1, "0,00", pos=(310, 185), size=(70, 30), style=wx.TE_READONLY)
        self.textbox_card_amount = wx.TextCtrl(part1, -1, "0", pos=(310, 230), size=(70, 30), style=wx.TE_READONLY)
        self.textbox_spent_value = wx.TextCtrl(part2, -1, "0,00", pos=(310, 5), size=(70, 30), style=wx.TE_READONLY)
        self.textbox_spent_amount = wx.TextCtrl(part2, -1, "0", pos=(310, 50), size=(70, 30), style=wx.TE_READONLY)
        self.textbox_cash_previous = wx.TextCtrl(part3, -1, "0,00", pos=(310, 5), size=(70, 30))
        self.textbox_cash_ideal = wx.TextCtrl(part3, -1, "0,00", pos=(310, 45), size=(70, 30), style=wx.TE_READONLY)
        self.textbox_cash_real = wx.TextCtrl(part3, -1, "0,00", pos=(310, 85), size=(70, 30))
        self.textbox_cash_tomorrow = wx.TextCtrl(part3, -1, "0,00", pos=(310, 125), size=(70, 30), style=wx.TE_READONLY)
        self.textbox_cash_removed = wx.TextCtrl(part3, -1, "0,00", pos=(310, 165), size=(70, 30))

        self.textbox_day_total.Disable()
        self.textbox_sales_value.Disable()
        self.textbox_sales_amount.Disable()
        self.textbox_money_value.Disable()
        self.textbox_money_amount.Disable()
        self.textbox_card_value.Disable()
        self.textbox_card_amount.Disable()
        self.textbox_spent_value.Disable()
        self.textbox_spent_amount.Disable()
        self.textbox_cash_ideal.Disable()
        self.textbox_cash_tomorrow.Disable()

        static_money_texts.append(wx.StaticText(panel3, -1, u"Total do dia", pos=(10, 17)))
        static_money_texts.append(wx.StaticText(part1, -1, u"Total das Vendas", pos=(5, 12)))
        static_number_texts.append(wx.StaticText(part1, -1, u"Quantidade de vendas", pos=(5, 57)))
        static_money_texts.append(wx.StaticText(part1, -1, u"Total das vendas em dinheiro", pos=(5, 102)))
        static_number_texts.append(wx.StaticText(part1, -1, u"Quantidade de vendas em dinheiro", pos=(5, 147)))
        static_money_texts.append(wx.StaticText(part1, -1, u"Total das vendas no cartão", pos=(5, 192)))
        static_number_texts.append(wx.StaticText(part1, -1, u"Quantidade de vendas no cartão", pos=(5, 237)))
        static_money_texts.append(wx.StaticText(part2, -1, u"Total de gastos", pos=(5, 12)))
        static_number_texts.append(wx.StaticText(part2, -1, u"Quantidade de gastos", pos=(5, 57)))
        static_money_texts.append(wx.StaticText(part3, -1, u"Caixa do dia anterior", pos=(5, 12)))
        static_money_texts.append(wx.StaticText(part3, -1, u"Caixa ideal", pos=(5, 52)))
        static_money_texts.append(wx.StaticText(part3, -1, u"Caixa real", pos=(5, 92)))
        static_money_texts.append(wx.StaticText(part3, -1, u"Caixa de amanhã", pos=(5, 132)))
        static_money_texts.append(wx.StaticText(part3, -1, u"Dinheiro retirado", pos=(5, 172)))
        
        self.textbox_cash_previous.Bind(wx.EVT_CHAR, core.check_money)
        self.textbox_cash_real.Bind(wx.EVT_CHAR, core.check_money)
        self.textbox_cash_removed.Bind(wx.EVT_CHAR, core.check_money)

        self.textbox_cash_previous.Bind(wx.EVT_TEXT, self.update_cash)
        self.textbox_cash_real.Bind(wx.EVT_TEXT, self.update_cash)
        self.textbox_cash_removed.Bind(wx.EVT_TEXT, self.update_cash)

        # Adiciona os pontos em cada linha com os numeros a direita para facilitar a leitura
        mon = self.GetTextExtent('R$')[0]
        dot = self.GetTextExtent('.')[0]
        space = 302
        for box in static_money_texts:
            wid = box.GetSize()[0]
            post = box.GetPosition()[1]
            free = space - wid
            free = free - mon
            dots = free // dot
            if box is static_money_texts[0]:
                wx.StaticText(box.GetParent(), -1, '.' * dots + 'R$', pos=(10 + wid, post))
            else:
                wx.StaticText(box.GetParent(), -1, '.' * dots + 'R$', pos=(5 + wid, post))

        for box in static_number_texts:
            wid = box.GetSize()[0]
            post = box.GetPosition()[1]
            free = space - wid
            dots = free // dot
            wx.StaticText(box.GetParent(), -1, '.' * dots, pos=(5 + wid, post))
Ejemplo n.º 16
0
    def __init__(self, parent):
        wx.Frame.__init__(self,
                          parent,
                          id=wx.ID_ANY,
                          title=wx.EmptyString,
                          pos=wx.DefaultPosition,
                          size=wx.Size(913, 641),
                          style=wx.DEFAULT_FRAME_STYLE | wx.TAB_TRAVERSAL)

        self.SetSizeHints(wx.DefaultSize, wx.DefaultSize)
        self.SetBackgroundColour(
            wx.SystemSettings.GetColour(wx.SYS_COLOUR_INACTIVECAPTION))

        bSizer1 = wx.BoxSizer(wx.HORIZONTAL)

        bSizer2 = wx.BoxSizer(wx.HORIZONTAL)

        bSizer3 = wx.BoxSizer(wx.VERTICAL)

        sbSizer1 = wx.StaticBoxSizer(wx.StaticBox(self, wx.ID_ANY, u"原始图像"),
                                     wx.VERTICAL)

        self.orgin_img = wx.StaticBitmap(sbSizer1.GetStaticBox(), wx.ID_ANY,
                                         wx.NullBitmap, wx.DefaultPosition,
                                         wx.DefaultSize, 0)
        sbSizer1.Add(self.orgin_img, 1, wx.ALL | wx.EXPAND, 5)

        bSizer3.Add(sbSizer1, 1, wx.EXPAND, 5)

        sbSizer2 = wx.StaticBoxSizer(wx.StaticBox(self, wx.ID_ANY, u"人姿和手部检测"),
                                     wx.VERTICAL)

        self.result_img = wx.StaticBitmap(sbSizer2.GetStaticBox(), wx.ID_ANY,
                                          wx.NullBitmap, wx.DefaultPosition,
                                          wx.DefaultSize, 0)
        sbSizer2.Add(self.result_img, 1, wx.ALL | wx.EXPAND, 5)

        bSizer3.Add(sbSizer2, 1, wx.EXPAND, 5)

        bSizer2.Add(bSizer3, 1, wx.EXPAND, 5)

        bSizer4 = wx.BoxSizer(wx.VERTICAL)

        sbSizer3 = wx.StaticBoxSizer(wx.StaticBox(self, wx.ID_ANY, u"运行日志"),
                                     wx.VERTICAL)

        self.tips = wx.TextCtrl(sbSizer3.GetStaticBox(), wx.ID_ANY,
                                wx.EmptyString, wx.DefaultPosition,
                                wx.DefaultSize,
                                wx.TE_MULTILINE | wx.TE_READONLY)
        sbSizer3.Add(self.tips, 1, wx.ALL | wx.EXPAND, 5)

        bSizer4.Add(sbSizer3, 1, wx.EXPAND, 5)

        sbSizer4 = wx.StaticBoxSizer(wx.StaticBox(self, wx.ID_ANY, u"检测结果"),
                                     wx.VERTICAL)

        self.result = wx.TextCtrl(sbSizer4.GetStaticBox(), wx.ID_ANY,
                                  wx.EmptyString, wx.DefaultPosition,
                                  wx.DefaultSize,
                                  wx.TE_MULTILINE | wx.TE_READONLY)
        sbSizer4.Add(self.result, 1, wx.ALL | wx.EXPAND, 5)

        bSizer4.Add(sbSizer4, 1, wx.EXPAND, 5)

        bSizer2.Add(bSizer4, 1, wx.EXPAND, 5)

        bSizer5 = wx.BoxSizer(wx.VERTICAL)

        sbSizer5 = wx.StaticBoxSizer(wx.StaticBox(self, wx.ID_ANY, u"控制台"),
                                     wx.VERTICAL)

        sbSizer6 = wx.StaticBoxSizer(
            wx.StaticBox(sbSizer5.GetStaticBox(), wx.ID_ANY, u"选择视频或文件"),
            wx.HORIZONTAL)

        self.m_button7 = wx.Button(sbSizer6.GetStaticBox(), wx.ID_ANY, u"选择图片",
                                   wx.DefaultPosition, wx.DefaultSize, 0)
        sbSizer6.Add(self.m_button7, 1, wx.ALL | wx.EXPAND, 5)

        self.m_button8 = wx.Button(sbSizer6.GetStaticBox(), wx.ID_ANY, u"选择视频",
                                   wx.DefaultPosition, wx.DefaultSize, 0)
        sbSizer6.Add(self.m_button8, 1, wx.ALL | wx.EXPAND, 5)

        sbSizer5.Add(sbSizer6, 0, wx.EXPAND, 5)

        sbSizer7 = wx.StaticBoxSizer(
            wx.StaticBox(sbSizer5.GetStaticBox(), wx.ID_ANY, u"特征提取"),
            wx.VERTICAL)

        self.m_button1 = wx.Button(sbSizer7.GetStaticBox(), wx.ID_ANY, u"特征提取",
                                   wx.DefaultPosition, wx.DefaultSize, 0)
        sbSizer7.Add(self.m_button1, 0, wx.ALL | wx.EXPAND, 5)

        sbSizer5.Add(sbSizer7, 0, wx.EXPAND, 5)

        sbSizer8 = wx.StaticBoxSizer(
            wx.StaticBox(sbSizer5.GetStaticBox(), wx.ID_ANY, u"手语预测"),
            wx.VERTICAL)

        self.m_button5 = wx.Button(sbSizer8.GetStaticBox(), wx.ID_ANY,
                                   u"选择分类模型", wx.DefaultPosition,
                                   wx.DefaultSize, 0)
        sbSizer8.Add(self.m_button5, 0, wx.ALL | wx.EXPAND, 5)

        self.m_button6 = wx.Button(sbSizer8.GetStaticBox(), wx.ID_ANY, u"预测",
                                   wx.DefaultPosition, wx.DefaultSize, 0)
        sbSizer8.Add(self.m_button6, 0, wx.ALL | wx.EXPAND, 5)

        sbSizer5.Add(sbSizer8, 0, wx.EXPAND, 5)

        sbSizer9 = wx.StaticBoxSizer(
            wx.StaticBox(sbSizer5.GetStaticBox(), wx.ID_ANY, u"示例图"),
            wx.VERTICAL)

        self.black_img = wx.StaticBitmap(sbSizer9.GetStaticBox(), wx.ID_ANY,
                                         wx.NullBitmap, wx.DefaultPosition,
                                         wx.DefaultSize, 0)
        sbSizer9.Add(self.black_img, 1, wx.ALL | wx.EXPAND, 5)

        sbSizer5.Add(sbSizer9, 1, wx.EXPAND, 5)

        bSizer5.Add(sbSizer5, 1, wx.EXPAND, 5)

        bSizer2.Add(bSizer5, 1, wx.EXPAND, 5)

        bSizer1.Add(bSizer2, 1, wx.EXPAND, 5)

        self.SetSizer(bSizer1)
        self.Layout()
        self.m_menubar1 = wx.MenuBar(0)
        self.m_menubar1.SetForegroundColour(
            wx.SystemSettings.GetColour(wx.SYS_COLOUR_ACTIVECAPTION))
        self.m_menubar1.SetBackgroundColour(
            wx.SystemSettings.GetColour(wx.SYS_COLOUR_ACTIVECAPTION))

        self.m_menu1 = wx.Menu()
        self.m_menuItem1 = wx.MenuItem(self.m_menu1, wx.ID_ANY, u"图片",
                                       wx.EmptyString, wx.ITEM_NORMAL)
        self.m_menu1.Append(self.m_menuItem1)

        self.m_menuItem2 = wx.MenuItem(self.m_menu1, wx.ID_ANY, u"视频",
                                       wx.EmptyString, wx.ITEM_NORMAL)
        self.m_menu1.Append(self.m_menuItem2)

        self.m_menubar1.Append(self.m_menu1, u"检测")

        self.m_menu2 = wx.Menu()
        self.m_menubar1.Append(self.m_menu2, u"采集")

        self.m_menu3 = wx.Menu()
        self.m_menubar1.Append(self.m_menu3, u"关于")

        self.SetMenuBar(self.m_menubar1)

        self.m_statusBar2 = self.CreateStatusBar(1, wx.STB_SIZEGRIP, wx.ID_ANY)
        self.m_statusBar2.SetForegroundColour(
            wx.SystemSettings.GetColour(wx.SYS_COLOUR_ACTIVECAPTION))
        self.m_statusBar2.SetBackgroundColour(
            wx.SystemSettings.GetColour(wx.SYS_COLOUR_ACTIVECAPTION))

        self.Centre(wx.BOTH)

        # Connect Events
        self.m_button7.Bind(wx.EVT_BUTTON, self.img_btn)
        self.m_button8.Bind(wx.EVT_BUTTON, self.video_btn)
        self.m_button1.Bind(wx.EVT_BUTTON, self.feature_btn)
        self.m_button5.Bind(wx.EVT_BUTTON, self.chosemodel_btn)
        self.m_button6.Bind(wx.EVT_BUTTON, self.predict_btn)
Ejemplo n.º 17
0
    def __init__(self, parent, set_dir=None):
        wx.Dialog.__init__(self,
                           parent,
                           -1,
                           "Image Browser",
                           wx.DefaultPosition, (400, 400),
                           style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER)

        self.set_dir = os.getcwd()
        self.set_file = None

        if set_dir != None:
            if os.path.exists(
                    set_dir):  # set to working directory if nothing set
                self.set_dir = set_dir

        vbox_top = wx.BoxSizer(wx.VERTICAL)
        self.SetSizer(vbox_top)

        hbox_loc = wx.BoxSizer(wx.HORIZONTAL)
        vbox_top.Add(hbox_loc, 0, wx.GROW | wx.ALIGN_LEFT | wx.ALL, 0)

        loc_label = wx.StaticText(self, -1, "Folder:")
        hbox_loc.Add(
            loc_label, 0, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL
            | wx.ADJUST_MINSIZE, 5)

        self.dir = wx.TextCtrl(self,
                               -1,
                               self.set_dir,
                               style=wx.TE_RICH | wx.TE_PROCESS_ENTER)
        self.Bind(wx.EVT_TEXT_ENTER, self.OnDirectoryTextSet, self.dir)
        hbox_loc.Add(self.dir, 1, wx.GROW | wx.ALIGN_LEFT | wx.ALL, 5)

        up_bmp = wx.ArtProvider.GetBitmap(wx.ART_GO_DIR_UP, wx.ART_BUTTON,
                                          (16, 16))
        btn = wx.BitmapButton(self, -1, up_bmp)
        btn.SetHelpText("Up one level")
        btn.SetToolTipString("Up one level")
        self.Bind(wx.EVT_BUTTON, self.OnUpDirectory, btn)
        hbox_loc.Add(btn, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 2)

        folder_bmp = wx.ArtProvider.GetBitmap(wx.ART_FOLDER_OPEN,
                                              wx.ART_BUTTON, (16, 16))
        btn = wx.BitmapButton(self, -1, folder_bmp)
        btn.SetHelpText("Browse for a &folder...")
        btn.SetToolTipString("Browse for a folder...")
        self.Bind(wx.EVT_BUTTON, self.OnChooseDirectory, btn)
        hbox_loc.Add(btn, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 5)

        hbox_nav = wx.BoxSizer(wx.HORIZONTAL)
        vbox_top.Add(hbox_nav, 0, wx.ALIGN_LEFT | wx.ALL, 0)

        label = wx.StaticText(self, -1, "Files of type:")
        hbox_nav.Add(label, 0, wx.ALIGN_CENTER_VERTICAL | wx.LEFT, 5)

        self.fl_ext = '*.bmp'  # initial setting for file filtering
        self.GetFiles()  # get the file list

        self.fl_ext_types = (
            # display, filter
            ("All supported formats", "All"),
            ("BMP (*.bmp)", "*.bmp"),
            ("GIF (*.gif)", "*.gif"),
            ("PNG (*.png)", "*.png"),
            ("JPEG (*.jpg)", "*.jpg"),
            ("ICO (*.ico)", "*.ico"),
            ("PNM (*.pnm)", "*.pnm"),
            ("PCX (*.pcx)", "*.pcx"),
            ("TIFF (*.tif)", "*.tif"),
            ("All Files", "*.*"),
        )
        self.set_type, self.fl_ext = self.fl_ext_types[
            0]  # initial file filter setting
        self.fl_types = [x[0] for x in self.fl_ext_types]
        self.sel_type = wx.ComboBox(self, -1, self.set_type,
                                    wx.DefaultPosition, wx.DefaultSize,
                                    self.fl_types, wx.CB_DROPDOWN)
        # after this we don't care about the order any more
        self.fl_ext_types = dict(self.fl_ext_types)

        self.Bind(wx.EVT_COMBOBOX, self.OnSetType, self.sel_type)
        hbox_nav.Add(self.sel_type, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALL, 5)

        splitter = wx.SplitterWindow(self, -1, wx.DefaultPosition,
                                     wx.Size(100, 100), 0)
        splitter.SetMinimumPaneSize(100)

        split_left = wx.Panel(splitter, -1, wx.DefaultPosition, wx.DefaultSize,
                              wx.NO_BORDER | wx.TAB_TRAVERSAL)
        vbox_left = wx.BoxSizer(wx.VERTICAL)
        split_left.SetSizer(vbox_left)

        self.tb = tb = wx.ListBox(split_left, -1, wx.DefaultPosition,
                                  wx.DefaultSize, self.fl_list, wx.LB_SINGLE)
        self.Bind(wx.EVT_LISTBOX, self.OnListClick, tb)
        self.Bind(wx.EVT_LISTBOX_DCLICK, self.OnListDClick, tb)
        vbox_left.Add(self.tb, 1, wx.GROW | wx.ALL, 0)

        width, height = self.tb.GetSize()

        split_right = wx.Panel(splitter, -1, wx.DefaultPosition,
                               wx.DefaultSize, wx.NO_BORDER | wx.TAB_TRAVERSAL)
        vbox_right = wx.BoxSizer(wx.VERTICAL)
        split_right.SetSizer(vbox_right)

        self.image_view = ImagePanel(split_right)
        vbox_right.Add(self.image_view, 1, wx.GROW | wx.ALL, 0)

        splitter.SplitVertically(split_left, split_right, 150)
        vbox_top.Add(splitter, 1, wx.GROW | wx.ALL, 5)

        hbox_btns = wx.BoxSizer(wx.HORIZONTAL)
        vbox_top.Add(hbox_btns, 0, wx.ALIGN_RIGHT | wx.ALL, 5)

        ok_btn = wx.Button(self, wx.ID_OPEN, "", wx.DefaultPosition,
                           wx.DefaultSize, 0)
        self.Bind(wx.EVT_BUTTON, self.OnOk, ok_btn)
        #ok_btn.SetDefault()
        hbox_btns.Add(ok_btn, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALL, 5)

        cancel_btn = wx.Button(self, wx.ID_CANCEL, "", wx.DefaultPosition,
                               wx.DefaultSize, 0)
        hbox_btns.Add(cancel_btn, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALL, 5)

        self.ResetFiles()
Ejemplo n.º 18
0
    def CalcMin(self):
        """
        Calculate the minimum size.
        
        :rtype: :ref:`Size`
        
        """
        numrows, numcols = self.CalcNumRowsCols()
        numchild = len(self.GetChildren())

        if numchild == 0:
            return wx.Size(10, 10)

        if numrows == 0 and numcols == 0:
            print(
                "TableSizer must have the number of rows or columns set. Cannot continue."
            )
            return wx.Size(10, 10)

        self.row_widths = [0 for x in range(0, numrows)]
        self.col_heights = [0 for x in range(0, numcols)]
        currentRow = 0
        currentCol = 0
        counter = 0
        self.hgrow = 0
        self.vgrow = 0

        # get the max row width and max column height
        for item in self.GetChildren():
            if self.cols != 0:
                currentRow, currentCol = divmod(counter, numcols)
            else:
                currentCol, currentRow = divmod(counter, numrows)

            if item.IsShown():
                width, height = item.CalcMin()

                if self.isVertical and item.GetProportion() > 0:
                    self.hgrow += item.GetProportion()
                elif self.isHorizontal and item.GetProportion() > 0:
                    self.vgrow += item.GetProportion()

                if width > self.row_widths[currentRow]:
                    self.row_widths[currentRow] = width

                if height > self.col_heights[currentCol]:
                    self.col_heights[currentCol] = height

            counter += 1

        minwidth = 0
        for row_width in self.row_widths:
            minwidth += row_width

        minheight = 0
        for col_height in self.col_heights:
            minheight += col_height

        self.fixed_width = minwidth
        self.fixed_height = minheight

        return wx.Size(minwidth, minheight)
Ejemplo n.º 19
0
    def __init__(self,
                 parent,
                 id=wx.ID_ANY,
                 pos=wx.DefaultPosition,
                 size=wx.DefaultSize,
                 style=wx.NO_BORDER,
                 name="AnalogClock",
                 clockStyle=DEFAULT_CLOCK_STYLE,
                 minutesStyle=TICKS_CIRCLE,
                 hoursStyle=TICKS_POLY):

        wx.Window.__init__(self, parent, id, pos, size, style, name)

        # Base size for scale calc purposes.
        self.basesize = wx.Size(348, 348)

        # Store some references.
        self.clockStyle = clockStyle
        self.minutesStyle = minutesStyle
        self.hoursStyle = hoursStyle

        self.DrawHands = self._drawHands
        self.DrawBox = self._drawBox
        self.RecalcCoords = self._recalcCoords

        self.shadowOffset = 3

        self.allHandStyles = [
            SHOW_HOURS_HAND, SHOW_MINUTES_HAND, SHOW_SECONDS_HAND
        ]

        # Initialize clock face.
        #
        # By default we don't use colours or borders on the clock face.
        bg = self.GetBackgroundColour()
        face = Face(dyer=Dyer(bg, 0, bg))

        # Initialize tick marks.
        #
        # TickSet is a set of tick marks; there's always two TickSets defined
        # regardless whether they're being shown or not.
        ticksM = TickSet(self, style=minutesStyle, size=5, kind="minutes")
        ticksH = TickSet(self,
                         style=hoursStyle,
                         size=25,
                         kind="hours",
                         rotate=clockStyle & ROTATE_TICKS)

        # Box holds the clock face and tick marks.
        self.Box = Box(self, face, ticksM, ticksH)

        # Initialize hands.
        #
        # HandSet is the set of hands; there's always one HandSet defined
        # regardless whether hands are being shown or not.
        #
        # A 'lenfac = 0.95', e.g., means that the length of that hand will
        # be 95% of the maximum allowed hand length ('nice' maximum length).
        handH = Hand(size=7, lenfac=0.7)
        handM = Hand(size=5, lenfac=0.95)
        handS = Hand(size=1, lenfac=0.95)
        self.Hands = HandSet(self, handH, handM, handS)

        # Create the customization dialog.
        self.Setup = None

        # Make a context menu.
        popup1 = wx.NewIdRef()
        popup2 = wx.NewIdRef()
        cm = self.cm = wx.Menu()
        cm.Append(popup1, "Customize...")
        cm.Append(popup2, "About...")

        # Set event handlers.
        self.Bind(wx.EVT_SIZE, self._OnSize)
        self.Bind(wx.EVT_PAINT, self._OnPaint)
        self.Bind(wx.EVT_ERASE_BACKGROUND, lambda evt: None)
        self.Bind(wx.EVT_TIMER, self._OnTimer)
        self.Bind(wx.EVT_WINDOW_DESTROY, self._OnDestroyWindow)
        self.Bind(wx.EVT_CONTEXT_MENU, self._OnContextMenu)
        self.Bind(wx.EVT_MENU, self._OnShowSetup, id=popup1)
        self.Bind(wx.EVT_MENU, self._OnShowAbout, id=popup2)

        # Set initial size based on given size, or best size
        self.SetInitialSize(size)

        # Do initial drawing (in case there is not an initial size event)
        self.RecalcCoords(self.GetSize())
        self.DrawBox()

        # Initialize the timer that drives the update of the clock face.
        # Update every half second to ensure that there is at least one true
        # update during each realtime second.
        self.timer = wx.Timer(self)
        self.timer.Start(500)
Ejemplo n.º 20
0
    def RecalcSizes(self):
        """
        Recalculate the sizes.
        """

        numrows, numcols = self.CalcNumRowsCols()
        numchild = len(self.GetChildren())

        if numchild == 0:
            return
        currentRow = 0
        currentCol = 0
        counter = 0

        print("cols %d, rows %d" % (self.cols, self.rows))
        print("fixed_height %d, fixed_width %d" %
              (self.fixed_height, self.fixed_width))
        #print("self.GetSize() = " + `self.GetSize()`)

        row_widths = [0 for x in range(0, numrows)]
        col_heights = [0 for x in range(0, numcols)]
        item_sizes = [0 for x in range(0, len(self.GetChildren()))]
        grow_sizes = [0 for x in range(0, len(self.GetChildren()))]

        curHPos = 0
        curVPos = 0
        curCol = 0
        curRow = 0
        # first, we set sizes for all children, and while doing so, calc
        # the maximum row heights and col widths. Then, afterwards we handle
        # the positioning of the controls

        for item in self.GetChildren():
            if self.cols != 0:
                currentRow, currentCol = divmod(counter, numcols)
            else:
                currentCol, currentRow = divmod(counter, numrows)
            if item.IsShown():
                item_minsize = item.GetMinSizeWithBorder()
                width = item_minsize[0]
                height = item_minsize[1]

                print("row_height %d, row_width %d" %
                      (self.col_heights[currentCol],
                       self.row_widths[currentRow]))
                growable_width = (self.GetSize()[0]) - width
                growable_height = (self.GetSize()[1]) - height

                #if not self.isVertical and not self.isHorizontal:
                #    growable_width = self.GetSize()[0] - self.row_widths[currentRow]
                #    growable_height = self.GetSize()[1] - self.col_heights[currentCol]

                #print("grow_height %d, grow_width %d" % (growable_height, growable_width))

                item_vgrow = 0
                item_hgrow = 0
                # support wx.EXPAND for box sizers to be compatible
                if item.GetFlag() & wx.EXPAND:
                    if self.isVertical:
                        if self.hgrow > 0 and item.GetProportion() > 0:
                            item_hgrow = (growable_width *
                                          item.GetProportion()) / self.hgrow
                        item_vgrow = growable_height

                    elif self.isHorizontal:
                        if self.vgrow > 0 and item.GetProportion() > 0:
                            item_vgrow = (growable_height *
                                          item.GetProportion()) / self.vgrow
                        item_hgrow = growable_width

                if growable_width > 0 and item.GetHGrow() > 0:
                    item_hgrow = (growable_width * item.GetHGrow()) / 100
                    print("hgrow = %d" % (item_hgrow))

                if growable_height > 0 and item.GetVGrow() > 0:
                    item_vgrow = (growable_height * item.GetVGrow()) / 100
                    print("vgrow = %d" % (item_vgrow))

                grow_size = wx.Size(item_hgrow, item_vgrow)
                size = item_minsize  #wx.Size(item_minsize[0] + item_hgrow, item_minsize[1] + item_vgrow)
                if size[0] + grow_size[0] > row_widths[currentRow]:
                    row_widths[currentRow] = size[0] + grow_size[0]
                if size[1] + grow_size[1] > col_heights[currentCol]:
                    col_heights[currentCol] = size[1] + grow_size[1]

                grow_sizes[counter] = grow_size
                item_sizes[counter] = size

            counter += 1

        counter = 0
        for item in self.GetChildren():
            if self.cols != 0:
                currentRow, currentCol = divmod(counter, numcols)
            else:
                currentCol, currentRow = divmod(counter, numrows)

            itempos = self.GetPosition()
            if item.IsShown():
                rowstart = itempos[0]
                for row in range(0, currentRow):
                    rowstart += row_widths[row]

                colstart = itempos[1]
                for col in range(0, currentCol):
                    #print("numcols = %d, currentCol = %d, col = %d" % (numcols, currentCol, col))
                    colstart += col_heights[col]

                itempos[0] += rowstart
                itempos[1] += colstart

                if item.GetFlag() & wx.ALIGN_RIGHT:
                    itempos[0] += (row_widths[currentRow] -
                                   item_sizes[counter][0])
                elif item.GetFlag() & (wx.ALIGN_CENTER
                                       | wx.ALIGN_CENTER_HORIZONTAL):
                    itempos[0] += (row_widths[currentRow] -
                                   item_sizes[counter][0]) / 2

                if item.GetFlag() & wx.ALIGN_BOTTOM:
                    itempos[1] += (col_heights[currentCol] -
                                   item_sizes[counter][1])
                elif item.GetFlag() & (wx.ALIGN_CENTER
                                       | wx.ALIGN_CENTER_VERTICAL):
                    itempos[1] += (col_heights[currentCol] -
                                   item_sizes[counter][1]) / 2

                hgrowth = (grow_sizes[counter][0] - itempos[0])
                if hgrowth > 0:
                    item_sizes[counter][0] += hgrowth

                vgrowth = (grow_sizes[counter][1] - itempos[1])
                if vgrowth > 0:
                    item_sizes[counter][1] += vgrowth
                #item_sizes[counter][1] -= itempos[1]
                item.SetDimension(itempos, item_sizes[counter])

            counter += 1
Ejemplo n.º 21
0
    def __init__(self, parent):
        wx.Dialog.__init__(self,
                           parent,
                           id=wx.ID_ANY,
                           title=u"Implant Set Editor",
                           size=wx.Size(640, 600))

        self.block = False
        self.SetSizeHintsSz(wx.DefaultSize, wx.DefaultSize)

        mainSizer = wx.BoxSizer(wx.VERTICAL)

        self.entityEditor = ImplantSetEntityEditor(self)
        mainSizer.Add(self.entityEditor, 0, wx.ALL | wx.EXPAND, 2)

        self.sl = wx.StaticLine(self)
        mainSizer.Add(self.sl, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)

        self.iview = ImplantSetEditor(self)
        mainSizer.Add(self.iview, 1, wx.ALL | wx.EXPAND, 5)

        self.slfooter = wx.StaticLine(self)
        mainSizer.Add(self.slfooter, 0, wx.EXPAND | wx.TOP, 5)

        footerSizer = wx.BoxSizer(wx.HORIZONTAL)

        self.stNotice = wx.StaticText(self, wx.ID_ANY, u"")
        self.stNotice.Wrap(-1)
        footerSizer.Add(self.stNotice, 1, wx.BOTTOM | wx.TOP | wx.LEFT, 5)

        if "wxGTK" in wx.PlatformInfo:
            self.closeBtn = wx.Button(self, wx.ID_ANY, u"Close",
                                      wx.DefaultPosition, wx.DefaultSize, 0)
            mainSizer.Add(self.closeBtn, 0, wx.ALL | wx.ALIGN_RIGHT, 5)
            self.closeBtn.Bind(wx.EVT_BUTTON, self.closeEvent)

        importExport = (("Import", wx.ART_FILE_OPEN, "from"),
                        ("Export", wx.ART_FILE_SAVE_AS, "to"))

        for name, art, direction in importExport:
            bitmap = wx.ArtProvider.GetBitmap(art, wx.ART_BUTTON)
            btn = wx.BitmapButton(self, wx.ID_ANY, bitmap)

            btn.SetMinSize(btn.GetSize())
            btn.SetMaxSize(btn.GetSize())

            btn.Layout()
            setattr(self, name, btn)
            btn.Enable(True)
            btn.SetToolTipString("%s implant sets %s clipboard" %
                                 (name, direction))
            footerSizer.Add(btn, 0,
                            wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_RIGHT)

        mainSizer.Add(footerSizer, 0, wx.ALL | wx.EXPAND, 5)

        self.SetSizer(mainSizer)
        self.Layout()

        if not self.entityEditor.checkEntitiesExist():
            self.Destroy()
            return

        self.Bind(wx.EVT_CHOICE, self.entityChanged)

        self.Import.Bind(wx.EVT_BUTTON, self.importPatterns)
        self.Export.Bind(wx.EVT_BUTTON, self.exportPatterns)

        self.CenterOnParent()
        self.ShowModal()
Ejemplo n.º 22
0
    def __init__(self, parent):
        wx.Frame.__init__(self,
                          parent,
                          id=wx.ID_ANY,
                          title=u"Metodo Cuadrados Medios IM15005 - TS2018",
                          pos=wx.DefaultPosition,
                          size=wx.Size(450, 500),
                          style=wx.DEFAULT_FRAME_STYLE | wx.TAB_TRAVERSAL)

        #self.SetSizeHints( wx.DefaultSize, wx.DefaultSize )
        self.SetBackgroundColour(
            wx.SystemSettings.GetColour(wx.SYS_COLOUR_BACKGROUND))

        fgSizer2 = wx.FlexGridSizer(6, 3, 0, 0)
        fgSizer2.SetFlexibleDirection(wx.BOTH)
        fgSizer2.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED)

        fgSizer2.Add((0, 20), 1, wx.EXPAND, 5)

        fgSizer2.Add((0, 20), 1, wx.EXPAND, 5)

        fgSizer2.Add((0, 20), 1, wx.EXPAND, 5)

        fgSizer2.Add((20, 0), 1, wx.EXPAND, 5)

        self.m_staticText2 = wx.StaticText(self, wx.ID_ANY,
                                           u"Pseudo Aleatorios a Generar",
                                           wx.DefaultPosition, wx.DefaultSize,
                                           0)
        self.m_staticText2.Wrap(-1)
        fgSizer2.Add(self.m_staticText2, 0, wx.ALL, 5)

        self.txt1 = wx.TextCtrl(self, wx.ID_ANY, wx.EmptyString,
                                wx.DefaultPosition, wx.DefaultSize, 0)
        fgSizer2.Add(self.txt1, 0, wx.ALL, 5)

        fgSizer2.Add((20, 0), 1, wx.EXPAND, 5)

        self.m_staticText21 = wx.StaticText(self, wx.ID_ANY, u"Valor Semilla",
                                            wx.DefaultPosition, wx.DefaultSize,
                                            0)
        self.m_staticText21.Wrap(-1)
        fgSizer2.Add(self.m_staticText21, 0, wx.ALL, 5)

        self.txt2 = wx.TextCtrl(self, wx.ID_ANY, wx.EmptyString,
                                wx.DefaultPosition, wx.DefaultSize, 0)
        fgSizer2.Add(self.txt2, 0, wx.ALL, 5)

        fgSizer2.Add((20, 0), 1, wx.EXPAND, 5)

        fgSizer2.Add((20, 0), 1, wx.EXPAND, 5)

        self.m_button1 = wx.Button(self, wx.ID_ANY, u"Procesar",
                                   wx.DefaultPosition, wx.DefaultSize, 0)
        fgSizer2.Add(self.m_button1, 0, wx.ALL, 5)

        fgSizer2.Add((0, 0), 1, wx.EXPAND, 5)

        self.list_ctrl = wx.ListCtrl(self,
                                     wx.ID_ANY,
                                     pos=(255, 100),
                                     size=(300, 200),
                                     style=wx.LC_REPORT)
        self.list_ctrl.InsertColumn(0, 'n', width=50)
        self.list_ctrl.InsertColumn(1, 'Medios', width=120)
        self.list_ctrl.InsertColumn(2, 'Pseudoaleatorios', width=130)
        fgSizer2.Add(self.list_ctrl, 0, wx.ALL, 5)

        fgSizer2.Add((0, 0), 1, wx.EXPAND, 5)

        fgSizer2.Add((0, 0), 1, wx.EXPAND, 5)

        fgSizer2.Add((0, 0), 1, wx.EXPAND, 5)

        self.m_button2 = wx.Button(self, wx.ID_ANY, u"Salir",
                                   wx.DefaultPosition, wx.DefaultSize, 0)
        fgSizer2.Add(self.m_button2, 0, wx.ALL, 5)

        self.SetSizer(fgSizer2)
        self.Layout()

        self.Centre(wx.BOTH)

        # Connect Events
        self.m_button1.Bind(wx.EVT_BUTTON, self.eventClick)
        self.m_button2.Bind(wx.EVT_BUTTON, self.eventC)
Ejemplo n.º 23
0
    def __init__(self, parent, id, title, transcript_object):
        """ Create the Transcript Properties form """
        self.width = 500
        self.height = 260
        # Make the Keyword Edit List resizable by passing wx.RESIZE_BORDER style
        Dialogs.GenForm.__init__(self,
                                 parent,
                                 id,
                                 title,
                                 size=(self.width, self.height),
                                 style=wx.DEFAULT_DIALOG_STYLE
                                 | wx.RESIZE_BORDER,
                                 useSizers=True,
                                 HelpContext='Transcript Properties')

        # Define the form's main object
        self.obj = transcript_object

        # Create the form's main VERTICAL sizer
        mainSizer = wx.BoxSizer(wx.VERTICAL)
        # Create a HORIZONTAL sizer for the first row
        r1Sizer = wx.BoxSizer(wx.HORIZONTAL)

        # Create a VERTICAL sizer for the next element
        v1 = wx.BoxSizer(wx.VERTICAL)
        # Add the Transcript ID element
        self.id_edit = self.new_edit_box(_("Transcript ID"),
                                         v1,
                                         self.obj.id,
                                         maxLen=100)
        # Add the element to the sizer
        r1Sizer.Add(v1, 1, wx.EXPAND)

        # Add the row sizer to the main vertical sizer
        mainSizer.Add(r1Sizer, 0, wx.EXPAND)

        # Add a vertical spacer to the main sizer
        mainSizer.Add((0, 10))

        # Create a HORIZONTAL sizer for the next row
        r2Sizer = wx.BoxSizer(wx.HORIZONTAL)

        # Create a VERTICAL sizer for the next element
        v2 = wx.BoxSizer(wx.VERTICAL)
        # Add the Series ID element
        series_id_edit = self.new_edit_box(_("Series ID"), v2,
                                           self.obj.series_id)
        # Add the element to the row sizer
        r2Sizer.Add(v2, 1, wx.EXPAND)
        # Disable Series ID
        series_id_edit.Enable(False)

        # Add a horizontal spacer to the row sizer
        r2Sizer.Add((10, 0))

        # Create a VERTICAL sizer for the next element
        v3 = wx.BoxSizer(wx.VERTICAL)
        # Add the Episode ID element
        episode_id_edit = self.new_edit_box(_("Episode ID"), v3,
                                            self.obj.episode_id)
        # Add the element to the row sizer
        r2Sizer.Add(v3, 1, wx.EXPAND)
        # Disable Episode ID
        episode_id_edit.Enable(False)

        # Add the row sizer to the main vertical sizer
        mainSizer.Add(r2Sizer, 0, wx.EXPAND)

        # Add a vertical spacer to the main sizer
        mainSizer.Add((0, 10))

        # Create a HORIZONTAL sizer for the next row
        r3Sizer = wx.BoxSizer(wx.HORIZONTAL)

        # Create a VERTICAL sizer for the next element
        v4 = wx.BoxSizer(wx.VERTICAL)
        # Add the Transcriber element
        transcriber_edit = self.new_edit_box(_("Transcriber"),
                                             v4,
                                             self.obj.transcriber,
                                             maxLen=100)
        # Add the element to the row sizer
        r3Sizer.Add(v4, 3, wx.EXPAND | wx.RIGHT, 10)

        # Create a VERTICAL sizer for the next element
        v7 = wx.BoxSizer(wx.VERTICAL)
        # Add the Min Transcript Width element
        mintranscriptwidth = self.new_edit_box(
            _("Min. Width"), v7, str(self.obj.minTranscriptWidth))
        # Add the element to the row sizer
        r3Sizer.Add(v7, 1, wx.EXPAND)

        # Add the row sizer to the main vertical sizer
        mainSizer.Add(r3Sizer, 0, wx.EXPAND)

        # Add a vertical spacer to the main sizer
        mainSizer.Add((0, 10))

        # Create a HORIZONTAL sizer for the next row
        r4Sizer = wx.BoxSizer(wx.HORIZONTAL)

        # Create a VERTICAL sizer for the next element
        v5 = wx.BoxSizer(wx.VERTICAL)
        # Add the Comment element
        comment_edit = self.new_edit_box(_("Comment"),
                                         v5,
                                         self.obj.comment,
                                         maxLen=255)
        # Add the element to the row sizer
        r4Sizer.Add(v5, 1, wx.EXPAND)

        # Add the row sizer to the main vertical sizer
        mainSizer.Add(r4Sizer, 0, wx.EXPAND)

        # Add a vertical spacer to the main sizer
        mainSizer.Add((0, 10))

        # Create a HORIZONTAL sizer for the next row
        r5Sizer = wx.BoxSizer(wx.HORIZONTAL)

        # Create a VERTICAL sizer for the next element
        v6 = wx.BoxSizer(wx.VERTICAL)
        # Add the Import File element
        self.rtfname_edit = self.new_edit_box(
            _("RTF/XML/TXT File to import  (optional)"), v6, '')
        # Make this text box a File Drop Target
        self.rtfname_edit.SetDropTarget(
            EditBoxFileDropTarget(self.rtfname_edit))
        # Add the element to the row sizer
        r5Sizer.Add(v6, 1, wx.EXPAND)

        # Add a horizontal spacer to the row sizer
        r5Sizer.Add((10, 0))

        # Add the Browse Button
        browse = wx.Button(self.panel, -1, _("Browse"))
        # Add the Browse Method to the Browse Button
        wx.EVT_BUTTON(self, browse.GetId(), self.OnBrowseClick)
        # Add the element to the sizer
        r5Sizer.Add(browse, 0, wx.ALIGN_BOTTOM)
        # If Mac ...
        if 'wxMac' in wx.PlatformInfo:
            # ... add a spacer to avoid control clipping
            r5Sizer.Add((2, 0))

        # Add the row sizer to the main vertical sizer
        mainSizer.Add(r5Sizer, 0, wx.EXPAND)

        # Add a vertical spacer to the main sizer
        mainSizer.Add((0, 10))

        # Create a sizer for the buttons
        btnSizer = wx.BoxSizer(wx.HORIZONTAL)
        # Add the buttons
        self.create_buttons(sizer=btnSizer)
        # Add the button sizer to the main sizer
        mainSizer.Add(btnSizer, 0, wx.EXPAND)
        # If Mac ...
        if 'wxMac' in wx.PlatformInfo:
            # ... add a spacer to avoid control clipping
            mainSizer.Add((0, 2))

        # Set the PANEL's main sizer
        self.panel.SetSizer(mainSizer)
        # Tell the PANEL to auto-layout
        self.panel.SetAutoLayout(True)
        # Lay out the Panel
        self.panel.Layout()
        # Lay out the panel on the form
        self.Layout()
        # Resize the form to fit the contents
        self.Fit()

        # Get the new size of the form
        (width, height) = self.GetSizeTuple()
        # Reset the form's size to be at least the specified minimum width
        self.SetSize(wx.Size(max(self.width, width), height))
        # Define the minimum size for this dialog as the current size, and define height as unchangeable
        self.SetSizeHints(max(self.width, width), height, -1, height)
        # Center the form on screen
        self.CenterOnScreen()
        # Set focus to the Transcript ID
        self.id_edit.SetFocus()
Ejemplo n.º 24
0
    def _init_ctrls(self, prnt):
        # generated method, don't edit
        wx.Dialog.__init__(self,
                           id=wxID_WXDIALOG1,
                           name='',
                           parent=prnt,
                           pos=wx.Point(333, 110),
                           size=wx.Size(558, 437),
                           style=wx.DEFAULT_DIALOG_STYLE,
                           title='Transfer Dialog')
        self.SetClientSize(wx.Size(550, 403))

        self.staticText1 = wx.StaticText(
            id=wxID_WXDIALOG1STATICTEXT1,
            label='Source Indicates that your requested data is now available.',
            name='staticText1',
            parent=self,
            pos=wx.Point(80, 16),
            size=wx.Size(415, 20),
            style=0)
        self.staticText1.SetForegroundColour(wx.Colour(255, 0, 0))
        self.staticText1.SetFont(
            wx.Font(12, wx.SWISS, wx.NORMAL, wx.NORMAL, False,
                    'MS Sans Serif'))
        self.staticText1.SetBackgroundColour(wx.Colour(0, 255, 255))

        self.button1 = wx.Button(id=wxID_WXDIALOG1BUTTON1,
                                 label='Transfer Natively',
                                 name='button1',
                                 parent=self,
                                 pos=wx.Point(56, 344),
                                 size=wx.Size(112, 23),
                                 style=0)
        self.button1.Bind(wx.EVT_BUTTON,
                          self.OnButton1Button,
                          id=wxID_WXDIALOG1BUTTON1)

        self.button2 = wx.Button(id=wxID_WXDIALOG1BUTTON2,
                                 label='Transfer To File',
                                 name='button2',
                                 parent=self,
                                 pos=wx.Point(208, 344),
                                 size=wx.Size(112, 23),
                                 style=0)
        self.button2.SetBackgroundColour(wx.Colour(192, 192, 192))
        self.button2.Bind(wx.EVT_BUTTON,
                          self.OnButton2Button,
                          id=wxID_WXDIALOG1BUTTON2)

        self.button3 = wx.Button(id=wxID_WXDIALOG1BUTTON3,
                                 label='Abort Transfer',
                                 name='button3',
                                 parent=self,
                                 pos=wx.Point(360, 344),
                                 size=wx.Size(112, 23),
                                 style=0)
        self.button3.Bind(wx.EVT_BUTTON,
                          self.OnButton3Button,
                          id=wxID_WXDIALOG1BUTTON3)

        self.staticText2 = wx.StaticText(id=wxID_WXDIALOG1STATICTEXT2,
                                         label='X-Resolution:',
                                         name='staticText2',
                                         parent=self,
                                         pos=wx.Point(72, 64),
                                         size=wx.Size(63, 13),
                                         style=0)

        self.staticText3 = wx.StaticText(id=wxID_WXDIALOG1STATICTEXT3,
                                         label='Y-Resolution:',
                                         name='staticText3',
                                         parent=self,
                                         pos=wx.Point(72, 88),
                                         size=wx.Size(63, 13),
                                         style=0)

        self.staticText4 = wx.StaticText(id=wxID_WXDIALOG1STATICTEXT4,
                                         label='Image Width:',
                                         name='staticText4',
                                         parent=self,
                                         pos=wx.Point(72, 112),
                                         size=wx.Size(63, 13),
                                         style=0)

        self.staticText5 = wx.StaticText(id=wxID_WXDIALOG1STATICTEXT5,
                                         label='Image Length:',
                                         name='staticText5',
                                         parent=self,
                                         pos=wx.Point(64, 136),
                                         size=wx.Size(68, 13),
                                         style=0)

        self.staticText6 = wx.StaticText(id=wxID_WXDIALOG1STATICTEXT6,
                                         label='Samples Per Pixel:',
                                         name='staticText6',
                                         parent=self,
                                         pos=wx.Point(48, 160),
                                         size=wx.Size(87, 13),
                                         style=0)

        self.staticText7 = wx.StaticText(id=wxID_WXDIALOG1STATICTEXT7,
                                         label='Bits Per Sample:',
                                         name='staticText7',
                                         parent=self,
                                         pos=wx.Point(56, 184),
                                         size=wx.Size(77, 13),
                                         style=0)

        self.staticText8 = wx.StaticText(id=wxID_WXDIALOG1STATICTEXT8,
                                         label='Bits Per Pixel:',
                                         name='staticText8',
                                         parent=self,
                                         pos=wx.Point(64, 208),
                                         size=wx.Size(64, 13),
                                         style=0)

        self.staticText9 = wx.StaticText(id=wxID_WXDIALOG1STATICTEXT9,
                                         label='Planar:',
                                         name='staticText9',
                                         parent=self,
                                         pos=wx.Point(96, 232),
                                         size=wx.Size(33, 13),
                                         style=0)

        self.staticText10 = wx.StaticText(id=wxID_WXDIALOG1STATICTEXT10,
                                          label='Pixel Type:',
                                          name='staticText10',
                                          parent=self,
                                          pos=wx.Point(72, 256),
                                          size=wx.Size(52, 13),
                                          style=0)

        self.staticText11 = wx.StaticText(id=wxID_WXDIALOG1STATICTEXT11,
                                          label='Compression:',
                                          name='staticText11',
                                          parent=self,
                                          pos=wx.Point(64, 280),
                                          size=wx.Size(63, 13),
                                          style=0)

        self.txtXResolution = wx.TextCtrl(id=wxID_WXDIALOG1TXTXRESOLUTION,
                                          name='txtXResolution',
                                          parent=self,
                                          pos=wx.Point(160, 64),
                                          size=wx.Size(100, 21),
                                          style=0,
                                          value='')

        self.txtYResolution = wx.TextCtrl(id=wxID_WXDIALOG1TXTYRESOLUTION,
                                          name='txtYResolution',
                                          parent=self,
                                          pos=wx.Point(160, 88),
                                          size=wx.Size(100, 21),
                                          style=0,
                                          value='')

        self.txtImageWidth = wx.TextCtrl(id=wxID_WXDIALOG1TXTIMAGEWIDTH,
                                         name='txtImageWidth',
                                         parent=self,
                                         pos=wx.Point(160, 112),
                                         size=wx.Size(100, 21),
                                         style=0,
                                         value='')

        self.txtImageLength = wx.TextCtrl(id=wxID_WXDIALOG1TXTIMAGELENGTH,
                                          name='txtImageLength',
                                          parent=self,
                                          pos=wx.Point(160, 136),
                                          size=wx.Size(100, 21),
                                          style=0,
                                          value='')

        self.txtSamplesPerPixel = wx.TextCtrl(
            id=wxID_WXDIALOG1TXTSAMPLESPERPIXEL,
            name='txtSamplesPerPixel',
            parent=self,
            pos=wx.Point(160, 160),
            size=wx.Size(100, 21),
            style=0,
            value='')

        self.txtBitsPerSample = wx.TextCtrl(id=wxID_WXDIALOG1TXTBITSPERSAMPLE,
                                            name='txtBitsPerSample',
                                            parent=self,
                                            pos=wx.Point(160, 184),
                                            size=wx.Size(100, 21),
                                            style=0,
                                            value='')

        self.txtBitsPerPixel = wx.TextCtrl(id=wxID_WXDIALOG1TXTBITSPERPIXEL,
                                           name='txtBitsPerPixel',
                                           parent=self,
                                           pos=wx.Point(160, 208),
                                           size=wx.Size(100, 21),
                                           style=0,
                                           value='')

        self.txtPlanar = wx.TextCtrl(id=wxID_WXDIALOG1TXTPLANAR,
                                     name='txtPlanar',
                                     parent=self,
                                     pos=wx.Point(160, 232),
                                     size=wx.Size(100, 21),
                                     style=0,
                                     value='')

        self.txtPixelType = wx.TextCtrl(id=wxID_WXDIALOG1TXTPIXELTYPE,
                                        name='txtPixelType',
                                        parent=self,
                                        pos=wx.Point(160, 256),
                                        size=wx.Size(100, 21),
                                        style=0,
                                        value='')

        self.txtCompression = wx.TextCtrl(id=wxID_WXDIALOG1TXTCOMPRESSION,
                                          name='txtCompression',
                                          parent=self,
                                          pos=wx.Point(160, 280),
                                          size=wx.Size(100, 21),
                                          style=0,
                                          value='')

        self.txtDocumentNumber = wx.TextCtrl(
            id=wxID_WXDIALOG1TXTDOCUMENTNUMBER,
            name='txtDocumentNumber',
            parent=self,
            pos=wx.Point(408, 64),
            size=wx.Size(100, 21),
            style=0,
            value='')

        self.staticText12 = wx.StaticText(id=wxID_WXDIALOG1STATICTEXT12,
                                          label='Document Number:',
                                          name='staticText12',
                                          parent=self,
                                          pos=wx.Point(304, 72),
                                          size=wx.Size(92, 13),
                                          style=0)

        self.txtPageNumber = wx.TextCtrl(id=wxID_WXDIALOG1TXTPAGENUMBER,
                                         name='txtPageNumber',
                                         parent=self,
                                         pos=wx.Point(408, 96),
                                         size=wx.Size(100, 21),
                                         style=0,
                                         value='')

        self.staticText13 = wx.StaticText(id=wxID_WXDIALOG1STATICTEXT13,
                                          label='Page Number:',
                                          name='staticText13',
                                          parent=self,
                                          pos=wx.Point(320, 104),
                                          size=wx.Size(68, 13),
                                          style=0)

        self.txtFrameNumber = wx.TextCtrl(id=wxID_WXDIALOG1TXTFRAMENUMBER,
                                          name='txtFrameNumber',
                                          parent=self,
                                          pos=wx.Point(408, 128),
                                          size=wx.Size(100, 21),
                                          style=0,
                                          value='')

        self.staticText18 = wx.StaticText(id=wxID_WXDIALOG1STATICTEXT18,
                                          label='Frame Number:',
                                          name='staticText18',
                                          parent=self,
                                          pos=wx.Point(320, 128),
                                          size=wx.Size(72, 13),
                                          style=0)

        self.txtLeft = wx.TextCtrl(id=wxID_WXDIALOG1TXTLEFT,
                                   name='txtLeft',
                                   parent=self,
                                   pos=wx.Point(408, 184),
                                   size=wx.Size(100, 21),
                                   style=0,
                                   value='')

        self.staticText14 = wx.StaticText(id=wxID_WXDIALOG1STATICTEXT14,
                                          label='Left:',
                                          name='staticText14',
                                          parent=self,
                                          pos=wx.Point(376, 192),
                                          size=wx.Size(21, 13),
                                          style=0)

        self.txtTop = wx.TextCtrl(id=wxID_WXDIALOG1TXTTOP,
                                  name='txtTop',
                                  parent=self,
                                  pos=wx.Point(408, 216),
                                  size=wx.Size(100, 21),
                                  style=0,
                                  value='')

        self.staticText15 = wx.StaticText(id=wxID_WXDIALOG1STATICTEXT15,
                                          label='Top:',
                                          name='staticText15',
                                          parent=self,
                                          pos=wx.Point(376, 216),
                                          size=wx.Size(22, 13),
                                          style=0)

        self.txtRight = wx.TextCtrl(id=wxID_WXDIALOG1TXTRIGHT,
                                    name='txtRight',
                                    parent=self,
                                    pos=wx.Point(408, 248),
                                    size=wx.Size(100, 21),
                                    style=0,
                                    value='')

        self.staticText16 = wx.StaticText(id=wxID_WXDIALOG1STATICTEXT16,
                                          label='Right',
                                          name='staticText16',
                                          parent=self,
                                          pos=wx.Point(368, 248),
                                          size=wx.Size(25, 13),
                                          style=0)

        self.txtBottom = wx.TextCtrl(id=wxID_WXDIALOG1TXTBOTTOM,
                                     name='txtBottom',
                                     parent=self,
                                     pos=wx.Point(408, 280),
                                     size=wx.Size(100, 21),
                                     style=0,
                                     value='')

        self.staticText17 = wx.StaticText(id=wxID_WXDIALOG1STATICTEXT17,
                                          label='Bottom:',
                                          name='staticText17',
                                          parent=self,
                                          pos=wx.Point(360, 280),
                                          size=wx.Size(36, 13),
                                          style=0)

        self.staticBox1 = wx.StaticBox(id=wxID_WXDIALOG1STATICBOX1,
                                       label='Dimensions',
                                       name='staticBox1',
                                       parent=self,
                                       pos=wx.Point(312, 168),
                                       size=wx.Size(216, 152),
                                       style=0)

        self.staticBox2 = wx.StaticBox(id=wxID_WXDIALOG1STATICBOX2,
                                       label='Scan Information',
                                       name='staticBox2',
                                       parent=self,
                                       pos=wx.Point(24, 40),
                                       size=wx.Size(256, 280),
                                       style=0)

        self.staticBox3 = wx.StaticBox(id=wxID_WXDIALOG1STATICBOX3,
                                       label='Document Information',
                                       name='staticBox3',
                                       parent=self,
                                       pos=wx.Point(296, 48),
                                       size=wx.Size(232, 112),
                                       style=0)
Ejemplo n.º 25
0
    def _init_ctrls(self, prnt):
        # generated method, don't edit
        wx.Dialog.__init__(self,
                           id=wxID_PROCESSPROGRESSDLG,
                           name='ProcessProgressDlg',
                           parent=prnt,
                           pos=wx.Point(313, 215),
                           size=wx.Size(428, 363),
                           style=wx.RESIZE_BORDER | wx.DEFAULT_DIALOG_STYLE,
                           title=self.dlg_caption)
        self.SetAutoLayout(True)
        self.SetClientSize(wx.Size(420, 336))
        self.Bind(wx.EVT_CLOSE, self.OnProcessprogressdlgClose)

        self.cancelBtn = wx.Button(id=wxID_PROCESSPROGRESSDLGCANCELBTN,
                                   label=_('Cancel'),
                                   name='cancelBtn',
                                   parent=self,
                                   pos=wx.Point(332, 304),
                                   size=wx.Size(80, 24),
                                   style=0)
        self.cancelBtn.SetConstraints(
            LayoutAnchors(self.cancelBtn, False, False, True, True))
        self.cancelBtn.Bind(wx.EVT_BUTTON,
                            self.OnCancelbtnButton,
                            id=wxID_PROCESSPROGRESSDLGCANCELBTN)

        self.cmdStxt = wx.StaticText(id=wxID_PROCESSPROGRESSDLGCMDSTXT,
                                     label='staticText1',
                                     name='cmdStxt',
                                     parent=self,
                                     pos=wx.Point(8, 8),
                                     size=wx.Size(404, 64),
                                     style=wx.ST_NO_AUTORESIZE)
        self.cmdStxt.SetConstraints(
            LayoutAnchors(self.cmdStxt, True, True, True, False))

        self.splitterWindow = wx.SplitterWindow(
            id=wxID_PROCESSPROGRESSDLGSPLITTERWINDOW,
            name='splitterWindow',
            parent=self,
            pos=wx.Point(8, 80),
            size=wx.Size(360, 192),
            style=self.splitterStyle)
        self.splitterWindow.SetConstraints(
            LayoutAnchors(self.splitterWindow, True, True, True, True))

        self.errorTctrl = wx.TextCtrl(id=wxID_PROCESSPROGRESSDLGERRORTCTRL,
                                      name='errorTctrl',
                                      parent=self.splitterWindow,
                                      pos=wx.Point(0, 0),
                                      size=wx.Size(360, 80),
                                      style=wx.TE_MULTILINE | wx.TE_RICH,
                                      value='')
        self.errorTctrl.SetForegroundColour(wx.Colour(128, 0, 0))

        self.outputTctrl = wx.TextCtrl(id=wxID_PROCESSPROGRESSDLGOUTPUTTCTRL,
                                       name='outputTctrl',
                                       parent=self.splitterWindow,
                                       pos=wx.Point(0, 87),
                                       size=wx.Size(360, 105),
                                       style=wx.TE_MULTILINE | wx.TE_RICH,
                                       value='')
        self.splitterWindow.SplitHorizontally(self.errorTctrl,
                                              self.outputTctrl, 80)

        self.statusStxt = wx.StaticText(id=wxID_PROCESSPROGRESSDLGSTATUSSTXT,
                                        label='staticText1',
                                        name='statusStxt',
                                        parent=self,
                                        pos=wx.Point(8, 288),
                                        size=wx.Size(292, 16),
                                        style=0)
        self.statusStxt.SetConstraints(
            LayoutAnchors(self.statusStxt, True, False, True, True))

        self.statusGge = wx.Gauge(id=wxID_PROCESSPROGRESSDLGSTATUSGGE,
                                  name='statusGge',
                                  parent=self,
                                  pos=wx.Point(8, 312),
                                  range=100,
                                  size=wx.Size(208, 16),
                                  style=wx.GA_HORIZONTAL)
        self.statusGge.SetConstraints(
            LayoutAnchors(self.statusGge, True, False, True, True))

        self.killBtn = wx.Button(id=wxID_PROCESSPROGRESSDLGKILLBTN,
                                 label=_('Kill'),
                                 name='killBtn',
                                 parent=self,
                                 pos=wx.Point(242, 304),
                                 size=wx.Size(81, 24),
                                 style=0)
        self.killBtn.SetConstraints(
            LayoutAnchors(self.killBtn, False, False, True, True))
        self.killBtn.Enable(False)
        self.killBtn.Bind(wx.EVT_BUTTON,
                          self.OnKillbtnButton,
                          id=wxID_PROCESSPROGRESSDLGKILLBTN)
Ejemplo n.º 26
0
    def _init_ctrls(self, prnt):
        # generated method, don't edit
        wx.Dialog.__init__(self, id=wxID_PROPERTIESDIALOG,
              name=u'PropertiesDialog', parent=prnt, pos=wx.Point(483, 325),
              size=wx.Size(775, 446), style=wx.DEFAULT_DIALOG_STYLE,
              title=u'Properties')
        self._init_utils()
        self.SetClientSize(wx.Size(775, 446))
        self.Center(wx.BOTH)
        self.Bind(wx.EVT_ACTIVATE, self.OnPropertiesDialogActivate)

        self.AddProp = wx.Button(id=wxID_PROPERTIESDIALOGADDPROP,
              label=u'Add Property', name=u'AddProp', parent=self,
              pos=wx.Point(439, 399), size=wx.Size(125, 30), style=0)
        self.AddProp.Bind(wx.EVT_BUTTON, self.OnAddPropButton,
              id=wxID_PROPERTIESDIALOGADDPROP)

        self.splitterWindow1 = wx.SplitterWindow(id=wxID_PROPERTIESDIALOGSPLITTERWINDOW1,
              name='splitterWindow1', parent=self, point=wx.Point(8, 79),
              size=wx.Size(760, 308), style=wx.ALWAYS_SHOW_SB | wx.SP_3D)
        self.splitterWindow1.SetBestFittingSize(wx.Size(760, 305))

        self.sashWindow2 = wx.SashWindow(id=wxID_PROPERTIESDIALOGSASHWINDOW2,
              name='sashWindow2', parent=self.splitterWindow1, pos=wx.Point(204,
              0), size=wx.Size(556, 305),
              style=wx.ALWAYS_SHOW_SB | wx.CLIP_CHILDREN | wx.HSCROLL | wx.VSCROLL | wx.SW_3D)
        self.sashWindow2.SetAutoLayout(True)
        self.sashWindow2.SetBestFittingSize(wx.Size(556, 285))
        self.sashWindow2.SetMaximumSizeY(375)

        self.nameBox = wx.TextCtrl(id=wxID_PROPERTIESDIALOGNAMEBOX,
              name=u'nameBox', parent=self, pos=wx.Point(208, 40),
              size=wx.Size(144, 25), style=0, value=u'')

        self.idBox = wx.TextCtrl(id=wxID_PROPERTIESDIALOGIDBOX, name=u'idBox',
              parent=self, pos=wx.Point(360, 40), size=wx.Size(283, 25),
              style=0, value=u'')

        self.typeChoice = wx.Choice(choices=["boolean", "char", "double",
              "float", "short", "long", "objref", "octet", "string", "ulong",
              "ushort"], id=wxID_PROPERTIESDIALOGTYPECHOICE, name=u'typeChoice',
              parent=self.sashWindow2, pos=wx.Point(32, 105), size=wx.Size(100,
              27), style=0)
        self.typeChoice.SetBestFittingSize(wx.Size(100, 27))

        self.elementChoice = wx.Choice(choices=["Simple", "SimpleSequence",
              "Test", "Struct", "StructSequence"],
              id=wxID_PROPERTIESDIALOGELEMENTCHOICE, name=u'elementChoice',
              parent=self, pos=wx.Point(32, 40), size=wx.Size(152, 27),
              style=0)
        self.elementChoice.Bind(wx.EVT_CHOICE, self.OnElementChoiceChoice,
              id=wxID_PROPERTIESDIALOGELEMENTCHOICE)

        self.modeChoice = wx.Choice(choices=["readonly", "readwrite",
              "writeonly"], id=wxID_PROPERTIESDIALOGMODECHOICE,
              name=u'modeChoice', parent=self, pos=wx.Point(653, 39),
              size=wx.Size(104, 27), style=0)

        self.description = wx.TextCtrl(id=wxID_PROPERTIESDIALOGDESCRIPTION,
              name=u'description', parent=self.sashWindow2, pos=wx.Point(16,
              32), size=wx.Size(272, 40), style=wx.TE_MULTILINE, value=u'')

        self.unitsChoice = wx.Choice(choices=["None", "Hz", "W", "V", "cycles_per_sample"],
              id=wxID_PROPERTIESDIALOGUNITSCHOICE, name=u'unitsChoice',
              parent=self.sashWindow2, pos=wx.Point(185, 105), size=wx.Size(85,
              27), style=0)
        self.unitsChoice.SetBestFittingSize(wx.Size(85, 27))

        self.minBox = wx.TextCtrl(id=wxID_PROPERTIESDIALOGMINBOX,
              name=u'minBox', parent=self.sashWindow2, pos=wx.Point(184, 236),
              size=wx.Size(80, 25), style=0, value=u'min')

        self.maxBox = wx.TextCtrl(id=wxID_PROPERTIESDIALOGMAXBOX,
              name=u'maxBox', parent=self.sashWindow2, pos=wx.Point(184, 268),
              size=wx.Size(80, 25), style=0, value=u'max')

        self.staticText1 = wx.StaticText(id=wxID_PROPERTIESDIALOGSTATICTEXT1,
              label=u'Description', name='staticText1', parent=self.sashWindow2,
              pos=wx.Point(16, 11), size=wx.Size(76, 17), style=0)

        self.kindChoice = wx.Choice(choices=["allocation", "configure", "test",
              "execparam", "factoryparam"], id=wxID_PROPERTIESDIALOGKINDCHOICE,
              name=u'kindChoice', parent=self.sashWindow2, pos=wx.Point(27,
              170), size=wx.Size(110, 27), style=0)
        self.kindChoice.SetBestFittingSize(wx.Size(110, 27))
        self.kindChoice.Bind(wx.EVT_CHOICE, self.OnKindChoiceChoice,
              id=wxID_PROPERTIESDIALOGKINDCHOICE)

        self.staticText2 = wx.StaticText(id=wxID_PROPERTIESDIALOGSTATICTEXT2,
              label=u'Type', name='staticText2', parent=self.sashWindow2,
              pos=wx.Point(65, 84), size=wx.Size(39, 17), style=0)

        self.staticText3 = wx.StaticText(id=wxID_PROPERTIESDIALOGSTATICTEXT3,
              label=u'Units', name='staticText3', parent=self.sashWindow2,
              pos=wx.Point(212, 84), size=wx.Size(41, 17), style=0)

        self.staticText4 = wx.StaticText(id=wxID_PROPERTIESDIALOGSTATICTEXT4,
              label=u'Kind', name='staticText4', parent=self.sashWindow2,
              pos=wx.Point(69, 149), size=wx.Size(36, 17), style=0)

        self.staticText5 = wx.StaticText(id=wxID_PROPERTIESDIALOGSTATICTEXT5,
              label=u'Range', name='staticText5', parent=self.sashWindow2,
              pos=wx.Point(205, 215), size=wx.Size(48, 17), style=0)

        self.staticText6 = wx.StaticText(id=wxID_PROPERTIESDIALOGSTATICTEXT6,
              label=u'Value(s)', name='staticText6', parent=self.sashWindow2,
              pos=wx.Point(362, 23), size=wx.Size(58, 17), style=0)

        self.sashWindow1 = wx.SashWindow(id=wxID_PROPERTIESDIALOGSASHWINDOW1,
              name='sashWindow1', parent=self.splitterWindow1, pos=wx.Point(0,
              0), size=wx.Size(199, 305), style=wx.CLIP_CHILDREN | wx.SW_3D)
        self.splitterWindow1.SplitVertically(self.sashWindow1, self.sashWindow2,
              200)

        self.valueBox = wx.TextCtrl(id=wxID_PROPERTIESDIALOGVALUEBOX,
              name=u'valueBox', parent=self.sashWindow2, pos=wx.Point(336, 44),
              size=wx.Size(100, 25), style=0, value=u'')
        self.valueBox.SetBestFittingSize(wx.Size(100, 25))

        root = __file__
        if os.path.islink (root):
              root = os.path.realpath (root)
        root = os.path.dirname (os.path.abspath (root))
        self.addValue = wx.BitmapButton(bitmap=wx.Bitmap( root + '/images/plus.bmp',
              wx.BITMAP_TYPE_BMP), id=wxID_PROPERTIESDIALOGADDVALUE,
              name=u'addValue', parent=self.sashWindow2, pos=wx.Point(456, 44),
              size=wx.Size(24, 24), style=wx.BU_AUTODRAW)
        self.addValue.Bind(wx.EVT_BUTTON, self.OnAddValueButton,
              id=wxID_PROPERTIESDIALOGADDVALUE)

        self.staticText7 = wx.StaticText(id=wxID_PROPERTIESDIALOGSTATICTEXT7,
              label=u'Element Type', name='staticText7', parent=self,
              pos=wx.Point(57, 16), size=wx.Size(141, 17), style=0)

        self.staticText8 = wx.StaticText(id=wxID_PROPERTIESDIALOGSTATICTEXT8,
              label=u'Name', name='staticText8', parent=self, pos=wx.Point(252,
              16), size=wx.Size(45, 17), style=0)

        self.staticText9 = wx.StaticText(id=wxID_PROPERTIESDIALOGSTATICTEXT9,
              label=u'ID', name='staticText9', parent=self, pos=wx.Point(485,
              16), size=wx.Size(24, 17), style=0)

        self.staticText10 = wx.StaticText(id=wxID_PROPERTIESDIALOGSTATICTEXT10,
              label=u'Mode', name='staticText10', parent=self, pos=wx.Point(687,
              16), size=wx.Size(42, 17), style=0)

        self.valueList = wx.ListCtrl(id=wxID_PROPERTIESDIALOGVALUELIST,
              name=u'valueList', parent=self.sashWindow2, pos=wx.Point(316, 82),
              size=wx.Size(185, 206),
              style=wx.ALWAYS_SHOW_SB | wx.LC_EDIT_LABELS | wx.LC_VRULES | wx.LC_REPORT | wx.SIMPLE_BORDER | wx.LC_HRULES | wx.VSCROLL | wx.LC_SINGLE_SEL)
        self.valueList.SetBestFittingSize(wx.Size(185, 206))
        self._init_coll_valueList_Columns(self.valueList)
        self.valueList.Bind(wx.EVT_RIGHT_UP, self.OnValueListRightUp)

        self.Cancel = wx.Button(id=wxID_PROPERTIESDIALOGCANCEL, label=u'Cancel',
              name=u'Cancel', parent=self, pos=wx.Point(680, 399),
              size=wx.Size(85, 30), style=0)
        self.Cancel.Bind(wx.EVT_BUTTON, self.OnCancelButton,
              id=wxID_PROPERTIESDIALOGCANCEL)

        self.enumBox = wx.TextCtrl(id=wxID_PROPERTIESDIALOGENUMBOX,
              name=u'enumBox', parent=self.sashWindow2, pos=wx.Point(20, 251),
              size=wx.Size(125, 25), style=0, value=u'')

        self.staticText11 = wx.StaticText(id=wxID_PROPERTIESDIALOGSTATICTEXT11,
              label=u'Enumeration', name=u'staticText11',
              parent=self.sashWindow2, pos=wx.Point(36, 230), size=wx.Size(90,
              17), style=0)

        self.ok = wx.Button(id=wxID_PROPERTIESDIALOGOK, label=u'OK', name=u'ok',
              parent=self, pos=wx.Point(579, 399), size=wx.Size(85, 30),
              style=0)
        self.ok.Bind(wx.EVT_BUTTON, self.OnOkButton, id=wxID_PROPERTIESDIALOGOK)

        self.actionChoice = wx.Choice(choices=["eq", "ne", "gt", "lt", "ge",
              "le", "external"], id=wxID_PROPERTIESDIALOGACTIONCHOICE,
              name=u'actionChoice', parent=self.sashWindow2, pos=wx.Point(185,
              170), size=wx.Size(85, 27), style=0)

        self.staticText12 = wx.StaticText(id=wxID_PROPERTIESDIALOGSTATICTEXT12,
              label=u'Action', name='staticText12', parent=self.sashWindow2,
              pos=wx.Point(209, 149), size=wx.Size(50, 17), style=0)
Ejemplo n.º 27
0
    def __init__(self, parent):
        wx.Frame.__init__(self,
                          parent,
                          id=wx.ID_ANY,
                          title=u"RRAP_HCE_182a_R0",
                          pos=wx.DefaultPosition,
                          size=wx.Size(-1, -1),
                          style=wx.DEFAULT_FRAME_STYLE | wx.TAB_TRAVERSAL)

        self.SetSizeHintsSz(wx.DefaultSize, wx.DefaultSize)

        fgSizer1 = wx.FlexGridSizer(2, 2, 0, 0)
        fgSizer1.SetFlexibleDirection(wx.BOTH)
        fgSizer1.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED)

        gbSizer1 = wx.GridBagSizer(0, 0)
        gbSizer1.SetFlexibleDirection(wx.BOTH)
        gbSizer1.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED)

        self.m_staticText1 = wx.StaticText(self, wx.ID_ANY,
                                           u"Test Tool Vendor",
                                           wx.DefaultPosition, wx.DefaultSize,
                                           0)
        self.m_staticText1.Wrap(-1)
        gbSizer1.Add(self.m_staticText1, wx.GBPosition(1, 0), wx.GBSpan(1, 1),
                     wx.ALL, 8)

        self.m_staticText11 = wx.StaticText(self, wx.ID_ANY,
                                            u"Test Tool Report path",
                                            wx.DefaultPosition, wx.DefaultSize,
                                            0)
        self.m_staticText11.Wrap(-1)
        gbSizer1.Add(self.m_staticText11, wx.GBPosition(2, 0), wx.GBSpan(1, 1),
                     wx.ALL, 8)

        inputChoiceChoices = [u"ICCSolutions", u"Galitt", u"UL"]
        self.inputChoice = wx.Choice(self, wx.ID_ANY, wx.DefaultPosition,
                                     wx.DefaultSize, inputChoiceChoices, 0)
        self.inputChoice.SetSelection(1)
        gbSizer1.Add(self.inputChoice, wx.GBPosition(1, 2), wx.GBSpan(1, 1),
                     wx.ALL, 6)

        self.xmlButton = wx.Button(self, wx.ID_ANY,
                                   u"Generate XML Analyze Result",
                                   wx.Point(-1, -1), wx.Size(220, -1), 0)
        self.xmlButton.SetDefault()
        gbSizer1.Add(self.xmlButton, wx.GBPosition(4, 2), wx.GBSpan(1, 1),
                     wx.ALL, 5)

        self.pdfButton = wx.Button(self, wx.ID_ANY,
                                   u"Generate PDF Analyze Result",
                                   wx.Point(-1, -1), wx.Size(220, -1), 0)
        self.pdfButton.SetDefault()
        gbSizer1.Add(self.pdfButton, wx.GBPosition(5, 2), wx.GBSpan(1, 1),
                     wx.ALL, 5)

        self.executeLog = wx.TextCtrl(self,
                                      wx.ID_ANY,
                                      wx.EmptyString,
                                      wx.DefaultPosition,
                                      wx.Size(500, 400),
                                      style=wx.TE_MULTILINE)
        gbSizer1.Add(self.executeLog, wx.GBPosition(3, 0), wx.GBSpan(1, 5),
                     wx.ALL, 5)

        gbSizer1.Add((0, 310), wx.GBPosition(3, 5), wx.GBSpan(1, 1), wx.EXPAND,
                     5)

        self.inputPath = wx.FilePickerCtrl(self, wx.ID_ANY, wx.EmptyString,
                                           u"Select the test report", u"*.*",
                                           wx.DefaultPosition, wx.DefaultSize,
                                           wx.FLP_DEFAULT_STYLE)
        gbSizer1.Add(self.inputPath, wx.GBPosition(2, 2), wx.GBSpan(1, 2), 0,
                     1)

        self.m_bitmap3 = wx.StaticBitmap(self, wx.ID_ANY,
                                         visa.visa.getBitmap(),
                                         wx.DefaultPosition, wx.DefaultSize, 0)
        gbSizer1.Add(self.m_bitmap3, wx.GBPosition(0, 0), wx.GBSpan(1, 1),
                     wx.ALL, 5)

        # self.m_staticText6 = wx.StaticText(self, wx.ID_ANY, u"Developed by", wx.DefaultPosition, wx.DefaultSize,
        # 								   0)
        # self.m_staticText6.Wrap(-1)
        # self.m_staticText6.SetFont(wx.Font(wx.NORMAL_FONT.GetPointSize(), 70, 90, 92, False, wx.EmptyString))
        # self.m_staticText6.SetForegroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_GRAYTEXT))
        # gbSizer1.Add(self.m_staticText6, wx.GBPosition(4, 0), wx.GBSpan(1, 1), wx.ALIGN_BOTTOM|wx.ALL, 5)
        #
        # #image = wx.Image(u"applus.png", wx.BITMAP_TYPE_ANY)
        # image = applus.applus.getBitmap().ConvertToImage()
        # image.Rescale(image.GetWidth()/2.5, image.GetHeight()/2.5)
        # self.m_bitmap4 = wx.StaticBitmap(self, wx.ID_ANY, image.ConvertToBitmap(),
        # 								 wx.DefaultPosition, wx.DefaultSize, 0)
        #
        # gbSizer1.Add((0, 5), wx.GBPosition(6, 6), wx.GBSpan(1, 1), wx.EXPAND, 5)
        #
        # gbSizer1.Add(self.m_bitmap4, wx.GBPosition(5, 0), wx.GBSpan(1, 1), wx.ALL, 5)

        fgSizer1.Add(gbSizer1, 1, wx.EXPAND, 5)

        self.SetSizer(fgSizer1)
        self.Layout()
        fgSizer1.Fit(self)

        self.Centre(wx.BOTH)

        # Connect Events
        self.xmlButton.Bind(wx.EVT_BUTTON, self.genXmlReport)
        self.pdfButton.Bind(wx.EVT_BUTTON, self.genPdfReport)
Ejemplo n.º 28
0
    def __init__(self, parent):
        wx.Panel.__init__(self,
                          parent,
                          id=wx.ID_ANY,
                          pos=wx.DefaultPosition,
                          size=wx.Size(718, 261),
                          style=wx.TAB_TRAVERSAL)

        bSizer16 = wx.BoxSizer(wx.VERTICAL)

        bSizer2 = wx.BoxSizer(wx.HORIZONTAL)

        bSizer4 = wx.BoxSizer(wx.VERTICAL)

        self.search_symbol = wx.SearchCtrl(self, wx.ID_ANY, wx.EmptyString,
                                           wx.DefaultPosition, wx.DefaultSize,
                                           wx.TE_PROCESS_ENTER)
        self.search_symbol.ShowSearchButton(True)
        self.search_symbol.ShowCancelButton(True)
        self.search_symbol.SetMinSize(wx.Size(180, -1))

        bSizer4.Add(self.search_symbol, 0,
                    wx.ALL | wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT, 5)

        self.tree_symbols = wx.dataview.DataViewCtrl(self, wx.ID_ANY,
                                                     wx.DefaultPosition,
                                                     wx.DefaultSize, 0)
        bSizer4.Add(self.tree_symbols, 1, wx.ALL | wx.EXPAND, 5)

        bSizer2.Add(bSizer4, 1, wx.EXPAND, 5)

        self.panel_image_symbol = wx.Panel(self, wx.ID_ANY, wx.DefaultPosition,
                                           wx.DefaultSize, wx.TAB_TRAVERSAL)
        bSizer41 = wx.BoxSizer(wx.VERTICAL)

        self.image_symbol = wx.StaticBitmap(self.panel_image_symbol, wx.ID_ANY,
                                            wx.NullBitmap, wx.DefaultPosition,
                                            wx.DefaultSize, 0)
        bSizer41.Add(self.image_symbol, 1, wx.ALL | wx.EXPAND, 5)

        self.panel_image_symbol.SetSizer(bSizer41)
        self.panel_image_symbol.Layout()
        bSizer41.Fit(self.panel_image_symbol)
        bSizer2.Add(self.panel_image_symbol, 1, wx.EXPAND | wx.ALL, 5)

        bSizer16.Add(bSizer2, 1, wx.EXPAND, 5)

        m_sdbSizer2 = wx.StdDialogButtonSizer()
        self.m_sdbSizer2OK = wx.Button(self, wx.ID_OK)
        m_sdbSizer2.AddButton(self.m_sdbSizer2OK)
        self.m_sdbSizer2Cancel = wx.Button(self, wx.ID_CANCEL)
        m_sdbSizer2.AddButton(self.m_sdbSizer2Cancel)
        m_sdbSizer2.Realize()

        bSizer16.Add(m_sdbSizer2, 0, wx.EXPAND, 5)

        self.SetSizer(bSizer16)
        self.Layout()

        # Connect Events
        self.search_symbol.Bind(wx.EVT_SEARCHCTRL_CANCEL_BTN,
                                self.onSearchSymbolCancel)
        self.search_symbol.Bind(wx.EVT_SEARCHCTRL_SEARCH_BTN,
                                self.onSearchSymbolButton)
        self.search_symbol.Bind(wx.EVT_TEXT_ENTER, self.onSearchSymbolEnter)
        self.tree_symbols.Bind(wx.dataview.EVT_DATAVIEW_SELECTION_CHANGED,
                               self.onTreeSymbolsSelectionChanged,
                               id=wx.ID_ANY)
        self.m_sdbSizer2Cancel.Bind(wx.EVT_BUTTON, self.onButtonCancelClick)
        self.m_sdbSizer2OK.Bind(wx.EVT_BUTTON, self.onButtonOkClick)
Ejemplo n.º 29
0
 def __init__(self, network, parent=None):
     wx.Frame.__init__(self,
                       parent=None,
                       title='MINST_APP',
                       size=(500, 400),
                       pos=(100, 100),
                       style=wx.DEFAULT_FRAME_STYLE | wx.TAB_TRAVERSAL)
     self.network = network
     '''工具栏'''
     self.sbar1 = self.CreateStatusBar()
     self.sbar1.SetStatusText('please draw a num')
     tbar1 = self.CreateToolBar(wx.TB_HORIZONTAL, wx.ID_ANY)
     tbar1.SetBackgroundColour(
         wx.SystemSettings.GetColour(wx.SYS_COLOUR_3DLIGHT))
     btn_clear = wx.Button(tbar1, label=u'clear')  # clear button
     tbar1.AddControl(btn_clear)
     btn_preidct = wx.Button(tbar1, label=u'predict')  # predict button
     tbar1.AddControl(btn_preidct)
     self.auto_predict = wx.CheckBox(
         tbar1, label=u'auto predict')  # auto predict checkbox
     tbar1.AddControl(self.auto_predict)
     tbar1.Realize()  # realize toolbar
     '''布局'''
     sizer = wx.BoxSizer(wx.HORIZONTAL)
     '''画图面板'''
     box_draw = wx.StaticBox(self, label='Draw')
     sizer_draw = wx.StaticBoxSizer(box_draw, wx.VERTICAL)
     draw_panel = wx.Panel(sizer_draw.GetStaticBox(), size=(280, 280))
     draw_panel.SetForegroundColour(wx.Colour(0, 0, 0))
     draw_panel.SetBackgroundColour(wx.Colour(255, 255, 255))
     draw_panel.SetMaxSize(wx.Size(280, 280))
     sizer_draw.Add(draw_panel)
     sizer.Add(sizer_draw)
     self.draw_panel = draw_panel
     self.draw_panel.Bind(wx.EVT_PAINT, self.OnPaint)
     '''预测面板'''
     box_predict = wx.StaticBox(self, label='Predict Result')
     sizer_predict = wx.StaticBoxSizer(box_predict, wx.VERTICAL)
     self.PredictRateList = []
     '''0'''
     sizer_predict0 = wx.BoxSizer(wx.HORIZONTAL)
     text0 = wx.StaticText(sizer_predict.GetStaticBox(), label=u'0')
     sizer_predict0.Add(text0)
     gauge0 = wx.Gauge(sizer_predict.GetStaticBox())
     gauge0.SetValue(0)
     sizer_predict0.Add(gauge0)
     self.PredictRateList.append(gauge0)
     sizer_predict.Add(sizer_predict0)
     '''1'''
     sizer_predict1 = wx.BoxSizer(wx.HORIZONTAL)
     text1 = wx.StaticText(sizer_predict.GetStaticBox(), label=u'1')
     sizer_predict1.Add(text1)
     gauge1 = wx.Gauge(sizer_predict.GetStaticBox())
     gauge1.SetValue(0)
     sizer_predict1.Add(gauge1)
     self.PredictRateList.append(gauge1)
     sizer_predict.Add(sizer_predict1)
     '''2'''
     sizer_predict2 = wx.BoxSizer(wx.HORIZONTAL)
     text2 = wx.StaticText(sizer_predict.GetStaticBox(), label=u'2')
     sizer_predict2.Add(text2)
     gauge2 = wx.Gauge(sizer_predict.GetStaticBox())
     gauge2.SetValue(0)
     sizer_predict2.Add(gauge2)
     self.PredictRateList.append(gauge2)
     sizer_predict.Add(sizer_predict2)
     '''3'''
     sizer_predict3 = wx.BoxSizer(wx.HORIZONTAL)
     text3 = wx.StaticText(sizer_predict.GetStaticBox(), label=u'3')
     sizer_predict3.Add(text3)
     gauge3 = wx.Gauge(sizer_predict.GetStaticBox())
     gauge3.SetValue(0)
     sizer_predict3.Add(gauge3)
     self.PredictRateList.append(gauge3)
     sizer_predict.Add(sizer_predict3)
     '''4'''
     sizer_predict4 = wx.BoxSizer(wx.HORIZONTAL)
     text4 = wx.StaticText(sizer_predict.GetStaticBox(), label=u'4')
     sizer_predict4.Add(text4)
     gauge4 = wx.Gauge(sizer_predict.GetStaticBox())
     gauge4.SetValue(0)
     sizer_predict4.Add(gauge4)
     self.PredictRateList.append(gauge4)
     sizer_predict.Add(sizer_predict4)
     '''5'''
     sizer_predict5 = wx.BoxSizer(wx.HORIZONTAL)
     text5 = wx.StaticText(sizer_predict.GetStaticBox(), label=u'5')
     sizer_predict5.Add(text5)
     gauge5 = wx.Gauge(sizer_predict.GetStaticBox())
     gauge5.SetValue(0)
     sizer_predict5.Add(gauge5)
     # PredictRateList = []
     self.PredictRateList.append(gauge5)
     sizer_predict.Add(sizer_predict5)
     '''6'''
     sizer_predict6 = wx.BoxSizer(wx.HORIZONTAL)
     text6 = wx.StaticText(sizer_predict.GetStaticBox(), label=u'6')
     sizer_predict6.Add(text6)
     gauge6 = wx.Gauge(sizer_predict.GetStaticBox())
     gauge6.SetValue(0)
     sizer_predict6.Add(gauge6)
     self.PredictRateList.append(gauge6)
     sizer_predict.Add(sizer_predict6)
     '''7'''
     sizer_predict7 = wx.BoxSizer(wx.HORIZONTAL)
     text7 = wx.StaticText(sizer_predict.GetStaticBox(), label=u'7')
     sizer_predict7.Add(text7)
     gauge7 = wx.Gauge(sizer_predict.GetStaticBox())
     gauge7.SetValue(0)
     sizer_predict7.Add(gauge7)
     self.PredictRateList.append(gauge7)
     sizer_predict.Add(sizer_predict7)
     '''8'''
     sizer_predict8 = wx.BoxSizer(wx.HORIZONTAL)
     text8 = wx.StaticText(sizer_predict.GetStaticBox(), label=u'8')
     sizer_predict8.Add(text8)
     gauge8 = wx.Gauge(sizer_predict.GetStaticBox())
     gauge8.SetValue(0)
     sizer_predict8.Add(gauge8)
     self.PredictRateList.append(gauge8)
     sizer_predict.Add(sizer_predict8)
     '''9'''
     sizer_predict9 = wx.BoxSizer(wx.HORIZONTAL)
     text9 = wx.StaticText(sizer_predict.GetStaticBox(), label=u'9')
     sizer_predict9.Add(text9)
     gauge9 = wx.Gauge(sizer_predict.GetStaticBox())
     gauge9.SetValue(0)
     sizer_predict9.Add(gauge9)
     self.PredictRateList.append(gauge9)
     sizer_predict.Add(sizer_predict9)
     '''result'''
     sizer_result = wx.BoxSizer(wx.HORIZONTAL)
     result = wx.StaticText(sizer_predict.GetStaticBox(),
                            label=u'本项目由我爱大蒜鼎力支持',
                            style=wx.ALIGN_CENTER_HORIZONTAL)
     sizer_predict.Add(result)
     sizer.Add(sizer_predict)
     self.SetSizer(sizer)
     self.Layout()
     self.Centre(wx.BOTH)
     self.mnistArray = np.zeros(28 * 28)
     self.Bind(wx.EVT_CLOSE, self.close)
     btn_clear.Bind(wx.EVT_BUTTON, self.Onclear)
     btn_preidct.Bind(wx.EVT_BUTTON, self.OnPredict)
     self.draw_panel.Bind(wx.EVT_LEFT_DOWN, self.Onleft_down)
     self.draw_panel.Bind(wx.EVT_LEFT_UP, self.Onleft_up)
     self.draw_panel.Bind(wx.EVT_MOTION, self.OnMotion)
     self.isdrawing = False
     self.lastX = 0
     self.lastY = 0
Ejemplo n.º 30
0
 def GetBestSize(self, grid, attr, dc, row, col):
     text = grid.GetCellValue(row, col)
     dc.SetFont(attr.GetFont())
     w, h = dc.GetMultiLineTextExtent(text)
     return wx.Size(w, h)