Make an open stack modal by script

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Make an open stack modal by script

Mike Kerner via use-livecode
Hi all.

I broached this subject before but in the reverse direction. I have an app that allows multiple windows (I call forms) open at the same time. For instance I can have the customer form, the sites form and the devices form open simultaneously. Changing the customer loads the sites for the new customer and selects the first site, which loads the devices at that site and loads the first device.

Clearly if I am editing a device, I want to prevent the user from switching the customer or site, pulling the rug out from under the device edit session. A *GREAT* way to do this might be to make the edit window modal when the user enters the edit mode, preventing him from interacting with the other windows until the form data is saved. Unfortunately, and to my great chagrin, the mode of a window is read only.

Am I going to have to use send in time to close and reopen the window modally, and reverse it when the data is saved?

Bob S
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Make an open stack modal by script

Mike Kerner via use-livecode
set the style of stack XXX to modal

set the tail end of the style entry in the Dictionary for details

On 3/28/2018 11:35 AM, Bob Sneidar via use-livecode wrote:

> Hi all.
>
> I broached this subject before but in the reverse direction. I have an app that allows multiple windows (I call forms) open at the same time. For instance I can have the customer form, the sites form and the devices form open simultaneously. Changing the customer loads the sites for the new customer and selects the first site, which loads the devices at that site and loads the first device.
>
> Clearly if I am editing a device, I want to prevent the user from switching the customer or site, pulling the rug out from under the device edit session. A *GREAT* way to do this might be to make the edit window modal when the user enters the edit mode, preventing him from interacting with the other windows until the form data is saved. Unfortunately, and to my great chagrin, the mode of a window is read only.
>
> Am I going to have to use send in time to close and reopen the window modally, and reverse it when the data is saved?
>
> Bob S
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Make an open stack modal by script

Mike Kerner via use-livecode
Brilliant! This will make things much smoother. I was hiding all other substacks while editing, but the disappearance of the other windows was disconcerting.

Bob S

> On Mar 28, 2018, at 08:50 , Paul Dupuis via use-livecode <[hidden email]> wrote:
>
> set the style of stack XXX to modal
>
> set the tail end of the style entry in the Dictionary for details


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Make an open stack modal by script

Mike Kerner via use-livecode
In reply to this post by Mike Kerner via use-livecode
Bob Sneidar wrote:

 > Unfortunately, and to my great chagrin, the mode of a window is read
 > only.

What does that mean?  What exactly do you see?

I can't think of any mode that prevents text entry, so maybe you've
encountered a bug, or some other script is preventing editing.

--
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  [hidden email]                http://www.FourthWorld.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Make an open stack modal by script

Mike Kerner via use-livecode
The Property called mode is read only. The mode is set using the style keyword as was pointed out. That works a peach! I had been jumping through hoops to prevent users from accidentally switching a customer or site while editing a device record belonging to one of those two. Now I just set the style to "Modal" while editing and return it to "TopLevel" when not.

Bob S


> On Mar 28, 2018, at 10:00 , Richard Gaskin via use-livecode <[hidden email]> wrote:
>
> Bob Sneidar wrote:
>
> > Unfortunately, and to my great chagrin, the mode of a window is read
> > only.
>
> What does that mean?  What exactly do you see?
>
> I can't think of any mode that prevents text entry, so maybe you've encountered a bug, or some other script is preventing editing.
>
> --
> Richard Gaskin


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Make an open stack modal by script

Mike Kerner via use-livecode
Ah, yes - the *property* is read-only; I had mistakenly read that as
being about the stack itself somehow being read-only.

Yes, the relationship between mode, style, and the mode commands
(toplevel, palette, modal, modeless) are wonderfully flexible.

Mode lets us know what state the window is in at any given time.

Style lets us set a mode as a default when we use open or go.

The mode commands let us override that style to open a stack of any
style in any mode as needed.

In devolution's DeskView window I use these to allow easy toggling of
modes by double-clicking the window representation within it:

If that stack's style is toplevel it bring it to the front as toplevel.

If the style is anything else it uses the toplevel command so I can work
on it.

If its mode is already toplevel but its style is not, it reopens the
stack in its style.

--
  Richard Gaskin
  Fourth World Systems


Bob Sneidar wrote:

 > The Property called mode is read only. The mode is set using the style
 > keyword as was pointed out. That works a peach! I had been jumping
 > through hoops to prevent users from accidentally switching a customer
 > or site while editing a device record belonging to one of those two.
 > Now I just set the style to "Modal" while editing and return it to
 > "TopLevel" when not.
 >
 > Bob S
 >
 >
 >> On Mar 28, 2018, at 10:00 , Richard Gaskin wrote:
 >>
 >> Bob Sneidar wrote:
 >>
 >> > Unfortunately, and to my great chagrin, the mode of a window
 >> > is read only.
 >>
 >> What does that mean?  What exactly do you see?
 >>
 >> I can't think of any mode that prevents text entry, so maybe you've
 >> encountered a bug, or some other script is preventing editing.
 >>
 >> --
 >> Richard Gaskin

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode