Substacks on top
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Substacks on top
I am converting a large program from SumTotal Toolbook to Livecode. A lot of things are similar, but one major difference is the handling of windows within windows. Toolbook had a rather neat feature called ‘viewers’ which could be opened to show different pages from the current book or other books, and and remained visible until closed. Livecode has substacks which can be opened on top of the mainstack but unfortunately disappear when the mainstack is clicked. The ‘always on top’ setting is useless as it hides message boxes and everything else. This is a major headache unless someone has a solution as I made extensive use of viewers in Toolbook.
Re: Substacks on top
you should try "as modal"
http://lessons.livecode.com/m/4071/l/11 ... dal-dialog
Code: Select all
go stack "myStack" as modal
http://lessons.livecode.com/m/4071/l/11 ... dal-dialog
-
- VIP Livecode Opensource Backer
- Posts: 9823
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Substacks on top
Welcome aboard, Odysseus.
I had some very good times with Toolbook, and used Viewers extensively. And with the built-in syntax for making system calls, I even made some with custom shapes. Nice program. If it was multi-platform I'd probably still be using it.
In LC we don't have Viewers yet (on the to-do list for down the road), but the closest approximation isn't too bad if you don't mind a little script.
I could explain it, but it's easier to provide an example... It uses a borderless palette style to simulate the Viewer, with a moveStack handler in the base stack so that moving the base stack moves the palette window along with it.
It's not bad, but sometimes you may see a bit of a lag between dragging actions and the placement of the "FauxViewer".
In most cases I find it's easier to use groups instead.
May I ask what you're building that makes a Viewer a better fit than a group?
I had some very good times with Toolbook, and used Viewers extensively. And with the built-in syntax for making system calls, I even made some with custom shapes. Nice program. If it was multi-platform I'd probably still be using it.
In LC we don't have Viewers yet (on the to-do list for down the road), but the closest approximation isn't too bad if you don't mind a little script.
I could explain it, but it's easier to provide an example... It uses a borderless palette style to simulate the Viewer, with a moveStack handler in the base stack so that moving the base stack moves the palette window along with it.
It's not bad, but sometimes you may see a bit of a lag between dragging actions and the placement of the "FauxViewer".
In most cases I find it's easier to use groups instead.
May I ask what you're building that makes a Viewer a better fit than a group?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Substacks on top
Thanks for the suggestion, I will try that. The program is a Fire Alarm monitoring system for Shopping Centres/Hospitals/Factory Complexes etc, polling up to 64 panels via TCP/IP or RS485. It's sold all over the world, and I have about 10 different language files for it. The operator can call up individual panel facias on the screen, which mirror the actual panels live, and can also view site drawings with live detectors, break glasses etc. I keep variable information in separate books/stacks from the core program, sometimes for convenience and sometimes because it is essential. Sure in some instances I can show and hide groups on the stack, but the major problem is the site drawings, as I give the user the ability to add pages and place drawings into the 'data' book/stack, and place device icons in the appropriate places. In Toolbook I then called up the correct page from the data book into a viewer, and the user could click on a device to examine its details and disable it if necessary. I have the panels working successfully in Livecode, albeit with the panel fixed on top or disappearing when the main stack is clicked (surely that's an easy fix for you , but I am worried about the drawings side of it.
-
- VIP Livecode Opensource Backer
- Posts: 9823
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Substacks on top
Set the style property of your "viewer" stack to palette to keep it in front. Clicks in it will lose focus for the main stack behind it, but at least clicking the main stack won't submarine your "viewer".
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Substacks on top
I realised from your example program that I could use palette. I thought before that I wouldn’t be able to change things on the card in script, but it turns out you can.
Re: Substacks on top
So here’s the dilemma. If I make the substack toplevel, it disappears when I click the main stack, and if I make it palette, it disappears when I click outside the livecode area, which I need to do to copy items from the desktop. Livecode really needs a proper viewer system so we can have a window within the main stack showing other cards in the stack or cards from other stacks.
Re: Substacks on top
Hi odysseus,
This way the stack will always be on top, no matter what application is currently active!
If I remember correctly Richard (FrouthWorld) already made an enhancement request for this many, many years ago...
Best
Klaus
in that case don't use palette but use -> systemwindow
Code: Select all
set the systemwindow of stack "your viewer stack here..." to TRUE
Yes, that would be a great addition.
If I remember correctly Richard (FrouthWorld) already made an enhancement request for this many, many years ago...
Best
Klaus
-
- Livecode Opensource Backer
- Posts: 9359
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Substacks on top
Richmond's Fantasy Time.
Imagine a stack called "See Me" and a substack called "See You" . . .
Now put a button on a card (called "c3") of the mainstack with this code:
[pseudoCode}
I believe that would be a useful addition to LiveCode.
Imagine a stack called "See Me" and a substack called "See You" . . .
Now put a button on a card (called "c3") of the mainstack with this code:
[pseudoCode}
Code: Select all
on mouseUp
palette "See You"
show card "c3" of stack "See Me" in stack "See You"
end mouseUp
-
- Livecode Opensource Backer
- Posts: 9359
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Substacks on top
One can, of course have this sort of script in a button on one's main stack:
and this in one's substack:
BUT that palette command doesn't seem to work.
-
Code: Select all
on mouseUp
import snapshot from card "c1"
set the name of the last image to "XXX"
cut image "XXX"
open stack "See You"
end mouseUp
Code: Select all
on openStack
paste
palette this stack
end openStack
on closeStack
delete image "XXX"
end closeStack
BUT that palette command doesn't seem to work.
-