canvas.gui: Update for 'file'->'src' rename.
This commit is contained in:
parent
c628771b4b
commit
e593ee2c30
4 changed files with 11 additions and 11 deletions
|
@ -926,7 +926,7 @@ var Image = {
|
|||
# canvas://by-index/texture[0])
|
||||
setFile: func(file)
|
||||
{
|
||||
me.set("file", file);
|
||||
me.set("src", file);
|
||||
},
|
||||
# Set rectangular region of source image to be used
|
||||
#
|
||||
|
|
|
@ -40,7 +40,7 @@ var WindowButton = {
|
|||
else if( me._window._focused )
|
||||
file ~= "_normal";
|
||||
|
||||
me._root.set("file", file ~ ".png");
|
||||
me._root.set("src", file ~ ".png");
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -466,6 +466,8 @@ var initDemo = func
|
|||
my_canvas.addEventListener("drag", func(e) { printf("drag: screen(%.1f|%.1f) client(%.1f|%.1f) local(%.1f|%.1f) delta(%.1f|%.1f)", e.screenX, e.screenY, e.clientX, e.clientY, e.localX, e.localY, e.deltaX, e.deltaY); });
|
||||
my_canvas.addEventListener("wheel", func(e) { printf("wheel: screen(%.1f|%.1f) client(%.1f|%.1f) %.1f", e.screenX, e.screenY, e.clientX, e.clientY, e.deltaY); });
|
||||
var root = my_canvas.createGroup();
|
||||
root.createChild("image")
|
||||
.set("src", "http://wiki.flightgear.org/skins/common/images/icons-fg-135.png");
|
||||
var text =
|
||||
root.createChild("text")
|
||||
.setText("This could be used for building an 'Aircraft Help' dialog.\nYou can also #use it to play around with the new Canvas system :). β")
|
||||
|
@ -512,17 +514,15 @@ var initDemo = func
|
|||
});
|
||||
}
|
||||
|
||||
# TODO think of some generic/non-leaking way to do this
|
||||
setlistener(props.globals.initNode("/sim/gui/canvas/demo", 0, 'BOOL'), func(p)
|
||||
(func {
|
||||
var init_listener = setlistener("/nasal/canvas/loaded", func(p)
|
||||
{
|
||||
if( !p.getValue() )
|
||||
return;
|
||||
|
||||
setlistener("/nasal/canvas/loaded", func(p)
|
||||
{
|
||||
if( !p.getValue() )
|
||||
return;
|
||||
removelistener(init_listener);
|
||||
|
||||
if( getprop("/sim/gui/canvas/demo") )
|
||||
initDemo();
|
||||
}, 1, 0);
|
||||
}, 1, 0);
|
||||
})();
|
||||
|
|
|
@ -82,7 +82,7 @@ DefaultStyle.widgets.button = {
|
|||
else
|
||||
me._bg.set("fill", me._style.getColor("button_bg_color"));
|
||||
|
||||
me._border.set("file", file ~ ".png");
|
||||
me._border.set("src", file ~ ".png");
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ var Tooltip = {
|
|||
|
||||
me._frame =
|
||||
root.createChild("image", "background")
|
||||
.set("file", "gui/images/tooltip.png")
|
||||
.set("src", "gui/images/tooltip.png")
|
||||
.set("slice", me._slice ~ " fill")
|
||||
.setSize(size);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue