PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → Major Bug with TabOpen and OpenPopupMenu
Major Bug with TabOpen and OpenPopupMenu
Iniciado por guest, 15,feb. 2016 11:49 - 4 respuestas
Publicado el 15,febrero 2016 - 11:49
Hi,
seems there is a major bug with dynamic tabs and OpenPopupMenu in WD20.
Here is the scenario

1. Use a dynamic tab and add to it 2 dynamic tabs with internal windows.
2. Both the internal windows have a PopMenu with the SAME name.
3. Now use OpenPopupMenu to call the PopMenu in each of the 2 dynamic tabs.

You will see that it ALWAYS calls the Popmenu of the first tab in the dynamic tab.
It cannot distinguish between the 2 popups, probably because they are on the same window NOW.
I am now investigating if this is a scenario that happens also with buttons etc ....
This would be a HUGE PROBLEM (at least for me).

Steven Sitas
Publicado el 15,febrero 2016 - 12:44
Hi, for two days I tried to make internal windows usable for a future program. I found so many funnies, some of them were impossible to circumvent. Referencing controls (like in your case) have been the most frustrating cases. Theoretically, the correct reference to a button control within a sidebar on the main menue would be Menu.Sidebar1.button - no way. Ok, but Button worked in global procedure whenever being on the main menue. Being on the internal window, it said, that the control couldn't be found.

Just try to reference the Popup menues by their location or give them a different name ...
Publicado el 15,febrero 2016 - 13:00
Hi,
It seems you cannot reference Popupmenus with something like IW_internalwindow.myPopup ...
So I spent ALL the day renaming ALL my Popupmenus.

The problem is that I liked the new dynamic tab so I changed one of my production apps to use them. I did some testing before sending it out to the clients but I didn't catch the problem inhouse - it never passed my mind that I would face this kind of problem.

What now is really bothering me is if this "naming issue" goes all the way to buttons also or even worst to local procedures !!!

thanks for your post

Steven Sitas
Publicado el 15,febrero 2016 - 14:17
I haven't used dynamic tabs, but do have quite a few internal windows in tabs and don't have the same problem. In v20, there was a change to standard charter prefix for internal window controls from IW_ to IWC_.. Now IWC_ controls hold IW_ windows. I renamed all internal window controls to IWC_ that were created in prior versions, and assume this was done to remove ambiguity. With that in place, elements of internal windows can reference like IWC_InterWindowsControl..Popupmenu from procedures outside the window such as global procedures.

I have seen problems where references to internal windows controls get messed up after a whole lot of changes, but this is usual fixed by a re-compile, or a delete of the cpl dir in the project dir.
Miembro registrado
71 mensajes
Publicado el 23,junio 2016 - 09:03
Hi all,
I went through the same process as you and I won :-)

Here is my code where you can see how I reference controls on panes. As far as I understand it, you must always specify pane on your tab control and then you can reference control within this pane.

oInternalWin is Control
oInternalWin <- TAB_Verze[sActivePaneAlias]
IF oInternalWin.iw_Construction_Verze.GR_VsechnyKontroly..Modified=True THEN //here you can see how I reference "GR_VsechnyKontroly..Modified"
IF Dialog("Test")=1 THEN
oInternalWin.iw_Construction_Verze.Save_IW_Controls(sActivePaneAlias)
END
END


Sad is that intellisense in editor does not work and you have to be carefull when typing control name.

Also you should be able to solve this with indirection but I try NOT to use indirection as much as possible as I find it "dirty technique", I prefer classes if possible.

Here are some commands I used during testing dynamic tabs, it is possible that some of them are wrong, I have it now just in my comments and I do not already remember what was working and what not but it should point you in some direction as well.

I remember there was one strange thing, that some commands were perfectly working in debugger window but I got an error when the same command was in code, it is probably because debugger runs in some "special mode"...

{EnumControl(TAB_Verze, i),indWindow}..fullname
{sMyInternalWindow+".EDT_Zadani"}..Value
Trace({TAB_Verze[EnumControl(TAB_Verze, i)]+".EDT_Zadani",indWindow})
Trace({TAB_Verze["ALIAS_10"]+".EDT_Zadani"})



Please also take a look at this topic where I explain how to reference procedure inside of internal window. http://forum.pcsoft.fr/en-US/pcsoft.us.windev/56887-wd20-referencing-procedure-dynamic-tab-control/read.awp…

And one more thing, there is a webinar on dynamic tabs on WinDevUS by Andy Stapleton https://plus.google.com/events/csvd5ouig6tiu58ka2vt8tc9lug

Btw. I reported bug to WinDev that you can close or create new pane even when TAB control si grayed, they accept it, does it happens to you as well?

Petr