private RmlElementEditor openRangeEditor(Element element, GuiFrameworkUICallback uiCallback, int left, int top)
        {
            //Find actions
            String actionName = element.GetAttribute("onchange").StringValue;

            if (String.IsNullOrEmpty(actionName))
            {
                actionName = Guid.NewGuid().ToString();
                element.SetAttribute("onclick", actionName);
            }
            SlideAction action = slide.getAction(actionName);

            if (action == null)
            {
                action = new BlendSceneAction(actionName);
                slide.addAction(action);
            }

            //Make copy of action, this is really important, a lot of the function of this editor assumes this
            //is copied.
            SlideAction editingAction = CopySaver.Default.copy(action);

            EditInterface editInterface = setupEditInterface(editingAction, slide);

            editInterfaceEditor = new EditInterfaceEditor("Blend", editInterface, uiCallback);
            //appearanceEditor = new EditInterfaceEditor("Appearance", elementStyle.getEditInterface(), uiCallback);
            RmlElementEditor editor = RmlElementEditor.openEditor(element, left, top, this);

            editor.addElementEditor(editInterfaceEditor);
            return(editor);
        }
Exemplo n.º 2
0
        public override RmlElementEditor openEditor(Element element, GuiFrameworkUICallback uiCallback, int left, int top)
        {
            attributeEditor = new ElementAttributeEditor(element, uiCallback);
            RmlElementEditor editor = RmlElementEditor.openEditor(element, left, top, this);

            editor.addElementEditor(attributeEditor);
            return(editor);
        }
Exemplo n.º 3
0
        public override bool delete(Element element, RmlElementEditor editor, RmlWysiwygComponent component)
        {
            String text = element.InnerRml;

            if (String.IsNullOrEmpty(text))
            {
                component.deleteElement(element);
                return(true);
            }
            return(false);
        }
Exemplo n.º 4
0
        public override bool delete(Element element, RmlElementEditor editor, RmlWysiwygComponent component)
        {
            String src = element.GetAttributeString("src");

            if (String.IsNullOrEmpty(src))
            {
                component.deleteElement(element);
                return(true);
            }
            return(false);
        }
        public override bool applyChanges(Element element, RmlElementEditor editor, RmlWysiwygComponent component, out TwoWayCommand additionalUndoOperations)
        {
            additionalUndoOperations = null;
            switch (element.GetAttributeString("type"))
            {
            case "range":
                return(applyRangeChanges(element, editor, component));

            default:
                return(false);
            }
        }
Exemplo n.º 6
0
        public override RmlElementEditor openEditor(Element element, GuiFrameworkUICallback uiCallback, int left, int top)
        {
            bool hasFullscreen = element.HasAttribute("onclick");

            appearance          = new ImageElementStyle(element);
            appearance.Changed += appearance_Changed;
            appearanceEditor    = new EditInterfaceEditor("Appearance", appearance.getEditInterface(), uiCallback);
            slideImageEditor    = new SlideImageComponent(editorResourceProvider, subdirectory, element.GetAttributeString("src"), hasFullscreen);
            RmlElementEditor editor = RmlElementEditor.openEditor(element, left, top, this);

            editor.addElementEditor(slideImageEditor);
            editor.addElementEditor(appearanceEditor);
            return(editor);
        }
        public override RmlElementEditor openEditor(Element element, GuiFrameworkUICallback uiCallback, int left, int top)
        {
            elementStyle          = new TextElementStyle(element, true);
            elementStyle.Changed += elementStyle_Changed;
            String rml = DecodeFromHtml(element.InnerRml);

            textEditor       = new ElementTextEditor(rml);
            appearanceEditor = new EditInterfaceEditor("Appearance", elementStyle.getEditInterface(), uiCallback);
            RmlElementEditor editor = RmlElementEditor.openEditor(element, left, top, this);

            editor.addElementEditor(textEditor);
            editor.addElementEditor(appearanceEditor);
            return(editor);
        }
