Page 1 of 1

Multiwin problem

Posted: Thu Oct 08, 2020 10:38 am
by dominique_devuyst
Hi everybody,
I am trying to do something like that, ie do a "multiwin" but depending on conditions :

Code: Select all

. . . . 
if val(Open_last_choice)==1
	x:=val(PL_adres_last_recno)
	if x>0
		Adr_view()   // open the adr window
	endif
	x:=val(PLANTES_last_recno)
	if x>0
		open_win_Combi()
	endif
	x:=val(PL_NOTES_last_recno)
	if x>0
		Note_view()
	endif
endif
Of course this code can't work to do that, but I can't find how to do.

Does somebody have an idea?

Dominique

Re: Multiwin problem

Posted: Fri Oct 09, 2020 12:20 am
by AUGE_OHR
hi,

not sure what you mean with "MultiWin" :idea:

a Window normal have a ACTIVATE and will stay until Window.RELEASE
if you want to use more than one Window than you have to ACTIVATE ALL after open each Window

your Idea might reduce Code but is hard to read and understand when have a Problem.

Re: Multiwin problem

Posted: Fri Oct 09, 2020 6:28 am
by dragancesu
What do you think when you write "multiwin" ?

Probably to open a new window depending on some parameters, but it is better to make one program/window which you will manage through parameters

Depending on the parameters you display or not some fields, you do it all on one form instead of 3 in your example

It would be good to attach a little more code

Re: Multiwin problem

Posted: Fri Oct 09, 2020 7:39 am
by serge_girard
Dominique,

Do you mean: running one EXE and within this opening the same form with different records? In this way you could compare the 2 or more?

Serge

Re: Multiwin problem

Posted: Fri Oct 09, 2020 9:21 am
by dominique_devuyst
Hi
Thanks for your replies.
dragancesu wrote: Fri Oct 09, 2020 6:28 am What do you think when you write "multiwin" ?
Probably to open a new window depending on some parameters, but it is better to make one program/window which you will manage through parameters
Depending on the parameters you display or not some fields, you do it all on one form instead of 3 in your example
It would be good to attach a little more code
Yes I would like to open the same forms as when I closed the previous session of the app. I save the parameters in the ini file to reopen the same forms in the next session. This forms must be all visible on the screen.

For example this code do that :

Code: Select all

**********
Function open_win_Combi
********
IF !IsWindowDefined(Win_browser).AND.!IsWindowDefined(Win_PlView)
	PLAY WAVE Img_path0+"open_Scratch2.wav" 
	Pl_First_entry:=.T.
	Load Window Win_browser
	Load Window Win_PlView
    go recno()
	Activate Window Win_browser, Win_PlView	
else
etc ......
To be both visible on the screen the names of the forms must be activate on the same line separated with commas.
So impossible to put a condition.
To be clear : the code in my previous post don't do of course what I would like.

Note :
the code of Adr_view() (for example) is :

Code: Select all

*****************
Function Adr_view
*************
IF !IsWindowDefined(Win_Adr_view)
	Adr_First_entry:=.T.
	PLAY WAVE Img_path0+"open_Scratch2.wav" 
	Load Window Win_Adr_view
	Win_Adr_view.Search_1.setfocus
	Activate Window Win_Adr_view
endif
return
So, I hope that my request is more clear.

Dominique

Re: Multiwin problem

Posted: Fri Oct 09, 2020 1:26 pm
by srvet_claudio
Hi,
Try with:

aForm:= {}

IF...
AADD(aForm, "Form1")

IF...
AADD(aForm, "Form2")

...

_ActivateWindow( aForm )

Re: Multiwin problem

Posted: Fri Oct 09, 2020 5:32 pm
by dominique_devuyst
Hi Claudio,

Thanks for the solution, It works fine!
Good to know.

Dominique