Inheritance: Stetic.Wrapper.Object, IRadioGroupManagerProvider
Exemplo n.º 1
0
 void OnProjectReloaded(object s, EventArgs a)
 {
     // Called when the underlying project has changed. Object references need to be updated.
     if (autoCommitChanges)
     {
         if (designer != null)
         {
             if (groupToEdit != null)
             {
                 groupToolbar.ActiveGroup = project.ActionGroups [groupToEdit];
             }
             else
             {
                 Stetic.Wrapper.Container container = project.GetTopLevelWrapper(containerName, true);
                 groupToolbar.ActionGroups = container.LocalActionGroups;
             }
         }
     }
     else
     {
         // We only need to remap the actions
         group = project.ActionGroups [groupToEdit];
         actionCopyMap.Clear();
         foreach (Wrapper.Action dupac in groupCopy.Actions)
         {
             Wrapper.Action ac = group.GetAction(dupac.Name);
             if (ac != null)
             {
                 actionCopyMap [dupac] = ac;
             }
         }
     }
 }
Exemplo n.º 2
0
        public void RestoreState(object[] data)
        {
            if (data == null)
            {
                return;
            }

            groupCopy      = new Stetic.Wrapper.ActionGroup();
            groupCopy.Name = (string)data [0];

            XmlDocument doc = new XmlDocument();

            doc.LoadXml((string)data [2]);

            // Create the map which links edited action with source actions
            actionCopyMap.Clear();
            foreach (DictionaryEntry e in (Hashtable)data [1])
            {
                Wrapper.Action dupaction = groupCopy.GetAction((string)e.Key);
                Wrapper.Action action    = group.GetAction((string)e.Value);
                actionCopyMap [dupaction] = action;
            }

            groupCopy.SignalAdded   += new Stetic.SignalEventHandler(OnSignalAdded);
            groupCopy.SignalChanged += new Stetic.SignalChangedEventHandler(OnSignalChanged);
        }
Exemplo n.º 3
0
 public void SetSelectedAction(Wrapper.Action action)
 {
     // No need to create the designer if the active action is being set to null.
     if (action != null || designer != null)
     {
         Backend.Editor.SelectedAction = action;
     }
 }
Exemplo n.º 4
0
 internal byte[] GetActionIcon(Wrapper.Action ac)
 {
     Gdk.Pixbuf pix = ac.RenderIcon(Gtk.IconSize.Menu);
     if (pix == null)
     {
         return(null);
     }
     return(pix.SaveToBuffer("png"));
 }
Exemplo n.º 5
0
        internal void NotifySignalChanged(Wrapper.Action action, string name, Signal oldSignal, Signal signal)
        {
            ActionComponent c = (ActionComponent)app.GetComponent(action, name, null);

            if (c != null && SignalChanged != null)
            {
                SignalChanged(this, new ComponentSignalEventArgs(project, c, oldSignal, signal));
            }
        }
Exemplo n.º 6
0
 public void NotifySignalChanged(Wrapper.Action action, string name, Signal oldSignal, Signal signal)
 {
     Gtk.Application.Invoke(
         delegate { if (!disposed)
                    {
                        designer.NotifySignalChanged(action, name, oldSignal, signal);
                    }
         }
         );
 }
Exemplo n.º 7
0
 public void NotifySignalAdded(Wrapper.Action action, string name, Signal signal)
 {
     Gtk.Application.Invoke(
         (o, args) => { if (!disposed)
                        {
                            designer.NotifySignalAdded(action, name, signal);
                        }
         }
         );
 }
Exemplo n.º 8
0
        protected virtual void AddActionCommands(Wrapper.Action action)
        {
            if (allowBinding)
            {
                Gtk.ToolButton bindButton = new Gtk.ToolButton(null, Catalog.GetString("Bind to Field"));
                bindButton.IsImportant = true;
                bindButton.Show();
                Insert(bindButton, -1);
                if (action == null)
                {
                    bindButton.Sensitive = false;
                }

                bindButton.Clicked += delegate { frontend.NotifyBindField(); };
            }
        }
Exemplo n.º 9
0
        void UpdateActionCommands(Wrapper.Action action)
        {
            foreach (Gtk.Widget w in Children)
            {
                if (!internalButtons.Contains(w))
                {
                    Remove(w);
                    w.Destroy();
                }
            }
            AddActionCommands(action);

            if (internalButtons.Count > 0 && internalButtons.Count != Children.Length)
            {
                Insert(new Gtk.SeparatorToolItem(), internalButtons.Count);
            }
            ShowAll();
        }
Exemplo n.º 10
0
 public void GetSelectedAction(out Wrapper.Action action, out string name)
 {
     if (designer != null)
     {
         action = designer.Editor.SelectedAction;
         if (action != null)
         {
             name = action.Name;
         }
         else
         {
             name = null;
         }
     }
     else
     {
         action = null;
         name   = null;
     }
 }
Exemplo n.º 11
0
        string GetHandlerName(string signalName)
        {
            Wrapper.Widget selWidget = selection as Wrapper.Widget;
            if (selWidget != null)
            {
//				if (selWidget.IsTopLevel)
//					return "On" + signalName;
//				else
//					return "On" + GetIdentifier (selWidget.Wrapped.Name) + signalName;
                return(string.Format("{0}_{1}",
                                     GetIdentifier(selWidget.Wrapped.Name), signalName));
            }

            Wrapper.Action action = selection as Wrapper.Action;
            if (action != null)
            {
                return("On" + GetIdentifier(action.Name) + signalName);
            }

            return("On" + signalName);
        }
Exemplo n.º 12
0
        string GetHandlerName(string signalName)
        {
            Wrapper.Widget selWidget = selection as Wrapper.Widget;
            if (selWidget != null)
            {
                if (selWidget.IsTopLevel)
                {
                    return("On" + signalName);
                }
                else
                {
                    return("On" + GetIdentifier(selWidget.Wrapped.Name) + signalName);
                }
            }

            Wrapper.Action action = selection as Wrapper.Action;
            if (action != null)
            {
                return("On" + GetIdentifier(action.Name) + signalName);
            }

            return("On" + signalName);
        }
Exemplo n.º 13
0
 void OnSignalChanged(object s, Stetic.SignalChangedEventArgs a)
 {
     Wrapper.Action action = (Wrapper.Action)a.Wrapper;
     frontend.NotifySignalChanged(action, action.Name, a.OldSignal, a.Signal);
 }