Exemplo n.º 8
0
        public override RmlElementEditor openEditor(Element element, GuiFrameworkUICallback uiCallback, int left, int top)
        {
            elementStyle          = new TextElementStyle(element, true);
            elementStyle.Changed += elementStyle_Changed;
            appearanceEditor      = new EditInterfaceEditor("Appearance", elementStyle.getEditInterface(), uiCallback);

            dataElementEditor = new DataElementEditor(element);
            EditInterface editInterface = dataElementEditor.EditInterface;

            editInterfaceEditor = new EditInterfaceEditor("Data Display Properties", editInterface, uiCallback);
            dataElementEditor.EditInterfaceEditor = editInterfaceEditor;
            RmlElementEditor editor = RmlElementEditor.openEditor(element, left, top, this);

            editor.addElementEditor(editInterfaceEditor);
            editor.addElementEditor(appearanceEditor);

            return(editor);
        }
Exemplo n.º 9
0
        public override bool applyChanges(Element element, RmlElementEditor editor, RmlWysiwygComponent component, out TwoWayCommand additionalUndoOperations)
        {
            additionalUndoOperations = null;
            switch (element.GetAttributeString("type"))
            {
            case "range":
                attributeEditor.applyToElement(element);
                break;

            default:
                String text = textEditor.Text;
                element.InnerRml = textEditor.Text;
                attributeEditor.applyToElement(element);
                break;
            }


            return(true);
        }
Exemplo n.º 10
0
        public override RmlElementEditor openEditor(Element element, GuiFrameworkUICallback uiCallback, int left, int top)
        {
            RmlElementEditor editor = RmlElementEditor.openEditor(element, left, top, this);

            switch (element.GetAttributeString("type"))
            {
            case "range":
                attributeEditor = new ElementAttributeEditor(element, uiCallback);
                editor.addElementEditor(attributeEditor);
                break;

            default:
                textEditor      = new ElementTextEditor(element.InnerRml);
                attributeEditor = new ElementAttributeEditor(element, uiCallback);
                editor.addElementEditor(textEditor);
                editor.addElementEditor(attributeEditor);
                break;
            }
            return(editor);
        }
Exemplo n.º 11
0
        public override RmlElementEditor openEditor(Element element, GuiFrameworkUICallback uiCallback, int left, int top)
        {
            elementStyle          = new TextElementStyle(element, false);
            elementStyle.Changed += elementStyle_Changed;
            String rml = TextElementStrategy.DecodeFromHtml(element.InnerRml);

            textEditor = new ElementTextEditor(rml);
            String actionName = element.GetAttribute("onclick").StringValue;

            if (String.IsNullOrEmpty(actionName))
            {
                actionName = Guid.NewGuid().ToString();
                element.SetAttribute("onclick", actionName);
            }
            SlideAction action = slide.getAction(actionName);

            if (action == null)
            {
                action = ((Func <String, SlideAction>)actionTypeBrowser.DefaultSelection.Value)(actionName);
                slide.addAction(action);
            }

            //Make copy of action, this is really important, a lot of the function of this editor assumes this
            //is copied.
            SlideAction editingAction = CopySaver.Default.copy(action);

            EditInterface editInterface = setupEditInterface(editingAction, slide);

            actionEditor     = new EditInterfaceEditor("Action", editInterface, uiCallback);
            appearanceEditor = new EditInterfaceEditor("Appearance", elementStyle.getEditInterface(), uiCallback);
            RmlElementEditor editor = RmlElementEditor.openEditor(element, left, top, this);

            editor.addElementEditor(textEditor);
            editor.addElementEditor(actionEditor);
            editor.addElementEditor(appearanceEditor);
            return(editor);
        }
Exemplo n.º 12
0
 public override bool applyChanges(Element element, RmlElementEditor editor, RmlWysiwygComponent component, out TwoWayCommand additionalUndoOperations)
 {
     additionalUndoOperations = null;
     return(attributeEditor.applyToElement(element));
 }
