Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
31b976b
[[ ObjectVisibility ]] rework MCObject::isvisible() to be usable from…
livecodeian Dec 7, 2015
b2922dd
[[ ObjectVisibility ]] Simplify object visibility setters by getting …
livecodeian Dec 7, 2015
5cdbd12
Merge branch 'bugfix-16553' into bugfix-native_layer_in_group
livecodeian Dec 7, 2015
3594136
Merge branch 'develop' of https://github.com/livecode/livecode into b…
livecodeian Dec 9, 2015
9f54534
[[ ObjectVisibility ]] Remove SetVisibility / SetInvisible from playe…
livecodeian Dec 9, 2015
4f44036
[[ NativeLayer ]] Make native layer applicable to all objects rather …
livecodeian Dec 11, 2015
8b88874
[[ NativeLayer ]] Move native layer event dispatching from MCWidget t…
livecodeian Dec 15, 2015
25282df
[[ NativeLayer ]] Move native layer geometry changed notification to …
livecodeian Dec 15, 2015
3dfa265
[[ NativeLayer ]] Implement group object native container layer.
livecodeian Dec 15, 2015
8f1e4c1
[[ NativeLayer ]] Make sure content views aren't moved when group min…
livecodeian Dec 16, 2015
053b578
[[ NativeLayer ]] Propagate toolchanged message to group contents
livecodeian Dec 16, 2015
e758c18
[[ NativeLayer ]] Remove superfluous MCNativeLayer OnOpen / OnClose
livecodeian Dec 16, 2015
d860254
[[ NativeLayer ]] rename MCPlayer::setrect MCPlayer::doSetRect
livecodeian Jan 6, 2016
5c96b0c
[[ NativeLayer ]] Add server stubs for MCNativeLayer
livecodeian Jan 6, 2016
6104e9c
[[ NativeLayer ]] Update iOS NativeLayer to use UIView containers.
livecodeian Jan 6, 2016
8781c38
[[ NativeLayer ]] Update Android NativeLayer to use RelativeLayout co…
livecodeian Jan 7, 2016
a0cb138
Merge branch 'develop' of https://github.com/livecode/livecode into b…
livecodeian Jan 12, 2016
e4391e1
[[ NativeLayer ]] Add notification when parent clipping area changes
livecodeian Jan 20, 2016
39b429c
[[ NativeLayer ]] Update win32 native layer to use clipping container…
livecodeian Jan 20, 2016
3b36d73
[[ NativeLayer ]] Update linux native layer to constrain container wi…
livecodeian Jan 21, 2016
1ce7867
[[ NativeLayer ]] update native layer viewport geometry when attachin…
livecodeian Jan 21, 2016
d28964b
[[ NativeLayer ]] Add stub MCNativeLayer::doSetViewportGeometry methods
livecodeian Jan 21, 2016
09c518d
Merge branch 'develop' of https://github.com/livecode/livecode into b…
livecodeian Jan 21, 2016
fb013df
[[ Bug 16568 ]] Add bugfix release note
livecodeian Jan 21, 2016
ac68e7d
Merge branch 'develop' of https://github.com/livecode/livecode into b…
livecodeian Jan 21, 2016
e679bf4
[[ NativeLayer ]] initialize native layer to nil in MCObject copy con…
livecodeian Jan 22, 2016
5f85a88
[[ Bug 16568 ]] Remove unnecessary code causing compile error on Linux
livecodeian Jan 28, 2016
10e2960
Merge branch 'develop' of https://github.com/livecode/livecode into b…
livecodeian Jan 28, 2016
74b7d0a
Merge branch 'develop' of https://github.com/livecode/livecode into b…
livecodeian Jan 28, 2016
07a38a8
[[ Bug 16568 ]] Restore initialisation of MCObject theme values delet…
livecodeian Jan 28, 2016
14e8e88
[[ Bug 16568 ]] Rename MCObject::doSetRect -> applyrect. Make MCObjec…
livecodeian Feb 15, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/notes/bugfix-16568.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Browser widget visibility not updated correctly when in a group
2 changes: 1 addition & 1 deletion engine/src/button.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1673,7 +1673,7 @@ uint2 MCButton::gettransient() const
}


