private void WriteSignalsCallback(BindingForm form) { // Form signals WriteText("// GtkWindow signals Callback"); foreach (BindingSignal signal in form.Signals) { WriteText(signal.BuildSourceCallback(form.Class) + "{"); WriteText(Utils.Tabs(1) + "// Callback code"); WriteText("}\n"); } WriteText(""); WriteText("// --- Widgets signals Callbacks"); foreach (BindingWidget widget in form.Widgets) { WriteText("// Signal callbacks for Widget " + widget.Id); foreach (BindingSignal signal in widget.Signals) { WriteText(signal.BuildSourceCallback(form.Class) + "{"); WriteText(Utils.Tabs(1) + "// Callback code"); WriteText("}\n"); } WriteText(""); } }
private void FormGridView_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { // Open a new form with the corresponding widget lists var pressed_cell = e.RowIndex; BindingForm source = (BindingForm)Storage.Parser.FormBindingSources[pressed_cell]; var WidgetContainer = GuiManager.CreateWidgetPanel(source); }
private void WriteSignalsCallback(BindingForm form) { // Form signals WriteText(Utils.Tabs(1) + "// GtkWindow signals Callback"); foreach (BindingSignal signal in form.Signals) { WriteText(Utils.Tabs(1) + signal.Prototype); } WriteText(""); WriteText(Utils.Tabs(1) + "// --- Widgets signals Callbacks"); foreach (BindingWidget widget in form.Widgets) { WriteText(Utils.Tabs(1) + "// Callbacks for Widget " + widget.Id); if (widget.Signals != null) { foreach (BindingSignal signal in widget.Signals) { WriteText(Utils.Tabs(1) + signal.Prototype); } } WriteText(""); } }
public void ProcessSingleSource(BindingForm form) { //Initialize the stream for the current class form.SourceCodeStream = new MemoryStream(); // Initialize the IOManager for current Form form IOManager = new StreamIOManager(form.SourceCodeStream); // Constructor WriteConstructors(form); // InitComponents WriteInitComponents(form); // Show function WriteText(form.Class + "::" + "Show() {"); WriteText(Utils.Tabs(1) + "window->show();"); WriteText("}\n"); // Close function WriteText(form.Class + "::" + "Close() {"); WriteText(Utils.Tabs(1) + "window->close();"); WriteText("}\n"); // Hide function WriteText(form.Class + "::" + "Hide() {"); WriteText(Utils.Tabs(1) + "window->hide();"); WriteText("}\n"); // Signal callbacks WriteSignalsCallback(form); // Write to file IOManager.StreamToFile(SourcePath + CurrentForm.Class + ".cpp"); }
private void BuildHeader(BindingForm form) { //Initialize the stream for the current class form.HeaderCodeStream = new MemoryStream(); // Initialize the IOManager for current Form form IOManager = new StreamIOManager(form.HeaderCodeStream); // Head WriteHead(CurrentForm.Class); // Public methods and vars WriteConstructor(form.Class); WriteConstructor(form.Class, "Glib::Dispatcher *dispatcher"); WriteVariable(new Utils.CppVariable("Gtk::Window", "window", true)); WritePrototype("void", "Show"); WritePrototype("void", "Hide"); WritePrototype("void", "Close"); // Private members WriteText(Utils.Tabs(1) + "private:"); //Widgets WriteWidgetStruct(); WritePrototype("void", "Init"); //TODO CALLBACKS SIGNAL WriteSignalsCallback(form); // Write to file IOManager.StreamToFile(SourcePath + CurrentForm.Class + ".h"); }
public static SignalContainer CreateSignalPanel(BindingForm form) { long guid = form.GUISignalContainerId; SignalContainer container = CreateSignalPanel(guid, "Signals for Window " + form.Id, form.Signals); form.GUISignalContainerId = container.ID; return(container); }
public GenerateDialogViewModel(Action close) { _close = close; BindingData = new BindingForm(); BindingData.Number = "1"; BindingData.Prefix = "variant"; BindingData.Directory = AppDomain.CurrentDomain.BaseDirectory; }
private void WriteConstructors(BindingForm form) { WriteText(form.Class + "::" + form.Class + "() {"); WriteText(Utils.Tabs(1) + "InitComponents();"); WriteText("}"); WriteText(""); WriteText(form.Class + "::" + form.Class + "(Glib::Dispatcher *dispatcher) {"); WriteText(Utils.Tabs(1) + form.Class + "Dispatcher = dispatcher;"); WriteText("}"); WriteText(""); }
public void ProcessSources() { foreach (var objForm in DataSource) { var form = (BindingForm)objForm; if (form.CodeProcess) { CurrentForm = form; ProcessSingleSource(form); } } }
public void ProcessHeaders() { foreach (var objForm in DataSource) { var form = (BindingForm)objForm; if (form.CodeProcess) { CurrentForm = form; BuildHeader(form); } } }
private void WriteInitComponents(BindingForm form) { WriteText(form.Class + "::" + "InitComponents() {"); WriteText(Utils.Tabs(1) + "builder->get_widget(\"" + form.Id + "\", window);"); WriteText(""); WriteText(Utils.Tabs(1) + "// Widgets initialisation"); List <string> initcomplist = new List <string>(); foreach (BindingWidget widget in form.Widgets) { if (widget.AddToClass) { initcomplist.Add(Utils.Tabs(1) + "builder->get_widget(\"" + widget.Name + "\"," + widget.VariableName + ");"); } } IOManager.WriteListOfStringIntoStream(initcomplist); WriteText("}"); }
public static WidgetContainer CreateWidgetPanel(BindingForm form) { if (form.GUIContainerId < 0) { // Non è stato ancora creato il pannello relativo al widget WidgetContainer widgetContainer = new WidgetContainer(form); form.GUIContainerId = widgetContainer.ID; widgetContainer.Text = "Form " + form.Id; widgetContainer.Show(GuiManager.dockPanel, DockState.DockRight); WidgetContainersList.Add(widgetContainer); return(widgetContainer); } else { //Search for the WidgetContainer with GUIContainerId WidgetContainer container = WidgetContainersList.Find(obj => obj.ID == form.GUIContainerId); //container.Focus(); container.Show(); return(container); } }
public WidgetContainer(BindingForm form) { InitializeComponent(); bindingForm = form; SetDataSource(bindingForm.Widgets); }