xbp Menu in my program causes a black non-modal window

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
obelix
Posts: 48
Joined: Tue Dec 03, 2013 7:44 am
Location: Villingen-Schwenningen, Black Forest, Germany

xbp Menu in my program causes a black non-modal window

#1 Post by obelix »

I want to use a menu system I used in a Clipper-Version with express++
If I use the procedure erzeugemenusystem() like below, the menu system runs in a black non-modal windows (see attachment)
If I add the procedure appsys(), teh program breaks with the comment: unknown method for this object operation menuBar
Do I have any chance to use this menu system ?

Code: Select all

# include ....
[b]//PROC appsys ; RETURN  [/b]    
procedure main
LOCAL GETList := {}, oStatic1, oStatic2, oStatic3, i, aGETs[20],   aFenster, zahl, nEvent, oXbp
dc_gui(.t.)
....
[b]SetAppWindow() // :useShortCuts := .t.[/b]
...
// an extract of the menu-system

[b]procedure erzeugeMenuSystem(oMenubar)[/b]
  public mnStamm, mnBearbeiten, mnAusdrucke, mnDienstprog, mnUebernahme, mnProg, mnEnde

  mnStamm := XbpMenu():new(oMenuBar)
  mnStamm:title := "~Stammdaten"
  mnStamm:create()
      smnArtikel       := XbpMenu():new( mnStamm )
      smnArtikel:title := "~Artikel"
      smnArtikel:create()

      smnArtikel:addItem( { "~Artikelerfassung/ Korrektur",{|| disableMenu(), artierf(), enableMenu()} } )
      smnArtikel:addItem( { "~Selektierter Art.-Ausdruck",{|| disableMenu(), artlist(), enableMenu()} } )
      mnStamm:addItem( { smnArtikel, } )

 return
Attachments
menuBar.jpg
menuBar.jpg (82.04 KiB) Viewed 11692 times
quiet old but still young and unskilled in express++

User avatar
rdonnay
Site Admin
Posts: 4733
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: xbp Menu in my program causes a black non-modal window

#2 Post by rdonnay »

It looks like this menu system was designed for CRT windows.

Do you have documentation?

Why aren't you using the eXpress++ menu system?

Show me some code.
The eXpress train is coming - and it has more cars.

User avatar
obelix
Posts: 48
Joined: Tue Dec 03, 2013 7:44 am
Location: Villingen-Schwenningen, Black Forest, Germany

Re: xbp Menu in my program causes a black non-modal window

#3 Post by obelix »

Roger,
the menu system shown in the code and the attachement was designed for a crt program. As I'm transforming this program into a modal version, I would like to use
a menu system the clients know from the crt version.
It would be okay to use the express++ menu system, but I didn't find a way to create a sub sub menu like 'Artikelerfassung/Korrektur'
quiet old but still young and unskilled in express++

User avatar
rdonnay
Site Admin
Posts: 4733
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: xbp Menu in my program causes a black non-modal window

#4 Post by rdonnay »

Are you saying that your entire application runs in a CRT window?

How are you creating oMenubar ?

The eXpress++ menu system creates as many sub-sub menus as you want.

Code: Select all

DCMENUBAR oMenuBar

  DCSUBMENU oMenu1 PROMPT 'Menu 1' PARENT oMenuBar

     DCMENUITEM 'Menu item 1' PARENT oMenu1

        DCSUBMENU oMenu1_1 PROMPT 'Menu 1/1' PARENT oMenu1

           DCMENUITEM 'Menu Item 1_1/1 PARENT oMenu1_1
The eXpress train is coming - and it has more cars.

User avatar
obelix
Posts: 48
Joined: Tue Dec 03, 2013 7:44 am
Location: Villingen-Schwenningen, Black Forest, Germany

Re: xbp Menu in my program causes a black non-modal window

#5 Post by obelix »

Thank you Roger, I think it's what I need. I will try it the next days. That will help me on to bring my program to an end.

It's only the menu that ist running in a crt-Window and there remains a black crt window in the background, but the dcread()s and dcbrowse()s run in the foreground as they have to.
The further version is a crt programm running in a window determined by the parameters in appsys.prg
quiet old but still young and unskilled in express++

User avatar
rdonnay
Site Admin
Posts: 4733
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: xbp Menu in my program causes a black non-modal window

#6 Post by rdonnay »

I still see no reason why you cannot use your existing menu system with eXpress++.

When you create a the XbpMenuBar() object it's parent should be the dialog window created by eXpress++.
The eXpress train is coming - and it has more cars.

User avatar
obelix
Posts: 48
Joined: Tue Dec 03, 2013 7:44 am
Location: Villingen-Schwenningen, Black Forest, Germany

Re: xbp Menu in my program causes a black non-modal window

#7 Post by obelix »

Roger,
It would be very comfortable if I had the chance to use the procedure erzeugnemenusystem(). I wrote a small program using some of the submenus to show you the behavior of the program. The function dummy() replaces the different functions triggered by erzeugermenusystem(). I send it in the attachement.
Thank you for looking after my problem. :D
Attachments
menudemo.zip
(55.06 KiB) Downloaded 634 times
quiet old but still young and unskilled in express++

messaoudlazhar
Posts: 42
Joined: Mon Dec 23, 2013 2:10 pm
Contact:

Re: xbp Menu in my program causes a black non-modal window

#8 Post by messaoudlazhar »

obelix,
Here is a corrected copy of your program
best regard
Attachments
menudemo.zip
(55.39 KiB) Downloaded 637 times

User avatar
obelix
Posts: 48
Joined: Tue Dec 03, 2013 7:44 am
Location: Villingen-Schwenningen, Black Forest, Germany

Re: xbp Menu in my program causes a black non-modal window

#9 Post by obelix »

At first glance, I feel giddy at the improvement of my code. I just had to add some lines to my code and it's great: Thank you Moussuad !! :violin: :violin: :violin:
for someone who likes to use this code too:
My line with SetAppWindow() :useShortCuts := .T. has to be changed in: SetAppWindow()
quiet old but still young and unskilled in express++

Post Reply