Skip to content

Commit

Permalink
ADDED modeller code (basic app frame, no logic yet)
Browse files Browse the repository at this point in the history
  • Loading branch information
ksterker committed Aug 17, 2009
1 parent bc8b67f commit 6c1d0d2
Show file tree
Hide file tree
Showing 14 changed files with 2,405 additions and 2 deletions.
1 change: 1 addition & 0 deletions configure.in
Expand Up @@ -233,6 +233,7 @@ src/backend/Makefile
src/common/Makefile
src/dlgedit/Makefile
src/mapedit/Makefile
src/modeller/Makefile
src/questedit/Makefile
test/Makefile
])
2 changes: 1 addition & 1 deletion src/Makefile.am
@@ -1,2 +1,2 @@
SUBDIRS = backend common dlgedit mapedit questedit
SUBDIRS = backend common dlgedit mapedit modeller questedit

12 changes: 11 additions & 1 deletion src/common/gui_file.cc
Expand Up @@ -102,9 +102,19 @@ bool GuiFile::run ()

void GuiFile::add_filter (const std::string & pattern, const std::string & name)
{
unsigned long pos;
std::string pattern_str = pattern;
GtkFileFilter *filter = gtk_file_filter_new ();
gtk_file_filter_set_name (filter, name.c_str ());
gtk_file_filter_add_pattern (filter, pattern.c_str ());

while ((pos = pattern_str.find ('|')) != std::string::npos)
{
std::string filter_str = pattern_str.substr (0, pos);
pattern_str = pattern_str.substr (pos + 1);
gtk_file_filter_add_pattern (filter, filter_str.c_str ());
}

gtk_file_filter_add_pattern (filter, pattern_str.c_str ());
gtk_file_chooser_add_filter (GTK_FILE_CHOOSER(window), filter);
gtk_file_chooser_set_filter (GTK_FILE_CHOOSER(window), filter);
}
447 changes: 447 additions & 0 deletions src/mapedit/entity-properties.glade

Large diffs are not rendered by default.

195 changes: 195 additions & 0 deletions src/mapedit/grid-properties.glade
@@ -0,0 +1,195 @@
<?xml version="1.0"?>
<interface>
<!-- interface-requires gtk+ 2.12 -->
<!-- interface-naming-policy toplevel-contextual -->
<object class="GtkDialog" id="dialog1">
<property name="border_width">5</property>
<property name="type">popup</property>
<property name="resizable">False</property>
<property name="default_width">200</property>
<property name="default_height">80</property>
<property name="type_hint">normal</property>
<property name="decorated">False</property>
<property name="deletable">False</property>
<property name="has_separator">False</property>
<child internal-child="vbox">
<object class="GtkVBox" id="dialog-vbox1">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
<child>
<object class="GtkTable" id="table1">
<property name="visible">True</property>
<property name="n_rows">3</property>
<property name="n_columns">3</property>
<property name="column_spacing">4</property>
<property name="row_spacing">4</property>
<child>
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="label" translatable="yes">X</property>
<property name="justify">right</property>
</object>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options"></property>
<property name="y_options"></property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="xalign">1</property>
<property name="yalign">1</property>
<property name="label" translatable="yes">Y</property>
<property name="justify">right</property>
</object>
<packing>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options"></property>
<property name="y_options"></property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="label" translatable="yes">Offset</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label4">
<property name="visible">True</property>
<property name="label" translatable="yes">Spacing</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="x_offset">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property>
<property name="xalign">1</property>
<property name="overwrite_mode">True</property>
<property name="numeric">True</property>
<property name="wrap">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="y_offset">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property>
<property name="xalign">1</property>
<property name="overwrite_mode">True</property>
<property name="numeric">True</property>
<property name="wrap">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="x_spacing">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property>
<property name="xalign">1</property>
<property name="overwrite_mode">True</property>
<property name="numeric">True</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="y_spacing">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property>
<property name="xalign">1</property>
<property name="overwrite_mode">True</property>
<property name="numeric">True</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
</packing>
</child>
<child>
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="stock">gtk-zoom-fit</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="cb_autoadjust">
<property name="label" translatable="yes">Auto-adjust</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="has_tooltip">True</property>
<property name="tooltip_text">If selected, the grid will automatically adapt to the selected object.</property>
<property name="focus_on_click">False</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="padding">2</property>
<property name="position">2</property>
</packing>
</child>
<child internal-child="action_area">
<object class="GtkHButtonBox" id="dialog-action_area">
<property name="width_request">0</property>
<property name="height_request">0</property>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
</object>
</child>
</object>
</interface>
18 changes: 18 additions & 0 deletions src/modeller/Makefile.am
@@ -0,0 +1,18 @@
## Process this file with automake to produce Makefile.in

noinst_PROGRAMS = modeller

noinst_HEADERS = \
gui_modeller.h \
gui_preview.h \
mdl_cmdline.h

modeller_SOURCES = \
gui_modeller.cc \
gui_preview.cc \
main.cc \
mdl_cmdline.cc

INCLUDES = -I@top_srcdir@/src/common -I@top_srcdir@/src
modeller_CXXFLAGS = -D_VERSION_=\"0.1\" $(GTK_CFLAGS) $(PY_CFLAGS) $(ADONTHELL_CFLAGS) ${IGE_MAC_CFLAGS}
modeller_LDADD = ../common/libcommon.a $(GTK_LIBS) $(ADONTHELL_LIBS) ${IGE_MAC_LIBS}

0 comments on commit 6c1d0d2

Please sign in to comment.