PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WINDEV 2024 → MDI - Lost in windows!
MDI - Lost in windows!
Started by Jelte, Aug., 18 2004 12:47 PM - 4 replies
Posted on August, 18 2004 - 12:47 PM
Hello all,
It has been a while since i posted here, i hope everyone had a nice holiday .
I have a problem, I made an application in WD8 that uses MDI.
I call the same window 3 times, each time giving it a seperate alias.
For instance
Window1
Window2
Window3
Each window shows differend data in a table trough a filter or Query.
The program uses wizards for several tasks. A wizard is opened in a window of its own. After a wizard is complete, it needs, for instance, to refresh the table shown at the currently active MDI. (MDIactive)
For doing that i have a local procedure in the MDI window called LRefreshTable.
Now this is what happens.
I open window1 "MDIopen(Window_Table,"Window1","Tabels1")"
Then i open window2 "MDIopen(Window_Table,"Window2","Tabels2")"
So window 2 is the Active mdi window.
But when i start the wizard the Procedure wich i call from Window2 the wizard runs in Window1 (or it just crashes).
I tried all sorts of things.
Window_Table.LRefreshTable // I understand why this wouldnt work
{MDIactive() +".LRefreshTable"}
{Currentwin()+".LRefreshTable"}
(I tried MDIactive and Currentwin with a button on the MDI child, not the wizard)
Nothings seems to work. Does anyone have a suggestion, According to the windev help i have to use CurrentWin, but when i copy paste the text is uses there it doesnt work, generates an error before compiling.

Thanks in advance guys.
Jelte
Posted on August, 19 2004 - 2:01 AM
Hi Jelte
I have a problem, I made an application in WD8 that uses MDI.
I call the same window 3 times, each time giving it a seperate alias.
For instance
Window1
Window2
Window3
Each window shows differend data in a table trough a filter or Query.
The program uses wizards for several tasks. A wizard is opened in a window of
its own.

[...]
I understand there is 'a' problem but not sure what 'the' problem is.
Trying to make it a little easier to understand ... (?)
A child window is opened 3 times, depending on '?', a table on those windows
is filled with a query/browse ...
Now, this child-window's are opening (how?) some kind of 'wizard'? windows
and this wizard windows should update the (table on the) child window who
opened the wizard window? and that is not working? pffff ...
Trying to make it clear ...
--
Peter
Posted on August, 19 2004 - 11:33 AM
Hi Jelte
I have a problem, I made an application in WD8 that uses MDI.
I call the same window 3 times, each time giving it a seperate alias.
For instance
Window1
Window2
Window3
Each window shows differend data in a table trough a filter or Query.
The program uses wizards for several tasks. A wizard is opened in a window of
its own.
[...]

I understand there is 'a' problem but not sure what 'the' problem is.
Trying to make it a little easier to understand ... (?)
A child window is opened 3 times, depending on '?', a table on those windows
is filled with a query/browse ...
Now, this child-window's are opening (how?) some kind of 'wizard'? windows
and this wizard windows should update the (table on the) child window who
opened the wizard window? and that is not working? pffff ...
Trying to make it clear ...
--
Peter

Peter,
Sorry if its unclear, let me explain a bit more.
The app has got 1 MDI parent with 2 child MDI windows and 1 normal NonMDI window.
1 MDIchild contains a menu and 1 MDIchild contains a table.
In the menu of the first MDI window i have 3 buttons, each button opens the MDIchild with the Table but each button does that a little bit differend.
Windows 1 to 3 are globalVariables.
Button one has this code.
if Window1 = "" then
Window1 = MDIopen(Window_Table,"Window1","Tabels1")
else
MDIactive(Window1)
end
Button 2 has this code
if Window2 = "" then
Window2 = MDIopen(Window_Table,"Window2","Tabels2")
else
MDIactive(Window2)
end
Button 3 has this code
if Window3 = "" then
Window3 = MDIopen(Window_Table,"Window3","Tabels3")
else
MDIactive(Window3)
end
>From the MDIchild Window_Table i can call another window(nonMDI). In that window, (I call it a wizard), a user can change settings for the table in Window_Table(MDIchild).
For instance set a Filter or run a Query.
I hope it makes sence now
Now this is what happens.
First I open window1 from the menu. Then without closing that window(window1) i go back to the menu.
Then i open window2 from the menu.
From window2 i open the NonMDI window to change the table in window2.

But instead of changing the table in window2, it changes the table in window1.

does it still make sence
in short.
How do i tell the nonMDI window in wich MDI child window he should change something.

Jelte
Posted on August, 19 2004 - 5:20 PM
Hi Jelte,

>1 MDIchild contains a menu and 1 MDIchild contains a table.
[...]
From the MDIchild Window_Table i can call another window(nonMDI).

With 'Open(...)' or 'OpenChild(...) ?
>I hope it makes sence now
A little ;-)
From window2 i open the NonMDI window to change the table in window2.

Yes, but in your first post it seemed that you want to start a procedure
(LRefreshTable()) belonging to the 'ChildWindow', from the 'WizartdWindow' ?
i think it is like :
1. If you want to change a control on the right ChildWindow from the
WizardWindow something like {MDIActive()+".Edit1"}=NewValue can do the job.
2. If you want to start a local procedure, belonging to the 'ChildWindow'
from the 'WizardWindow', i think MyChildWindow.LRefreshTable() is OK but
then you need to specify in the procedure which table on which window has to
updated. So not something like 'TableAddline(MyTable, ... ) but
'TableAddline({MdiActive()+".MyTable"}, ... )
Greetings,
Peter
Posted on August, 20 2004 - 12:45 PM
'TableAddline({MdiActive()+".MyTable"}, ... )
Greetings,
Peter

Thanks Peter,
that did it, i needed to change the Local Procedure like you said.
I almost worked at once now.
Thanks alot,
Jelte