Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 5 Jahren, 7 Monaten
Letzter Beitrag:
vor 5 Jahren, 7 Monaten
Beteiligte Autoren:
Frans, DW, Pete Halsted, Allard, Al

How to copy a popupmenu to another window

Startbeitrag von Frans am 08.01.2013 23:27

Hello to you all,

How can I copy a popupmenu to another window?
I know there is a simple answer but I couldn't find it.

Thanks in advance.


I don't believe you can copy a popup window.

I love the new popup windows, but struggled with the fact that they sort of break our ability to refactor code.

I have played with several different methods of having reusable popup windows. The method I am currently using is I create a control template, I don't have any controls on the control itself, but you can create a popup page for the control template, so by doing that I can drop that control template on multiple pages, and that same popup page is available on them.

I show this technique as part of this article http://www.thenextage.com/wordpress/the-cure-effect-how-the-cure-heading-on-thetaxcure-com-was-achieved-with-pure-wx-code/

I also did a wxlive.us webinar that for that article.

von Pete Halsted - am 09.01.2013 02:16
Hello Frans

You can't copy the complete menu, but you can copy the menu items with the usual copy and paste.
Create a popmenu on your new window with one blank item. Open the other window and copy and paste the menu elements from one menu to the other.


von Al - am 09.01.2013 15:21
I am sorry I miss read the question, I thought you were talking about the new Popup Windows, not menus.

But I have used a similar technique for Popup menus as well. I have a "standard" Popup menu I use for my edit in place browses. I have a control template with no controls on it, and I define a popup menu for that control template. Then I can drop that control template on any window and I have that popup menu defined.

von Pete Halsted - am 09.01.2013 16:16
Hello Frans,

Put a super control on you window with the popup menu. Attach the popup to the super control and copy & paste it to the new window.


von DW - am 09.01.2013 17:11
Are you using windev or webdev ?

In webdev I use tempelates. A page is based on the tempelate and can inherrit from the tempelate. So if in the tempelate is a popup, i inherrit the popup and have the popup availeble in that page. Then you can overload that popup to add other items then the original

The same can be done with a menu



von Allard - am 09.01.2013 18:00
Hello to you all,

Thanks for the answers. I use Windev17 and copied line by line.
Not 10 times faster but it works. Perhaps in the future there wil be a possibility to copy a popupmenu from one window to another.

von Frans - am 10.01.2013 19:29
Hello Frans,

It is possible, if a popupmenu is linked to any control on a window and you copy and paste that control to another window the popupwindow will be copied also.


von DW - am 10.01.2013 22:48

The trick worked

Hello DW,

Sorry that I overlooked your answer.
I knew that there was a trick but I couldn't remember/find it.
You are right: In the GUI pane you select the Popup menu; then copy it to the new window; run it and after that delete the control. The popupmenu stay in the new window.
Works perfect.

von Frans - am 14.01.2013 22:21
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.