Page 1 of 1

Themed TGet on windows (fixed)

Posted: Mon Oct 31, 2005 9:58 am
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

Posted: Mon Oct 31, 2005 3:39 pm
by Antonio Linares
Roberto,

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

No luck yet :(

Posted: Sat Nov 05, 2005 3:18 pm
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

Posted: Sat Nov 05, 2005 4:07 pm
by Antonio Linares
Roberto,

We keep trying it here, so hopefully we may find a solution for it.

Posted: Mon Nov 07, 2005 5:20 am
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.

Posted: Mon Nov 07, 2005 11:33 am
by Roberto Parisi
Thx Antonio but with your changes the result is an editbox without border!

Regards,
Roberto Parisi

Posted: Mon Nov 07, 2005 12:26 pm
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.

Posted: Mon Nov 07, 2005 5:59 pm
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

changes

Posted: Mon Dec 05, 2005 10:41 am
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

Posted: Mon Dec 05, 2005 12:06 pm
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,
...

Posted: Tue Dec 06, 2005 9:29 am
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   


a clear patch!

Posted: Wed Dec 07, 2005 5:26 pm
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

Posted: Wed Dec 07, 2005 6:48 pm
by Antonio Linares
Riccardo,

I email you the files.

Posted: Tue Dec 13, 2005 2:46 pm
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

Posted: Wed Dec 14, 2005 7:56 am
by Antonio Linares
Riccardo,

Already sent.