POPUP Disallowed - why?

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
bluebird
Posts: 172
Joined: Wed Sep 28, 2016 3:55 am
DBs Used: DBF

POPUP Disallowed - why?

Post by bluebird »

Friends,

I get a failure message trying to run the PRG below: Context/Dropdown/Notify Menus Does not support submenus
The code does compile into an exe file though.

The code below is a simple startup file with lots of stubs for future development if I can just get things off the ground.
Please ignore the stubs.

I also included the IDE generated fmg file

The fmg file refered to in the code below was generated by the IDE. I have used the menus before , doing
the work manually. Can any kind observer see what I am doing wrong to deserve this error message.

Thanks to those who read this



#include "hmg.ch"


Function Main

Load Window win_1

DEFINE POPUP 'File Actions'
MENUITEM 'Begin Selections' ACTION SelectImages()
MENUITEM 'Quit 1' Name Q11 ACTION Win_1.Release
MENUITEM 'Reset ' Name Res12 ACTION ImageReset()
END POPUP


Return

*------------------------------------------------------------*
Function SelectImages()
*
* Get a list of Files
* Add each to Grid GImages
*------------------------------------------------------------*
msgdebug('Undefined yet')
return


*------------------------------------------------------------*
FUNCTION ImageReset( )
*------------------------------------------------------------*
msgdebug('Undefined yet')
return

*------------------------------------------------------------*
FUNCTION BUILDOUTPUTCOMPOSITE( )
*------------------------------------------------------------*
msgdebug('Undefined yet')
return

*------------------------------------------------------------*
FUNCTION SAVECOMPOSITE( )
*------------------------------------------------------------*
msgdebug('Undefined yet')
return

*------------------------------------------------------------*
FUNCTION SHOWZOOM( )
*------------------------------------------------------------*
msgdebug('Undefined yet')
return
* HMG-IDE UNICODE Form Designer Generated Code
* (c) Roberto Lopez - http://sites.google.com/site/hmgweb

DEFINE WINDOW TEMPLATE AT 181 , 524 WIDTH 550 HEIGHT 375 VIRTUAL WIDTH Nil VIRTUAL HEIGHT Nil TITLE "" ICON NIL MAIN CURSOR NIL ON INIT Nil ON RELEASE Nil ON INTERACTIVECLOSE Nil ON MOUSECLICK Nil ON MOUSEDRAG Nil ON MOUSEMOVE Nil ON SIZE Nil ON MAXIMIZE Nil ON MINIMIZE Nil ON PAINT Nil BACKCOLOR Nil NOTIFYICON NIL NOTIFYTOOLTIP NIL ON NOTIFYCLICK Nil ON GOTFOCUS Nil ON LOSTFOCUS Nil ON SCROLLUP Nil ON SCROLLDOWN Nil ON SCROLLLEFT Nil ON SCROLLRIGHT Nil ON HSCROLLBOX Nil ON VSCROLLBOX Nil

DEFINE FRAME Frame_1
ROW 70
COL 190
WIDTH 160
HEIGHT 156
FONTNAME "Arial"
FONTSIZE 9
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
CAPTION "Frame_1"
BACKCOLOR {192,192,192}
FONTCOLOR NIL
OPAQUE .T.
END FRAME

DEFINE FRAME Frame_2
ROW 30
COL 30
WIDTH 97
HEIGHT 76
FONTNAME "Arial"
FONTSIZE 9
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
CAPTION "Frame_2"
BACKCOLOR NIL
FONTCOLOR NIL
OPAQUE .T.
END FRAME

DEFINE FRAME Frame_3
ROW 40
COL 380
WIDTH 81
HEIGHT 74
FONTNAME "Arial"
FONTSIZE 9
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
CAPTION "Frame_3"
BACKCOLOR NIL
FONTCOLOR NIL
OPAQUE .T.
END FRAME

DEFINE FRAME Frame_4
ROW 160
COL 390
WIDTH 113
HEIGHT 96
FONTNAME "Arial"
FONTSIZE 9
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
CAPTION "Frame_4"
BACKCOLOR NIL
FONTCOLOR NIL
OPAQUE .T.
END FRAME

DEFINE FRAME Frame_5
ROW 160
COL 40
WIDTH 99
HEIGHT 95
FONTNAME "Arial"
FONTSIZE 9
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
CAPTION "Frame_5"
BACKCOLOR NIL
FONTCOLOR NIL
OPAQUE .T.
END FRAME

DEFINE IMAGE Image_1
ROW 100
COL 200
WIDTH 160
HEIGHT 123
PICTURE ""
HELPID Nil
VISIBLE .T.
STRETCH .F.
ACTION Nil
END IMAGE

DEFINE IMAGE Image_2
ROW 50
COL 40
WIDTH 85
HEIGHT 95
PICTURE ""
HELPID Nil
VISIBLE .T.
STRETCH .F.
ACTION Nil
END IMAGE