Exemplo n.º 13
0
 public override void attachToParent(RmlElementEditor parentEditor, Widget parent)
 {
     base.attachToParent(parentEditor, parent);
     text.KeyButtonReleased += text_KeyButtonReleased;
     InputManager.Instance.setKeyFocusWidget(text);
 }
Exemplo n.º 14
0
 public override void attachToParent(RmlElementEditor parentEditor, Widget parent)
 {
     base.attachToParent(parentEditor, parent);
     propertiesForm.layout();
 }
Exemplo n.º 15
0
 public override bool applyChanges(Element element, RmlElementEditor editor, RmlWysiwygComponent component, out TwoWayCommand additionalUndoOperations)
 {
     additionalUndoOperations = null;
     build(element);
     return(true);
 }
Exemplo n.º 16
0
        public override bool applyChanges(Element element, RmlElementEditor editor, RmlWysiwygComponent component, out TwoWayCommand additionalUndoOperations)
        {
            element.ClearLocalStyles();
            StringBuilder styleString = new StringBuilder();
            StringBuilder classString = new StringBuilder();
            bool          changesMade = false;

            element.SetAttribute("src", slideImageEditor.ImageName);
            if (slideImageEditor.ShowFullscreen)
            {
                String actionName = element.GetAttributeString("onclick");
                if (actionName == null)
                {
                    actionName = Guid.NewGuid().ToString();
                    element.SetAttribute("onclick", actionName);
                }

                Action <ShowPopupImageAction> undoAction;
                ShowPopupImageAction          oldAction = slide.getAction(actionName) as ShowPopupImageAction;
                if (oldAction == null)
                {
                    undoAction = a =>
                    {
                        slide.removeAction(actionName);
                    };
                }
                else
                {
                    undoAction = a =>
                    {
                        slide.replaceAction(a);
                    };
                }

                var action = new ShowPopupImageAction(actionName)
                {
                    ImageName = slideImageEditor.ImageName,
                };

                additionalUndoOperations = new TwoWayDelegateCommand <ShowPopupImageAction, ShowPopupImageAction>(action, oldAction, new TwoWayDelegateCommand <ShowPopupImageAction, ShowPopupImageAction> .Funcs()
                {
                    ExecuteFunc = (exec) =>
                    {
                        slide.replaceAction(exec);
                    },
                    UndoFunc = undoAction,
                });

                additionalUndoOperations.execute(); //This is not called automatically by the classes consuming this, so we make sure to actually apply the changes
            }
            else
            {
                String actionName = element.GetAttributeString("onclick");
                ShowPopupImageAction oldAction = null;
                if (actionName != null)
                {
                    oldAction = slide.getAction(actionName) as ShowPopupImageAction;
                }

                if (oldAction != null)
                {
                    additionalUndoOperations = new TwoWayDelegateCommand <ShowPopupImageAction, ShowPopupImageAction>(null, oldAction, new TwoWayDelegateCommand <ShowPopupImageAction, ShowPopupImageAction> .Funcs()
                    {
                        ExecuteFunc = (exec) =>
                        {
                            slide.removeAction(actionName);
                        },
                        UndoFunc = (undo) =>
                        {
                            slide.replaceAction(undo);
                        }
                    });
                    additionalUndoOperations.execute(); //Make sure changes are applied
                }
                else
                {
                    additionalUndoOperations = null;
                }

                element.RemoveAttribute("onclick");
            }
            changesMade = appearance.buildClassList(classString) | changesMade;
            changesMade = appearance.buildStyleAttribute(styleString) | changesMade;
            if (changesMade)
            {
                if (classString.Length > 0)
                {
                    element.SetAttribute("class", classString.ToString());
                }
                else
                {
                    element.RemoveAttribute("class");
                }
                if (styleString.Length > 0)
                {
                    element.SetAttribute("style", styleString.ToString());
                }
                else
                {
                    element.RemoveAttribute("style");
                }
            }

            return(changesMade);
        }
Exemplo n.º 17
0
 private bool applyRangeChanges(Element element, RmlElementEditor editor, RmlWysiwygComponent component)
 {
     return(true);
 }