Dialog refresh

Dialog refresh

Postby MarcoBoschi » Fri Dec 11, 2009 2: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?
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: Dialog refresh

Postby MarcoBoschi » Fri Dec 11, 2009 4: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
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: Dialog refresh

Postby James Bott » Fri Dec 11, 2009 5:25 pm

Marco,

Are you using the UPDATE clause on all the controls?

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Dialog refresh

Postby MarcoBoschi » Fri Dec 11, 2009 5:51 pm

No James
Thanks
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: Dialog refresh

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 42118
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Dialog refresh

Postby MarcoBoschi » Sat Dec 12, 2009 9: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
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: Dialog refresh

Postby Enrico Maria Giordano » 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: Select all  Expand view  RUN
#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
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Dialog refresh

Postby MarcoBoschi » Sun Dec 13, 2009 11:35 am

Perfect!

Thank you Enrico :-)
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: Dialog refresh

Postby Antonio Linares » Sun Dec 13, 2009 1:07 pm

Marco, Enrico,

Probably these lines are the culprit for such refresh, from FWH\source\classes\control.prg:
Code: Select all  Expand view  RUN

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

Re: Dialog refresh

Postby Enrico Maria Giordano » Sun Dec 13, 2009 1:09 pm

Can you recall me what the ALT problem was?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Dialog refresh

Postby Antonio Linares » Sun Dec 13, 2009 1: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42118
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Dialog refresh

Postby Enrico Maria Giordano » Sun Dec 13, 2009 1:11 pm

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

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Dialog refresh

Postby Enrico Maria Giordano » Sun Dec 13, 2009 1: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: Select all  Expand view  RUN
#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
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Dialog refresh

Postby MarcoBoschi » Sun Dec 13, 2009 2: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
// ::oWnd:Refresh()
return nResult

Thanks a lot and congratulations!
Marco
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 50 guests