void MCButton::setrect(const MCRectangle &nrect)
void MCButton::applyrect(const MCRectangle &nrect)
{
rect = nrect;
MCRectangle trect;
Expand Down
2 changes: 1 addition & 1 deletion engine/src/button.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class MCButton : public MCControl
#endif

virtual uint2 gettransient() const;
virtual void setrect(const MCRectangle &nrect);
virtual void applyrect(const MCRectangle &nrect);

#ifdef LEGACY_EXEC
virtual Exec_stat getprop_legacy(uint4 parid, Properties which, MCExecPoint &, Boolean effective, bool recursive = false);
Expand Down
2 changes: 1 addition & 1 deletion engine/src/eps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ Boolean MCEPS::mup(uint2 which, bool p_release)
return True;
}

void MCEPS::setrect(const MCRectangle &nrect)
void MCEPS::applyrect(const MCRectangle &nrect)
{
if (rect.width != nrect.width || rect.height != nrect.height)
{
Expand Down
2 changes: 1 addition & 1 deletion engine/src/eps.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class MCEPS : public MCControl
virtual const char *gettypestring();
virtual Boolean mdown(uint2 which);
virtual Boolean mup(uint2 which, bool p_release);
virtual void setrect(const MCRectangle &nrect);
virtual void applyrect(const MCRectangle &nrect);

#ifdef LEGACY_EXEC
virtual Exec_stat getprop_legacy(uint4 parid, Properties which, MCExecPoint &, Boolean effective, bool recursive = false);
Expand Down
23 changes: 16 additions & 7 deletions engine/src/exec-interface-group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -801,12 +801,21 @@ void MCGroup::GetClipsToRect(MCExecContext& ctxt, bool& r_clips_to_rect)
r_clips_to_rect = m_clips_to_rect;
}

void MCGroup::SetVisible(MCExecContext& ctxt, uinteger_t part, bool setting)
// PM-2015-07-02: [[ Bug 13262 ]] Make sure we attach/detach the player when
// showing/hiding a group that has a player
void MCGroup::SetVisible(MCExecContext &ctxt, uinteger_t part, bool setting)
{
SetVisibility(ctxt, part, setting, true);
}

void MCGroup::SetInvisible(MCExecContext& ctxt, uinteger_t part, bool setting)
{
SetVisibility(ctxt, part, setting, false);
MCControl::SetVisible(ctxt, part, setting);
#ifdef PLATFORM_PLAYER
for(MCPlayer *t_player = MCplayers; t_player != nil; t_player = t_player -> getnextplayer())
{
if (t_player -> getparent() == this)
{
if (setting)
t_player -> attachplayer();
else
t_player -> detachplayer();
}
}
#endif
}
16 changes: 3 additions & 13 deletions engine/src/exec-interface-image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -739,10 +739,10 @@ void MCImage::SetInk(MCExecContext& ctxt, intenum_t ink)
notifyneeds(false);
}

void MCImage::SetVisibility(MCExecContext& ctxt, uinteger_t part, bool setting, bool visible)
void MCImage::SetVisible(MCExecContext& ctxt, uinteger_t part, bool setting)
{
Boolean wasvisible = isvisible();
MCObject::SetVisibility(ctxt, part, setting, visible);
bool wasvisible = isvisible();
MCObject::SetVisible(ctxt, part, setting);
if (!(MCbufferimages || flags & F_I_ALWAYS_BUFFER)
&& !isvisible() && m_rep != nil)
closeimage();
Expand All @@ -762,16 +762,6 @@ void MCImage::SetVisibility(MCExecContext& ctxt, uinteger_t part, bool setting,
}
}

void MCImage::SetVisible(MCExecContext& ctxt, uinteger_t part, bool setting)
{
SetVisibility(ctxt, part, setting, true);
}

