How can I show original original window after Menutray.prg?

How can I show original original window after Menutray.prg?

Postby kim yong woo » Tue Sep 22, 2015 6:40 am

Dear Sirs,

I have combined Menutray() and added oWnd:hide() on Window minimize button, as followings.
To add oWnd:hide() on minimize button, referred Mr. Enrico Maria Giordano's comments.

Code: Select all  Expand view
Function Main()
   DEFINE Window oWnd  TITLE "Test Call"

   DEFINE BUTTON resource "EXIT" of oBar  Message "Exit"   Group  Action ( lExit:=.t., oWnd:end() )


    ACTIVATE WINDOW oWnd Maximized ;
     ON INIT (oTray := TTrayIcon():New( oWnd, oIcon, "Testing tray ...",;
             { || MsgInfo( "Left CLick" ) },;
             { | nRow, nCol | MenuTray( nRow, nCol, oTray ) } ),oWnd:Show()) ;
     ON RESIZE SHOWRESIZETYPE( nSizeType ) ;
     VALID ( oWnd:hide(), lExit )

Return nil


#define SIZE_INIT      NIL
#define SIZE_RESTORED  0
#define SIZE_MINIMIZED 1
#define SIZE_MAXIMIZED 2

STATIC FUNCTION SHOWRESIZETYPE( nSizeType )
  STATIC lInit := .T.

    DO CASE
        CASE nSizeType = SIZE_INIT
            lInit = .F.
        CASE nSizeType = SIZE_RESTORED .AND. !lInit
        CASE nSizeType = SIZE_MINIMIZED
           oWnd:hide()
        CASE nSizeType = SIZE_MAXIMIZED
    ENDCASE

RETURN NIL

Function MenuTray( nRow, nCol, oTray )

   local oMenu

   MENU oMenu POPUP
      MENUITEM "Show" ACTION oWnd:Show(), oWnd:SetFocus()
      MENUITEM "Hide" ACTION oWnd:Hide()
      SEPARATOR
      MENUITEM "Close Application" ACTION ( lExit:=.t., oWnd:end() )
   ENDMENU

   ACTIVATE POPUP oMenu AT nRow, nCol OF oTray:oWnd

return NIL
 


But, When I clicked oWnd:Show() in Tray, It doesn't roll back to original windows, at one time..

1. It showed..
http://pharmalink.kr/images/Tray01.jpg

2.Click Tray "Show""
http://pharmalink.kr/images/Tray02.jpg

3.Click Bottom icon, again..
http://pharmalink.kr/images/Tray03.jpg

4.Then, It was possible to see Original window..
http://pharmalink.kr/images/Tray04.jpg

How Can I modify my codes?

Thanks in advance..
User avatar
kim yong woo
 
Posts: 57
Joined: Sun Apr 12, 2009 10:51 am
Location: Seoul, Korea

Re: How can I show original original window after Menutray.prg?

Postby Antonio Linares » Wed Sep 23, 2015 8:26 am

Please review FWH\samples\TestTray.prg
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42077
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 89 guests