DEFINE IMAGE Image_3
ROW 40
COL 390
WIDTH 85
HEIGHT 95
PICTURE ""
HELPID Nil
VISIBLE .T.
STRETCH .F.
ACTION Nil
END IMAGE

DEFINE IMAGE Image_4
ROW 200
COL 60
WIDTH 85
HEIGHT 95
PICTURE ""
HELPID Nil
VISIBLE .T.
STRETCH .F.
ACTION Nil
END IMAGE

DEFINE IMAGE Image_5
ROW 200
COL 400
WIDTH 85
HEIGHT 95
PICTURE ""
HELPID Nil
VISIBLE .T.
STRETCH .F.
ACTION Nil
END IMAGE

DEFINE LABEL Label_1
ROW 10
COL 200
WIDTH 120
HEIGHT 24
VALUE "5 image Composite"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR {192,197,133}
FONTCOLOR NIL
END LABEL

DEFINE BUTTON Button_1
ROW 280
COL 230
WIDTH 100
HEIGHT 28
ACTION SelectImages()
CAPTION "CLick to Begin"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
HELPID Nil
FLAT .F.
TABSTOP .T.
VISIBLE .T.
TRANSPARENT .F.
MULTILINE .F.
PICTURE Nil
PICTALIGNMENT TOP
END BUTTON

END WINDOW

User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: POPUP Disallowed - why?

Post by andyglezl »

Hola Bluebird, trata esto...
------------------------------------
Hi Bluebird, try this...

Code: Select all

DEFINE MAIN MENU OF Win_1
	DEFINE POPUP 'File Actions'   Name 'something'
		ITEM 'Begin Selections' ACTION SelectImages()
		ITEM 'Quit 1'  ACTION Win_1.Release
		ITEM 'Reset '  ACTION ImageReset() 
	END POPUP
END MENU				

O a lo mejor te confundiste con el DEFINE CONTEXT MENU ???
-----------------------------------------------------------------------------
Or maybe you got confused with the DEFINE CONTEXT MENU ???

Code: Select all

	DEFINE CONTEXT MENU OF Win_1
		MENUITEM 'Begin Selections' ACTION SelectImages()
		MENUITEM 'Quit 1'  ACTION Win_1.Release
		MENUITEM 'Reset '  ACTION ImageReset() 
	END MENU

Yo no he utilizado el IDE...
-----------------------------------
I have not used the IDE ...
Andrés González López
Desde Guadalajara, Jalisco. México.
bluebird
Posts: 172
Joined: Wed Sep 28, 2016 3:55 am
DBs Used: DBF

Re: POPUP Disallowed - why?

Post by bluebird »

Thank you for the reply

The code in the post does not say "context menu" but maybe I did select one of those from the IDE.
If I did then it should show up in the code thought.

Can anyone see how to edit the code to fix the error condition?

Thanks again
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: POPUP Disallowed - why?

Post by andyglezl »

Si tu cambias lo que tienes:
----------------------------------
If you change what you have:


DEFINE POPUP 'File Actions'
MENUITEM 'Begin Selections' ACTION SelectImages()
MENUITEM 'Quit 1' Name Q11 ACTION Win_1.Release
MENUITEM 'Reset ' Name Res12 ACTION ImageReset()
END POPUP


Por lo que te comento, funciona
--------------------------------------------
From what I tell you, it works


DEFINE MAIN MENU OF Win_1
DEFINE POPUP 'File Actions' Name 'something'
ITEM 'Begin Selections' ACTION SelectImages()
ITEM 'Quit 1' ACTION Win_1.Release
ITEM 'Reset ' ACTION ImageReset()
END POPUP
END MENU

menupopup.png
menupopup.png (10.07 KiB) Viewed 2408 times
Andrés González López
Desde Guadalajara, Jalisco. México.
bluebird
Posts: 172
Joined: Wed Sep 28, 2016 3:55 am
DBs Used: DBF

Re: POPUP Disallowed - why?

Post by bluebird »

Thanks again Andy for helping with my 1st use of the IDE.

It works now!

Question: If the first window calls another window that also has a menu, are the menus both called "MAIN"
even though the second window is a child. Its the word "main" that confuses me That word suggests that it means the
most important or first. Does "main" only imply a type?
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: POPUP Disallowed - why?

Post by esgici »

bluebird wrote: Sat Feb 24, 2018 3:39 pm ...
Question: If the first window calls another window that also has a menu, are the menus both called "MAIN"
even though the second window is a child. Its the word "main" that confuses me That word suggests that it means the
most important or first. Does "main" only imply a type?
Answer : no; each form / window may have own main menu.

"OF" and "PARENT" keywords in the control's syntax implies this.

Please look at this demo:
Screen shoot
Screen shoot
MainMenuDemo.JPG (28.2 KiB) Viewed 2329 times
Demo.zip
Demo project source files
(695 Bytes) Downloaded 143 times
Happy HMG'ing :D
Viva INTERNATIONAL HMG :D
Post Reply