Page 1 of 1

Popup menu

Posted: Mon Aug 08, 2011 8:05 am
by Otto
I think if you have only 1 item in a popup menu the width of the popup is wrong.
Could someone please check this.
Thanks in advance

Otto

Code: Select all

// Defining ButtonBar buttons which uses Bitmaps files from disk

#include "FiveWin.ch"

static oWnd

//----------------------------------------------------------------------------//

function Main()

   local oBar
   local oBrush
   local oPopup

   DEFINE BRUSH oBrush COLOR nRGB( 12, 129, 87 )

   DEFINE WINDOW oWnd FROM 1, 10 TO 20, 60 ;
      TITLE "Testing Buttons from disk" ;
      BRUSH oBrush

   DEFINE BUTTONBAR oBar OF oWnd _3D

 
         MENU oPopup oPopup
   
         MENUITEM "Test" ACTION msginfo( "Test" )    
        
    ENDMENU

 
   DEFINE BUTTON OF oBar FILE "..\bitmaps\16x16\exit.bmp" ;
      ACTION MsgInfo( FWVERSION ) ;
      MESSAGE "You can place..." GROUP;
      MENU oPopup

  

   DEFINE BUTTON OF oBar FILE "..\bitmaps\16x16\Open.bmp"  ;
      ACTION MsgInfo( FWVERSION ) ;
      MESSAGE "Any BMP File here..." 

   DEFINE BUTTON OF oBar FILE "..\bitmaps\16x16\Cut.bmp" ;
      ACTION MsgInfo( FWVERSION ) ;
      MESSAGE "Reading it from disk !!!"

   SET MESSAGE OF oWnd TO FWVERSION + " " + FWCOPYRIGHT

   ACTIVATE WINDOW oWnd

return nil

//----------------------------------------------------------------------------//
 

Re: Popup menu

Posted: Mon Aug 08, 2011 8:42 am
by Enrico Maria Giordano
Otto wrote:

Code: Select all

MENU oPopup oPopup

Code: Select all

MENU oPopup POPUP
EMG

Re: Popup menu

Posted: Mon Aug 08, 2011 12:04 pm
by Otto
Enrico thank you for your help. I see my mistake now.
Best regards,
Otto

Re: Popup menu

Posted: Tue Aug 09, 2011 3:05 am
by peterk
Hi Otto/Enrico/Others

I have this problem with pop up menus that I have never been able to resolve
When a pop up menu is displayed, no menu item is highlighted, the user has to press 'Down" to move to the first menu item, then press 'Enter' to select it
I wish to be able to specify the default menu item to be highlighted/pre-selected when the pop up menu opens (e.g. the first menu item), so that the user if he wants to selectitem 1 just has to press 'Enter'

Any assistance would be appreciated
Thanks, Peter