- Code: Select all Expand view RUN
- #include "wcolors.ch"
#include "Fivewin.CH"
static oWnd, oTray, oIcon
function TESTIT()
local oIcon1
DEFINE ICON oIcon FILE "c:\fwh\icons\fivewin.ICO"
DEFINE ICON oIcon1 FILE "c:\fwh\icons\folder.ico"
DEFINE WINDOW oWnd TITLE "Icon Tray Class for FiveWin! from Jim Gale" ICON oIcon
ACTIVATE WINDOW oWnd ;
ON INIT oTray := TTrayIcon():New( oWnd, oIcon, "Testing tray ...",;
{ || MsgInfo( "Left CLick" ) },;
{ | nRow, nCol | MenuTray( nRow, nCol, oTray ) } ) ;
VALID oTray:End() ;
ON RIGHT CLICK oTray:SetIcon( oIcon1, "Another" )
return NIL
***********************************************************
FUNCTION MenuTray( nRow, nCol )
LOCAL oMenu
LOCAL cFontMenu := "Verdana"
LOCAL nHFontMenu := 14
LOCAL oFontMenu
DEFINE FONT oFontMenu NAME cFontMenu SIZE 0, -nHFontMenu
MENU oMenu POPUP FONT oFontMenu 2013 LOGOMENU "c:\fwh\bitmaps\pngs\image1.png"
MENUITEM "Show" ACTION oWnd:Show(), oWnd:SetFocus()
MENUITEM "Hide" ACTION oWnd:Hide()
SEPARATOR
MENUITEM "Close Application" ACTION oWnd:end()
ENDMENU
ACTIVATE POPUP oMenu AT nRow, nCol OF oTray:oWnd
return NIL
EMG