コード例 #1
0
        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("");
            }
        }
コード例 #2
0
 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);
 }
コード例 #3
0
ファイル: BuildHeaders.cs プロジェクト: c-buzz/GladeToCpp
        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("");
            }
        }
コード例 #4
0
        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");
        }
コード例 #5
0
ファイル: BuildHeaders.cs プロジェクト: c-buzz/GladeToCpp
        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");
        }
コード例 #6
0
        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);
        }
コード例 #7
0
 public GenerateDialogViewModel(Action close)
 {
     _close                = close;
     BindingData           = new BindingForm();
     BindingData.Number    = "1";
     BindingData.Prefix    = "variant";
     BindingData.Directory = AppDomain.CurrentDomain.BaseDirectory;
 }
コード例 #8
0
        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("");
        }
コード例 #9
0
        public void ProcessSources()
        {
            foreach (var objForm in DataSource)
            {
                var form = (BindingForm)objForm;

                if (form.CodeProcess)
                {
                    CurrentForm = form;
                    ProcessSingleSource(form);
                }
            }
        }
コード例 #10
0
ファイル: BuildHeaders.cs プロジェクト: c-buzz/GladeToCpp
        public void ProcessHeaders()
        {
            foreach (var objForm in DataSource)
            {
                var form = (BindingForm)objForm;

                if (form.CodeProcess)
                {
                    CurrentForm = form;
                    BuildHeader(form);
                }
            }
        }
コード例 #11
0
        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("}");
        }
コード例 #12
0
 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);
     }
 }
コード例 #13
0
ファイル: WidgetContainer.cs プロジェクト: c-buzz/GladeToCpp
 public WidgetContainer(BindingForm form)
 {
     InitializeComponent();
     bindingForm = form;
     SetDataSource(bindingForm.Widgets);
 }