images/genicons.sh
author Andrey Skvortsov <andrej.skvortzov@gmail.com>
Mon, 13 Aug 2018 18:29:07 +0300
changeset 2284 64bb520009f3
parent 2238 a01a3ed1af2c
child 3569 419f17564583
permissions -rwxr-xr-x
Fix wxHMI example after upgrading wxGlade

Newer wxGlade generates code to initialize GridSizer's with empty
elements.

...
grid_sizer_1.Add(self.window_1, 1, wx.ALIGN_CENTER, 0)
sizer_2.Add((0, 0), 0, 0, 0)
sizer_2.Add((0, 0), 0, 0, 0)
sizer_2.Add((0, 0), 0, 0, 0)
sizer_2.Add((0, 0), 0, 0, 0)
...

That causes following traceback, if new buttons are added
to already full sizer.

PLCobject : Traceback (most recent call last):

File "./Beremiz_service.py", line 389, in default_evaluator
res = (tocall(*args, **kwargs), None)

File "/tmp/tmpQS8ct2/runtime_0.py", line 540, in _runtime_0_start
wx.MessageBox(_("Please stop PLC to close"))

File "/tmp/tmpQS8ct2/runtime_0.py", line 504, in Init
lambda axis:( MakeButtonFunc(self, sizer, axis+"axisMinus"),

File "/tmp/tmpQS8ct2/runtime_0.py", line 502, in <lambda>
lambda btname: MakeButtonFunc(self, sizer, btname), ActionButtons)

File "/tmp/tmpQS8ct2/runtime_0.py", line 461, in MakeButtonFunc
print sizer, btname

File "/usr/lib/python2.7/dist-packages/wx-3.0-gtk3/wx/_core.py", line 14453, in Add
return _core_.Sizer_Add(*args, **kwargs)

PyAssertionError: C++ assertion "Assert failure" failed at
../src/common/sizer.cpp(1401) in DoInsert(): too many items (11 > 2*5)
in grid sizer (maybe you should omit the number of either rows or
columns?)


Tested with wxGlade version 0.8.3
Closes #41
2238
a01a3ed1af2c Take plcopen_icons.svg as source of png icons as well
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 533
diff changeset
     1
#!/bin/sh
197
a50b5fa04c57 SVG/Inkscape based icon generation script + SVG drawing.
etisserant
parents:
diff changeset
     2
a50b5fa04c57 SVG/Inkscape based icon generation script + SVG drawing.
etisserant
parents:
diff changeset
     3
INKSCAPE=inkscape
a50b5fa04c57 SVG/Inkscape based icon generation script + SVG drawing.
etisserant
parents:
diff changeset
     4
2238
a01a3ed1af2c Take plcopen_icons.svg as source of png icons as well
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 533
diff changeset
     5
for fname in `ls *.svg`; do
a01a3ed1af2c Take plcopen_icons.svg as source of png icons as well
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 533
diff changeset
     6
    for i in `cat $fname |grep -o -e '%%[^%]*%%'|sed 's/%//g'` 
a01a3ed1af2c Take plcopen_icons.svg as source of png icons as well
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 533
diff changeset
     7
    do
a01a3ed1af2c Take plcopen_icons.svg as source of png icons as well
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 533
diff changeset
     8
        if [ $i.png -nt $fname ]; then
a01a3ed1af2c Take plcopen_icons.svg as source of png icons as well
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 533
diff changeset
     9
 	    echo "Skip $i"
a01a3ed1af2c Take plcopen_icons.svg as source of png icons as well
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 533
diff changeset
    10
        else
a01a3ed1af2c Take plcopen_icons.svg as source of png icons as well
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 533
diff changeset
    11
	    rm  -f $i.png
a01a3ed1af2c Take plcopen_icons.svg as source of png icons as well
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 533
diff changeset
    12
	    echo "$INKSCAPE" $fname -z -e $i.png -i $i
a01a3ed1af2c Take plcopen_icons.svg as source of png icons as well
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 533
diff changeset
    13
	    "$INKSCAPE" $fname -z -e $i.png -i $i
a01a3ed1af2c Take plcopen_icons.svg as source of png icons as well
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 533
diff changeset
    14
        fi
a01a3ed1af2c Take plcopen_icons.svg as source of png icons as well
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 533
diff changeset
    15
    done
197
a50b5fa04c57 SVG/Inkscape based icon generation script + SVG drawing.
etisserant
parents:
diff changeset
    16
done
a50b5fa04c57 SVG/Inkscape based icon generation script + SVG drawing.
etisserant
parents:
diff changeset
    17
2238
a01a3ed1af2c Take plcopen_icons.svg as source of png icons as well
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 533
diff changeset
    18
cp ico024.png brz.png
a01a3ed1af2c Take plcopen_icons.svg as source of png icons as well
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 533
diff changeset
    19
convert -compress none ico*.png brz.ico
533
25437efb7ae4 Christmas 2009 release
Edouard TISSERANT <edouard.tisserant@gmail.com>
parents: 199
diff changeset
    20
rm -f ico*.png
2238
a01a3ed1af2c Take plcopen_icons.svg as source of png icons as well
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 533
diff changeset
    21
a01a3ed1af2c Take plcopen_icons.svg as source of png icons as well
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 533
diff changeset
    22
a01a3ed1af2c Take plcopen_icons.svg as source of png icons as well
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 533
diff changeset
    23
convert -compress none poeico*.png poe.ico
a01a3ed1af2c Take plcopen_icons.svg as source of png icons as well
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 533
diff changeset
    24
rm -f poeico*.png
a01a3ed1af2c Take plcopen_icons.svg as source of png icons as well
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 533
diff changeset
    25