FiveWeb - a Menu and a dialog box

FiveWeb - a Menu and a dialog box

Postby Antonio Linares » Tue Jan 22, 2013 3:27 pm

This post is an answer to a tech support requirement from Colin Haig, who wants to have a menu and build a dialogbox from it, using FiveWeb:

working example:
http://www.fivetechsoft.net/cgi-bin/colin

colin.prg
Code: Select all  Expand view
#include "FiveWeb.ch"

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

function Main( cParams )

   SET BACKIMAGE TO "http://fiveweb.googlecode.com/svn/trunk/images/beach.jpg"
   
   SetTheme( "flick" )
   
   BuildMenu()

   if pcount() > 0
      Process( cParams )
      return nil
   endif

return nil

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

function BuildMenu()

   local AppName := AppName(), oMenu

   MENU oMenu
      MENUITEM "Test"
      MENU
         MENUITEM "dialog" ACTION ( 'document.location = "' + AppName() + '?dlg1"' )
      ENDMENU

      MENUITEM "About"
      MENU
         MENUITEM "My App..." ACTION MsgInfo( "My FiveWeb app" )
      ENDMENU
   ENDMENU

return oMenu

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

function Process( cParams )

   local aParams := hb_aTokens( cParams, ":" )
 
   do case
      case aParams[ 1 ] == "dlg1"
           MyDialog( aParams )
  endcase

return nil          

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

function MyDialog( aParams )

   local oDlg

   DEFINE DIALOG oDlg TITLE "Colin example" SIZE 600, 400

   @ 12, 10 SAY "Title:" OF oDlg

   @ 12, 80 SAY "..." OF oDlg

   @ 260, 250 BUTTON "Cancel" OF oDlg ACTION ( oDlg:End() )
   
   ACTIVATE DIALOG oDlg NOWAIT

return nil

//----------------------------------------------------------------------------//    
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42089
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 52 guests