Dots disappear when drag and move control!

Post Reply
User avatar
vilian
Posts: 795
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil
Contact:

Dots disappear when drag and move control!

Post by vilian »

Antonio,

In FWH92 as the control drag and move, the rectangle would display the displacement disappears !

How to fix it?

Code: Select all

    @ 10,20 GET oGet VAR cVar PICTURE "@!" DESIGN SIZE 20,60 PIXEL OF oDlgEdit UPDATE
 
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Dots disappear when drag and move control!

Post by Antonio Linares »

Vilian,

This example works fine. Tested in Windows 7:

Code: Select all

#include "FiveWin.ch"  
 
function Main()        
 
   local oDlg
 
   DEFINE DIALOG oDlg TITLE "Test"        
 
   ACTIVATE DIALOG oDlg CENTERED ;
      ON INIT PlaceControls( oDlg ) 
 
return nil 

function PlaceControls( oDlg )

   local oGet, cVar := "Hello"        

   @ 20, 20 GET oGet VAR cVar PICTURE "@!" DESIGN SIZE 80, 25 PIXEL OF oDlg UPDATE 

return nil
 
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
vilian
Posts: 795
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil
Contact:

Re: Dots disappear when drag and move control!

Post by vilian »

Antonio,


Test with the example below. Move the control, you can see the problem.

Code: Select all

#include "FiveWin.ch"

static oWnd
function Main()
local oDlg

    DEFINE WINDOW oWnd      ;
      MDI                   ;

   ACTIVATE WINDOW oWnd MAXIMIZED;
            ON INIT ExibJanela()

RETURN NIL

FUNCTION EXIBJANELA()

   DEFINE DIALOG oDlg TITLE "Test" OF OWND

   ACTIVATE DIALOG oDlg CENTERED ;
      ON INIT (PlaceControls( oDlg ))

return nil

function PlaceControls( oDlg )

   local oGet, cVar := "Hello"

   @ 20, 20 GET oGet VAR cVar PICTURE "@!" DESIGN SIZE 80, 25 PIXEL OF oDlg UPDATE

return nil

 
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Dots disappear when drag and move control!

Post by Antonio Linares »

Vilian,

It seems as the problem is that the border is being painted on the container window:

Image

We need to review CtrlDrawFocus() source code.
regards, saludos

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

Re: Dots disappear when drag and move control!

Post by Antonio Linares »

Vilian,

Fixed. These new lines are required in FWH\source\winapi\ctrldraw.c

Code: Select all

   ...

   while( GetParent( hWndParent ) )
   {
      char ClassName[ 100 ];  // new !
      
      GetClassName( hWndParent, ClassName, 99 );  // new !
      
      if( strcmp( ClassName, "#32770" ) == 0 ) // a Modal Dialog     // new !
         break;    // new !
    
      hWndParent = GetParent( hWndParent );
      ...
 
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
vilian
Posts: 795
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil
Contact:

Re: Dots disappear when drag and move control!

Post by vilian »

Antonio,

don´t work !!!

Code: Select all

   while( GetParent( hWndParent ) )
   {
      char ClassName[ 100 ];  // new !

      GetClassName( hWndParent, ClassName, 99 );  // new !

      if( strcmp( ClassName, "#32770" ) == 0 ) // new !
         break;    // new !

      hWndParent = GetParent( hWndParent );

      if( ( GetWindowLong( hWndParent, GWL_STYLE ) & WS_CAPTION ) == WS_CAPTION )
         iParentsWithCaption++;
   }
 
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Dots disappear when drag and move control!

Post by Antonio Linares »

Vilian,

You can download your fixed EXE from here and check it for yourself:
http://www.mediafire.com/?sharekey=414c ... 0a1ae8665a

It works fine on Windows 7
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
vilian
Posts: 795
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil
Contact:

Re: Dots disappear when drag and move control!

Post by vilian »

Antonio,

You can send me your ctrldraw.c or. Obj?
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Dots disappear when drag and move control!

Post by Antonio Linares »

regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
vilian
Posts: 795
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil
Contact:

Re: Dots disappear when drag and move control!

Post by vilian »

Antonio,

Thanks, work´s fine.
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
Post Reply