void MCImage::SetInvisible(MCExecContext& ctxt, uinteger_t part, bool setting)
{
SetVisibility(ctxt, part, setting, false);
}

// MERG-2015-02-11: [[ ImageMetadata ]] Refactored image metadata property
void MCImage::GetMetadataProperty(MCExecContext& ctxt, MCNameRef p_prop, MCExecValue& r_value)
{
Expand Down
33 changes: 6 additions & 27 deletions engine/src/exec-interface-object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3151,17 +3151,11 @@ void MCObject::Set3D(MCExecContext& ctxt, bool setting)

////////////////////////////////////////////////////////////////////////////////

void MCObject::SetVisibility(MCExecContext& ctxt, uint32_t part, bool setting, bool visible)
void MCObject::SetVisible(MCExecContext& ctxt, uint32_t part, bool setting)
{
bool dirty;
dirty = changeflag(setting, F_VISIBLE);

if (!visible)
{
flags ^= F_VISIBLE;
dirty = !dirty;
}

// MW-2011-10-17: [[ Bug 9813 ]] Record the current effective rect of the object.
MCRectangle t_old_effective_rect;
if (dirty && opened && gettype() >= CT_GROUP)
Expand All @@ -3188,42 +3182,27 @@ void MCObject::SetVisibility(MCExecContext& ctxt, uint32_t part, bool setting, b

void MCObject::GetVisible(MCExecContext& ctxt, uint32_t part, bool& r_setting)
{
r_setting = getflag(F_VISIBLE);
}

void MCObject::SetVisible(MCExecContext& ctxt, uint32_t part, bool setting)
{
SetVisibility(ctxt, part, setting, true);
r_setting = isvisible(false);
}

void MCObject::GetEffectiveVisible(MCExecContext& ctxt, uint32_t part, bool& r_setting)
{
bool t_vis;
t_vis = getflag(F_VISIBLE);

// if visible and effective and parent is a
// group then keep searching parent properties
if (t_vis && parent != NULL && parent->gettype() == CT_GROUP)
parent->GetEffectiveVisible(ctxt, part, t_vis);

r_setting = t_vis;
r_setting = isvisible(true);
}

void MCObject::GetInvisible(MCExecContext& ctxt, uint32_t part, bool& r_setting)
{
r_setting = (flags & F_VISIBLE) == False;
r_setting = !isvisible(false);
}

void MCObject::SetInvisible(MCExecContext& ctxt, uint32_t part, bool setting)
{
SetVisibility(ctxt, part, setting, false);
SetVisible(ctxt, part, !setting);
}

void MCObject::GetEffectiveInvisible(MCExecContext& ctxt, uint32_t part, bool& r_setting)
{
bool t_setting;
GetEffectiveVisible(ctxt, part, t_setting);
r_setting = !t_setting;
r_setting = !isvisible(true);
}

void MCObject::GetEnabled(MCExecContext& ctxt, uint32_t part, bool& r_setting)
Expand Down
14 changes: 2 additions & 12 deletions engine/src/exec-interface-player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -697,10 +697,10 @@ void MCPlayer::SetBorderWidth(MCExecContext& ctxt, uinteger_t width)
Redraw();
}

void MCPlayer::SetVisibility(MCExecContext& ctxt, uinteger_t part, bool setting, bool visible)
void MCPlayer::SetVisible(MCExecContext& ctxt, uinteger_t part, bool setting)
{
uint4 oldflags = flags;
MCObject::SetVisibility(ctxt, part, setting, visible);
MCControl::SetVisible(ctxt, part, setting);

// PM-2015-07-01: [[ Bug 15191 ]] Keep the LC 6.7 behaviour in non-platform player, to make the video layer to hide
#ifndef FEATURE_PLATFORM_PLAYER
Expand All @@ -713,16 +713,6 @@ void MCPlayer::SetVisibility(MCExecContext& ctxt, uinteger_t part, bool setting,
updatevisibility();
}

void MCPlayer::SetVisible(MCExecContext& ctxt, uinteger_t part, bool setting)
{
SetVisibility(ctxt, part, setting, true);
}

void MCPlayer::SetInvisible(MCExecContext& ctxt, uinteger_t part, bool setting)
{
SetVisibility(ctxt, part, setting, false);
}

void MCPlayer::SetTraversalOn(MCExecContext& ctxt, bool setting)
{
MCObject::SetTraversalOn(ctxt, setting);
Expand Down
2 changes: 1 addition & 1 deletion engine/src/field.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1399,7 +1399,7 @@ uint2 MCField::gettransient() const
return 0;
}

void MCField::setrect(const MCRectangle &nrect)
void MCField::applyrect(const MCRectangle &nrect)
{
// The contents only need to be laid out if the size changes. In particular,
// it is the width that is important; the height does not affect layout.
Expand Down
2 changes: 1 addition & 1 deletion engine/src/field.h
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ class MCField : public MCControl
virtual void timer(MCNameRef mptr, MCParameter *params);
virtual void select();
virtual uint2 gettransient() const;
virtual void setrect(const MCRectangle &nrect);
virtual void applyrect(const MCRectangle &nrect);

#ifdef LEGACY_EXEc
virtual Exec_stat getprop_legacy(uint4 parid, Properties which, MCExecPoint &, Boolean effective, bool recursive = false);
Expand Down
2 changes: 1 addition & 1 deletion engine/src/graphic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ Boolean MCGraphic::doubleup(uint2 which)
return MCControl::doubleup(which);
}

void MCGraphic::setrect(const MCRectangle &nrect)
void MCGraphic::applyrect(const MCRectangle &nrect)
{
if (realpoints != NULL)
{
Expand Down
2 changes: 1 addition & 1 deletion engine/src/graphic.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class MCGraphic : public MCControl
virtual Boolean mup(uint2 which, bool p_release);
virtual Boolean doubledown(uint2 which);
virtual Boolean doubleup(uint2 which);
virtual void setrect(const MCRectangle &nrect);
virtual void applyrect(const MCRectangle &nrect);

// MW-2011-11-23: [[ Array Chunk Props ]] Add 'effective' param to arrayprop access.
#ifdef LEGACY_EXEC
Expand Down
96 changes: 76 additions & 20 deletions engine/src/group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,58 @@ bool MCGroup::visit_children(MCObjectVisitorOptions p_options, uint32_t p_part,
return t_continue;
}

void MCGroup::toolchanged(Tool p_new_tool)
{
MCControl::toolchanged(p_new_tool);
if (controls != nil)
{
MCControl *t_ctrl;
t_ctrl = controls;
do
{
t_ctrl->toolchanged(p_new_tool);
t_ctrl = t_ctrl->next();
}
while (t_ctrl != controls);
}
}

MCRectangle MCGroup::getviewportgeometry()
{
MCRectangle t_viewport;
t_viewport = getrect();

MCObject *t_parent;
t_parent = getparent();
if (t_parent != nil && t_parent->gettype() == CT_GROUP)
t_viewport = MCU_intersect_rect(t_viewport, ((MCGroup*)t_parent)->getviewportgeometry());

return t_viewport;
}

void MCGroup::geometrychanged(const MCRectangle &p_rect)
{
MCControl::geometrychanged(p_rect);
viewportgeometrychanged(getviewportgeometry());
}

void MCGroup::viewportgeometrychanged(const MCRectangle &p_rect)
{
MCRectangle t_viewport;
t_viewport = MCU_intersect_rect(p_rect, getrect());

if (controls != nil)
{
MCControl *t_control = controls;
do
{
t_control->viewportgeometrychanged(t_viewport);
t_control = t_control->next();
}
while (t_control != controls);
}
}

void MCGroup::open()
{
MCControl::open();
Expand Down Expand Up @@ -796,7 +848,7 @@ Boolean MCGroup::doubleup(uint2 which)
return False;
}

void MCGroup::setrect(const MCRectangle &nrect)
void MCGroup::applyrect(const MCRectangle &nrect)
{
bool t_size_changed;
t_size_changed = nrect . width != rect . width || nrect . height != rect . height;
Expand Down Expand Up @@ -2747,6 +2799,10 @@ bool MCGroup::computeminrect(Boolean scrolling)
else
t_all = true;
state = oldstate;

// IM-2015-12-16: [[ NativeLayer ]] The group rect has changed, so send geometry change notification.
geometrychanged(getrect());

return t_all;
}
else if ((flags & F_HSCROLLBAR || flags & F_VSCROLLBAR)
Expand Down Expand Up @@ -3695,6 +3751,25 @@ void MCGroup::relayercontrol_insert(MCControl *p_control, MCControl *p_target)
p_control -> layer_redrawall();
}

bool MCGroup::getNativeContainerLayer(MCNativeLayer *&r_layer)
{
if (getNativeLayer() == nil)
{
void *t_view;
if (!MCNativeLayer::CreateNativeContainer(t_view))
return false;
if (!SetNativeView(t_view))
{
MCNativeLayer::ReleaseNativeView(t_view);
return false;
}
}

r_layer = getNativeLayer();

return true;
}

void MCGroup::scheduledelete(bool p_is_child)
{
MCControl::scheduledelete(p_is_child);
Expand All @@ -3710,22 +3785,3 @@ void MCGroup::scheduledelete(bool p_is_child)
while(t_control != controls);
}
}

// PM-2015-07-02: [[ Bug 13262 ]] Make sure we attach/detach the player when
// showing/hiding a group that has a player
void MCGroup::SetVisibility(MCExecContext &ctxt, uinteger_t part, bool flag, bool visible)
{
MCControl::SetVisibility(ctxt, part, flag, visible);
#ifdef PLATFORM_PLAYER
for(MCPlayer *t_player = MCplayers; t_player != nil; t_player = t_player -> getnextplayer())
{
if (t_player -> getparent() == this)
{
if (flag && visible || !flag && !visible)
t_player -> attachplayer();
else
t_player -> detachplayer();
}
}
#endif
}
14 changes: 11 additions & 3 deletions engine/src/group.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class MCGroup : public MCControl
virtual Boolean mup(uint2 which, bool p_release);
virtual Boolean doubledown(uint2 which);
virtual Boolean doubleup(uint2 which);
virtual void setrect(const MCRectangle &nrect);
virtual void applyrect(const MCRectangle &nrect);

#ifdef LEGACY_EXEC
virtual Exec_stat getprop_legacy(uint4 parid, Properties which, MCExecPoint &, Boolean effective, bool recursive = false);
Expand Down Expand Up @@ -129,6 +129,16 @@ class MCGroup : public MCControl
virtual void relayercontrol_remove(MCControl *control);
virtual void relayercontrol_insert(MCControl *control, MCControl *target);

virtual void toolchanged(Tool p_new_tool);

virtual void geometrychanged(const MCRectangle &p_rect);

virtual void viewportgeometrychanged(const MCRectangle &p_rect);

virtual MCRectangle getviewportgeometry();

bool getNativeContainerLayer(MCNativeLayer *&r_layer);

virtual void scheduledelete(bool p_is_child);

MCControl *findchildwithid(Chunk_term type, uint4 p_id);
Expand Down Expand Up @@ -302,9 +312,7 @@ class MCGroup : public MCControl
void SetClipsToRect(MCExecContext& ctxt, bool p_clips_to_rect);
void GetClipsToRect(MCExecContext& ctxt, bool &r_clips_to_rect);

void SetInvisible(MCExecContext& ctxt, uinteger_t part, bool setting);
void SetVisible(MCExecContext& ctxt, uinteger_t part, bool setting);
void SetVisibility(MCExecContext& ctxt, uinteger_t part, bool flag, bool visible);

virtual void SetEnabled(MCExecContext& ctxt, uint32_t part, bool setting);
virtual void SetDisabled(MCExecContext& ctxt, uint32_t part, bool setting);
Expand Down
Loading