dialog implementation

This commit is contained in:
2018-07-19 15:47:57 +02:00
parent 73ea4d6838
commit a2bc980c64
4 changed files with 132 additions and 117 deletions

View File

@@ -0,0 +1,48 @@
/*
* GDSII-Converter
* Copyright (C) 2018 Mario Hüttel <mario.huettel@gmx.net>
*
* This file is part of GDSII-Converter.
*
* GDSII-Converter is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* GDSII-Converter is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GDSII-Converter. If not, see <http://www.gnu.org/licenses/>.
*/
#include "conv-settings-dialog.h"
G_DEFINE_TYPE(RendererSettingsDialog, renderer_settings_dialog, GTK_TYPE_DIALOG)
static void renderer_settings_dialog_class_init(RendererSettingsDialogClass *klass)
{
/* No special code needed. Child cells are destroyed automatically due to reference counter */
return;
}
static void renderer_settings_dialog_init(RendererSettingsDialog *self)
{
GtkBuilder *builder;
GtkBox *box;
GtkDialog *dialog;
dialog = &(self->parent);
builder = gtk_builder_new_from_resource("/dialog.glade");
box = GTK_BOX(gtk_builder_get_object(builder, "dialog-box"));
gtk_dialog_add_buttons(dialog, "Cancel", GTK_RESPONSE_CANCEL, "OK", GTK_RESPONSE_OK, NULL);
gtk_container_add(GTK_CONTAINER(dialog), box);
g_object_unref(builder);
}
GtkWidget *renderer_settings_dialog_new(void)
{
return (GtkWidget *) g_object_new(RENDERER_TYPE_SETTINGS_DIALOG, NULL);
}

View File

@@ -0,0 +1,39 @@
/*
* GDSII-Converter
* Copyright (C) 2018 Mario Hüttel <mario.huettel@gmx.net>
*
* This file is part of GDSII-Converter.
*
* GDSII-Converter is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* GDSII-Converter is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GDSII-Converter. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __CONV_SETTINGS_DIALOG_H__
#define __CONV_SETTINGS_DIALOG_H__
#include <gtk/gtk.h>
G_BEGIN_DECLS
G_DECLARE_FINAL_TYPE(RendererSettingsDialog, renderer_settings_dialog, RENDERER, SETTINGS_DIALOG, GtkDialog)
GtkWidget *renderer_settings_dialog_new(void);
struct _RendererSettingsDialog {
GtkDialog parent;
};
#define RENDERER_TYPE_SETTINGS_DIALOG (renderer_settings_dialog_get_type())
G_END_DECLS
#endif /* __CONV_SETTINGS_DIALOG_H__ */

View File

@@ -38,12 +38,12 @@ typedef struct _LayerElementPriv {
GtkCheckButton *export;
} LayerElementPriv;
typedef struct _LayerElement {
struct _LayerElement {
/* Inheritance */
GtkListBoxRow parent;
/* Custom Elements */
LayerElementPriv priv;
} LayerElement;
};
GtkWidget *layer_element_new(void);