SetCloseEvent function in a latest build

This is a discussion on SetCloseEvent function in a latest build within the xharbour forums in Programming Languages category; Hi ! Who khow, how to emulate SetCloseEvent function in a new gtwvt(g) terminal version ? I use this function to control "application close" system button. This is source of rtl/gx.c, that doesn't work since march builds. HB_FUNC( SETCLOSEEVENT ) { PHB_ITEM pEvent = hb_param( 1, HB_IT_NUMERIC ); if ( pEvent == NULL ) { hb_errRT_BASE_SubstR( EG_ARG, 3012, NULL, "SETCLOSEEVENT", 1, hb_paramError( 1 ) ); } else { hb_gtSetCloseEvent( hb_itemGetNL( pEvent ) ); } }...

Go Back   Application Development Forum > Programming Languages > xharbour

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-28-2008, 02:53 PM
k_dima
Guest
 
Default SetCloseEvent function in a latest build

Hi ! Who khow, how to emulate SetCloseEvent function in a new
gtwvt(g) terminal version ? I use this function to control
"application close" system button.
This is source of rtl/gx.c, that doesn't work since march builds.

HB_FUNC( SETCLOSEEVENT )
{
PHB_ITEM pEvent = hb_param( 1, HB_IT_NUMERIC );
if ( pEvent == NULL )
{
hb_errRT_BASE_SubstR( EG_ARG, 3012, NULL, "SETCLOSEEVENT", 1,
hb_paramError( 1 ) );
}
else {
hb_gtSetCloseEvent( hb_itemGetNL( pEvent ) );
}
}

Reply With Quote
  #2  
Old 08-29-2008, 06:09 AM
Mario H. Sabado
Guest
 
Default Re: SetCloseEvent function in a latest build

Hi k_dima,

Maybe below info will give you a hint?

Regards,
Mario

#include "hbgtinfo.ch"
Hb_GtInfo( HB_GTI_CLOSABLE, .F. )


k_dima wrote:
> Hi ! Who khow, how to emulate SetCloseEvent function in a new
> gtwvt(g) terminal version ? I use this function to control
> "application close" system button.
> This is source of rtl/gx.c, that doesn't work since march builds.
>
> HB_FUNC( SETCLOSEEVENT )
> {
> PHB_ITEM pEvent = hb_param( 1, HB_IT_NUMERIC );
> if ( pEvent == NULL )
> {
> hb_errRT_BASE_SubstR( EG_ARG, 3012, NULL, "SETCLOSEEVENT", 1,
> hb_paramError( 1 ) );
> }
> else {
> hb_gtSetCloseEvent( hb_itemGetNL( pEvent ) );
> }
> }
>

Reply With Quote
  #3  
Old 08-29-2008, 10:41 AM
k_dima
Guest
 
Default Re: SetCloseEvent function in a latest build

On 29 ΑΧΗ, 13:09, "Mario H. Sabado" <mhsab...@gmail.com> wrote:
> Hi k_dima,
>
> Maybe below info will give you a hint?
>
> Regards,
> Mario
>
> #include "hbgtinfo.ch"
> Hb_GtInfo( HB_GTI_CLOSABLE, .F. )
>
>
>

I need a callback event HB_GTE_CLOSE, and see, that it doesn't
supported in a current GT version

/* Harbour GT callback events - WORK IN PROGRESS */
#define HB_GTE_ACTIVATE 1
#define HB_GTE_SETFOCUS 2
#define HB_GTE_KILLFOCUS 3
#define HB_GTE_CLOSE 4
#define HB_GTE_RESIZED 5



Reply With Quote
  #4  
Old 09-01-2008, 07:21 AM
Saulius
Guest
 
Default Re: SetCloseEvent function in a latest build

k_dima,

>I need a callback event HB_GTE_CLOSE, and see, that it doesn't
>supported in a current GT version


>/* Harbour GT callback events - WORK IN PROGRESS */
>#define HB_GTE_ACTIVATE 1
>#define HB_GTE_SETFOCUS 2
>#define HB_GTE_KILLFOCUS 3
>#define HB_GTE_CLOSE 4
>#define HB_GTE_RESIZED 5


Look at sample \tests\wvtext.prg
Pay attention on this line:
HB_GtInfo( HB_GTI_NOTIFIERBLOCK, {|nEvent| MyNotifier( nEvent ) } )

Best regards,
Saulius


