diff options
author | Bruce Smith <bruce@nanorex.com> | 2008-11-26 00:34:12 +0000 |
---|---|---|
committer | Bruce Smith <bruce@nanorex.com> | 2008-11-26 00:34:12 +0000 |
commit | 857ef28e895ef94df3be0d7a15b224e423900a02 (patch) | |
tree | d065eb6d8be377ff1cb7b9585c8a4a85d54d401c | |
parent | b7cc19c9216296cbce06955f1e52ab1eed445293 (diff) | |
download | nanoengineer-theirix-857ef28e895ef94df3be0d7a15b224e423900a02.tar.gz nanoengineer-theirix-857ef28e895ef94df3be0d7a15b224e423900a02.zip |
replace jpg with png images
-rwxr-xr-x | cad/src/exprs/controls.py | 10 | ||||
-rw-r--r-- | cad/src/exprs/scratch/test_animation_mode.py | 4 | ||||
-rwxr-xr-x | cad/src/exprs/test.py | 45 | ||||
-rw-r--r-- | cad/src/exprs/test_statearray_2.py | 9 | ||||
-rw-r--r-- | cad/src/exprs/test_statearray_3.py | 2 | ||||
-rwxr-xr-x | cad/src/ui/exprs/README | 28 | ||||
-rwxr-xr-x | cad/src/ui/exprs/README.txt | 38 | ||||
-rw-r--r-- | cad/src/ui/exprs/test/redblue-34x66.png | bin | 0 -> 7510 bytes | |||
-rw-r--r-- | cad/src/ui/exprs/textures/blueflake.png | bin | 0 -> 132905 bytes | |||
-rw-r--r-- | cad/src/ui/exprs/widgets/mac_checkbox_off.png | bin | 0 -> 4676 bytes | |||
-rw-r--r-- | cad/src/ui/exprs/widgets/mac_checkbox_on.png | bin | 0 -> 5292 bytes |
11 files changed, 74 insertions, 62 deletions
diff --git a/cad/src/exprs/controls.py b/cad/src/exprs/controls.py index 206e0e7bb..575e50906 100755 --- a/cad/src/exprs/controls.py +++ b/cad/src/exprs/controls.py @@ -2,7 +2,7 @@ """ controls.py - some simple controls, like ChoiceButton, ChoiceColumn/Row, checkbox_v3 -@author: bruce +@author: Bruce @version: $Id$ @copyright: 2006-2008 Nanorex, Inc. See LICENSE file for details. @@ -246,8 +246,8 @@ class checkbox_v3(InstanceMacro): ##e rename # note: this can do something check ## # solved: it's probably from above: import Set; from Set import something else but not Set _value = Highlightable( If( var, - checkbox_image('mac_checkbox_on.jpg'), - checkbox_image('mac_checkbox_off.jpg'), + checkbox_image('mac_checkbox_on.png'), + checkbox_image('mac_checkbox_off.png'), ), ## on_press = Set(var, not_Expr(var) ) # wanted (sort of), but doesn't work yet, as explained here: ## AssertionError:... <C_rule_for_formula at 0xff2de10 for 'var' in 'checkbox_v3'> should implement set_for_our_cls @@ -300,8 +300,8 @@ class checkbox_pref(InstanceMacro): ## AssertionError: compute method asked for on non-Instance <PrefsKey_StateRef#47221(a)> var = stateref.value checkbox = If( var, - checkbox_image('mac_checkbox_on.jpg'), - checkbox_image('mac_checkbox_off.jpg'), + checkbox_image('mac_checkbox_on.png'), + checkbox_image('mac_checkbox_off.png'), ) _value = DisplayListChunk( Highlightable( SimpleRow( CenterY(checkbox), CenterY(use_label)), # align = CenterY is nim ## on_press = Set(debug_evals_of_Expr(stateref.value), not_Expr(var) ), #070119 debug_evals_of_Expr - worked diff --git a/cad/src/exprs/scratch/test_animation_mode.py b/cad/src/exprs/scratch/test_animation_mode.py index b54c2bbca..9b9476130 100644 --- a/cad/src/exprs/scratch/test_animation_mode.py +++ b/cad/src/exprs/scratch/test_animation_mode.py @@ -98,7 +98,7 @@ _key_command = 16777249 ###TODO: -# works in exprs/test.py: Image("/Users/bruce/Desktop/IMG_0560 clouds1.jpg") +# works in exprs/test.py: Image("/Users/bruce/Desktop/IMG_0560 clouds1.png") # see test_commands.py... # WARNING: if you have test_animation_mode.py OR test_animation_mode.pyc in cad/src, that one gets imported instead of one in ~/Nanorex/Modes. @@ -1268,7 +1268,7 @@ class test_animation_mode(_superclass, IorE_guest_mixin): # list of supers might if 0: expr = Rect() # works if 1: - expr = Image("/Users/bruce/Desktop/IMG_0560 clouds g5 2.jpg", size = Rect(), two_sided = True) + expr = Image("/Users/bruce/Desktop/IMG_0560 clouds g5 2.png", size = Rect(), two_sided = True) # note: this code is similar to _expr_instance_for_imagename in confirmation_corner.py ih = get_glpane_InstanceHolder(glpane) diff --git a/cad/src/exprs/test.py b/cad/src/exprs/test.py index efa04417a..21f7b5a47 100755 --- a/cad/src/exprs/test.py +++ b/cad/src/exprs/test.py @@ -1,11 +1,11 @@ -# Copyright 2006-2007 Nanorex, Inc. See LICENSE file for details. +# Copyright 2006-2008 Nanorex, Inc. See LICENSE file for details. """ exprs/test.py - tests of exprs package, accessible from testmode UI; also some exprs/testmode support code (which ought to be refiled) @author: Bruce @version: $Id$ -@copyright: 2006-2007 Nanorex, Inc. See LICENSE file for details. +@copyright: 2006-2008 Nanorex, Inc. See LICENSE file for details. """ #e during devel, see drawtest1_innards for main entry point from testdraw.py @@ -407,7 +407,7 @@ testexpr_10d = ToggleShow(ToggleShow( Rect(2,3,yellow) )) # works # Image -blueflake = "blueflake.jpg" +blueflake = "blueflake.png" testexpr_11a = Image(courierfile) # works testexpr_11a1 = Image("courier-128.png") # works (note: same image) @@ -516,18 +516,18 @@ testexpr_11pcy2 = imagetest("win_collapse_icon.png", convert = 'RGBA', _tmpmode # more translucent image tests inserted (& finally working after new options added) - 070403; 070404 works with decal = False default testexpr_11pd1 = Overlay( Closer(DraggableObject(Image("win_collapse_icon.png", convert = 'RGBA', decal = True))), - DraggableObject(Image("blueflake.jpg")) + DraggableObject(Image("blueflake.png")) ) # works, but closer image has no transparency (as expected with decal = True) testexpr_11pd2 = Overlay( Closer(DraggableObject(Image("win_collapse_icon.png", convert = 'RGBA', decal = False))), - DraggableObject(Image("blueflake.jpg")) + DraggableObject(Image("blueflake.png")) ) # works, but without blend option being set, still no transparency (expected) # (but does change image bg color from blue (prior test, might be an accident of color setting leakage) to black) testexpr_11pd3 = Overlay( Closer(DraggableObject(Image("win_collapse_icon.png", convert = 'RGBA', decal = False, blend = True))), - DraggableObject(Image("blueflake.jpg")) + DraggableObject(Image("blueflake.png")) ) # works, incl transparency after 070403-late changes in image.py, # but translucent image obscures the other one (expected, since drawn first, with depthwrite on) # (fyi, screenshot in 'translucent first+depthwrite.jpg', not in cvs) -testexpr_11pd4 = Overlay( DraggableObject(Image("blueflake.jpg")), +testexpr_11pd4 = Overlay( DraggableObject(Image("blueflake.png")), Closer(DraggableObject(Image("win_collapse_icon.png", convert = 'RGBA', decal = False, blend = True))), ) # works, including proper translucency, and (after GL_ALPHA_TEST added) properly not highlightable in fully transparent pixels ###e should add option to turn off depth buffer writing @@ -553,7 +553,7 @@ def test_translucent_icons(_files, _dir = ""): #e refile into images.py? (along if type(_files) == type(""): # permit single file arg [untested, as is _dir = "" with os.path.join] _files = [_files] - _tmp = DraggableObject(SimpleColumn(Image("blueflake.jpg", size = Rect(5)), + _tmp = DraggableObject(SimpleColumn(Image("blueflake.png", size = Rect(5)), TextRect("drag blueflake under icons to see\n" "their translucency over it")), translation = (0,0,0)) @@ -611,10 +611,11 @@ testexpr_11pd7 = DraggableObject( ok_image( _dir1 + "OK_Cancel_TrianglesOutline_ testexpr_11pd8 = DraggableObject( ok_image_2( _dir1 + "OK_Cancel_TrianglesOutline_100x100.png", alpha_test = False )) # works testexpr_11pd9 = DraggableObject( cancel_image( _dir1 + "OK_Cancel_TrianglesOutline_100x100.png", alpha_test = True )) # works (expected grab caveats) -testexpr_11pd10 = DraggableObject( ok_image( "blueflake.jpg", alpha_test = True, convert = False )) # works (subtri of opaque image) +testexpr_11pd10 = DraggableObject( ok_image( "blueflake.png", alpha_test = True, convert = False )) # works (subtri of opaque image) + # [comment from when this was blueflake.jpg:] # tests different native size, jpg not png, perhaps different native format (RGB vs RGBA, don't know), tri coords ok for diff native size, # and finding filename in usual way. BTW, with convert = RGBA or RGB has SystemError: unknown raw mode (and message mentions CMYK). -testexpr_11pd10a = DraggableObject( ok_image( "blueflake.jpg", blend = False, convert = False )) # works (tests tri not needing blend) +testexpr_11pd10a = DraggableObject( ok_image( "blueflake.png", blend = False, convert = False )) # works (tests tri not needing blend) # try some images only available on bruce's g4 @@ -675,15 +676,15 @@ testexpr_11r1 = Image(blueflake, rescale = False) # works; I can't really tell w testexpr_11r1b = Image(blueflake, rescale = False, ideal_width = 512, ideal_height = 512) # works, but note unexpected black border on left testexpr_11r1c = SimpleRow(testexpr_11r1, testexpr_11r1b) # works (but not aligned or even at same scale -- hard to compare) -testexpr_11r2 = Image("redblue-34x66.jpg", rescale = False) # works, except the desired image is in upper left corner of black padding, +testexpr_11r2 = Image("redblue-34x66.png", rescale = False) # works, except the desired image is in upper left corner of black padding, # not lower left as expected, and maybe some filtering happened when it pasted, # and the black padding itself is destined to be undrawn ###BUG that some of that is nim ##e -testexpr_11r2b = Image("redblue-34x66.jpg") # works (rescaled to wider aspect ratio, like before) +testexpr_11r2b = Image("redblue-34x66.png") # works (rescaled to wider aspect ratio, like before) -testexpr_11s = Translate(Image("blueflake.jpg",size=Rect(7,0.4)),(1,0)) # try the new size option [061130] -- works [broken] [works again] -testexpr_11s1 = Highlightable(Image("blueflake.jpg",size=Rect(7,0.4))) # make sure this fixes mouseover stickiness and sbar text -- works [broken] [works again] -testexpr_11s2 = Boxed(Image("blueflake.jpg",size=Rect(7,0.4))) # test its lbox -- won't work? coded a fix, but that broke the use of size entirely!! [fixed, works] +testexpr_11s = Translate(Image("blueflake.png",size=Rect(7,0.4)),(1,0)) # try the new size option [061130] -- works [broken] [works again] +testexpr_11s1 = Highlightable(Image("blueflake.png",size=Rect(7,0.4))) # make sure this fixes mouseover stickiness and sbar text -- works [broken] [works again] +testexpr_11s2 = Boxed(Image("blueflake.png",size=Rect(7,0.4))) # test its lbox -- won't work? coded a fix, but that broke the use of size entirely!! [fixed, works] testexpr_11t = imagetest("storyV3-p31.tiff") # 070222; local to bruce G5 (not in cvs); -- fails, IOError: cannot identify image file testexpr_11tx = imagetest("storyV3-p31x.tiff") # different error -- that means _11t finds the file and can't load it -- why? @@ -738,7 +739,7 @@ testexpr_13x7 = Boxed(PixelGrabber(Rect(1,1,red))) # simpler test -- works, save testexpr_13x8 = Boxed(PixelGrabber(SimpleColumn(Rect(1,1,red),Rect(1,1,blue)))) # this also had lbox bug, now i fixed it, now works. # It was a simple lbox misunderstanding in PixelGrabber code. [###e maybe it means lbox attr signs are wrongly designed?] -savedimage = "redblue-34x66.jpg" +savedimage = "redblue-34x66.png" ## was "/tmp/PixelGrabber-test.jpg" - use that too but not as a "test" since it's not deterministic; ## it'd actually be a "command to see the last PixelGrabber test which saved into the default file" testexpr_13z = Boxed(bordercolor=purple)(Image(savedimage)) # works, but aspect ratio wrong -- that's a feature for now... @@ -828,7 +829,7 @@ testexpr_15b = ChoiceColumn(6,2, background = Rect(3,1,green), background_off = niceargs = dict(background = Rect(3,1,green), background_off = IconImage("espwindow-hide.png")) testexpr_15c = ChoiceColumn(6,2, content = TextRect("zz",1,30), **niceargs) # bug more likely at far right end of text, but not consistent testexpr_15d = ChoiceColumn(6,2, content = Rect(7,0.3,white), **niceargs) # compare Rect here -- works, reliable except right after click [which is a ###BUG] -testexpr_15e = ChoiceColumn(6,2, content = Translate(Image("blueflake.jpg",size=Rect(7,0.4)),(1,0)), **niceargs) # compare Image -- works +testexpr_15e = ChoiceColumn(6,2, content = Translate(Image("blueflake.png",size=Rect(7,0.4)),(1,0)), **niceargs) # compare Image -- works # see also _22 # State [061203] @@ -855,8 +856,8 @@ class checkbox_v1(InstanceMacro): var = State(int, 0) #e bool, False? _value = Highlightable( list_Expr( - checkbox_image('mac_checkbox_off.jpg'), - checkbox_image('mac_checkbox_on.jpg'), + checkbox_image('mac_checkbox_off.png'), + checkbox_image('mac_checkbox_on.png'), )[ mod_Expr(var,2) ], #e or use If on_press = Set(var, mod_Expr(var+1,2) ) #e or use not_Expr @@ -875,8 +876,8 @@ class checkbox_v2(InstanceMacro): # (but i don't know if the arg or option decl can be part of the same decl, unless it's renamed, e.g. StateArg) _value = Highlightable( If( var, - checkbox_image('mac_checkbox_on.jpg'), - checkbox_image('mac_checkbox_off.jpg'), + checkbox_image('mac_checkbox_on.png'), + checkbox_image('mac_checkbox_off.png'), ), on_press = Set(var, not_Expr(var) ) ) @@ -1257,7 +1258,7 @@ testexpr_21g = Translate( class_21g(), (-6,0) ) # works [061212 154p]; works in ##niceargs = dict(background = Rect(3,1,green), background_off = IconImage("espwindow-hide.png")) ##testexpr_15c = ChoiceColumn(6,2, content = TextRect("zz",1,30), **niceargs) # bug more likely at far right end of text, but not consistent ##testexpr_15d = ChoiceColumn(6,2, content = Rect(7,0.3,white), **niceargs) # compare Rect here -- works, reliable except right after click [which is a ###BUG] -##testexpr_15e = ChoiceColumn(6,2, content = Translate(Image("blueflake.jpg",size=Rect(7,0.4)),(1,0)), **niceargs) # compare Image -- works +##testexpr_15e = ChoiceColumn(6,2, content = Translate(Image("blueflake.png",size=Rect(7,0.4)),(1,0)), **niceargs) # compare Image -- works testexpr_22 = DrawInCorner(ChoiceRow(6,2), (1,-1)) # works! (though default options are far from perfect) # see also kluge_dragtool_state_prefs_default and _19* diff --git a/cad/src/exprs/test_statearray_2.py b/cad/src/exprs/test_statearray_2.py index f05d43ffb..6aea8b351 100644 --- a/cad/src/exprs/test_statearray_2.py +++ b/cad/src/exprs/test_statearray_2.py @@ -1,8 +1,10 @@ -# Copyright 2007 Nanorex, Inc. See LICENSE file for details. +# Copyright 2007-2008 Nanorex, Inc. See LICENSE file for details. """ test_statearray_2.py -$Id$ +@author: Bruce +@version: $Id$ +@copyright: 2007-2008 Nanorex, Inc. See LICENSE file for details. test code for one kind of constrained dragging @@ -11,7 +13,6 @@ used in testexpr_35a in exprs/test.py DEPRECATED -- replaced by test_statearray_3.py """ -__author__ = 'bruce' # maybe some of these imports are not needed @@ -117,7 +118,7 @@ class _height_dragger(DelegatingInstanceOrExpr): drag_handler = Instance( xxx_drag_behavior( _self._delegate, height_ref, Ray(ORIGIN, DX) )) ### DX for initial test, then DZ # note: passing _self._delegate (not _self.delegate) fixed my "undiagnosed bug". delegate = DraggableObject( - Image("blueflake.jpg"), ###e needs an option to be visible from both sides (default True, probably) + Image("blueflake.png"), ###e needs an option to be visible from both sides (default True, probably) ## constrain_delta = _self.constrain_delta, ###IMPLEM constrain_delta in DraggableObject ## delta_stateref = height_ref ###IMPLEM delta_stateref [done] (and rename it); and change this to make height_ref a number not vector; ##e and maybe include the constraint in that transform, since it seems implicit in it anyway. ####HOW in semantics? diff --git a/cad/src/exprs/test_statearray_3.py b/cad/src/exprs/test_statearray_3.py index 326187092..c1aacd6ce 100644 --- a/cad/src/exprs/test_statearray_3.py +++ b/cad/src/exprs/test_statearray_3.py @@ -80,7 +80,7 @@ class _height_dragger_3(DelegatingInstanceOrExpr): delegate = Overlay( Highlightable( Translate( - Image("blueflake.jpg"), ###e needs an option to be visible from both sides (default True, probably) + Image("blueflake.png"), ###e needs an option to be visible from both sides (default True, probably) drag_handler._translation ###k ok?? only if that thing hangs around even in between drags, i guess! #e #k not sure if this code-commoning is good, but it's tempting. hmm. ), diff --git a/cad/src/ui/exprs/README b/cad/src/ui/exprs/README deleted file mode 100755 index 2f873e3cb..000000000 --- a/cad/src/ui/exprs/README +++ /dev/null @@ -1,28 +0,0 @@ -$Id$ - - Copyright 2006-2007 Nanorex, Inc. See LICENSE file for details. -NOTE: image files (like the ones in this directory) -need to be committed as binary files, like this: - - % cvs add -kb binary.png - % cvs commit -m "new image of an elephant" binary.png - -Sources of these images (relevant for inferring copyright): - -courier-128.png - derived by bruce from screenshot of IDLE (Python IDE) on Mac, -using courier font from Tk library on Mac (should be ok since font pixmaps -themselves are not copyrightable, AFAIK); hereby placed into the public domain, -by bruce 061125 - -blueflake.jpg - derived by bruce [as IMG_1613-p1.jpg] from a personally taken -photo [IMG_1613.jpg] of his minor son's painting; hereby placed into the public -domain, by bruce 061125 - -redblue-34x66.jpg - trivial; saved from NE1 - -mac_checkbox_off.jpg, mac_checkbox_on.jpg -- screenshots of NE1 prefs (Qt3) on Mac OS X 10.3.9 - -These are classified into subdirectories based on their intended use -in the cad/src/exprs package or its client code. - -# end diff --git a/cad/src/ui/exprs/README.txt b/cad/src/ui/exprs/README.txt new file mode 100755 index 000000000..e7c488311 --- /dev/null +++ b/cad/src/ui/exprs/README.txt @@ -0,0 +1,38 @@ +$Id$ + + Copyright 2006-2008 Nanorex, Inc. See LICENSE file for details. + +NOTE: image files (like the ones in this directory) +need to be committed as binary files. When we used cvs, +this was done like this: + + % cvs add -kb binary.png + % cvs commit -m "new image of an elephant" binary.png + +Now that we use svn, I think it's sufficient to have a correct +~/.subversion/config file, as explained in + + http://www.nanoengineer-1.net/mediawiki/index.php?title=Subversion#subversion_config_file + +Note: the .jpg versions below no longer work in NE1 on recent versions of Mac OS and/or Qt, +at least in some developer configurations. As of 081125, only the .png images are used. + +Sources of these images (relevant for inferring copyright): + +courier-128.png - derived by bruce from screenshot of IDLE (Python IDE) on Mac, +using courier font from Tk library on Mac (should be ok since font pixmaps +themselves are not copyrightable, AFAIK); hereby placed into the public domain, +by bruce 061125 + +blueflake.jpg/.png - derived by bruce [as IMG_1613-p1.jpg] from a personally taken +photo [IMG_1613.jpg] of his minor son's painting; hereby placed into the public +domain, by bruce 061125 + +redblue-34x66.jpg/.png - trivial; saved from NE1 + +mac_checkbox_off.jpg/.png, mac_checkbox_on.jpg/.png -- screenshots of NE1 prefs (Qt3) on Mac OS X 10.3.9 + +These are classified into subdirectories based on their intended use +in the cad/src/exprs package or its client code. + +# end diff --git a/cad/src/ui/exprs/test/redblue-34x66.png b/cad/src/ui/exprs/test/redblue-34x66.png Binary files differnew file mode 100644 index 000000000..6efa88f89 --- /dev/null +++ b/cad/src/ui/exprs/test/redblue-34x66.png diff --git a/cad/src/ui/exprs/textures/blueflake.png b/cad/src/ui/exprs/textures/blueflake.png Binary files differnew file mode 100644 index 000000000..3ab0e6412 --- /dev/null +++ b/cad/src/ui/exprs/textures/blueflake.png diff --git a/cad/src/ui/exprs/widgets/mac_checkbox_off.png b/cad/src/ui/exprs/widgets/mac_checkbox_off.png Binary files differnew file mode 100644 index 000000000..27021fce0 --- /dev/null +++ b/cad/src/ui/exprs/widgets/mac_checkbox_off.png diff --git a/cad/src/ui/exprs/widgets/mac_checkbox_on.png b/cad/src/ui/exprs/widgets/mac_checkbox_on.png Binary files differnew file mode 100644 index 000000000..718a559a1 --- /dev/null +++ b/cad/src/ui/exprs/widgets/mac_checkbox_on.png |