public void verificaTela(Form form)
        {
            formAux4 = form;

            if (formAux4.Equals(telaFuncionario.getInstancia()))
            {
                this.btnDadosPessoais.BackgroundImage = global::GuiWindowsForms.Properties.Resources.func_dados_71x62;
                this.btnDadosPessoais.Enabled = false;
                lblDados_Menu.Visible = true;
                lblDados_Menu.ForeColor = System.Drawing.Color.Yellow;

                this.btnDadosProfissionais.BackgroundImage = global::GuiWindowsForms.Properties.Resources.func_profissional_64x71_disabled;
                this.btnDadosProfissionais.Enabled = true;
                lblProfissionais_menu.Visible = false;
                lblProfissionais_menu.ForeColor = System.Drawing.Color.White;

            }
            else if (formAux4.Equals(telaFuncionarioDadosProfissionais.getInstancia()))
            {

                this.btnDadosProfissionais.BackgroundImage = global::GuiWindowsForms.Properties.Resources.func_profissional_64x71;
                this.btnDadosProfissionais.Enabled = false;
                lblProfissionais_menu.Visible = true;
                lblProfissionais_menu.ForeColor = System.Drawing.Color.Yellow;

                this.btnDadosPessoais.BackgroundImage = global::GuiWindowsForms.Properties.Resources.func_dados_71x62_disabled;
                this.btnDadosPessoais.Enabled = true;
                lblDados_Menu.Visible = false;
                lblDados_Menu.ForeColor = System.Drawing.Color.White;

            }
        }
        public void verificaTela(Form form)
        {
            formAux2 = form;

            if (formAux2.Equals(telaConfiguracoes.getInstancia()))
            {
                this.btnControledeAcesso.BackgroundImage = global::GuiWindowsForms.Properties.Resources.conf_acesso_64x80;
                this.btnControledeAcesso.Enabled = false; //mudar para true após (botão começa true também
                lblControleAcesso_menu.Visible = true;
                lblControleAcesso_menu.ForeColor = System.Drawing.Color.Yellow;
            }
            else if (formAux2.Equals(telaConfiguracoesControleDeAcesso.getInstancia()))
            {
                this.btnControledeAcesso.BackgroundImage = global::GuiWindowsForms.Properties.Resources.conf_acesso_64x80_disabled;
                this.btnControledeAcesso.Enabled = false;
                lblControleAcesso_menu.Visible = true;
                lblControleAcesso_menu.ForeColor = System.Drawing.Color.Yellow;
            }
        }
Ejemplo n.º 3
0
Archivo: Form.cs Proyecto: mind0n/hive
        /// <include file='doc\Form.uex' path='docs/doc[@for="Form.RemoveOwnedForm"]/*' />
        /// <devdoc>
        ///    <para>
        ///       Removes a form from the list of owned forms. Also sets the owner of the
        ///       removed form to null.
        ///    </para>
        /// </devdoc>
        public void RemoveOwnedForm(Form ownedForm) {
            if (ownedForm == null)
                return;

            if (ownedForm.OwnerInternal != null) {
                ownedForm.Owner = null; // NOTE: this will call RemoveOwnedForm again, bypassing if.
                return;
            }

            Form[] ownedForms = (Form[])Properties.GetObject(PropOwnedForms);
            int ownedFormsCount = Properties.GetInteger(PropOwnedFormsCount);

            if (ownedForms != null) {
                for (int i = 0; i < ownedFormsCount; i++) {
                    if (ownedForm.Equals(ownedForms[i])) {

                        // clear out the reference.
                        //
                        ownedForms[i] = null;

                        // compact the array.
                        //
                        if (i + 1 < ownedFormsCount) {
                            Array.Copy(ownedForms, i + 1, ownedForms, i, ownedFormsCount - i - 1);
                            ownedForms[ownedFormsCount - 1] = null;
                        }
                        ownedFormsCount--;
                    }
                }

                Properties.SetInteger(PropOwnedFormsCount, ownedFormsCount);
            }
        }
 public void RemoveOwnedForm(Form ownedForm)
 {
     if (ownedForm != null)
     {
         if (ownedForm.OwnerInternal != null)
         {
             ownedForm.Owner = null;
         }
         else
         {
             Form[] sourceArray = (Form[]) base.Properties.GetObject(PropOwnedForms);
             int integer = base.Properties.GetInteger(PropOwnedFormsCount);
             if (sourceArray != null)
             {
                 for (int i = 0; i < integer; i++)
                 {
                     if (ownedForm.Equals(sourceArray[i]))
                     {
                         sourceArray[i] = null;
                         if ((i + 1) < integer)
                         {
                             Array.Copy(sourceArray, i + 1, sourceArray, i, (integer - i) - 1);
                             sourceArray[integer - 1] = null;
                         }
                         integer--;
                     }
                 }
                 base.Properties.SetInteger(PropOwnedFormsCount, integer);
             }
         }
     }
 }