Reply With Quote
  #5  
Old 09-01-2008, 08:17 AM
k_dima
Guest
 
Default Re: SetCloseEvent function in a latest build

I tryed to compile this sample, but it use callback events, that
defined as "work in progress" in the hbgtinfo.ch, so it doesn't work
in the Xharbour.
Anyway, thanks , will see if it will be work in the future.

On 1 ΣΕΞΤ, 14:21, "Saulius" <Saul...@NOSPAM.com> wrote:
> k_dima,
>
> >I need a callback event HB_GTE_CLOSE, and see, that it doesn't
> >supported in a current GT version
> >/* Harbour GT callback events - WORK IN PROGRESS */
> >#define HB_GTE_ACTIVATE š š š š 1
> >#define HB_GTE_SETFOCUS š š š š 2
> >#define HB_GTE_KILLFOCUS š š š š3
> >#define HB_GTE_CLOSE š š š š š š4
> >#define HB_GTE_RESIZED š š š š š5

>
> Look at sample \tests\wvtext.prg
> Pay attention on this line:
> HB_GtInfo( HB_GTI_NOTIFIERBLOCK, {|nEvent| MyNotifier( nEvent ) } )
>

Reply With Quote
  #6  
Old 09-01-2008, 05:14 PM
Pritpal Bedi
Guest
 
Default Re: SetCloseEvent function in a latest build

<<<<
I tryed to compile this sample, but it use callback events, that
defined as "work in progress" in the hbgtinfo.ch, so it doesn't work
in the Xharbour.
Anyway, thanks , will see if it will be work in the future.
>>>>


It works in current CVS also. What you are looking for exactly extra than:

FUNCTION Main()
Hb_GtInfo( HB_GTI_CLOSABLE, .T. )
HB_GtInfo( HB_GTI_NOTIFIERBLOCK, {|nEvent| MyNotifier( nEvent ) } )

RETURN NIL

STATIC FUNCTION MyNotifier( nEvent )
DO CASE
CASE nEvent == HB_GTE_CLOSE
DispScreen()
if Alert( 'Close Application', {'Yes','No' } ) == 2
Return ( 1 )
endif
ENDCASE
RETURN 0

Regards
Pritpal Bedi, INDIA-USA


Reply With Quote
  #7  
Old 09-02-2008, 02:09 AM
k_dima
Guest
 
Default Re: SetCloseEvent function in a latest build

Hi Pritpal !
I compiled wvtext.prg vai Xhb Builder beta 83 based on CVS 2008-08-28
and wvg.lib
I cannot get working MyNotifier function, application close or get
focus without any notification.Other features works.
Here is my xharbour builder project file

CINI =
C_OUTPUTFOLDER =
DEFFILE =
INCLUDEFOLDERS =
LAUTORUN =
LDEBUG = .F.
LGUI = .T.
LIBFOLDERS =
LMT = .F.
LPRG_CLASSICDEBUG = .F.
LPRG_DEBUG = .F.
LUSEDLL = .F.
MAPFILE =
MYC_FLAGS =
MYDEFINES =
MYLINK_FLAGS =
MYPRG_FLAGS =
MYRC_FLAGS =
MYSLY_FLAGS =
OUTPUTFOLDER =
PRG_OUTPUTFOLDER =
RC_OUTPUTFOLDER =
RUNARGUMENTS =
SLY_OUTPUTFOLDER =
STARTIN =
TARGETFOLDER =

[wvtext.prg]
MYC_FLAGS =
MYDEFINES =
MYPRG_FLAGS =

[C:\xHB_new\lib\WVG.lib]

and log file

Type: C >>>xhb.exe -o"wvtext.c" -m -n -p -q -gc0 -I"C:\xHB_new
\include" -I"C:\xHB_new\include\w32" "wvtext.prg"<<<

xHarbour Compiler build 1.1.0 (SimpLex) (Rev. 6204)
Copyright 1999-2008, http://www.xharbour.org http://www.harbour-project.org/
Generating object output to 'wvtext.obj'...

