Revision: 3177
http://vexi.svn.sourceforge.net/vexi/?rev=3177&view=rev
Author: clrg
Date: 2008-11-06 00:51:23 +0000 (Thu, 06 Nov 2008)
Log Message:
-----------
getTrap is ambiguous - use rtrap/wtrap in addTrap/delTrap
Modified Paths:
--------------
trunk/core/org.vexi.core/src/org/vexi/core/Box.jpp
Modified: trunk/core/org.vexi.core/src/org/vexi/core/Box.jpp
===================================================================
--- trunk/core/org.vexi.core/src/org/vexi/core/Box.jpp 2008-11-05 23:04:08 UTC
(rev 3176)
+++ trunk/core/org.vexi.core/src/org/vexi/core/Box.jpp 2008-11-06 00:51:23 UTC
(rev 3177)
@@ -1457,10 +1457,10 @@
}
/** set flags on added traps */
- public void addTrap(JS key, JS f) throws JSExn {
- super.addTrap(key, f);
- // We are only interested in write traps
- if (f.getFormalArgs().length != 1) {
+ public void addTrap(JS key, JS function) throws JSExn {
+ super.addTrap(key, function);
+ // differentiate between read and write traps
+ if (function.getFormalArgs().length != 1) {
//#switch (JSU.toString(key))
case "surface": set(SURFACE_READ_TRAP);
case "visible": set(VISIBLE_READ_TRAP);
@@ -1495,26 +1495,34 @@
/** remove unnecessary flags */
public void delTrap(JS key, JS function) throws JSExn {
+ // differentiate between read and write traps
+ if (function.getFormalArgs().length != 1) {
+ //#switch (JSU.toString(key))
+ case "surface": if (rtrap(SC_surface)==null)
clear(SURFACE_READ_TRAP);
+ case "visible": if (rtrap(SC_visible)==null)
clear(VISIBLE_READ_TRAP);
+ //#end
+ return;
+ }
super.delTrap(key, function);
//#switch (JSU.toString(key))
- case "x": if (getTrap(SC_x) == null) clear(X_TRAP);
- case "y": if (getTrap(SC_y) == null) clear(Y_TRAP);
- case "width": if (getTrap(SC_width) == null) clear(WIDTH_TRAP);
- case "height": if (getTrap(SC_height) == null) clear(HEIGHT_TRAP);
- case "minwidth": if (getTrap(SC_minwidth) == null)
clear(MINWIDTH_TRAP);
- case "maxwidth": if (getTrap(SC_maxwidth) == null)
clear(MAXWIDTH_TRAP);
- case "minheight": if (getTrap(SC_minheight) == null)
clear(MINHEIGHT_TRAP);
- case "maxheight": if (getTrap(SC_maxheight) == null)
clear(MAXHEIGHT_TRAP);
- case "contentwidth": if (getTrap(SC_contentwidth) == null)
clear(CONTENTWIDTH_TRAP);
- case "contentheight": if (getTrap(SC_contentheight) == null)
clear(CONTENTHEIGHT_TRAP);
- case "surface": if (getTrap(SC_surface) == null)
clear((short)(SURFACE_TRAP|SURFACE_READ_TRAP));
- case "visible": if (getTrap(SC_visible) == null)
clear((short)(VISIBLE_TRAP|VISIBLE_READ_TRAP));
- case "Enter": if (getTrap(SC_Enter) == null) clear(ENTER_TRAP);
- case "Leave": if (getTrap(SC_Leave) == null) clear(LEAVE_TRAP);
- case "_Move": if (getTrap(SC__Move) == null) clear(MOVE_TRAP);
- case "Move": if (getTrap(SC_Move) == null) clear(MOVE_TRAP);
- case "fontsize": if (getTrap(SC_fontsize) == null) text.fontsize_trap
= false;
- case "font": if (getTrap(SC_font) == null) text.font_trap = false;
+ case "x": if (wtrap(SC_x) == null) clear(X_TRAP);
+ case "y": if (wtrap(SC_y) == null) clear(Y_TRAP);
+ case "width": if (wtrap(SC_width) == null) clear(WIDTH_TRAP);
+ case "height": if (wtrap(SC_height) == null) clear(HEIGHT_TRAP);
+ case "minwidth": if (wtrap(SC_minwidth) == null) clear(MINWIDTH_TRAP);
+ case "maxwidth": if (wtrap(SC_maxwidth) == null) clear(MAXWIDTH_TRAP);
+ case "minheight": if (wtrap(SC_minheight) == null)
clear(MINHEIGHT_TRAP);
+ case "maxheight": if (wtrap(SC_maxheight) == null)
clear(MAXHEIGHT_TRAP);
+ case "contentwidth": if (wtrap(SC_contentwidth) == null)
clear(CONTENTWIDTH_TRAP);
+ case "contentheight": if (wtrap(SC_contentheight) == null)
clear(CONTENTHEIGHT_TRAP);
+ case "surface": if (wtrap(SC_surface) == null) clear(SURFACE_TRAP);
+ case "visible": if (wtrap(SC_visible) == null) clear(VISIBLE_TRAP);
+ case "Enter": if (wtrap(SC_Enter) == null) clear(ENTER_TRAP);
+ case "Leave": if (wtrap(SC_Leave) == null) clear(LEAVE_TRAP);
+ case "_Move": if (wtrap(SC__Move) == null) clear(MOVE_TRAP);
+ case "Move": if (wtrap(SC_Move) == null) clear(MOVE_TRAP);
+ case "fontsize": if (wtrap(SC_fontsize) == null) text.fontsize_trap =
false;
+ case "font": if (wtrap(SC_font) == null) text.font_trap = false;
//#end
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Vexi-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/vexi-svn