Xbase++ :lockUpdate() -> Fivewin ?

Xbase++ :lockUpdate() -> Fivewin ?

Postby Jimmy » Sat Nov 12, 2022 2:02 am

hi,

when "resize" i use this under Xbase++

Code: Select all  Expand view
PROCEDURE MyResize(aOldSize, aNewSize, oSelf)
   ...
   oSelf:lockUpdate(.T.)

   aChild := oSelf:Childlist()
   FOR ii := 1 TO LEN(aChild)
      // for all Controls
   NEXT

   oSelf:lockUpdate(.F.)
   oSelf:invalidateRect()

RETURN

Question :
a.) how can i suppress Screen "Output" while resize Control under Fivewin :?:
b.) under Xbase++ all Controls are "repaint" using invalidateRect() but under Fiverwin EACH Control need it :?:

---

i do have search for "LockWindowUpdate" but not found under Fivewin
https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-lockwindowupdate

i use this under HMG
Code: Select all  Expand view
#include "DLL.CH"
#define DLL_STDCALL                 0x20
STATIC PROCEDURE DoResize( oMain, ...)
   ...
   DLLCall( "user32.dll", DLL_STDCALL, "LockWindowUpdate", oMain:Hwnd )
   // resize Controls
   DLLCall( "user32.dll", DLL_STDCALL, "LockWindowUpdate", 0 )
   oMain:refresh()
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: Xbase++ :lockUpdate() -> Fivewin ?

Postby Antonio Linares » Sat Nov 12, 2022 7:06 am

Dear Jimmy,

Code: Select all  Expand view
HB_FUNC( LOCKWINDOWUPDATE )
{
   hb_retl( LockWindowUpdate( ( HWND ) hb_parnll( 1 ) );
}
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42065
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Xbase++ :lockUpdate() -> Fivewin ?

Postby Jimmy » Sun Nov 13, 2022 6:26 am

hi Antonio,
Antonio Linares wrote:   
Code: Select all  Expand view
hb_retl( LockWindowUpdate( ( HWND ) hb_parnll( 1 ) );

thx

typo, must be
Code: Select all  Expand view
hb_retl( LockWindowUpdate( ( HWND ) hb_parnll( 1 ) )  ) ;
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: Xbase++ :lockUpdate() -> Fivewin ?

Postby Antonio Linares » Sun Nov 13, 2022 8:11 pm

Dear Jimmy,

you are right

thanks!
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42065
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Xbase++ :lockUpdate() -> Fivewin ?

Postby karinha » Thu Nov 02, 2023 3:42 pm

Duda: para que sirve este comando LOCKWINDOWUPDATE() ?

Gracias.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7794
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Xbase++ :lockUpdate() -> Fivewin ?

Postby Jimmy » Thu Nov 02, 2023 6:10 pm

hi,

have a look at https://learn.microsoft.com/de-de/windows/win32/api/winuser/nf-winuser-lockwindowupdate

i use it e,g, when "re-size" a Window and do NOT want "paint" until all is finish
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: Xbase++ :lockUpdate() -> Fivewin ?

Postby Antonio Linares » Fri Nov 03, 2023 9:07 am

Nuevo método en la Clase TWindow de FWH:

METHOD LockUpdate( lOnOff ) INLINE LockWindowUpdate( If( Empty( lOnOff ) .or. lOnOff, ::hWnd, 0 ) )

Code: Select all  Expand view
HB_FUNC( LOCKWINDOWUPDATE )
{
   hb_retl( LockWindowUpdate( ( HWND ) hb_parnll( 1 ) ) );
}
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42065
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Xbase++ :lockUpdate() -> Fivewin ?

Postby Antonio Linares » Fri Nov 03, 2023 10:04 am

This seems a simpler version: Jimmy could you please try it with your code ? No need to supply a parameter

METHOD LockUpdate() INLINE LockWindowUpdate( ::hWnd )

Code: Select all  Expand view
HB_FUNC( LOCKWINDOWUPDATE )
{
   if( ! LockWindowUpdate( ( HWND ) hb_parnll( 1 ) ) )
      LockWindowUpdate( ( HWND ) 0 );
}


https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-lockwindowupdate
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42065
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Xbase++ :lockUpdate() -> Fivewin ?

Postby xmanuel » Fri Nov 03, 2023 12:15 pm

Antonio yo la dejaría como al principio pero usando hb_parptr:
Code: Select all  Expand view

HB_FUNC( LOCKWINDOWUPDATE )
{
   hb_retl( LockWindowUpdate( ( HWND ) hb_parptr( 1 ) ) );
}
 


hb_parptr() devuelve NULL si no se pasa nada que exactamente. lo que se quiere.
:)
______________________________________________________________________________
Sevilla - Andalucía
xmanuel
 
Posts: 761
Joined: Sun Jun 15, 2008 7:47 pm
Location: Sevilla

Re: Xbase++ :lockUpdate() -> Fivewin ?

Postby Jimmy » Sat Nov 04, 2023 3:37 pm

hi Antonio,

i try to find HB_FUNC( LOCKWINDOWUPDATE ) but did not found it in my FWH Source ... hm
but i found it in "C" Files as "External" ... hm

so i try
Code: Select all  Expand view
%HBDIR%\bin\hbmk2 -find LOCKWINDOWUPDATE

but "no match" ... hm

---

in my FWH i have

Code: Select all  Expand view
PROCEDURE DoDBFResize( oWnd ... )

   LOCKWINDOWUPDATE( oWnd:Hwnd )
   FOR ii := 1 TO nMax
      oObj := aParts[ ii ]

      oObj:SetSize( nPart, 48 )
      oObj:SetPos( 0, nPart * ( ii - 2 ) )
   NEXT
   LOCKWINDOWUPDATE( 0 )

RETURN

which work as expect
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: Xbase++ :lockUpdate() -> Fivewin ?

Postby Antonio Linares » Sat Nov 04, 2023 5:04 pm

Dear Jimmy,

using :
Adding this to Class TWindow: METHOD LockUpdate() INLINE LockWindowUpdate( ::hWnd )

Code: Select all  Expand view
HB_FUNC( LOCKWINDOWUPDATE )
{
   if( ! LockWindowUpdate( ( HWND ) hb_parnll( 1 ) ) )
      LockWindowUpdate( ( HWND ) 0 );
}


Your code could be changed this way:
Code: Select all  Expand view
PROCEDURE DoDBFResize( oWnd ... )

   oWnd:LockUpdate()
   FOR ii := 1 TO nMax
      oObj := aParts[ ii ]

      oObj:SetSize( nPart, 48 )
      oObj:SetPos( 0, nPart * ( ii - 2 ) )
   NEXT
   oWnd:LockUpdate()

RETURN
regards, saludos

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