Page 1 of 2

Sometimes Form Modal or Non-Modal

Posted: Thursday 1st December 2022 9:36am
by gambafeliz
As I have commented in another query. I would like to load a form to modeless so that I can use it with another and use screen splitting to have one form on the right and one on the left. But at the same time when I load a Message it hides the form that I have loaded as Show, therefore I would like to load the form in Show at its beginning and change it to Modal before loading the Message.

it's possible?
Can you think of any magic to do it?

Re: Sometimes Form Modal or Non-Modal

Posted: Thursday 1st December 2022 10:28am
by BruceSteers
gambafeliz wrote: Thursday 1st December 2022 9:36am As I have commented in another query. I would like to load a form to modeless so that I can use it with another and use screen splitting to have one form on the right and one on the left. But at the same time when I load a Message it hides the form that I have loaded as Show, therefore I would like to load the form in Show at its beginning and change it to Modal before loading the Message.

it's possible?
Can you think of any magic to do it?
You can set the Window.Utility property but it's not going to behave the same as using ShowModal()

your program needs fixing. As i have said, using message DOES NOT close a form , So it's your code doing it.
This showmodal / show difference is odd and your fix is just a "workaround".
ShowModal() will halt your code at the ShowModal() command till the Modal window is closed then your code continues.
Using Show() your code is allowed to continue as soon as the form window opens.
so if it works using ShowModal but not when using Show then after the Show() call your code has to be closing the form somehow.

Post your code dude, then we can track down the problem.

Re: Sometimes Form Modal or Non-Modal

Posted: Friday 2nd December 2022 9:15am
by gambafeliz
Thank you for your effort to help me. First, if you don't give me the correct answer, it's my fault and only mine. Since the ideal is that you see it, the problem at least with your eyes. Sorry about it.

My problem is this but I do not promise that it will be clear to you.

1. run FMain
2. I run Form Search, it is placed before the FMain and I want it to be stay static on the screen before the FMain until I close it, manually.
3. I run Form Data Entry, when doing so Form Search is hidden (does not close), let's say that it remains behind FMain.
4. What I would like is that, in front of FMain, there is Form Search and at the same level as Form Search, next to it, is Form Data Entry.

This as it occurs to you, solve it.

Re: Sometimes Form Modal or Non-Modal

Posted: Friday 2nd December 2022 11:34am
by thatbruce
This bit does not make sense:
2. I run Form Search, it is placed before the FMain and I want it to be stay static on the screen before the FMain until I close it, manually.
3. I run Form Data Entry, when doing so Form Search is hidden (does not close), let's say that it remains behind FMain.
Try again please.
Tell us what the user sees and what they are expecting to happen. Note, not you - the user. Pictures may help.

Re: Sometimes Form Modal or Non-Modal

Posted: Friday 2nd December 2022 4:41pm
by gambafeliz
I have uploaded as a PDF where:
1. Run FMain
2. Run Form1
3. I run Form2, but doing so hides Form1, this is not what I want.
Y
3. Again, because the representation is how I want it to happen.

Re: Sometimes Form Modal or Non-Modal

Posted: Friday 2nd December 2022 7:43pm
by BruceSteers
gambafeliz wrote: Friday 2nd December 2022 4:41pm I have uploaded as a PDF where:
1. Run FMain
2. Run Form1
3. I run Form2, but doing so hides Form1, this is not what I want.
Y
3. Again, because the representation is how I want it to happen.
Yes I think we all understand what you are saying/asking, you have explained many times.
We need to see why your code hides the other window.
It is not doing that all by itself,
What you want to happen in your oh so detailed pdf SHOULD happen !

it is not working properly because you have done something that hides or closes the other form.
your STEP 3 = IDEAL is how it should happen unless you have bad/forgotten code going against you.

Try making a small test project that does the same function you want but none of your other code and post it here in a zip file or something if you can reproduce the bug you have.

Re: Sometimes Form Modal or Non-Modal

Posted: Saturday 3rd December 2022 8:40am
by gambafeliz
Thank you and what I am going to tell you will seem terrible to you as a newbie, or even silly. Be constructive and at least have a laugh.

I do this;
1. Run FMain
2. I run Form1 from an FMain button
3. I click a side menu of FMain to Run Form2 (I'm sure this is the bug, the user clicks a FMain button and Form1 is behind FMain, don't you think? and at the same time I Run Form2.

Therefore the user does everything. My question about it. Due to the fact of point 3, Form1 should move to the position behind FMain and get out of the user's view, is it normal or am I still looking for another reason?

Re: Sometimes Form Modal or Non-Modal

Posted: Saturday 3rd December 2022 9:41am
by thatbruce
I think that I am beginning to understand what your problem might be.
The next thing we have to get through is how many forms you are trying to ShowModal at a time.

If FMain is starting Form1 as a modal window, which sort of means that it is "Always On Top", then you go back to FMain... Well you cant actually get it "back on top", because you have a modal window running. I think that you need to think about windows in the desktop sense (instead of "forms" in the Gambas sense) and how they behave. And should behave. Are we there yet?
b

Re: Sometimes Form Modal or Non-Modal

Posted: Saturday 3rd December 2022 2:59pm
by gambafeliz
I really like your logical view of my problem. You have to see it as a desk. Let's say FMain is the desktop and forms are programs I want to compare. And I'm usually going to run two. Thank you and we continue talking. Best regards

Re: Sometimes Form Modal or Non-Modal

Posted: Sunday 4th December 2022 11:10am
by gambafeliz
Is it possible in Gambas to nail a window as if from a picture on the wall?

Maybe this is the path for me. And do it from the operating system instead of Gambas?

Finally I leave it there. Thanks.