Ejemplo n.º 5
0
		/// <summary>
		/// Gets a value indicating if the Form can be found in any of the tabs.
		/// </summary>
		/// <param name="f"></param>
		/// <returns></returns>
		public bool ContainsMdiChild(Form f)
		{
			if (null == f)
				return false;

			foreach (MdiTabStripButton tsb in Items)
			{
				if (f.Equals(tsb.GetMdiChild()))
					return true;
			}

			return false;
		}
Ejemplo n.º 6
0
		/// <summary>
		/// Finds a tab from a Form.
		/// </summary>
		/// <param name="f"></param>
		/// <returns></returns>
		public MdiTabStripButton FindTab(Form f)
		{
			if (null == f)
				return null;

			foreach (MdiTabStripButton tsb in Items)
			{
				if (f.Equals(tsb.GetMdiChild()))
					return tsb;
			}

			return null;
		}
        public void verificaTela(Form form)
        {
            formAux = form;

            if (formAux.Equals(telaAluno.getInstancia()))
            {
                controlaBotoesMenu(telaAluno.getInstancia());
                this.btnDados.BackgroundImage = global::GuiWindowsForms.Properties.Resources.dados_73x74;
                this.btnDados.Enabled = false;
                lblDados_Menu.Visible = true;
                lblDados_Menu.ForeColor = System.Drawing.Color.Yellow;
            }
            else if (formAux.Equals(telaAlunoResponsavel.getInstancia()) || formAux.Equals(telaAlunoResponsavelVinculo.getInstancia()))
            {
                controlaBotoesMenu(telaAlunoResponsavel.getInstancia());
                this.btnResponsaveis.BackgroundImage = global::GuiWindowsForms.Properties.Resources.responsavel_73x66;
                this.btnResponsaveis.Enabled = false;
                lblResponsavel_menu.Visible = true;
                lblResponsavel_menu.ForeColor = System.Drawing.Color.Yellow;
            }
            else if (formAux.Equals(telaAlunoMedicacao.getInstancia()))
            {
                controlaBotoesMenu(telaAlunoMedicacao.getInstancia());
                this.btnInfoMedica.BackgroundImage = global::GuiWindowsForms.Properties.Resources.injecao_73x73;
                this.btnInfoMedica.Enabled = false;
                lblMedico_menu.Visible = true;
                lblMedico_menu.ForeColor = System.Drawing.Color.Yellow;
            }
            else if (formAux.Equals(telaAlunoFinanceiro.getInstancia()))
            {
                controlaBotoesMenu(telaAlunoFinanceiro.getInstancia());
                this.btnFinanceiro.BackgroundImage = global::GuiWindowsForms.Properties.Resources.financeiro_73x60;
                this.btnFinanceiro.Enabled = false;
                lblFinanceiro_menu.Visible = true;
                lblFinanceiro_menu.ForeColor = System.Drawing.Color.Yellow;
            }
            else if (formAux.Equals(telaAlunoAcademico.getInstancia()))
            {
                controlaBotoesMenu(telaAlunoAcademico.getInstancia());
                this.btnAcademico.BackgroundImage = global::GuiWindowsForms.Properties.Resources.academico_73x72;
                this.btnAcademico.Enabled = false;
                lblAcademico_menu.Visible = true;
                lblAcademico_menu.ForeColor = System.Drawing.Color.Yellow;
            }
            else if (formAux.Equals(telaAlunoMatricula.getInstancia()) || formAux.Equals(telaAlunoMatriculaAtividade.getInstancia()))
            {
                controlaBotoesMenu(telaAlunoMatricula.getInstancia());
                this.btnMatricula.BackgroundImage = global::GuiWindowsForms.Properties.Resources.matricula_68x69;
                this.btnMatricula.Enabled = false;
                lblMatricula_menu.Visible = true;
                lblMatricula_menu.ForeColor = System.Drawing.Color.Yellow;
            }
        }