'===========================================================================
' Subject: Banner Example                     Date: 00-00-01 (  :  )       
'  Author: Stewart Platt                      Code: rapidq                 
'  Origin: shteou@postmaster.co.uk          Packet: RAPIDQ.ABC
'===========================================================================
'An example of a banner, by Stewart Platt shteou@postmaster.co.uk


Showmessage "Welcome to an Example of how to link to an HTML website and open the default browser."

$APPTYPE GUI
$TYPECHECK ON
$INCLUDE "RAPIDQ.INC"

'The rich edit box.
DIM Help AS QMENUITEM
DIM File as qmenuitem
dim exitmenu as qmenuitem
DIM MainMenu AS QMainMenu

'The sub that allows the banner to open the default banner and goto the site.
Declare sub ShellExecute LIB "Shell32" ALIAS "ShellExecuteA" (HWnd AS LONG, ipoperation AS STRING, ipfile AS STRING, ipParameters AS STRING, IpDirectory AS STRING, nShowcmd AS LONG)
Declare sub banclick
declare sub helpclick
declare sub quit


CREATE MainForm AS QFORM
  Height = 150
  Width = 450
  Caption = "Banner example"
  Center
  borderstyle = bstoolwindow
  
  'This Qbutton could be changed to a Qimage to make a real banner effect
    CREATE banner AS Qbutton
        Left = 5
        Top = 25
        Width = 433
        caption = "Click Here to Visit ABC site"
        onclick = banclick
    END CREATE
End create

'This sub defines the site it will go to upon clicking on the banner
sub banclick
ShellExecute 0, "open", "http://www.allbasiccode.com/", "", "", 1
end sub


'I don't know why I put these in! Just to make it look a bit better I guess!  They Don't
'actually do anything!
Help.caption = "&Help"       
file.caption = "&File"
exitmenu.caption = "&Quit"   

mainMenu.Parent = MainForm
mainMenu.AddItems file, help

file.AddItems exitmenu

MainForm.ShowModal

