Moving the dialog

Moving the dialog

Postby Natter » Sat Oct 21, 2023 6:40 pm

Hi,

If, when moving the dialog with the mouse, part of this dialog turned out to be a screen,
then returning the dialog to the screen will be associated with significant delays (depending on the number of controls on the dialog).
I understand that this is due to the constant call of the Refresh() method.
How do I make the Refresh() method work only when the left mouse button is not pressed ?
Natter
 
Posts: 1222
Joined: Mon May 14, 2007 9:49 am

Re: Moving the dialog

Postby Antonio Linares » Sat Oct 21, 2023 9:21 pm

How many controls do you use in the dialog ?
regards, saludos

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

Re: Moving the dialog

Postby Natter » Sun Oct 22, 2023 8:10 am

For example, there is a main window (full screen). I open a TDialog (about 90% of the area of the main window).
xBrowse is located on this TDialog (about 90% of the TDialog area).
Natter
 
Posts: 1222
Joined: Mon May 14, 2007 9:49 am

Re: Moving the dialog

Postby Antonio Linares » Sun Oct 22, 2023 1:48 pm

that should not slow down the painting...

Is the xbrowse very complex ? I mean the data you show, calculations, etc
regards, saludos

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

Re: Moving the dialog

Postby Natter » Sun Oct 22, 2023 4:28 pm

No, xBrowser is simple - array, 10000 rows, 20 columns (if the xBrowser is small, everything is fine)
Natter
 
Posts: 1222
Joined: Mon May 14, 2007 9:49 am

Re: Moving the dialog

Postby Antonio Linares » Sun Oct 22, 2023 7:16 pm

> if the xBrowser is small, everything is fine

what do you mean with "small" ?
regards, saludos

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

Re: Moving the dialog

Postby Natter » Mon Oct 23, 2023 12:26 pm

1. How can I find out that part of the window is shifted behind the screen ?
2. How can I find out that the window update is caused by moving it to the screen ?
Natter
 
Posts: 1222
Joined: Mon May 14, 2007 9:49 am

Re: Moving the dialog

Postby Antonio Linares » Mon Oct 23, 2023 12:56 pm

Dear Yuri,

when a window, dialog or control is painted, FWH evals oWnd:bPainted if defined from METHOD Paint() CLASS TWindow
Code: Select all  Expand view  RUN
     if ValType( ::bPainted ) == "B"
         uVal = Eval( ::bPainted, ::hDC, ::cPS, Self )
      endif

::cPS is initialized from METHOD _BeginPaint() and contains a PAINTSTRUCT:
https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-paintstruct

in such structure you have the area which is going to be updated
regards, saludos

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

Re: Moving the dialog

Postby Natter » Mon Oct 23, 2023 1:24 pm

Thank you, Antonio! I'll try to figure it out. It was the code block :bPainted that caused delays when
pulling the window out from behind the screen. I needed an understanding of when to execute this block of code and when not to
Natter
 
Posts: 1222
Joined: Mon May 14, 2007 9:49 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 87 guests