Type: C >>>xlink.exe -NOEXPOBJ -MAP -FORCE:MULTIPLE -NOIMPLIB -
subsystem:windows -LIBPATH:"C:\xHB_new\lib" -LIBPATH:"C:\xHB_new
\c_lib" -LIBPATH:"C:\xHB_new\c_lib\win" "wvtext.obj" "C:\xHB_new\lib
\WVG.lib" "OptG.lib" "xhb.lib" "dbf.lib" "ntx.lib" "cdx.lib"
"rmdbfcdx.lib" crt.lib kernel32.lib user32.lib winspool.lib ole32.lib
oleaut32.lib odbc32.lib odbccp32.lib uuid.lib wsock32.lib ws2_32.lib
wininet.lib advapi32.lib shlwapi.lib msimg32.lib mpr.lib comctl32.lib
comdlg32.lib gdi32.lib shell32.lib winmm.lib lz32.lib Netapi32.lib -
out:"wvtest.exe"<<<

Regards, Dmitri.

On 2 ΣΕΞΤ, 00:14, "Pritpal Bedi" <bediprit...@hotmail.com> wrote:
> <<<<
> I tryed to compile this sample, but it use callback events, that
> defined as "work in progress" in the hbgtinfo.ch, so it doesn't work
> in the Xharbour.
> Anyway, thanks , will see if it will be work in the future.
>
>
>
> It works in current CVS also. What you are looking for exactly extra than:
>
> FUNCTION Main()
> š šHb_GtInfo( HB_GTI_CLOSABLE, .T. )
> š šHB_GtInfo( HB_GTI_NOTIFIERBLOCK, {|nEvent| MyNotifier( nEvent ) } )
>
> š šRETURN NIL
>
> STATIC FUNCTION MyNotifier( nEvent )
> š šDO CASE
> š šCASE nEvent == HB_GTE_CLOSE
> š š š DispScreen()
> š š š if Alert( 'Close Application', {'Yes','No' } ) == 2
> š š š š šReturn ( 1 )
> š š š endif
> š šENDCASE
> š šRETURN 0
>
> Regards
> Pritpal Bedi, INDIA-USA


Reply With Quote
  #8  
Old 09-03-2008, 01:29 AM
Pritpal Bedi
Guest
 
Default Re: SetCloseEvent function in a latest build

Hi
<<<
I compiled wvtext.prg vai Xhb Builder beta 83 based on CVS 2008-08-28
and wvg.lib
I cannot get working MyNotifier function, application close or get
focus without any notification.Other features works.
>>>


I do not know about xHarbour builder process but theoretically it should
work.
Try comiling with xHarbour org. If it will not work there then I will
explore
further.

Regards
Pritpal Bedi, INDIA-USA


Reply With Quote
  #9  
Old 09-08-2008, 11:19 PM
Ron Pinkas
Guest
 
Default Re: SetCloseEvent function in a latest build

Pritpal,

> I do not know about xHarbour builder process but theoretically it should
> work.
> Try comiling with xHarbour org. If it will not work there then I will
> explore
> further.


Sorry, did you even test your sample?

How in the world could it work, if there's absolutley no support for
HB_GTI_NOTIFIERBLOCK in gtwvt nor gtwvg?

pWVT->pGT->pNotifierBlock is NEVER assigned!

Once this omission is corrected we can begin to test it.

Ron



Reply With Quote
  #10  
Old 09-09-2008, 07:37 PM
Pritpal Bedi
Guest
 
Default Re: SetCloseEvent function in a latest build

Ron

Sorry, I forget to include it in hbgtcore.c:

static BOOL hb_gt_def_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )

case...

case HB_GTI_NOTIFIERBLOCK:
if( pGT->pNotifierBlock )
{
hb_itemRelease( pGT->pNotifierBlock );
pGT->pNotifierBlock = NULL;
}
if( hb_itemType( pInfo->pNewVal ) & HB_IT_BLOCK )
pGT->pNotifierBlock = hb_itemNew( pInfo->pNewVal );
break;

default..

Please insert above lines and commit.

Regards
Pritpal Bedi




"Ron Pinkas" <Ron@xHarbour.com> wrote in message
news:ga4pvp$e62$1@aioe.org...
> Pritpal,
>
>> I do not know about xHarbour builder process but theoretically it should
>> work.
>> Try comiling with xHarbour org. If it will not work there then I will
>> explore
>> further.

>
> Sorry, did you even test your sample?
>
> How in the world could it work, if there's absolutley no support for
> HB_GTI_NOTIFIERBLOCK in gtwvt nor gtwvg?
>
> pWVT->pGT->pNotifierBlock is NEVER assigned!
>
> Once this omission is corrected we can begin to test it.
>
> Ron
>
>
>



Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 10:15 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.