Themed TGet on windows (fixed)

Post Reply
Roberto Parisi
Posts: 116
Joined: Thu Oct 13, 2005 5:14 pm
Location: Italy

Themed TGet on windows (fixed)

Post by Roberto Parisi »

I can't obtain themed edit box on windows.

See the code below:

#include "fivewin.ch"

procedure main()
local oDlg, cText := Space(30)
define window oDlg title "Test" from 10,10 to 300,300 pixel
@1,1 get cText of oDlg size 200,20
activate window oDlg
return

The edit box has a black border instead the theme blue border.

It only happens with window, if I change the "define/activate window" with "define/activate dialog" it looks fine.

Antonio, I post this problem the first time in July 2004, please make my app full xp themed :)

Regards,
Roberto Parisi
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Roberto,

We have been today more than one hour trying to fix it.

No luck yet :(
regards, saludos

Antonio Linares
www.fivetechsoft.com
Roberto Parisi
Posts: 116
Joined: Thu Oct 13, 2005 5:14 pm
Location: Italy

Post by Roberto Parisi »

Thx Antonio,

I tried it by myself with no luck after 4 hours. :( (I'm curious how XChangeProc works)

Now I'm trying with non client area painting. I hope to find a trick for this problem.

Regards,
Roberto Parisi
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Roberto,

We keep trying it here, so hopefully we may find a solution for it.
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:

Post by Antonio Linares »

Roberto,

Its fixed! :) Thanks to Master Hernan Diego!

Just changes these lines,

winapi\mgetcrea.c:

#ifndef UNICODE
_retnl( ( LONG ) CreateWindowEx( WS_EX_CLIENTEDGE,
_parc( 1 ), ...

classes\tget.prg:

remove WS_BORDER style.
regards, saludos

Antonio Linares
www.fivetechsoft.com
Roberto Parisi
Posts: 116
Joined: Thu Oct 13, 2005 5:14 pm
Location: Italy

Post by Roberto Parisi »

Thx Antonio but with your changes the result is an editbox without border!

Regards,
Roberto Parisi
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Roberto,

You may not have properly modified winapi\mgetcrea.c. Or maybe did not linked in properly or replaced it in the lib.

Please check it. Its working fine and confirmed by some users.
regards, saludos

Antonio Linares
www.fivetechsoft.com
Roberto Parisi
Posts: 116
Joined: Thu Oct 13, 2005 5:14 pm
Location: Italy

Post by Roberto Parisi »

Ok, it works. CLIPPER declaration in my mgetcreate.c was dropping the underscore, with HB_FUNC it works.

Many thx to you and Herman Diego

Roberto Parisi
User avatar
Maverich
Posts: 31
Joined: Sun Oct 09, 2005 8:29 pm
Location: Prato, Italia

changes

Post by Maverich »

Antonio,
I don't understand what are the fixes I need in classes/tget.prg.
WS_Border appears in the lines:

Code: Select all

WS_Border appears in the lines:

   ::nStyle    = nOR( WS_CHILD, WS_VISIBLE,;
                      ES_AUTOHSCROLL, WS_BORDER,;
                      If( ! lReadOnly, WS_TABSTOP, 0 ),;
                      If( lDesign, WS_CLIPSIBLINGS, 0 ),;
                      If( lSpinner, WS_VSCROLL, 0 ),;
                      If( lReadOnly, ES_READONLY, 0 ),;
                      If( lCenter, ES_CENTER, If( lRight, ES_RIGHT, ES_LEFT ) ) )
//                      If( lCenter .OR. lRight, ES_MULTILINE, 0 ),; Only needed for Win31

   ::nStyle    = If( lNoBorder, nAnd( ::nStyle, nNot( WS_BORDER ) ), ::nStyle )
thanks
Riccardo
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Riccardo,

WS_BORDER has to be removed and in source\winapi\mgetcrea.c:

BOOL lIsAppThemed = FALSE;

...

BOOL _IsAppThemed( void );

lIsAppThemed = _IsAppThemed();

_retnl( ( LONG ) CreateWindowEx( lIsAppThemed ? WS_EX_CLIENTEDGE: 0,
...
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:

Post by Antonio Linares »

This fix for Class TGet Method New(...) seems to be a better one:

Code: Select all

   ...

   ::nStyle    = nOR( WS_CHILD, WS_VISIBLE,;
                      ES_AUTOHSCROLL,;
                      If( ! lReadOnly, WS_TABSTOP, 0 ),;
                      If( lDesign, WS_CLIPSIBLINGS, 0 ),;
                      If( lSpinner, WS_VSCROLL, 0 ),;
                      If( lReadOnly, ES_READONLY, 0 ),;
                      If( lCenter, ES_CENTER, If( lRight, ES_RIGHT, ES_LEFT ) ) )

   #ifdef __CLIPPER__
      if ! lNoBorder
         ::nStyle = nOr( ::nStyle, WS_BORDER )
      endif   
   #else
      if ! IsAppThemed()
         ::nStyle = nOr( ::nStyle, WS_BORDER )
      else
         ::nStyle = nOr( ::nStyle, If( oWnd:ChildLevel( TDialog() ) != 0, WS_BORDER, 0 ) )
      endif      
   #endif   

regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Maverich
Posts: 31
Joined: Sun Oct 09, 2005 8:29 pm
Location: Prato, Italia

a clear patch!

Post by Maverich »

Sorry Antonio, I continue not to understand.
In your Nov,7 message you said to update winapi\mgetcrea.c and classes\tget.prg.
Now you add another correction to mgetcrea.c and another to tget.prg.
How is the definitive patch?
could you please send me the 2 files by email?

regards
Riccardo
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Riccardo,

I email you the files.
regards, saludos

Antonio Linares
www.fivetechsoft.com
Riccardo
Posts: 13
Joined: Wed Dec 07, 2005 5:54 pm

Post by Riccardo »

Antonio,
please could you also send them to me?
Or, how is possible to have the patch of the FWH 2.7?

Thank you
Riccardo
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Riccardo,

Already sent.
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply