From: Glen Townsley on 15 Apr 2010 19:32 Amilcar, Thanks for the insight. I use the DLG preview and I also added the up/down page up/page down and home end keys. Cheers Glen Townsley CLASS pce_rpPrintPreviewDLG INHERIT rpPrintPreviewDLG METHOD Dispatch( oEvent ) CLASS pce_rpPrintPreviewDLG LOCAL uMsg AS LONG LOCAL wParam AS DWORD LOCAL lParam AS LONG LOCAL iDelta AS INT uMsg := oEvent:Message wParam := oEvent:wParam lParam := oEvent:lParam DO CASE // Mouse wheel CASE uMsg == WM_MOUSEWHEEL iDelta := SHORT( _CAST, HiWord( wParam ) ) IF iDelta < 0 SELF:NextPageBtn() ELSEIF iDelta > 0 SELF:PrevPageBtn() ENDIF SELF:EventReturnValue := 0L RETURN 1L CASE uMsg == WM_HOTKEY .AND. wParam == 102 SELF:FirstPageBtn() CASE uMsg == WM_HOTKEY .AND. wParam == 106 SELF:LastPageBtn() CASE uMsg == WM_HOTKEY .AND. ( wParam == 105 .OR. wParam == 104 ) SELF:PrevPageBtn() CASE uMsg == WM_HOTKEY .AND. ( wParam == 101 .OR. wParam == 103 ) SELF:NextPageBtn() ENDCASE RETURN SUPER:Dispatch( oEvent ) METHOD init( oParent,oPrinter,cCaption,lModal,ptrPlacement,nShowState,lLandScape,nZoom) CLASS pce_rpPrintPreviewDLG SUPER:init( oParent,oPrinter,cCaption,lModal,ptrPlacement,nShowState,lLandScape,nZoom ) RegisterHotKey( SELF:Handle(), 101, 0, VK_DOWN ) RegisterHotKey( SELF:Handle(), 102, 0, VK_HOME ) RegisterHotKey( SELF:Handle(), 103, 0, VK_NEXT ) RegisterHotKey( SELF:Handle(), 104, 0, VK_PRIOR ) RegisterHotKey( SELF:Handle(), 105, 0, VK_UP ) RegisterHotKey( SELF:Handle(), 106, 0, VK_END ) RETURN SELF "Amilcar A. Camargo" <amilcarcamargo(a)gmail.com> wrote in message news:pu7as5hojsdnvt3rn5rt66ssikhnga3pkf(a)4ax.com... > For Modal previews you inherit from 'rpPrintPreviewDLG' (i guess as i > don't use > them) > > Best regards, > > Amilcar A. Camargo F. > Guatemala, C. A.
From: Massimo Bighelli on 16 Apr 2010 06:10 Glen, and what about UnRegisterHotKey ? is it necessary, and when ? RegisterHotKey is related to DLG-Handle, then closing the DLG would be enough, isn't it? Massimo Bighelli ARCA Sistemi S.r.l. www.arcasistemi.it www.arcasistemi.eu "Glen Townsley" <glent(a)no_spam.pronamics.com.au> ha scritto nel messaggio news:hq87hc$9eo$1(a)speranza.aioe.org... > Amilcar, > > Thanks for the insight. I use the DLG preview and I also added the up/down > page up/page down and home end keys. > > Cheers > > Glen Townsley > > CLASS pce_rpPrintPreviewDLG INHERIT rpPrintPreviewDLG > > > METHOD Dispatch( oEvent ) CLASS pce_rpPrintPreviewDLG > LOCAL uMsg AS LONG > LOCAL wParam AS DWORD > LOCAL lParam AS LONG > LOCAL iDelta AS INT > > uMsg := oEvent:Message > wParam := oEvent:wParam > lParam := oEvent:lParam > DO CASE > // Mouse wheel > CASE uMsg == WM_MOUSEWHEEL > iDelta := SHORT( _CAST, HiWord( wParam ) ) > IF iDelta < 0 > SELF:NextPageBtn() > ELSEIF iDelta > 0 > SELF:PrevPageBtn() > ENDIF > SELF:EventReturnValue := 0L > RETURN 1L > CASE uMsg == WM_HOTKEY .AND. wParam == 102 > SELF:FirstPageBtn() > CASE uMsg == WM_HOTKEY .AND. wParam == 106 > SELF:LastPageBtn() > CASE uMsg == WM_HOTKEY .AND. ( wParam == 105 .OR. wParam == 104 ) > SELF:PrevPageBtn() > CASE uMsg == WM_HOTKEY .AND. ( wParam == 101 .OR. wParam == 103 ) > SELF:NextPageBtn() > ENDCASE > RETURN SUPER:Dispatch( oEvent ) > METHOD init( > oParent,oPrinter,cCaption,lModal,ptrPlacement,nShowState,lLandScape,nZoom) > CLASS pce_rpPrintPreviewDLG > > SUPER:init( > oParent,oPrinter,cCaption,lModal,ptrPlacement,nShowState,lLandScape,nZoom > ) > > RegisterHotKey( SELF:Handle(), 101, 0, VK_DOWN ) > RegisterHotKey( SELF:Handle(), 102, 0, VK_HOME ) > RegisterHotKey( SELF:Handle(), 103, 0, VK_NEXT ) > RegisterHotKey( SELF:Handle(), 104, 0, VK_PRIOR ) > RegisterHotKey( SELF:Handle(), 105, 0, VK_UP ) > RegisterHotKey( SELF:Handle(), 106, 0, VK_END ) > > > RETURN SELF > > > > "Amilcar A. Camargo" <amilcarcamargo(a)gmail.com> wrote in message > news:pu7as5hojsdnvt3rn5rt66ssikhnga3pkf(a)4ax.com... >> For Modal previews you inherit from 'rpPrintPreviewDLG' (i guess as i >> don't use >> them) >> >> Best regards, >> >> Amilcar A. Camargo F. >> Guatemala, C. A. > --- news://freenews.netfront.net/ - complaints: news(a)netfront.net ---
From: Glen Townsley on 18 Apr 2010 18:22
Massimo, I'm not totally sure you need to unregister as the object will go out of scope, but I suspect that you do need to so I have added the following to the class METHOD QueryClose( oCloseEvent ) CLASS pce_rpPrintPreviewDLG LOCAL lClose AS LOGIC lClose := SUPER:QueryClose( oCloseEvent ) IF lClose UnregisterHotKey( SELF:Handle(), 101 ) UnregisterHotKey( SELF:Handle(), 102 ) UnregisterHotKey( SELF:Handle(), 103 ) UnregisterHotKey( SELF:Handle(), 104 ) UnregisterHotKey( SELF:Handle(), 105 ) UnregisterHotKey( SELF:Handle(), 106 ) ENDIF RETURN lClose Cheers Glen "Massimo Bighelli" <info(a)arcasistemi.it> wrote in message news:hq9d3a$2a0l$1(a)adenine.netfront.net... > Glen, > > and what about UnRegisterHotKey ? > is it necessary, and when ? > RegisterHotKey is related to DLG-Handle, then closing the DLG would be > enough, isn't it? > > Massimo Bighelli > ARCA Sistemi S.r.l. > www.arcasistemi.it > www.arcasistemi.eu > > > "Glen Townsley" <glent(a)no_spam.pronamics.com.au> ha scritto nel messaggio > news:hq87hc$9eo$1(a)speranza.aioe.org... >> Amilcar, >> >> Thanks for the insight. I use the DLG preview and I also added the >> up/down page up/page down and home end keys. >> >> Cheers >> >> Glen Townsley >> >> CLASS pce_rpPrintPreviewDLG INHERIT rpPrintPreviewDLG >> >> >> METHOD Dispatch( oEvent ) CLASS pce_rpPrintPreviewDLG >> LOCAL uMsg AS LONG >> LOCAL wParam AS DWORD >> LOCAL lParam AS LONG >> LOCAL iDelta AS INT >> >> uMsg := oEvent:Message >> wParam := oEvent:wParam >> lParam := oEvent:lParam >> DO CASE >> // Mouse wheel >> CASE uMsg == WM_MOUSEWHEEL >> iDelta := SHORT( _CAST, HiWord( wParam ) ) >> IF iDelta < 0 >> SELF:NextPageBtn() >> ELSEIF iDelta > 0 >> SELF:PrevPageBtn() >> ENDIF >> SELF:EventReturnValue := 0L >> RETURN 1L >> CASE uMsg == WM_HOTKEY .AND. wParam == 102 >> SELF:FirstPageBtn() >> CASE uMsg == WM_HOTKEY .AND. wParam == 106 >> SELF:LastPageBtn() >> CASE uMsg == WM_HOTKEY .AND. ( wParam == 105 .OR. wParam == 104 ) >> SELF:PrevPageBtn() >> CASE uMsg == WM_HOTKEY .AND. ( wParam == 101 .OR. wParam == 103 ) >> SELF:NextPageBtn() >> ENDCASE >> RETURN SUPER:Dispatch( oEvent ) >> METHOD init( >> oParent,oPrinter,cCaption,lModal,ptrPlacement,nShowState,lLandScape,nZoom) >> CLASS pce_rpPrintPreviewDLG >> >> SUPER:init( >> oParent,oPrinter,cCaption,lModal,ptrPlacement,nShowState,lLandScape,nZoom >> ) >> >> RegisterHotKey( SELF:Handle(), 101, 0, VK_DOWN ) >> RegisterHotKey( SELF:Handle(), 102, 0, VK_HOME ) >> RegisterHotKey( SELF:Handle(), 103, 0, VK_NEXT ) >> RegisterHotKey( SELF:Handle(), 104, 0, VK_PRIOR ) >> RegisterHotKey( SELF:Handle(), 105, 0, VK_UP ) >> RegisterHotKey( SELF:Handle(), 106, 0, VK_END ) >> >> >> RETURN SELF >> >> >> >> "Amilcar A. Camargo" <amilcarcamargo(a)gmail.com> wrote in message >> news:pu7as5hojsdnvt3rn5rt66ssikhnga3pkf(a)4ax.com... >>> For Modal previews you inherit from 'rpPrintPreviewDLG' (i guess as i >>> don't use >>> them) >>> >>> Best regards, >>> >>> Amilcar A. Camargo F. >>> Guatemala, C. A. >> > > > --- news://freenews.netfront.net/ - complaints: news(a)netfront.net --- |