Ejemplo n.º 1
0
        protected virtual void SetUpDelegates()
        {
            Button button;

            List<string> propList = new List<string>();
            propList.Add("Name");
            button = new Button("", 200, 30, 1, propList, false);
            button.callback = new EditPropertyDelegate(CallbackMethod);
            buttonDictionary.Add("Name", button);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Este método tiene una falla conceptual gigante, y es que está creando en el modelo elementos de la vista.
        /// En si esto no es tan terrible, si es que todos los datos necesarios son provistos de la vista,
        /// lo cual no es el caso.
        /// TODO: Separar lógica modelo-vista.
        /// </summary>
        protected override void SetUpDelegates()
        {
            Button button;

            // Creamos las listas de nombres de propiedades
            // (Podría perfectamente haber heredado los botones, pero no lo hice... LAZYNESS!)
            List<string> xyzList = new List<string>();
            xyzList.Add("X"); xyzList.Add("Y"); xyzList.Add("Z");

            // Posición
            button = new Button("Position", 60, 20, 3, xyzList);
            button.callback = new EditPropertyDelegate(CallbackMethod);
            buttonDictionary.Add("Position", button);
            // Rotación
            button = new Button("Rotation", 60, 20, 3, xyzList);
            button.callback = new EditPropertyDelegate(CallbackMethod);
            buttonDictionary.Add("Rotation", button);
            // Escala
            button = new Button("Scale", 60, 20, 3, xyzList);
            button.callback = new EditPropertyDelegate(CallbackMethod);
            buttonDictionary.Add("Scale", button);
            // Vertex 0
            button = new Button("Vertex 0", 60, 20, 3, xyzList);
            button.callback = new EditPropertyDelegate(CallbackMethod);
            buttonDictionary.Add("Vertex 0", button);
            // Vertex 1
            button = new Button("Vertex 1", 60, 20, 3, xyzList);
            button.callback = new EditPropertyDelegate(CallbackMethod);
            buttonDictionary.Add("Vertex 1", button);
            // Vertex 2
            button = new Button("Vertex 2", 60, 20, 3, xyzList);
            button.callback = new EditPropertyDelegate(CallbackMethod);
            buttonDictionary.Add("Vertex 2", button);

            base.SetUpDelegates();
        }
Ejemplo n.º 3
0
        protected override void SetUpDelegates()
        {
            Button button;

            // Creamos las listas de nombres de propiedades
            // (Podría perfectamente haber heredado los botones, pero no lo hice... LAZYNESS!)
            List<string> xyzList = new List<string>();
            xyzList.Add("X"); xyzList.Add("Y"); xyzList.Add("Z");

            // Posición
            button = new Button("Center", 60, 20, 3, xyzList);
            button.callback = new EditPropertyDelegate(CallbackMethod);
            buttonDictionary.Add("Center", button);

            // Radio
            List<string> list = new List<string>();
            list.Add("Radius");
            button = new Button("Radius", 60, 20, 1, list);
            button.callback = new EditPropertyDelegate(CallbackMethod);
            buttonDictionary.Add("Radius", button);

            base.SetUpDelegates();
        }