FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index Bugs report & fixes / Informe de errores y arreglos Themed TGet on windows (fixed)
Posts: 116
Joined: Thu Oct 13, 2005 05:14 PM
Themed TGet on windows (fixed)
Posted: Mon Oct 31, 2005 09:58 AM

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

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Themed TGet on windows (fixed)
Posted: Mon Oct 31, 2005 03:39 PM

Roberto,

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

No luck yet :(

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 116
Joined: Thu Oct 13, 2005 05:14 PM
Themed TGet on windows (fixed)
Posted: Sat Nov 05, 2005 03:18 PM

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

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Themed TGet on windows (fixed)
Posted: Sat Nov 05, 2005 04:07 PM

Roberto,

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

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Themed TGet on windows (fixed)
Posted: Mon Nov 07, 2005 05:20 AM

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
Posts: 116
Joined: Thu Oct 13, 2005 05:14 PM
Themed TGet on windows (fixed)
Posted: Mon Nov 07, 2005 11:33 AM

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

Regards,
Roberto Parisi

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Themed TGet on windows (fixed)
Posted: Mon Nov 07, 2005 12:26 PM

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
Posts: 116
Joined: Thu Oct 13, 2005 05:14 PM
Themed TGet on windows (fixed)
Posted: Mon Nov 07, 2005 05:59 PM

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

Posts: 31
Joined: Sun Oct 09, 2005 08:29 PM
changes
Posted: Mon Dec 05, 2005 10:41 AM
Antonio,
I don't understand what are the fixes I need in classes/tget.prg.
WS_Border appears in the lines:
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
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Themed TGet on windows (fixed)
Posted: Mon Dec 05, 2005 12:06 PM

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
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Themed TGet on windows (fixed)
Posted: Tue Dec 06, 2005 09:29 AM
This fix for Class TGet Method New(...) seems to be a better one:

   ...

   ::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
Posts: 31
Joined: Sun Oct 09, 2005 08:29 PM
a clear patch!
Posted: Wed Dec 07, 2005 05:26 PM

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
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Themed TGet on windows (fixed)
Posted: Wed Dec 07, 2005 06:48 PM

Riccardo,

I email you the files.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 13
Joined: Wed Dec 07, 2005 05:54 PM
Themed TGet on windows (fixed)
Posted: Tue Dec 13, 2005 02:46 PM

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

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Themed TGet on windows (fixed)
Posted: Wed Dec 14, 2005 07:56 AM

Riccardo,

Already sent.

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion