Page 1 of 1

Create new records. Substack, group hidden?

Posted: Mon Nov 05, 2018 4:18 pm
by cbarbal
Hi all,

My question is the following:

I have a stack with the following cards, Estates, floors, tenants, income, suppliers and expenses.

What I have thought, I do not know if it is the best option, is to create a substack to enter the new records. Apart from having to pass the data between the subStack and the original Stack, at the moment I am not worried, in a card there may be 2 entry fields and in another about 20 fields.

The size of the cards would have to be different, depending on the fields to enter. If I'm not confused a stack is only one size and I would have to make as many substances as sizes. The same for printing an A4 portrait and another for an A4 landscape. It is right?

Another alternative would be to have a group hidden in each card and display it at the time of entering the new records. I do not know if there may be more options.

What experts advise me

Thanks in advance,

Carles

Re: Create new records. Substack, group hidden?

Posted: Mon Nov 05, 2018 5:24 pm
by dunbarx
Hi.

I like the subStack method, because it will float above or to the side of the working card, and that is more to the liking of most users.

The subStack can be any size, and can be changed as you need. All stacks have a "rect" property, which is open to change in many ways. You need to know this.

So create a single subStack of a single card. Several different suites (likely groups) of entry fields and buttons are then created,. and you show only the one pertinent to the card that is to be worked on. You might resize the subStack (If you want to) to the size of the current visible group. But that is often disconcerting to the user. It might be best to keep it to a single size.

Is this clear? Management of the subStack is simple. The "show" and Hide" commands are your friends here, both for the subStack and for the groups of controls.

Craig Newman

Re: Create new records. Substack, group hidden?

Posted: Mon Nov 05, 2018 6:44 pm
by cbarbal
Thanks for the answer Dunbarx.

If I have not misunderstood, I give the example of A4 printing and my program

1. I create a 900 x 900 substack
2.1. I create a group with the fields, buttons, etc., of 595 x 842. A4 Portrait
2.2.I create another group with fields, buttons, etc., of 842 x 595. A4 Landscape
2.n. For Expenses of 450 x 600
3. I'm going to the subStaqck that is hidden. I adjust it to the extent that I need, I make the corresponding group visible and show it as a modal window, or normal?
4. Then there is the issue of checking the data and saving the record. But it is the last step.

I'll look what I find in the lessons.

Regards

Carles

Re: Create new records. Substack, group hidden?

Posted: Mon Nov 05, 2018 7:33 pm
by dunbarx
Play around all you like.

But I would not think in terms of print areas when you create your groups. Build them as you like, and simply set the rect of the subStack to hold the largest of them comfortably.

Again, you could resize the subStack to always just frame whatever group happens to be visible. I personally would like to see a fixed-sized order entry window, even if a group pertinent to a particular card only occupies a portion of that window. That is a matter of style.

Correct. The subStack, and its groups, are made visible as needed, and hidden when not. The mode you show it as is up to you. Start off with a standard (mode 1) window.

Craig

Re: Create new records. Substack, group hidden?

Posted: Tue Nov 06, 2018 12:41 pm
by cbarbal
Hi Craig,

When referring to "rec" property, is the option position of the Inspector panel?

I enclose the demo that I have done. It works, but I do not want the record creation window to lose focus. The user has to choose between Cancel or Save to continue, now if he selects the mainstack pas in the background.
ProvaStacks 1.livecode.zip
(2.2 KiB) Downloaded 245 times
Thank you for your advices

Carles

Re: Create new records. Substack, group hidden?

Posted: Tue Nov 06, 2018 3:16 pm
by dunbarx
When referring to "rec" property, is the option position of the Inspector panel?
"rect", not "rec".

The rect of an object is its upper left and lower right coordinates, like "0,0,100,100". You would use the "position" pane in the inspector for stacks, cards or controls. Each of the above items is set there separately.

It is similar to many other properties that can set both the position and the size of things, like "top", "width", "bottomLeft", and "loc". Please read about ALL this in the dictionary, and experiment. Know that all these properties may be set under script control:

Code: Select all

set the top of field 3 to "100"
Your stack works fine. Keep at it. Add a little color. :wink:

Craig

Re: Create new records. Substack, group hidden?

Posted: Wed Nov 07, 2018 12:32 pm
by cbarbal
Hi all,

When I press the New Record button I run on preOpenStack in mainStack. I put a preOpenStack in the Support stack with pass preOpenStack, but it does the same to me. The same with closeStack in mainStack.

Any solution

Carles

Re: Create new records. Substack, group hidden?

Posted: Wed Nov 07, 2018 5:23 pm
by dunbarx
When I press the New Record button I run on preOpenStack in mainStack.
Not sure what this means. You press a button, and then what, exactly, happens? in other words, what is in the script of that button?

Craig

Re: Create new records. Substack, group hidden?

Posted: Wed Nov 07, 2018 6:36 pm
by cbarbal
The same as the demo, changing the names of the stack and the group to Catalan.

Code: Select all

on mouseUp
   go invisible stack "Suport"
   set the width of stack "Suport" to 420
   set the height of stack "Suport" to 160
   show the group "grpFinques" of stack "Suport"
   --   hide the group "grpRent" of stack "Suport"
   show stack "Suport"
end mouseUp
LiveCode001.jpg
Carles

Re: Create new records. Substack, group hidden?

Posted: Wed Nov 07, 2018 6:39 pm
by Klaus
Hi Carles,

if "Suport" is a substack, you can actually first format the stack and then go to it:

Code: Select all

on mouseUp
   set the width of stack "Suport" to 420
   set the height of stack "Suport" to 160

   # NOT -> THE group!
   show group "grpFinques" of stack "Suport"
   ##   hide group "grpRent" of stack "Suport"
   go stack "Suport"
end mouseUp
Best

Klaus

Re: Create new records. Substack, group hidden?

Posted: Wed Nov 07, 2018 6:45 pm
by cbarbal
Hi Klaus,

There will be several groups, each one will create the record in the corresponding table. How do I activate them?

I have answered too fast. It is only to omit the "the"

Carles

Re: Create new records. Substack, group hidden?

Posted: Wed Nov 07, 2018 6:50 pm
by Klaus
cbarbal wrote:
Wed Nov 07, 2018 6:45 pm
There will be several groups, each one will create the record in the corresponding table. How do I activate them?
Just show/hide them, but maybe add: ... grp "xyz" OF CD X of stack "Suport"
Jut to be on hte safe side
cbarbal wrote:
Wed Nov 07, 2018 6:45 pm
I have answered too fast. It is only to omit the "the"
Que? :D

Re: Create new records. Substack, group hidden?

Posted: Wed Nov 07, 2018 6:55 pm
by cbarbal
Hi Klaus,

Code: Select all

on mouseUp
   set the width of stack "Suport" to 420
   set the height of stack "Suport" to 160
   
   show group "grpFinques" of stack "Suport"
   go stack "Suport"
end mouseUp
Continue doing preOpenStack ..

Carles

Re: Create new records. Substack, group hidden?

Posted: Thu Nov 08, 2018 10:51 am
by cbarbal
Searching on the internet I found this link https://use-livecode.runrev.narkive.com ... bstack-why in which Klaus recommends an empty preOpenStack. I had it with pass preOpenStack.

Carles