Xbase++ :lockUpdate() -> Fivewin ?

Post Reply
User avatar
Jimmy
Posts: 1733
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Xbase++ :lockUpdate() -> Fivewin ?

Post by Jimmy »

hi,

when "resize" i use this under Xbase++

Code: Select all | Expand

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/windo ... ndowupdate

i use this under HMG

Code: Select all | Expand

#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
Antonio Linares
Site Admin
Posts: 42259
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

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

Post by Antonio Linares »

Dear Jimmy,

Code: Select all | Expand

HB_FUNC( LOCKWINDOWUPDATE )
{
   hb_retl( LockWindowUpdate( ( HWND ) hb_parnll( 1 ) );
}
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Jimmy
Posts: 1733
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

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

Post by Jimmy »

hi Antonio,
Antonio Linares wrote:   

Code: Select all | Expand

hb_retl( LockWindowUpdate( ( HWND ) hb_parnll( 1 ) );
thx

typo, must be

Code: Select all | Expand

hb_retl( LockWindowUpdate( ( HWND ) hb_parnll( 1 ) )  ) ;
greeting,
Jimmy
User avatar
Antonio Linares
Site Admin
Posts: 42259
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

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

Post by Antonio Linares »

Dear Jimmy,

you are right

thanks!
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
karinha
Posts: 7885
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Contact:

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

Post by karinha »

Duda: para que sirve este comando LOCKWINDOWUPDATE() ?

Gracias.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
Jimmy
Posts: 1733
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

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

Post by Jimmy »

hi,

have a look at https://learn.microsoft.com/de-de/windo ... ndowupdate

i use it e,g, when "re-size" a Window and do NOT want "paint" until all is finish
greeting,
Jimmy
User avatar
Antonio Linares
Site Admin
Posts: 42259
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

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

Post by Antonio Linares »

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

HB_FUNC( LOCKWINDOWUPDATE )
{
   hb_retl( LockWindowUpdate( ( HWND ) hb_parnll( 1 ) ) );
}
regards, saludos

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

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

Post by Antonio Linares »

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

HB_FUNC( LOCKWINDOWUPDATE )
{
   if( ! LockWindowUpdate( ( HWND ) hb_parnll( 1 ) ) )
      LockWindowUpdate( ( HWND ) 0 );
}
https://learn.microsoft.com/en-us/windo ... ndowupdate
regards, saludos

Antonio Linares
www.fivetechsoft.com
xmanuel
Posts: 763
Joined: Sun Jun 15, 2008 7:47 pm
Location: Sevilla
Contact:

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

Post by xmanuel »

Antonio yo la dejaría como al principio pero usando hb_parptr:

Code: Select all | Expand

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
User avatar
Jimmy
Posts: 1733
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

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

Post by Jimmy »

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

%HBDIR%\bin\hbmk2 -find LOCKWINDOWUPDATE
but "no match" ... hm

---

in my FWH i have

Code: Select all | Expand

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
Antonio Linares
Site Admin
Posts: 42259
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

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

Post by Antonio Linares »

Dear Jimmy,

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

Code: Select all | Expand

HB_FUNC( LOCKWINDOWUPDATE )
{
   if( ! LockWindowUpdate( ( HWND ) hb_parnll( 1 ) ) )
      LockWindowUpdate( ( HWND ) 0 );
}
Your code could be changed this way:

Code: Select all | Expand

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
Post Reply