FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Dialog refresh
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Dialog refresh
Posted: Fri Dec 11, 2009 02:53 PM

I have a doubt but I am not able to create a minimal example to show you.

In a dialog containing several fields: gets, button, radio, one tree and images If I press TAB key
more times happens that dialog refreshes...ONCE!
Only once until I close dialog and re-open again.
This always happens on the same object.

In old compiled versions (2006) of the same project this problem does not exist

Any idea?

Marco Boschi
info@marcoboschi.it
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: Dialog refresh
Posted: Fri Dec 11, 2009 04:10 PM
I've just tried another recompiled application.
I've found the same problem:
- old version works fine
- new one has this fastidious problem.

more items = more evidence ==>>
It seems to be a problem in correlation with system resources
Pressing TAB I have got a refresh always in the same object.
It depends on the application and its dialog
Marco Boschi
info@marcoboschi.it
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Dialog refresh
Posted: Fri Dec 11, 2009 05:25 PM

Marco,

Are you using the UPDATE clause on all the controls?

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: Dialog refresh
Posted: Fri Dec 11, 2009 05:51 PM

No James
Thanks

Marco Boschi
info@marcoboschi.it
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Dialog refresh
Posted: Fri Dec 11, 2009 10:53 PM

Marco,

What control is repainted ? Has that control a WHEN clause ?

All of them ? What controls do you have on your dialog ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: Dialog refresh
Posted: Sat Dec 12, 2009 09:48 AM

Antonio & James,
my intention is to prepare two minimal sample this w.e.
- the first one with resource
- the second one without resource
Probably this problem is more evident with many objects

However, here from my tests:
- all controls are refresh
- for instance if I put Skinbuttons() clause this refresh is in another moment
- my three tested application compiled with an older fwh version (dated 20090716) does not present this problem
-this refresh appears only once, if I close dialog and reopen presents the same problem, only Once

Have a nice we
marco

Marco Boschi
info@marcoboschi.it
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: Dialog refresh
Posted: Sun Dec 13, 2009 11:25 AM
This is a sample of the problem. Just click on the windows and then press TAB on the dialog. You should see a refresh:

Code (fw): Select all Collapse
#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oWnd

    DEFINE WINDOW oWnd

    ACTIVATE WINDOW oWnd;
             ON CLICK TEST()

    RETURN NIL


STATIC FUNCTION TEST()

    LOCAL oDlg

    LOCAL cVar := SPACE( 10 )

    LOCAL i

    DEFINE DIALOG oDlg;
           SIZE 900, 600;
           TITLE "Test"

    FOR i = 0 TO 59
        @ i % 20 * 15, 150 * INT( i / 20 ) GET cVar PIXEL
        @ i % 20 * 15, 150 * INT( i / 20 ) + 50 BUTTON "Test" + LTRIM( STR( i ) ) PIXEL
        @ i % 20 * 15, 150 * INT( i / 20 ) + 100 IMAGE SIZE 30, 10 PIXEL
    NEXT

    oDlg:bStart = { || oDlg:aControls[ 2 ]:SetFocus() }

    ACTIVATE DIALOG oDlg;
             CENTER

    RETURN NIL


EMG
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: Dialog refresh
Posted: Sun Dec 13, 2009 11:35 AM

Perfect!

Thank you Enrico :-)

Marco Boschi
info@marcoboschi.it
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Dialog refresh
Posted: Sun Dec 13, 2009 01:07 PM
Marco, Enrico,

Probably these lines are the culprit for such refresh, from FWH\source\classes\control.prg:
Code (fw): Select all Collapse
      case nMsg == WM_UPDATEUISTATE  // buttons, radios and checkboxes were erased when pressing ALT
           nResult = Super:HandleEvent( nMsg, nWParam, nLParam )
           if Upper( ::ClassName() ) == "TBTNBMP"
              ::Refresh()
           endif   
           ::oWnd:Refresh()  // This one !!!
           return nResult

You can comment that line to solve it, but then we get the ALT problem back again
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: Dialog refresh
Posted: Sun Dec 13, 2009 01:09 PM

Can you recall me what the ALT problem was?

EMG

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Dialog refresh
Posted: Sun Dec 13, 2009 01:10 PM
Enrico,

It is commented in the code:
buttons, radios and checkboxes were erased when pressing ALT
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: Dialog refresh
Posted: Sun Dec 13, 2009 01:11 PM

Ok, I'm going to examine the problem...

EMG

Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: Dialog refresh
Posted: Sun Dec 13, 2009 01:50 PM
I just tried to remove WM_UPDATEUISTATE handling and found that the sample I already provided at that time works just fine now:

Code (fw): Select all Collapse
#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oWnd

    DEFINE WINDOW oWnd

    DEFINE BUTTONBAR OF oWnd 2007

    DEFINE BUTTON;
           OF oWnd:oBar;
           FILE "C:\FWH\BITMAPS\OPEN.BMP";
           ACTION MYDIALOG()

    ACTIVATE WINDOW oWnd

    RETURN NIL


STATIC FUNCTION MYDIALOG()

    LOCAL oDlg

    DEFINE DIALOG oDlg

    ACTIVATE DIALOG oDlg;
             ON INIT TOOLBAR( oDlg );
             CENTER

    RETURN NIL


STATIC FUNCTION TOOLBAR( oDlg )

    DEFINE BUTTONBAR OF oDlg 2007

    DEFINE BUTTON;
           OF oDlg:oBar;
           FILE "C:\FWH\BITMAPS\CLOSE.BMP";
           ACTION oDlg:End()

    RETURN NIL


Maybe something is changed elsewhere that solved the problem. Can you try to replicate the bitmap vanishing problem with different samples or other kind of problem with different controls (that I never faced)?

EMG
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: Dialog refresh
Posted: Sun Dec 13, 2009 02:27 PM
Antonio, Enrico,

by first testing the problem seems to be solved

case nMsg == WM_UPDATEUISTATE // buttons, radios and checkboxes were erased when pressing ALT
nResult = Super:HandleEvent( nMsg, nWParam, nLParam )
if Upper( ::ClassName() ) == "TBTNBMP"
::Refresh()
endif
// ::Refresh()
return nResult

Thanks a lot and congratulations!
Marco
Marco Boschi
info@marcoboschi.it

Continue the discussion