[GRASS-SVN] r50380 - in grass/branches/develbranch_6/gui: images
images/symbols images/symbols/basic images/symbols/demo
images/symbols/extra images/symbols/geology wxpython/core
wxpython/gui_core wxpython/psmap
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Jan 22 04:18:21 EST 2012
Author: annakrat
Date: 2012-01-22 01:18:21 -0800 (Sun, 22 Jan 2012)
New Revision: 50380
Added:
grass/branches/develbranch_6/gui/images/symbols/
grass/branches/develbranch_6/gui/images/symbols/README
grass/branches/develbranch_6/gui/images/symbols/basic/
grass/branches/develbranch_6/gui/images/symbols/basic/arrow1.png
grass/branches/develbranch_6/gui/images/symbols/basic/arrow2.png
grass/branches/develbranch_6/gui/images/symbols/basic/box.png
grass/branches/develbranch_6/gui/images/symbols/basic/circle.png
grass/branches/develbranch_6/gui/images/symbols/basic/cross1.png
grass/branches/develbranch_6/gui/images/symbols/basic/cross2.png
grass/branches/develbranch_6/gui/images/symbols/basic/diamond.png
grass/branches/develbranch_6/gui/images/symbols/basic/marker.png
grass/branches/develbranch_6/gui/images/symbols/basic/octagon.png
grass/branches/develbranch_6/gui/images/symbols/basic/point.png
grass/branches/develbranch_6/gui/images/symbols/basic/pushpin.png
grass/branches/develbranch_6/gui/images/symbols/basic/star.png
grass/branches/develbranch_6/gui/images/symbols/basic/triangle.png
grass/branches/develbranch_6/gui/images/symbols/basic/x.png
grass/branches/develbranch_6/gui/images/symbols/demo/
grass/branches/develbranch_6/gui/images/symbols/demo/muchomurka.png
grass/branches/develbranch_6/gui/images/symbols/demo/smrk.png
grass/branches/develbranch_6/gui/images/symbols/extra/
grass/branches/develbranch_6/gui/images/symbols/extra/4pt_star.png
grass/branches/develbranch_6/gui/images/symbols/extra/adcp.png
grass/branches/develbranch_6/gui/images/symbols/extra/airport.png
grass/branches/develbranch_6/gui/images/symbols/extra/alpha_flag.png
grass/branches/develbranch_6/gui/images/symbols/extra/bridge.png
grass/branches/develbranch_6/gui/images/symbols/extra/compass.png
grass/branches/develbranch_6/gui/images/symbols/extra/dive_flag.png
grass/branches/develbranch_6/gui/images/symbols/extra/fancy_compass.png
grass/branches/develbranch_6/gui/images/symbols/extra/fiducial.png
grass/branches/develbranch_6/gui/images/symbols/extra/fish.png
grass/branches/develbranch_6/gui/images/symbols/extra/half-box.png
grass/branches/develbranch_6/gui/images/symbols/extra/half-circle.png
grass/branches/develbranch_6/gui/images/symbols/extra/n_arrow1.png
grass/branches/develbranch_6/gui/images/symbols/extra/n_arrow2.png
grass/branches/develbranch_6/gui/images/symbols/extra/n_arrow3.png
grass/branches/develbranch_6/gui/images/symbols/extra/offbox_ne.png
grass/branches/develbranch_6/gui/images/symbols/extra/offbox_nw.png
grass/branches/develbranch_6/gui/images/symbols/extra/offbox_se.png
grass/branches/develbranch_6/gui/images/symbols/extra/offbox_sw.png
grass/branches/develbranch_6/gui/images/symbols/extra/pentagon.png
grass/branches/develbranch_6/gui/images/symbols/extra/ping.png
grass/branches/develbranch_6/gui/images/symbols/extra/ring.png
grass/branches/develbranch_6/gui/images/symbols/extra/target.png
grass/branches/develbranch_6/gui/images/symbols/geology/
grass/branches/develbranch_6/gui/images/symbols/geology/half-arrow_left.png
grass/branches/develbranch_6/gui/images/symbols/geology/half-arrow_right.png
grass/branches/develbranch_6/gui/images/symbols/geology/strike_box.png
grass/branches/develbranch_6/gui/images/symbols/geology/strike_circle.png
grass/branches/develbranch_6/gui/images/symbols/geology/strike_half-bowtie.png
grass/branches/develbranch_6/gui/images/symbols/geology/strike_line.png
grass/branches/develbranch_6/gui/images/symbols/geology/strike_triangle.png
Removed:
grass/branches/develbranch_6/gui/images/symbols/README
grass/branches/develbranch_6/gui/images/symbols/basic/
grass/branches/develbranch_6/gui/images/symbols/basic/arrow1.png
grass/branches/develbranch_6/gui/images/symbols/basic/arrow2.png
grass/branches/develbranch_6/gui/images/symbols/basic/box.png
grass/branches/develbranch_6/gui/images/symbols/basic/circle.png
grass/branches/develbranch_6/gui/images/symbols/basic/cross1.png
grass/branches/develbranch_6/gui/images/symbols/basic/cross2.png
grass/branches/develbranch_6/gui/images/symbols/basic/diamond.png
grass/branches/develbranch_6/gui/images/symbols/basic/marker.png
grass/branches/develbranch_6/gui/images/symbols/basic/octagon.png
grass/branches/develbranch_6/gui/images/symbols/basic/point.png
grass/branches/develbranch_6/gui/images/symbols/basic/pushpin.png
grass/branches/develbranch_6/gui/images/symbols/basic/star.png
grass/branches/develbranch_6/gui/images/symbols/basic/triangle.png
grass/branches/develbranch_6/gui/images/symbols/basic/x.png
grass/branches/develbranch_6/gui/images/symbols/demo/
grass/branches/develbranch_6/gui/images/symbols/demo/muchomurka.png
grass/branches/develbranch_6/gui/images/symbols/demo/smrk.png
grass/branches/develbranch_6/gui/images/symbols/extra/
grass/branches/develbranch_6/gui/images/symbols/extra/4pt_star.png
grass/branches/develbranch_6/gui/images/symbols/extra/adcp.png
grass/branches/develbranch_6/gui/images/symbols/extra/airport.png
grass/branches/develbranch_6/gui/images/symbols/extra/alpha_flag.png
grass/branches/develbranch_6/gui/images/symbols/extra/bridge.png
grass/branches/develbranch_6/gui/images/symbols/extra/compass.png
grass/branches/develbranch_6/gui/images/symbols/extra/dive_flag.png
grass/branches/develbranch_6/gui/images/symbols/extra/fancy_compass.png
grass/branches/develbranch_6/gui/images/symbols/extra/fiducial.png
grass/branches/develbranch_6/gui/images/symbols/extra/fish.png
grass/branches/develbranch_6/gui/images/symbols/extra/half-box.png
grass/branches/develbranch_6/gui/images/symbols/extra/half-circle.png
grass/branches/develbranch_6/gui/images/symbols/extra/n_arrow1.png
grass/branches/develbranch_6/gui/images/symbols/extra/n_arrow2.png
grass/branches/develbranch_6/gui/images/symbols/extra/n_arrow3.png
grass/branches/develbranch_6/gui/images/symbols/extra/offbox_ne.png
grass/branches/develbranch_6/gui/images/symbols/extra/offbox_nw.png
grass/branches/develbranch_6/gui/images/symbols/extra/offbox_se.png
grass/branches/develbranch_6/gui/images/symbols/extra/offbox_sw.png
grass/branches/develbranch_6/gui/images/symbols/extra/pentagon.png
grass/branches/develbranch_6/gui/images/symbols/extra/ping.png
grass/branches/develbranch_6/gui/images/symbols/extra/ring.png
grass/branches/develbranch_6/gui/images/symbols/extra/target.png
grass/branches/develbranch_6/gui/images/symbols/geology/
grass/branches/develbranch_6/gui/images/symbols/geology/half-arrow_left.png
grass/branches/develbranch_6/gui/images/symbols/geology/half-arrow_right.png
grass/branches/develbranch_6/gui/images/symbols/geology/strike_box.png
grass/branches/develbranch_6/gui/images/symbols/geology/strike_circle.png
grass/branches/develbranch_6/gui/images/symbols/geology/strike_half-bowtie.png
grass/branches/develbranch_6/gui/images/symbols/geology/strike_line.png
grass/branches/develbranch_6/gui/images/symbols/geology/strike_triangle.png
Modified:
grass/branches/develbranch_6/gui/images/Makefile
grass/branches/develbranch_6/gui/wxpython/core/globalvar.py
grass/branches/develbranch_6/gui/wxpython/gui_core/dialogs.py
grass/branches/develbranch_6/gui/wxpython/gui_core/forms.py
grass/branches/develbranch_6/gui/wxpython/gui_core/widgets.py
grass/branches/develbranch_6/gui/wxpython/psmap/dialogs.py
grass/branches/develbranch_6/gui/wxpython/psmap/toolbars.py
Log:
wxGUI: symbol thumbnails selection added (merge from trunk)
Modified: grass/branches/develbranch_6/gui/images/Makefile
===================================================================
--- grass/branches/develbranch_6/gui/images/Makefile 2012-01-22 08:30:59 UTC (rev 50379)
+++ grass/branches/develbranch_6/gui/images/Makefile 2012-01-22 09:18:21 UTC (rev 50380)
@@ -9,7 +9,7 @@
FILES := $(wildcard *.png)
FILES += $(wildcard *.gif)
-default: $(patsubst %,$(ETCDIR)/%,$(FILES))
+default: $(patsubst %,$(ETCDIR)/%,$(FILES)) symbol_thumbnails
$(ETCDIR)/%.png: %.png | $(ETCDIR)
$(INSTALL_DATA) $< $@
@@ -17,5 +17,16 @@
$(ETCDIR)/%.gif: %.gif | $(ETCDIR)
$(INSTALL_DATA) $< $@
+symbol_thumbnails: $(ETCDIR)
+ if [ ! -d $(ETCDIR)/symbols ]; then $(MKDIR) $(ETCDIR)/symbols ; fi
+ for category in basic demo extra geology ; do \
+ if [ ! -d $(ETCDIR)/symbols/$$category ] ; then \
+ $(MKDIR) $(ETCDIR)/symbols/$$category ; \
+ fi ; \
+ for file in symbols/$$category/*.png ; do \
+ $(INSTALL_DATA) $$file $(ETCDIR)/symbols/$$category ; \
+ done ; \
+ done
+
$(ETCDIR):
$(MKDIR) $@
Deleted: grass/branches/develbranch_6/gui/images/symbols/README
===================================================================
--- grass/trunk/gui/images/symbols/README 2012-01-16 21:27:54 UTC (rev 50214)
+++ grass/branches/develbranch_6/gui/images/symbols/README 2012-01-22 09:18:21 UTC (rev 50380)
@@ -1,36 +0,0 @@
-Symbols in form of PNG images enable to choose easily symbols in d.vect
-and in wx.psmap dialogs. It is necessary to keep images synchronized with
-symbols from ./lib/symbol/symbol/ directories.
-
-How to create new symbol image:
-----------------------------------
-You can use following script (requires Inkscape), run script in symbol group
-directory (e.g. ./lib/symbol/symbol/basic) within a GRASS session.
-
-#!/bin/sh
-DIR=$(basename $PWD)
-PSMAP_FILE=tmp.psmap
-PS_FILE=tmp.ps
-PNG_OUT=png_out
-
-rm -r $PNG_OUT
-mkdir $PNG_OUT
-for SYMBOL in *
-do
- if [ -f $SYMBOL ]
- then
- echo "border none\npoint 50% 50%\n symbol $DIR/$SYMBOL\n end\nend" > $PSMAP_FILE
- ps.map input=$PSMAP_FILE output=$PS_FILE
- inkscape -f $PS_FILE --export-png=$PNG_OUT/$SYMBOL.png -D -h=30
-
- rm $PSMAP_FILE $PS_FILE
- else
- echo $SYMBOL is not regular file
- fi
-done
-
-Image should have 30x30 px to be displayed correctly in GUI dialog. If the symbol
-has different width and height, you are supposed to correct it (for example
-in Gimp see Image -> Canvas size). Also consider where the reference point of symbol
-is placed (see e.g. offbox_ne, offbox_ns symbols).
-
Copied: grass/branches/develbranch_6/gui/images/symbols/README (from rev 50214, grass/trunk/gui/images/symbols/README)
===================================================================
--- grass/branches/develbranch_6/gui/images/symbols/README (rev 0)
+++ grass/branches/develbranch_6/gui/images/symbols/README 2012-01-22 09:18:21 UTC (rev 50380)
@@ -0,0 +1,39 @@
+Symbols in form of PNG images enable to choose easily symbols in d.vect
+and in wx.psmap dialogs. It is necessary to keep images synchronized with
+symbols from ./lib/symbol/symbol/ directories.
+
+How to create new symbol image:
+----------------------------------
+You can use following script (requires Inkscape), run script in symbol group
+directory (e.g. ./lib/symbol/symbol/basic) within a GRASS session.
+Optipng will try to make the file as small as possible.
+
+#!/bin/sh
+DIR="$(basename $PWD)"
+PSMAP_FILE=tmp.psmap
+PS_FILE=tmp.ps
+PNG_OUT=png_out
+
+rm -r "$PNG_OUT"
+mkdir "$PNG_OUT"
+for SYMBOL in *
+do
+ if [ -f "$SYMBOL" ]
+ then
+ echo -e "border none\npoint 50% 50%\n symbol $DIR/$SYMBOL\n end\nend" > "$PSMAP_FILE"
+ ps.map input="$PSMAP_FILE" output="$PS_FILE"
+ inkscape -f "$PS_FILE" --export-png="$PNG_OUT/$SYMBOL.png" -D -h=30
+
+ rm "$PSMAP_FILE" "$PS_FILE"
+
+ #optipng -o5 "$PNG_OUT/$SYMBOL.png"
+ else
+ echo "$SYMBOL is not regular file"
+ fi
+done
+
+Image should have 30x30 px to be displayed correctly in GUI dialog. If the symbol
+has different width and height, you are supposed to correct it (for example
+in Gimp see Image -> Canvas size). Also consider where the reference point of symbol
+is placed (see e.g. offbox_ne, offbox_ns symbols).
+
Deleted: grass/branches/develbranch_6/gui/images/symbols/basic/arrow1.png
===================================================================
(Binary files differ)
Copied: grass/branches/develbranch_6/gui/images/symbols/basic/arrow1.png (from rev 50214, grass/trunk/gui/images/symbols/basic/arrow1.png)
===================================================================
(Binary files differ)
Deleted: grass/branches/develbranch_6/gui/images/symbols/basic/arrow2.png
===================================================================
(Binary files differ)
Copied: grass/branches/develbranch_6/gui/images/symbols/basic/arrow2.png (from rev 50214, grass/trunk/gui/images/symbols/basic/arrow2.png)
===================================================================
(Binary files differ)
Deleted: grass/branches/develbranch_6/gui/images/symbols/basic/box.png
===================================================================
(Binary files differ)
Copied: grass/branches/develbranch_6/gui/images/symbols/basic/box.png (from rev 50214, grass/trunk/gui/images/symbols/basic/box.png)
===================================================================
(Binary files differ)
Deleted: grass/branches/develbranch_6/gui/images/symbols/basic/circle.png
===================================================================
(Binary files differ)
Copied: grass/branches/develbranch_6/gui/images/symbols/basic/circle.png (from rev 50214, grass/trunk/gui/images/symbols/basic/circle.png)
===================================================================
(Binary files differ)
Deleted: grass/branches/develbranch_6/gui/images/symbols/basic/cross1.png
===================================================================
(Binary files differ)
Copied: grass/branches/develbranch_6/gui/images/symbols/basic/cross1.png (from rev 50214, grass/trunk/gui/images/symbols/basic/cross1.png)
===================================================================
(Binary files differ)
Deleted: grass/branches/develbranch_6/gui/images/symbols/basic/cross2.png
===================================================================
(Binary files differ)
Copied: grass/branches/develbranch_6/gui/images/symbols/basic/cross2.png (from rev 50214, grass/trunk/gui/images/symbols/basic/cross2.png)
===================================================================
(Binary files differ)
Deleted: grass/branches/develbranch_6/gui/images/symbols/basic/diamond.png
===================================================================
(Binary files differ)
Copied: grass/branches/develbranch_6/gui/images/symbols/basic/diamond.png (from rev 50214, grass/trunk/gui/images/symbols/basic/diamond.png)
===================================================================
(Binary files differ)
Deleted: grass/branches/develbranch_6/gui/images/symbols/basic/marker.png
===================================================================
(Binary files differ)
Copied: grass/branches/develbranch_6/gui/images/symbols/basic/marker.png (from rev 50214, grass/trunk/gui/images/symbols/basic/marker.png)
===================================================================
(Binary files differ)
Deleted: grass/branches/develbranch_6/gui/images/symbols/basic/octagon.png
===================================================================
(Binary files differ)
Copied: grass/branches/develbranch_6/gui/images/symbols/basic/octagon.png (from rev 50214, grass/trunk/gui/images/symbols/basic/octagon.png)
===================================================================
(Binary files differ)
Deleted: grass/branches/develbranch_6/gui/images/symbols/basic/point.png
===================================================================
(Binary files differ)
Copied: grass/branches/develbranch_6/gui/images/symbols/basic/point.png (from rev 50214, grass/trunk/gui/images/symbols/basic/point.png)
===================================================================
(Binary files differ)
Deleted: grass/branches/develbranch_6/gui/images/symbols/basic/pushpin.png
===================================================================
(Binary files differ)
Copied: grass/branches/develbranch_6/gui/images/symbols/basic/pushpin.png (from rev 50214, grass/trunk/gui/images/symbols/basic/pushpin.png)
===================================================================
(Binary files differ)
Deleted: grass/branches/develbranch_6/gui/images/symbols/basic/star.png
===================================================================
(Binary files differ)
Copied: grass/branches/develbranch_6/gui/images/symbols/basic/star.png (from rev 50214, grass/trunk/gui/images/symbols/basic/star.png)
===================================================================
(Binary files differ)
Deleted: grass/branches/develbranch_6/gui/images/symbols/basic/triangle.png
===================================================================
(Binary files differ)
Copied: grass/branches/develbranch_6/gui/images/symbols/basic/triangle.png (from rev 50214, grass/trunk/gui/images/symbols/basic/triangle.png)
===================================================================
(Binary files differ)
Deleted: grass/branches/develbranch_6/gui/images/symbols/basic/x.png
===================================================================
(Binary files differ)
Copied: grass/branches/develbranch_6/gui/images/symbols/basic/x.png (from rev 50214, grass/trunk/gui/images/symbols/basic/x.png)
===================================================================
(Binary files differ)
Deleted: grass/branches/develbranch_6/gui/images/symbols/demo/muchomurka.png
===================================================================
(Binary files differ)
Copied: grass/branches/develbranch_6/gui/images/symbols/demo/muchomurka.png (from rev 50214, grass/trunk/gui/images/symbols/demo/muchomurka.png)
===================================================================
(Binary files differ)
Deleted: grass/branches/develbranch_6/gui/images/symbols/demo/smrk.png
===================================================================
(Binary files differ)
Copied: grass/branches/develbranch_6/gui/images/symbols/demo/smrk.png (from rev 50214, grass/trunk/gui/images/symbols/demo/smrk.png)
===================================================================
(Binary files differ)
Deleted: grass/branches/develbranch_6/gui/images/symbols/extra/4pt_star.png
===================================================================
(Binary files differ)
Copied: grass/branches/develbranch_6/gui/images/symbols/extra/4pt_star.png (from rev 50214, grass/trunk/gui/images/symbols/extra/4pt_star.png)
===================================================================
(Binary files differ)
Deleted: grass/branches/develbranch_6/gui/images/symbols/extra/adcp.png
===================================================================
(Binary files differ)
Copied: grass/branches/develbranch_6/gui/images/symbols/extra/adcp.png (from rev 50214, grass/trunk/gui/images/symbols/extra/adcp.png)
===================================================================
(Binary files differ)
Deleted: grass/branches/develbranch_6/gui/images/symbols/extra/airport.png
===================================================================
(Binary files differ)
Copied: grass/branches/develbranch_6/gui/images/symbols/extra/airport.png (from rev 50214, grass/trunk/gui/images/symbols/extra/airport.png)
===================================================================
(Binary files differ)
Deleted: grass/branches/develbranch_6/gui/images/symbols/extra/alpha_flag.png
===================================================================
(Binary files differ)
Copied: grass/branches/develbranch_6/gui/images/symbols/extra/alpha_flag.png (from rev 50214, grass/trunk/gui/images/symbols/extra/alpha_flag.png)
===================================================================
(Binary files differ)
Deleted: grass/branches/develbranch_6/gui/images/symbols/extra/bridge.png
===================================================================
(Binary files differ)
Copied: grass/branches/develbranch_6/gui/images/symbols/extra/bridge.png (from rev 50214, grass/trunk/gui/images/symbols/extra/bridge.png)
===================================================================
(Binary files differ)
Deleted: grass/branches/develbranch_6/gui/images/symbols/extra/compass.png
===================================================================
(Binary files differ)
Copied: grass/branches/develbranch_6/gui/images/symbols/extra/compass.png (from rev 50214, grass/trunk/gui/images/symbols/extra/compass.png)
===================================================================
(Binary files differ)
Deleted: grass/branches/develbranch_6/gui/images/symbols/extra/dive_flag.png
===================================================================
(Binary files differ)
Copied: grass/branches/develbranch_6/gui/images/symbols/extra/dive_flag.png (from rev 50214, grass/trunk/gui/images/symbols/extra/dive_flag.png)
===================================================================
(Binary files differ)
Deleted: grass/branches/develbranch_6/gui/images/symbols/extra/fancy_compass.png
===================================================================
(Binary files differ)
Copied: grass/branches/develbranch_6/gui/images/symbols/extra/fancy_compass.png (from rev 50214, grass/trunk/gui/images/symbols/extra/fancy_compass.png)
===================================================================
(Binary files differ)
Deleted: grass/branches/develbranch_6/gui/images/symbols/extra/fiducial.png
===================================================================
(Binary files differ)
Copied: grass/branches/develbranch_6/gui/images/symbols/extra/fiducial.png (from rev 50214, grass/trunk/gui/images/symbols/extra/fiducial.png)
===================================================================
(Binary files differ)
Deleted: grass/branches/develbranch_6/gui/images/symbols/extra/fish.png
===================================================================
(Binary files differ)
Copied: grass/branches/develbranch_6/gui/images/symbols/extra/fish.png (from rev 50214, grass/trunk/gui/images/symbols/extra/fish.png)
===================================================================
(Binary files differ)
Deleted: grass/branches/develbranch_6/gui/images/symbols/extra/half-box.png
===================================================================
(Binary files differ)
Copied: grass/branches/develbranch_6/gui/images/symbols/extra/half-box.png (from rev 50214, grass/trunk/gui/images/symbols/extra/half-box.png)
===================================================================
(Binary files differ)
Deleted: grass/branches/develbranch_6/gui/images/symbols/extra/half-circle.png
===================================================================
(Binary files differ)
Copied: grass/branches/develbranch_6/gui/images/symbols/extra/half-circle.png (from rev 50214, grass/trunk/gui/images/symbols/extra/half-circle.png)
===================================================================
(Binary files differ)
Deleted: grass/branches/develbranch_6/gui/images/symbols/extra/n_arrow1.png
===================================================================
(Binary files differ)
Copied: grass/branches/develbranch_6/gui/images/symbols/extra/n_arrow1.png (from rev 50214, grass/trunk/gui/images/symbols/extra/n_arrow1.png)
===================================================================
(Binary files differ)
Deleted: grass/branches/develbranch_6/gui/images/symbols/extra/n_arrow2.png
===================================================================
(Binary files differ)
Copied: grass/branches/develbranch_6/gui/images/symbols/extra/n_arrow2.png (from rev 50214, grass/trunk/gui/images/symbols/extra/n_arrow2.png)
===================================================================
(Binary files differ)
Deleted: grass/branches/develbranch_6/gui/images/symbols/extra/n_arrow3.png
===================================================================
(Binary files differ)
Copied: grass/branches/develbranch_6/gui/images/symbols/extra/n_arrow3.png (from rev 50214, grass/trunk/gui/images/symbols/extra/n_arrow3.png)
===================================================================
(Binary files differ)
Deleted: grass/branches/develbranch_6/gui/images/symbols/extra/offbox_ne.png
===================================================================
(Binary files differ)
Copied: grass/branches/develbranch_6/gui/images/symbols/extra/offbox_ne.png (from rev 50214, grass/trunk/gui/images/symbols/extra/offbox_ne.png)
===================================================================
(Binary files differ)
Deleted: grass/branches/develbranch_6/gui/images/symbols/extra/offbox_nw.png
===================================================================
(Binary files differ)
Copied: grass/branches/develbranch_6/gui/images/symbols/extra/offbox_nw.png (from rev 50214, grass/trunk/gui/images/symbols/extra/offbox_nw.png)
===================================================================
(Binary files differ)
Deleted: grass/branches/develbranch_6/gui/images/symbols/extra/offbox_se.png
===================================================================
(Binary files differ)
Copied: grass/branches/develbranch_6/gui/images/symbols/extra/offbox_se.png (from rev 50214, grass/trunk/gui/images/symbols/extra/offbox_se.png)
===================================================================
(Binary files differ)
Deleted: grass/branches/develbranch_6/gui/images/symbols/extra/offbox_sw.png
===================================================================
(Binary files differ)
Copied: grass/branches/develbranch_6/gui/images/symbols/extra/offbox_sw.png (from rev 50214, grass/trunk/gui/images/symbols/extra/offbox_sw.png)
===================================================================
(Binary files differ)
Deleted: grass/branches/develbranch_6/gui/images/symbols/extra/pentagon.png
===================================================================
(Binary files differ)
Copied: grass/branches/develbranch_6/gui/images/symbols/extra/pentagon.png (from rev 50214, grass/trunk/gui/images/symbols/extra/pentagon.png)
===================================================================
(Binary files differ)
Deleted: grass/branches/develbranch_6/gui/images/symbols/extra/ping.png
===================================================================
(Binary files differ)
Copied: grass/branches/develbranch_6/gui/images/symbols/extra/ping.png (from rev 50214, grass/trunk/gui/images/symbols/extra/ping.png)
===================================================================
(Binary files differ)
Deleted: grass/branches/develbranch_6/gui/images/symbols/extra/ring.png
===================================================================
(Binary files differ)
Copied: grass/branches/develbranch_6/gui/images/symbols/extra/ring.png (from rev 50214, grass/trunk/gui/images/symbols/extra/ring.png)
===================================================================
(Binary files differ)
Deleted: grass/branches/develbranch_6/gui/images/symbols/extra/target.png
===================================================================
(Binary files differ)
Copied: grass/branches/develbranch_6/gui/images/symbols/extra/target.png (from rev 50214, grass/trunk/gui/images/symbols/extra/target.png)
===================================================================
(Binary files differ)
Deleted: grass/branches/develbranch_6/gui/images/symbols/geology/half-arrow_left.png
===================================================================
(Binary files differ)
Copied: grass/branches/develbranch_6/gui/images/symbols/geology/half-arrow_left.png (from rev 50214, grass/trunk/gui/images/symbols/geology/half-arrow_left.png)
===================================================================
(Binary files differ)
Deleted: grass/branches/develbranch_6/gui/images/symbols/geology/half-arrow_right.png
===================================================================
(Binary files differ)
Copied: grass/branches/develbranch_6/gui/images/symbols/geology/half-arrow_right.png (from rev 50214, grass/trunk/gui/images/symbols/geology/half-arrow_right.png)
===================================================================
(Binary files differ)
Deleted: grass/branches/develbranch_6/gui/images/symbols/geology/strike_box.png
===================================================================
(Binary files differ)
Copied: grass/branches/develbranch_6/gui/images/symbols/geology/strike_box.png (from rev 50214, grass/trunk/gui/images/symbols/geology/strike_box.png)
===================================================================
(Binary files differ)
Deleted: grass/branches/develbranch_6/gui/images/symbols/geology/strike_circle.png
===================================================================
(Binary files differ)
Copied: grass/branches/develbranch_6/gui/images/symbols/geology/strike_circle.png (from rev 50214, grass/trunk/gui/images/symbols/geology/strike_circle.png)
===================================================================
(Binary files differ)
Deleted: grass/branches/develbranch_6/gui/images/symbols/geology/strike_half-bowtie.png
===================================================================
(Binary files differ)
Copied: grass/branches/develbranch_6/gui/images/symbols/geology/strike_half-bowtie.png (from rev 50214, grass/trunk/gui/images/symbols/geology/strike_half-bowtie.png)
===================================================================
(Binary files differ)
Deleted: grass/branches/develbranch_6/gui/images/symbols/geology/strike_line.png
===================================================================
(Binary files differ)
Copied: grass/branches/develbranch_6/gui/images/symbols/geology/strike_line.png (from rev 50214, grass/trunk/gui/images/symbols/geology/strike_line.png)
===================================================================
(Binary files differ)
Deleted: grass/branches/develbranch_6/gui/images/symbols/geology/strike_triangle.png
===================================================================
(Binary files differ)
Copied: grass/branches/develbranch_6/gui/images/symbols/geology/strike_triangle.png (from rev 50214, grass/trunk/gui/images/symbols/geology/strike_triangle.png)
===================================================================
(Binary files differ)
Modified: grass/branches/develbranch_6/gui/wxpython/core/globalvar.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/core/globalvar.py 2012-01-22 08:30:59 UTC (rev 50379)
+++ grass/branches/develbranch_6/gui/wxpython/core/globalvar.py 2012-01-22 09:18:21 UTC (rev 50380)
@@ -23,6 +23,7 @@
ETCICONDIR = os.path.join(os.getenv("GISBASE"), "etc", "gui", "icons")
ETCWXDIR = os.path.join(ETCDIR, "wxpython")
ETCIMGDIR = os.path.join(ETCDIR, "gui", "images")
+ETCSYMBOLDIR = os.path.join(ETCDIR, "gui", "images", "symbols")
sys.path.append(os.path.join(ETCDIR, "python"))
import grass.script as grass
Modified: grass/branches/develbranch_6/gui/wxpython/gui_core/dialogs.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_core/dialogs.py 2012-01-22 08:30:59 UTC (rev 50379)
+++ grass/branches/develbranch_6/gui/wxpython/gui_core/dialogs.py 2012-01-22 09:18:21 UTC (rev 50380)
@@ -45,6 +45,7 @@
from core.gcmd import GError, RunCommand, GMessage
from gui_core.gselect import ElementSelect, LocationSelect, MapsetSelect, Select, GdalSelect
from gui_core.forms import GUI
+from gui_core.widgets import SingleSymbolPanel, EVT_SYMBOL_SELECTION_CHANGED
from core.utils import GetListOfMapsets, GetLayerNameFromCmd, GetValidLayerName
from core.settings import UserSettings
from core.debug import Debug
@@ -2161,3 +2162,175 @@
width, height = map(int, sel.split('x'))
self.width.SetValue(width)
self.height.SetValue(height)
+
+class SymbolDialog(wx.Dialog):
+ """!Dialog for GRASS symbols selection.
+
+ Dialog is called in gui_core::forms module.
+ """
+ def __init__(self, parent, symbolPath, currentSymbol = None, title = _("Symbols")):
+ """!Dialog constructor.
+
+ It is assumed that symbolPath contains folders with symbols.
+
+ @param parent dialog parent
+ @param symbolPath absolute path to symbols
+ @param currentSymbol currently selected symbol (e.g. 'basic/x')
+ @param title dialog title
+ """
+ wx.Dialog.__init__(self, parent = parent, title = title, id = wx.ID_ANY)
+
+ self.symbolPath = symbolPath
+ self.currentSymbol = currentSymbol # default basic/x
+ self.selected = None
+ self.selectedDir = None
+
+ self._layout()
+
+ def _layout(self):
+ mainPanel = wx.Panel(self, id = wx.ID_ANY)
+ mainSizer = wx.BoxSizer(wx.VERTICAL)
+ vSizer = wx.BoxSizer( wx.VERTICAL)
+ fgSizer = wx.FlexGridSizer(rows = 2, vgap = 5, hgap = 5)
+ self.folderChoice = wx.Choice(mainPanel, id = wx.ID_ANY, choices = os.listdir(self.symbolPath))
+ self.folderChoice.Bind(wx.EVT_CHOICE, self.OnFolderSelect)
+
+ fgSizer.Add(item = wx.StaticText(mainPanel, id = wx.ID_ANY, label = _("Symbol directory:")),
+ proportion = 0,
+ flag = wx.ALIGN_CENTER_VERTICAL)
+
+ fgSizer.Add(item = self.folderChoice, proportion = 0,
+ flag = wx.ALIGN_CENTER, border = 0)
+
+ self.infoLabel = wx.StaticText(mainPanel, id = wx.ID_ANY)
+ fgSizer.Add(wx.StaticText(mainPanel, id = wx.ID_ANY, label = _("Symbol name:")),
+ flag = wx.ALIGN_CENTRE_VERTICAL)
+ fgSizer.Add(self.infoLabel, proportion = 0,
+ flag = wx.ALIGN_CENTRE_VERTICAL)
+ vSizer.Add(fgSizer, proportion = 0, flag = wx.ALL, border = 5)
+
+ self.panels = self._createSymbolPanels(mainPanel)
+ for panel in self.panels:
+ vSizer.Add(panel, proportion = 0, flag = wx.ALL | wx.EXPAND, border = 5)
+ panel.Bind(EVT_SYMBOL_SELECTION_CHANGED, self.SelectionChanged)
+
+ mainSizer.Add(vSizer, proportion = 1, flag = wx.ALL| wx.EXPAND, border = 5)
+ self.btnCancel = wx.Button(parent = mainPanel, id = wx.ID_CANCEL)
+ self.btnOK = wx.Button(parent = mainPanel, id = wx.ID_OK)
+ self.btnOK.SetDefault()
+ self.btnOK.Enable(False)
+
+ # buttons
+ btnSizer = wx.StdDialogButtonSizer()
+ btnSizer.AddButton(self.btnCancel)
+ btnSizer.AddButton(self.btnOK)
+ btnSizer.Realize()
+ mainSizer.Add(item = btnSizer, proportion = 0,
+ flag = wx.EXPAND | wx.ALL, border = 5)
+
+ # show panel with the largest number of images and fit size
+ count = []
+ for folder in os.listdir(self.symbolPath):
+ count.append(len(os.listdir(os.path.join(self.symbolPath, folder))))
+
+ index = count.index(max(count))
+ self.folderChoice.SetSelection(index)
+ self.OnFolderSelect(None)
+ self.infoLabel.Show()
+
+ mainPanel.SetSizerAndFit(mainSizer)
+ self.SetSize(self.GetBestSize())
+
+ # show currently selected symbol
+ if self.currentSymbol:
+ # set directory
+ self.selectedDir, self.selected = os.path.split(self.currentSymbol)
+ self.folderChoice.SetStringSelection(self.selectedDir)
+ # select symbol
+ panelIdx = self.folderChoice.GetSelection()
+ for panel in self.symbolPanels[panelIdx]:
+ if panel.GetName() == self.selected:
+ panel.Select()
+ else:
+ self.folderChoice.SetSelection(0)
+
+ self.OnFolderSelect(None)
+
+ def _createSymbolPanels(self, parent):
+ """!Creates multiple panels with symbols.
+
+ Panels are shown/hidden according to selected folder."""
+ folders = os.listdir(self.symbolPath)
+
+ panels = []
+ self.symbolPanels = []
+ maxImages = 0
+
+ for folder in folders:
+ panel = wx.Panel(parent, style = wx.BORDER_RAISED)
+ sizer = wx.GridSizer(cols = 6, vgap = 3, hgap = 3)
+ images = self._getSymbols(path = os.path.join(self.symbolPath, folder))
+
+ symbolPanels = []
+ for img in images:
+ iP = SingleSymbolPanel(parent = panel, symbolPath = img)
+ sizer.Add(item = iP, proportion = 0, flag = wx.ALIGN_CENTER)
+ symbolPanels.append(iP)
+
+ panel.SetSizerAndFit(sizer)
+ panel.Hide()
+ panels.append(panel)
+ self.symbolPanels.append(symbolPanels)
+
+ return panels
+
+ def _getSymbols(self, path):
+ # we assume that images are in subfolders (1 level only)
+ imageList = []
+ for image in os.listdir(path):
+ imageList.append(os.path.join(path, image))
+
+ return sorted(imageList)
+
+ def OnFolderSelect(self, event):
+ """!Selected folder with symbols changed."""
+ idx = self.folderChoice.GetSelection()
+ for i in range(len(self.panels)):
+ sizer = self.panels[i].GetContainingSizer()
+ sizer.Show(self.panels[i], i == idx, recursive = True)
+ sizer.Layout()
+
+ if self.selectedDir == self.folderChoice.GetStringSelection():
+ self.btnOK.Enable()
+ self.infoLabel.SetLabel(self.selected)
+ else:
+ self.btnOK.Disable()
+ self.infoLabel.SetLabel('')
+
+ def SelectionChanged(self, event):
+ """!Selected symbol changed."""
+ if event.doubleClick:
+ self.EndModal(wx.ID_OK)
+ # deselect all
+ for i in range(len(self.panels)):
+ for panel in self.symbolPanels[i]:
+ if panel.GetName() != event.name:
+ panel.Deselect()
+
+ self.btnOK.Enable()
+
+ self.selected = event.name
+ self.selectedDir = self.folderChoice.GetStringSelection()
+
+ self.infoLabel.SetLabel(event.name)
+
+ def GetSelectedSymbol(self, fullPath = False):
+ """!Returns currently selected symbol.
+
+ @param fullPath true to return absolute path to symbol,
+ otherwise returns e.g. 'basic/x'
+ """
+ if fullPath:
+ return os.path.join(self.symbolPath, self.selectedDir, self.selected)
+
+ return os.path.join(self.selectedDir, self.selected)
Modified: grass/branches/develbranch_6/gui/wxpython/gui_core/forms.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_core/forms.py 2012-01-22 08:30:59 UTC (rev 50379)
+++ grass/branches/develbranch_6/gui/wxpython/gui_core/forms.py 2012-01-22 09:18:21 UTC (rev 50380)
@@ -985,19 +985,37 @@
p['wxId'] = [ txt2.GetId(), ]
txt2.Bind(wx.EVT_TEXT, self.OnSetValue)
else:
- # list of values (combo)
title_txt.SetLabel(title + ':')
- cb = wx.ComboBox(parent = which_panel, id = wx.ID_ANY, value = p.get('default',''),
- size = globalvar.DIALOG_COMBOBOX_SIZE,
- choices = valuelist, style = wx.CB_DROPDOWN)
value = self._getValue(p)
- if value:
- cb.SetValue(value) # parameter previously set
- which_sizer.Add( item=cb, proportion=0,
- flag=wx.ADJUST_MINSIZE | wx.BOTTOM | wx.LEFT, border=5)
- p['wxId'] = [ cb.GetId(), ]
- cb.Bind( wx.EVT_COMBOBOX, self.OnSetValue)
- cb.Bind(wx.EVT_TEXT, self.OnSetValue)
+
+ if p['name'] == 'icon': # symbols
+ bitmap = wx.Bitmap(os.path.join(globalvar.ETCSYMBOLDIR, value) + '.png')
+ bb = wx.BitmapButton(parent = which_panel, id = wx.ID_ANY,
+ bitmap = bitmap)
+ iconLabel = wx.StaticText(parent = which_panel, id = wx.ID_ANY)
+ iconLabel.SetLabel(value)
+ p['value'] = value
+ p['wxId'] = [bb.GetId(), iconLabel.GetId()]
+ bb.Bind(wx.EVT_BUTTON, self.OnSetSymbol)
+ this_sizer = wx.BoxSizer(wx.HORIZONTAL)
+ this_sizer.Add(item = bb, proportion = 0,
+ flag = wx.ADJUST_MINSIZE | wx.BOTTOM | wx.LEFT, border = 5)
+ this_sizer.Add(item = iconLabel, proportion = 0,
+ flag = wx.ADJUST_MINSIZE | wx.BOTTOM | wx.LEFT | wx.ALIGN_CENTER_VERTICAL, border = 5)
+ which_sizer.Add(item = this_sizer, proportion = 0,
+ flag = wx.ADJUST_MINSIZE, border = 0)
+ else:
+ # list of values (combo)
+ cb = wx.ComboBox(parent = which_panel, id = wx.ID_ANY, value = p.get('default',''),
+ size = globalvar.DIALOG_COMBOBOX_SIZE,
+ choices = valuelist, style = wx.CB_DROPDOWN)
+ if value:
+ cb.SetValue(value) # parameter previously set
+ which_sizer.Add(item = cb, proportion = 0,
+ flag = wx.ADJUST_MINSIZE | wx.BOTTOM | wx.LEFT, border = 5)
+ p['wxId'] = [cb.GetId(),]
+ cb.Bind(wx.EVT_COMBOBOX, self.OnSetValue)
+ cb.Bind(wx.EVT_TEXT, self.OnSetValue)
# text entry
if (p.get('type','string') in ('string','integer','float')
@@ -1689,6 +1707,29 @@
event.Skip()
+ def OnSetSymbol(self, event):
+ """!Shows dialog for symbol selection"""
+ myId = event.GetId()
+
+ for p in self.task.params:
+ if 'wxId' in p and myId in p['wxId']:
+ from gui_core.dialogs import SymbolDialog
+ dlg = SymbolDialog(self, symbolPath = globalvar.ETCSYMBOLDIR,
+ currentSymbol = p['value'])
+ if dlg.ShowModal() == wx.ID_OK:
+ img = dlg.GetSelectedSymbol(fullPath = True)
+ p['value'] = dlg.GetSelectedSymbol(fullPath = False)
+
+ bitmapButton = wx.FindWindowById(p['wxId'][0])
+ label = wx.FindWindowById(p['wxId'][1])
+
+ bitmapButton.SetBitmapLabel(wx.Bitmap(img + '.png'))
+ label.SetLabel(p['value'])
+
+ self.OnUpdateValues(event)
+
+ dlg.Destroy()
+
def OnUpdateSelection(self, event):
"""!Update dialog (layers, tables, columns, etc.)
"""
Modified: grass/branches/develbranch_6/gui/wxpython/gui_core/widgets.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_core/widgets.py 2012-01-22 08:30:59 UTC (rev 50379)
+++ grass/branches/develbranch_6/gui/wxpython/gui_core/widgets.py 2012-01-22 09:18:21 UTC (rev 50380)
@@ -25,6 +25,7 @@
@author Anna Kratochvilova <kratochanna gmail.com> (Google SoC 2011)
"""
+import os
import string
import wx
@@ -45,6 +46,9 @@
from core import globalvar
from core.debug import Debug
+from wx.lib.newevent import NewEvent
+wxSymbolSelectionChanged, EVT_SYMBOL_SELECTION_CHANGED = NewEvent()
+
class GNotebook(FN.FlatNotebook):
"""!Generic notebook widget
"""
@@ -408,3 +412,59 @@
if itemSelected:
self.ToggleItemSelection(itemSelected)
self.itemSelected = None
+
+class SingleSymbolPanel(wx.Panel):
+ """!Panel for displaying one symbol.
+
+ Changes background when selected. Assumes that parent will catch
+ events emitted on mouse click. Used in gui_core::dialog::SymbolDialog.
+ """
+ def __init__(self, parent, symbolPath):
+ """!Panel constructor
+
+ @param parent parent (gui_core::dialog::SymbolDialog)
+ @param symbolPath absolute path to symbol
+ """
+ wx.Panel.__init__(self, parent, id = wx.ID_ANY, style = wx.BORDER_RAISED)
+ self.SetName(os.path.splitext(os.path.basename(symbolPath))[0])
+ self.sBmp = wx.StaticBitmap(self, wx.ID_ANY, wx.Bitmap(symbolPath))
+
+ self.selected = False
+ self.selectColor = wx.SystemSettings.GetColour(wx.SYS_COLOUR_HIGHLIGHT)
+ self.deselectColor = wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOW)
+
+ sizer = wx.BoxSizer()
+ sizer.Add(item = self.sBmp, proportion = 0, flag = wx.ALL | wx.ALIGN_CENTER, border = 5)
+ self.SetBackgroundColour(self.deselectColor)
+ self.SetMinSize(self.GetBestSize())
+ self.SetSizerAndFit(sizer)
+
+ # binding to both (staticBitmap, Panel) necessary
+ self.sBmp.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown)
+ self.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown)
+ self.Bind(wx.EVT_LEFT_DCLICK, self.OnDoubleClick)
+ self.sBmp.Bind(wx.EVT_LEFT_DCLICK, self.OnDoubleClick)
+
+ def OnLeftDown(self, event):
+ """!Panel selected, background changes"""
+ self.selected = True
+ self.SetBackgroundColour(self.selectColor)
+ event.Skip()
+
+ event = wxSymbolSelectionChanged(name = self.GetName(), doubleClick = False)
+ wx.PostEvent(self.GetParent(), event)
+
+ def OnDoubleClick(self, event):
+ event = wxSymbolSelectionChanged(name = self.GetName(), doubleClick = True)
+ wx.PostEvent(self.GetParent(), event)
+
+ def Deselect(self):
+ """!Panel deselected, background changes back to default"""
+ self.selected = False
+ self.SetBackgroundColour(self.deselectColor)
+
+ def Select(self):
+ """!Select panel, no event emitted"""
+ self.selected = True
+ self.SetBackgroundColour(self.selectColor)
+
Modified: grass/branches/develbranch_6/gui/wxpython/psmap/dialogs.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/psmap/dialogs.py 2012-01-22 08:30:59 UTC (rev 50379)
+++ grass/branches/develbranch_6/gui/wxpython/psmap/dialogs.py 2012-01-22 09:18:21 UTC (rev 50380)
@@ -77,6 +77,7 @@
from core.utils import CmdToTuple, GetCmdString
from gui_core.gselect import Select
from core.gcmd import RunCommand, GError, GMessage, GWarning
+from gui_core.dialogs import SymbolDialog
# grass.set_raise_on_error(True)
@@ -1651,7 +1652,7 @@
# size and style
if self.subType == 'points':
- if dic['symbol']:
+ if not dic['eps']:
vInstruction += string.Template(" symbol $symbol\n").substitute(dic)
else: #eps
vInstruction += string.Template(" eps $eps\n").substitute(dic)
@@ -3270,6 +3271,7 @@
if self.type == 'points':
self.OnSize(None)
self.OnRotation(None)
+ self.OnSymbology(None)
if self.type == 'areas':
self.OnPattern(None)
@@ -3598,8 +3600,11 @@
self.symbolRadio = wx.RadioButton(panel, id = wx.ID_ANY, label = _("symbol:"), style = wx.RB_GROUP)
self.symbolRadio.SetValue(bool(self.vPropertiesDict['symbol']))
-
- self.symbolChoice = wx.Choice(panel, id = wx.ID_ANY, choices = self.symbols)
+ self.symbolName = wx.StaticText(panel, id = wx.ID_ANY)
+ self.symbolName.SetLabel(self.vPropertiesDict['symbol'])
+ bitmap = wx.Bitmap(os.path.join(globalvar.ETCSYMBOLDIR,
+ self.vPropertiesDict['symbol']) + '.png')
+ self.symbolButton = wx.BitmapButton(panel, id = wx.ID_ANY, bitmap = bitmap)
self.epsRadio = wx.RadioButton(panel, id = wx.ID_ANY, label = _("eps file:"))
self.epsRadio.SetValue(bool(self.vPropertiesDict['eps']))
@@ -3608,24 +3613,28 @@
buttonText = _("Browse"), toolTip = _("Type filename or click browse to choose file"),
dialogTitle = _("Choose a file"), startDirectory = '', initialValue = '',
fileMask = "Encapsulated PostScript (*.eps)|*.eps|All files (*.*)|*.*", fileMode = wx.OPEN)
- if self.vPropertiesDict['symbol']:
- self.symbolChoice.SetStringSelection(self.vPropertiesDict['symbol'])
+ if not self.vPropertiesDict['eps']:
self.epsFileCtrl.SetValue('')
else: #eps chosen
self.epsFileCtrl.SetValue(self.vPropertiesDict['eps'])
- self.symbolChoice.SetSelection(0)
+ gridBagSizer.AddGrowableCol(2)
gridBagSizer.Add(self.symbolRadio, pos = (0, 0), flag = wx.ALIGN_CENTER_VERTICAL, border = 0)
- gridBagSizer.Add(self.symbolChoice, pos = (0, 1), flag = wx.ALIGN_CENTER_VERTICAL, border = 0)
+ gridBagSizer.Add(self.symbolName, pos = (0, 1), flag = wx.ALIGN_CENTER_VERTICAL | wx.LEFT, border = 10)
+ gridBagSizer.Add(self.symbolButton, pos = (0, 2), flag = wx.ALIGN_RIGHT , border = 0)
gridBagSizer.Add(self.epsRadio, pos = (1, 0), flag = wx.ALIGN_CENTER_VERTICAL, border = 0)
- gridBagSizer.Add(self.epsFileCtrl, pos = (1, 1), flag = wx.ALIGN_CENTER_VERTICAL|wx.EXPAND, border = 0)
+ gridBagSizer.Add(self.epsFileCtrl, pos = (1, 1), span = (1, 2), flag = wx.ALIGN_CENTER_VERTICAL|wx.EXPAND, border = 0)
sizer.Add(gridBagSizer, proportion = 1, flag = wx.EXPAND|wx.ALL, border = 5)
border.Add(item = sizer, proportion = 0, flag = wx.ALL | wx.EXPAND, border = 5)
+ self.Bind(wx.EVT_BUTTON, self.OnSymbolSelection, self.symbolButton)
+ self.Bind(wx.EVT_RADIOBUTTON, self.OnSymbology, self.symbolRadio)
+ self.Bind(wx.EVT_RADIOBUTTON, self.OnSymbology, self.epsRadio)
+
#size
- box = wx.StaticBox (parent = panel, id = wx.ID_ANY, label = " %s " % _("Size"))
+ box = wx.StaticBox (parent = panel, id = wx.ID_ANY, label = " %s " % _("Size"))
sizer = wx.StaticBoxSizer(box, wx.HORIZONTAL)
gridBagSizer = wx.GridBagSizer(hgap = 5, vgap = 5)
gridBagSizer.AddGrowableCol(0)
@@ -3882,6 +3891,24 @@
for each in (self.patFileCtrl, self.patWidthText, self.patWidthSpin, self.patScaleText, self.patScaleSpin):
each.Enable(self.patternCheck.GetValue())
+ def OnSymbology(self, event):
+ useSymbol = self.symbolRadio.GetValue()
+
+ self.symbolButton.Enable(useSymbol)
+ self.symbolName.Enable(useSymbol)
+ self.epsFileCtrl.Enable(not useSymbol)
+
+ def OnSymbolSelection(self, event):
+ dlg = SymbolDialog(self, symbolPath = globalvar.ETCSYMBOLDIR,
+ currentSymbol = self.symbolName.GetLabel())
+ if dlg.ShowModal() == wx.ID_OK:
+ img = dlg.GetSelectedSymbol(fullPath = True)
+ name = dlg.GetSelectedSymbol(fullPath = False)
+ self.symbolButton.SetBitmapLabel(wx.Bitmap(img + '.png'))
+ self.symbolName.SetLabel(name)
+
+ dlg.Destroy()
+
def EnableLayerSelection(self, enable = True):
for widget in self.gridBagSizerL.GetChildren():
if widget.GetWindow() != self.warning:
@@ -3965,11 +3992,10 @@
if self.type == 'points':
#symbols
if self.symbolRadio.GetValue():
- self.vPropertiesDict['symbol'] = self.symbolChoice.GetStringSelection()
+ self.vPropertiesDict['symbol'] = self.symbolName.GetLabel()
self.vPropertiesDict['eps'] = None
else:
self.vPropertiesDict['eps'] = self.epsFileCtrl.GetValue()
- self.vPropertiesDict['symbol'] = None
#size
if self.sizeRadio.GetValue():
self.vPropertiesDict['size'] = self.sizeSpin.GetValue()
Modified: grass/branches/develbranch_6/gui/wxpython/psmap/toolbars.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/psmap/toolbars.py 2012-01-22 08:30:59 UTC (rev 50379)
+++ grass/branches/develbranch_6/gui/wxpython/psmap/toolbars.py 2012-01-22 09:18:21 UTC (rev 50380)
@@ -21,7 +21,7 @@
from core import globalvar
from gui_core.toolbars import BaseToolbar, BaseIcons
-from icon import MetaIcon
+from icons.icon import MetaIcon
class PsMapToolbar(BaseToolbar):
def __init__(self, parent):
More information about the grass-commit
mailing list