Multiwin problem

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
dominique_devuyst
Posts: 22
Joined: Wed Dec 20, 2017 8:29 am
DBs Used: DBF
Location: Belgium

Multiwin problem

Post 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
User avatar
AUGE_OHR
Posts: 2093
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: Multiwin problem

Post 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.
have fun
Jimmy
User avatar
dragancesu
Posts: 930
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia

Re: Multiwin problem

Post 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
User avatar
serge_girard
Posts: 3309
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: Multiwin problem

Post 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
There's nothing you can do that can't be done...
dominique_devuyst
Posts: 22
Joined: Wed Dec 20, 2017 8:29 am
DBs Used: DBF
Location: Belgium

Re: Multiwin problem

Post 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
User avatar
srvet_claudio
Posts: 2220
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: Multiwin problem

Post by srvet_claudio »

Hi,
Try with:

aForm:= {}

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

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

...

_ActivateWindow( aForm )
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
dominique_devuyst
Posts: 22
Joined: Wed Dec 20, 2017 8:29 am
DBs Used: DBF
Location: Belgium

Re: Multiwin problem

Post by dominique_devuyst »

Hi Claudio,

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

Dominique
Post Reply