Page 2 of 2

mol

Posted: Thu Nov 10, 2016 4:27 pm
by mol
Sorry, Pablo, I don't understand what do you mean...

I am in favor of improvements required for IDE

Posted: Thu Nov 10, 2016 5:10 pm
by Pablo César
Marek, when we have an ideal tool for working, all work yields and gains a lot of time. To implement user configuration to be serviced by IDE working as the user would like to work, do not necessary need to implememnt agressive methods.

What we have is to make ou wrokbench the most flexible and pratical for us. We can not have fear to make implementations. The important is to study how to do it...

We have to make our tools easier, tools must be with flexibility to adapt it to us the users. Not the opposite, ie. users needs to adapt for using the application, in case.

Re: ON KEY ESCAPE blocks ESC key for all applications running on system...

Posted: Thu Nov 10, 2016 6:53 pm
by KDJ
mol wrote:My friend Edward found problem with On Key ESCAPE...
This problem can be solved by capturing WM_COMMAND message:
EventCreate('frmMain_WM_COMMAND', frmMain.HANDLE, 273 /*WM_COMMAND*/)
and checking wParam:
IF (LoWord(EventWPARAM()) == 2 /*IDCANCEL*/)

Code: Select all

#include "hmg.ch"

PROCEDURE Main()

  DEFINE WINDOW frmMain ;
    AT 0,0 ;
    WIDTH 800 HEIGHT 500 ;
    TITLE 'Test' ICON 'R';
    MAIN;
    ON INIT (frmMain.Minimize, msgbox('The "Escape" will not work in the system until you restore "R" application from the tray'));
    NOTIFYICON 'R' ;
    NOTIFYTOOLTIP 'Test' ;
    ON NOTIFYCLICK frmMain.Restore;
    ON MINIMIZE frmMain.Hide;
    VISIBLE .F.

    DEFINE NOTIFY MENU
      ITEM 'Restore' ACTION frmMain.Restore
      SEPARATOR
      ITEM 'Exit'    ACTION frmMain.Release
    END MENU

    DEFINE MAIN MENU
      DEFINE POPUP '&Exit' NAME menu_xit
        MENUITEM 'Exit' ACTION IF(MsgYesNo('Exit?',,.T.), ThisWindow.Release, Nil)
      END POPUP
    END MENU
  END WINDOW
  
  //ON KEY ESCAPE of frmMain ACTION IF(MsgYesNo('Exit?',,.T.), frmMain.Release, Nil)

  EventCreate('frmMain_WM_COMMAND', frmMain.HANDLE, 273 /*WM_COMMAND*/)

  CENTER WINDOW frmMain
  ACTIVATE WINDOW frmMain

RETURN // Main()

FUNCTION frmMain_WM_COMMAND()

  IF (LoWord(EventWPARAM()) == 2 /*IDCANCEL*/) .and. MsgYesNo('Exit?', , .T.)
    frmMain.Release
  ENDIF

RETURN NIL

mol

Posted: Thu Nov 10, 2016 7:12 pm
by mol
Dzięki !