NOAUTORELEASE Window Main

HMG en Español

Moderator: Rathinagiri

Post Reply
User avatar
danielmaximiliano
Posts: 2625
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

NOAUTORELEASE Window Main

Post by danielmaximiliano »

Hola a todos :
cual es el mejor metodo para cerrar una ventana principal ?
what is the best method to close a main window?

Code: Select all

DEFINE WINDOW Principal ;
              AT 6 , 6 ;
              WIDTH 1010 HEIGHT 710;
              TITLE "Autoservicio Los Tilos 2012" ;
              ICON "Shopcart";
              MAIN ;
              NOMAXIMIZE NOMINIMIZE NOSIZE;
              ON RELEASE SalirA()
error : Release a window in its own 'on release' procedure or release the main window in any 'on release' procedure is not allowed. Program terminated

**********************************************************************


and this gives me another error, I had never used these.

Code: Select all

DEFINE WINDOW Principal ;
              AT 6 , 6 ;
              WIDTH 1010 HEIGHT 710;
              TITLE "Autoservicio Los Tilos 2012" ;
              ICON "Shopcart";
              MAIN ;
              NOMAXIMIZE NOMINIMIZE NOSIZE;
              NOAUTORELEASE
error : NOAUTORELEASE and MAIN Clauses Can't Be Used Simultaneously. Program Terminated

Code: Select all

Procedure SalirA
dbCloseall()
CallDll32 ( "CloseComFiscal" , "WINFIS32.DLL" ,handler)
Principal.release
return
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: NOAUTORELEASE Window Main

Post by esgici »

Hola Daniel
danielmaximiliano wrote:what is the best method to close a main window?
The method to use for close a window depends totally to programmer; "best" method is the method selected by he/she.

Normally user close a window either by clicking "Close" button on window's caption or selecting "Close" from "system" menu or simply pressing Alt-F4.

Or programmer issue a

Thiswindow.Release

or

<Form_Name>.Release

command depending on any event ( a button click, a menu item selection, pressing a key ( f.e. Escape ) etc ).

ON RELEASE event triggered AFTER a window released. So, you can't use "Release" command into ON RELEASE procedure/Function.

Simply remove

Code: Select all

Principal.release
line from Procedure SalirA.
HMG Doc wrote:- NoAutoRelease Style: When this style is used, windows are hide instead released from memory when the user clicks in the close box. Using "Activate Window All" command at program startup will force "NoAutoRelease" style for all windows (excepting main). You must use "Show" and "Hide" methods to make a window visible or invisible.
So you can't use "NoAutoRelease" style for main window, as error message noticed.

If you want inhibit user to close window, you need use either NOSYSMENU ( hide also min, max and close button in the window's caption ) or NOCAPTION.

Saludos
Viva INTERNATIONAL HMG :D
User avatar
danielmaximiliano
Posts: 2625
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: NOAUTORELEASE Window Main

Post by danielmaximiliano »

esgici wrote:Hola Daniel


If you want inhibit user to close window, you need use either NOSYSMENU ( hide also min, max and close button in the window's caption ) or NOCAPTION.

Saludos
Hola Esgici :
sencillamente perfecto.

Code: Select all

DEFINE WINDOW Principal ;
              AT 6 , 6 ;
              WIDTH 1010 HEIGHT 710;
              TITLE "Autoservicio Los Tilos 2012" ;
              ICON "Shopcart";
              MAIN ;
              NOMAXIMIZE NOMINIMIZE NOSIZE  NOSYSMENU

    DEFINE SPLITBOX
        DEFINE TOOLBAR ToolBar_1 BUTTONSIZE 132,132 IMAGESIZE 128,128 FONT "Elephant" SIZE 9 BOLD FLAT 
            BUTTON Stock ;
            CAPTION "Stock artículos" ;
            PICTURE "Carrito" ;
            ACTION Stock() ;
            TOOLTIP "Stock de artículos del Autoservicio" ;
            SEPARATOR
            
            BUTTON Ventas ;
            CAPTION "Ventas" ;
            PICTURE "Registradora" ;
            ACTION Ventas() ;
            TOOLTIP "Ventas de artículos" ;
            SEPARATOR
            
            BUTTON Configurar ;
            CAPTION "Configurar" ;
            PICTURE "Configurar" ;
            ACTION Configurar() ;
            TOOLTIP "Configurar Scanner e Impresora" ;
            SEPARATOR
            
            BUTTON Salir ;
            CAPTION "Salir" ;
            PICTURE "exit" ;
            ACTION SalirA() ;
            TOOLTIP "Salir de Los Tilos" ;
            SEPARATOR
        END TOOLBAR

Code: Select all

Procedure SalirA
dbCloseall()
CallDll32 ( "CloseComFiscal" , "WINFIS32.DLL" ,handler)
Principal.Release
return
Work ok / Trabaja bien.
Dedo OK.jpeg
Dedo OK.jpeg (31.81 KiB) Viewed 2970 times
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: NOAUTORELEASE Window Main

Post by esgici »

danielmaximiliano wrote:...sencillamente perfecto.
It's pleased that you like :)

But your hand sign isn't :(

( In our country this sign has a too bad mean. )

This is enough :
Finger OK
Finger OK
Dedo OK.jpeg (10.59 KiB) Viewed 2965 times
Please change it

Saludos
Viva INTERNATIONAL HMG :D
Post Reply