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; } } } }
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); }
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; } }
internal byte[] GetActionIcon(Wrapper.Action ac) { Gdk.Pixbuf pix = ac.RenderIcon(Gtk.IconSize.Menu); if (pix == null) { return(null); } return(pix.SaveToBuffer("png")); }
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)); } }
public void NotifySignalChanged(Wrapper.Action action, string name, Signal oldSignal, Signal signal) { Gtk.Application.Invoke( delegate { if (!disposed) { designer.NotifySignalChanged(action, name, oldSignal, signal); } } ); }
public void NotifySignalAdded(Wrapper.Action action, string name, Signal signal) { Gtk.Application.Invoke( (o, args) => { if (!disposed) { designer.NotifySignalAdded(action, name, signal); } } ); }
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(); }; } }
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(); }
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; } }
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); }
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); }
void OnSignalChanged(object s, Stetic.SignalChangedEventArgs a) { Wrapper.Action action = (Wrapper.Action)a.Wrapper; frontend.NotifySignalChanged(action, action.Name, a.OldSignal, a.Signal); }