void doTaskDetailWindow(int windowID)
    {
        SetupTestList ();
        GUIComponents.labelDetail(new Rect(20,30,310,20),"Id Tarea: ",t.getId_Task().ToString());
        GUI.contentColor = Color.yellow;
        int heightActual = 55;
        GUI.Label(new Rect(20,55,310,20),"Descripcion:");
        int offset = 18*((int)(t.getDescripcion().Length/50)+1);
        if (offset > 53){
            offset = 53;
        }
        heightActual = heightActual + offset + 25;
        GUI.contentColor = Color.white;
        GUI.Label(new Rect(40,75,290,offset),t.getDescripcion());
        GUIComponents.labelDetail(new Rect(20,heightActual,310,20),"Responsable: ",t.getResponsable());
        heightActual = heightActual + 25;
        GUIComponents.labelDetail(new Rect(20,heightActual,310,20),"Tiempo estimado: ",t.getT_Estimado().ToString());
        heightActual = heightActual + 25;
        GUIComponents.labelDetail(new Rect(20,heightActual,310,20),"Tiempo total: ",t.getT_Total().ToString());
        heightActual = heightActual + 25;
        GUIComponents.labelDetail(new Rect(20,heightActual,310,20),"Prioridad: ",t.getPrioridad().ToString());
        heightActual = heightActual + 25;
        GUIComponents.labelDetail(new Rect(20,heightActual,310,20),"Estado: ",t.getEstado());
        heightActual = heightActual + 25;
        GUI.Label (new Rect(20,heightActual,310,20),"Tests Asociados:");

        //Cargar los criterios en area con barra deslizable

        heightActual = heightActual + 30;
        GUILayout.BeginArea (new Rect (15, heightActual, 350, 220));

        gameScrollPositionTests = GUILayout.BeginScrollView (gameScrollPositionTests, GUILayout.Width (300), GUILayout.Height (100));

        int height = 0;
        foreach(string nameTest in testsNameStrings)
        {
            idtest = Convert.ToInt64(nameTest.Split(' ')[0]);
            Test test=this.getTest(idtest);
            if (GUI.Button(new Rect (10,height ,200, 20),nameTest)){

                GameObject g = new GameObject();
                g.AddComponent<GUI_DetalleTest>();
                g.SendMessage("setAnterior",this);
                g.SendMessage("setTest",test);
                g.SendMessage("Mostrar");
                openWindow = false;
            }

            if (GUI.Button(new Rect (220, height ,80, 20),"Eliminar")){
                AsociacionTareaTest a = new AsociacionTareaTest (t.getId_Task (), test.getIdTest ());
                MultiPlayer.Instance.getSmartFox().Send(new ExtensionRequest("eliminarAsociacion",a.toSFSObject()));
                EliminarAsociacion(idtest);
                GameObject g = new GameObject ();
                g.AddComponent <GUI_Mensaje>();
                g.SendMessage ("setAnterior", this);
                g.SendMessage ("setTitulo", "OK");
                g.SendMessage ("setMensaje", "Asociacion eliminada exitosamente.");
                g.SendMessage ("Mostrar");
                openWindow = false;
            }

            height += 25;
        }

        GUILayout.EndScrollView ();
        GUILayout.EndArea ();

        if (GUI.Button(new Rect(maxWidth/2-120,maxHeight-35,100,20),"Asociar Test")){
            GameObject g = new GameObject();
            g.AddComponent<GUI_AsociarTest>();
            g.SendMessage ("setTarea", t);
            g.SendMessage("setAnterior", this);
            g.SendMessage("Mostrar");
            openWindow = false;
        }

        if (GUI.Button(new Rect(maxWidth/2+20,maxHeight-35,100,20),"Cerrar")){
            openWindow = false;
            try {
                this.ant.Mostrar();
            }
            catch{
                Debug.Log("No tiene anterior porque viene del taskboard");
            }
            Destroy(this);
        }
    }
Example #2
0
    /*
    //destruye una ventana segun el ID que viene en el parametro nv
    public void removeVentana(int nv)
    {
        destruirVentana(nv);
        activarVentana();
    }

    //destruye una ventana segun el ID que viene en el parametro nv
    //y cierra la ventana principal de la user Story
    public void cerrarTodo(int nv)
    {
        destruirVentana(nv);
        usWindow=false;

    }
    */
    void doNewusWindow(int windowID)
    {
        Debug.Log ("Entrando " + t.getId_Story());

        setupAvailableTests ();
        if (testsNameStrings.Length != 0) {
                        int heightActual = 25;
                        GUI.contentColor = Color.yellow;
                        GUI.Label (new Rect (20, heightActual, 310, 20), "Tests Disponibles:");

                        GUI.contentColor = Color.white;
                        heightActual = heightActual + 20;
                        GUILayout.BeginArea (new Rect (15, heightActual, 350, 220));

                        gameScrollPositionTests = GUILayout.BeginScrollView (gameScrollPositionTests, GUILayout.Width (300), GUILayout.Height (200));
                        roomSelection = GUILayout.SelectionGrid (roomSelection, testsNameStrings, 1, GUI.skin.GetStyle ("button"));

                        if (roomSelection >= 0) {
                                ArrayList lista = listaTests;
                                test = (Test)lista [roomSelection];
                                AsociacionTareaTest a = new AsociacionTareaTest (t.getId_Task (), test.getIdTest ());
                                MultiPlayer.Instance.getSmartFox ().Send (new ExtensionRequest ("agregarAsociacionTareaTest", a.toSFSObject ()));

                                MultiPlayer.Instance.getSmartFox ().ProcessEvents ();

                                GameObject g = new GameObject ();
                                g.AddComponent <GUI_Mensaje>();
                                g.SendMessage ("setAnterior", this);
                                g.SendMessage ("setTitulo", "OK");
                                g.SendMessage ("setMensaje", "Asociado exitosamente.");
                                g.SendMessage ("Mostrar");
                                usWindow = false;
                                roomSelection = -1;
                        }
                        GUILayout.EndScrollView ();
                        GUILayout.EndArea ();

                        if (GUI.Button (new Rect (maxWidth / 2 - 70, maxHeight - 50, 140, 40), "Cancelar")) {
                                usWindow = false;
                                ant.Mostrar ();
                                Destroy (this);
                        }
        } else {

                        GUI.contentColor = Color.white;
                        GUI.Label (new Rect (20, maxHeight / 2 - 40, 310, 20), "No existen Tests disponibles para ser asociados.");
                        if (GUI.Button (new Rect (maxWidth / 2 - 70, maxHeight - 50, 140, 40), "Volver")) {
                                usWindow = false;
                                ant.Mostrar ();
                                Destroy (this);

                        }
                }
    }