Page 1 of 2

FWH 8.11 bKeyDown fails

Posted: Mon Dec 01, 2008 9:30 pm
by Horizon
Hi,

I use bKeydown like below in xBrowse for selecting row with Enter key.

Code: Select all

   oBrw:bKeyDown = { | nKey, nFlags | If( nKey == VK_RETURN, GO_DETAY(uData,oBrw,aOptions),) } 

It works in FWH 8.10 but it gives an error in FWH 8.11.

Code: Select all

Application 
=========== 
   Path and name: D:\PRG\DAVAW\DAVAW.exe (32 bits) 
   Size: 3,085,312 bytes 
   Time from start: 0 hours 0 mins 5 secs 
   Error occurred at: 01/12/2008, 23:21:03 
   Error description: Error BASE/1004  Class: 'NIL' has no exported method: OTREE 
   Args: 
     [   1] = U    

Stack Calls 
=========== 
   Called from:  => OTREE(0) 
   Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:KEYCHAR(0) 
   Called from:  => TWINDOW:HANDLEEVENT(0) 
   Called from: .\source\classes\CONTROL.PRG => TXBROWSE:HANDLEEVENT(0) 
   Called from: .\source\classes\WINDOW.PRG => _FWH(0) 
   Called from:  => DIALOGBOXINDIRECT(0) 
   Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE(0) 
   Called from: wLib_1.PRG => DETAY(622) 
   Called from: wLib_1.PRG => GO_DETAY(227) 
   Called from: wLib_1.PRG => (b)WYK_LIST(120) 
   Called from: .\source\classes\WINDOW.PRG => TWINDOW:KEYDOWN(0) 
   Called from: .\source\classes\CONTROL.PRG => TCONTROL:KEYDOWN(0) 
   Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:KEYDOWN(0) 
   Called from:  => TWINDOW:HANDLEEVENT(0) 
   Called from: .\source\classes\CONTROL.PRG => TXBROWSE:HANDLEEVENT(0) 
   Called from: .\source\classes\WINDOW.PRG => _FWH(0) 
   Called from:  => DIALOGBOXINDIRECT(0) 
   Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE(0) 
   Called from: wLib_1.PRG => WYK_LIST(200) 
How Can I solve this problem?

Thanks,

Posted: Mon Dec 01, 2008 10:20 pm
by Daniel Garcia-Gil
do you use enter key into browse with a tree??

if you answer = yes

check this post
http://forums.fivetechsoft.com/viewtopic.php?t=13788

Posted: Mon Dec 01, 2008 10:36 pm
by Horizon
Hi mcfox,

I don't use Tree in xBrowse. My answer is no.

Thanks,

Posted: Mon Dec 01, 2008 10:43 pm
by Daniel Garcia-Gil
well.... is good reason to see this post... review and make the change maybe solve you problem

http://forums.fivetechsoft.com/viewtopic.php?t=13788

Posted: Mon Dec 01, 2008 11:01 pm
by Horizon
Hi mcfox,

I have changed the xbrowse code in thread you mentioned. Firstly, I could not understand the subject because of language of this thread, but when i look the code this is the solution of my problem.

Thanks,

Antonio: I could not build the xhb fwh class library. Can you please regenerate the fwh 8.11 again with these changes:

1) xbrowse otreeitem changes.
http://forums.fivetechsoft.com/viewtopic.php?t=13788

2) folder transparent changes.
http://forums.fivetechsoft.com/viewtopic.php?t=13778

Posted: Tue Dec 02, 2008 10:07 am
by Antonio Linares
Hakan,

>
2) folder transparent changes.
http://forums.fivetechsoft.com/viewtopic.php?t=13778
>

What changes are those ? I don't see them. Thanks,

Posted: Tue Dec 02, 2008 10:36 am
by Horizon
Sorry Antonio,

I mentioned the Ramesh thread but I did not post the changes in TFolder class.

Ramesh thread http://forums.fivetechsoft.com/viewtopic.php?t=4807

TFolder changes:

In Default Method()

Code: Select all

      #ifndef __CLIPPER__
         if ::lTransparent
			      SetBkMode( hDC, 1 ) // TRANSPARENT
			      if IsAppThemed()
			         if ! Empty( ::oBrush:hBitmap )
			            SetBrushOrgEx( hDC, nBmpWidth( ::oBrush:hBitmap ) - ::nLeft, nBmpHeight( ::oBrush:hBitmap ) - ::nTop )
			            FillRect( hDC, GetClientRect( ::hWnd ), ::oBrush:hBrush )
			         else            //  This condition is added by RAMESH BABU P on Nov. 06, 2006
			            if Upper( ::ClassName() ) $ "TCHECKBOX;TRADIO;TGROUP"
			               // DrawPBack( ::hWnd,  hDC )
			               ParentImage( ::hWnd, hDC )
			               SendMessage( ::oWnd:hWnd, WM_ERASEBKGND, hDC, 0 ) // to properly remove/set the dotted rect
			            endif
			         endif
			      endif
			   else
			      if IsAppThemed() .and. Upper( ::ClassName() ) $ "TCHECKBOX;TRADIO"
			         DrawPBack( ::hWnd,  hDC )
			      endif
			   endif


      #endif

Instead of

Code: Select all

      #ifndef __CLIPPER__
          if IsAppThemed()
            if Empty( oDlg:oBrush:hBitmap )
               oDlg:bEraseBkGnd = { | hDC | DrawPBack( oDlg:hWnd, hDC ), 1 }
            endif
         endif
      #endif
I just need one more changes if it is possible. One of my previous thread is about TFont class. http://forums.fivetechsoft.com/viewtopic.php?t=12805
Because of my national language I have to set default nCharSet to 1 in METHOD new(). But I also update it every FWH new version if I didn't forget. If it is possible Can it be like that:

In My application start with

Code: Select all

#define Default_nCharSet 1
In TFont Class, METHOD new()

Code: Select all

#ifdef Default_nCharSet
DEFAULT nCharSet := Default_nCharSet
#endif
   DEFAULT cFaceName := "SYSTEM_FONT", nEscapement := 0, nOrientation := 0, nWeight := 0,;
           nHeight := 14, lItalic := .f., lFromUser := .f., lUnderLine := .f.,;
           lStrikeOut := .f., nCharSet := 0, nOutPrecision := 0,;
           nClipPrecision := 0, nQuality := 0, lBold := .f., nWidth := 0,;
           nPitchFamily := 0, ::nCount := 0, ::lDestroy := .t., aFonts := {}

Posted: Tue Dec 02, 2008 10:51 am
by Antonio Linares
Hakan,

These lines will never be executed (unless I am missing something) as Self will always be a TFolder (or inherited from it):

Code: Select all

                     if Upper( ::ClassName() ) $ "TCHECKBOX;TRADIO;TGROUP" 
                        // DrawPBack( ::hWnd,  hDC ) 
                        ParentImage( ::hWnd, hDC ) 
                        SendMessage( ::oWnd:hWnd, WM_ERASEBKGND, hDC, 0 ) // to properly remove/set the dotted rect 
                     endif 
...
               if IsAppThemed() .and. Upper( ::ClassName() ) $ "TCHECKBOX;TRADIO" 
                  DrawPBack( ::hWnd,  hDC ) 
               endif 

Posted: Tue Dec 02, 2008 11:22 am
by Horizon
Hi Antonio,

As I said these lines are not mine. I use SetColor method in dialog. Without these lines transparent does not works.

I have captured one of my form with changes and without changes below.

with changes:
Image

without (means i deleted changed Tfolder.prg from my make list. use standart library.)
Image

The code is the same.

Posted: Tue Dec 02, 2008 1:09 pm
by Antonio Linares
Hakan,

Could you please provide the source code that you are using for your folder ? Just the portion where you set the colors, thanks

Posted: Tue Dec 02, 2008 2:19 pm
by Horizon
Hi Antonio,

I'll try to prepare a working sample as soon as possible.

Posted: Tue Dec 02, 2008 2:29 pm
by Rick Lipkin
To All

I would be MOST interested in a way to turn a folder ( tab ) a specific color based on some data value in a specific folder ..

Rick Lipkin

Posted: Tue Dec 02, 2008 3:31 pm
by Horizon
Hi Antonio,

>>These lines will never be executed (unless I am missing something) as Self will always be a TFolder (or inherited from it):

Absolutely, You are right. I back to original code. I have changed one character and result is OK.

Code: Select all

         if IsAppThemed()
            if Empty( oDlg:oBrush:hBitmap )
               oDlg:bEraseBkGnd = { | hDC | DrawPBack( oDlg:hWnd, hDC ), 1 }
            endif
         endif
I have changed only this line. :))

Code: Select all

            if !Empty( oDlg:oBrush:hBitmap )
This is also my working example.

Code: Select all

#include "FiveWin.ch" 

function Main() 
LOCAL oGet1, oGet2, oGet3, oGet4, oGet5, obtnCancel
LOCAL oFnt, oFnt2, oDlg, oFld, oGrp, oGrp1 
LOCAL xVekNo := 11, xREFNO := SPACE(15), xNOTER := SPACE(20)
    
  DEFINE FONT oFnt NAME "Verdana" SIZE 0, -16 BOLD 
	DEFINE FONT oFnt1 NAME "Verdana" SIZE 0, -12

   DEFINE DIALOG oDlg SIZE 620, 294 FONT oFnt1 TRANSPARENT ;
   		STYLE nOr( WS_OVERLAPPEDWINDOW ) //COLOR CLR_BLACK,RGB(196,244,244)
		oDlg:SetColor(,9425383)
   
  @ 2, 3 FOLDER oFld OF oDlg SIZE 100, 100 PIXEL ; 
      PROMPTS "Page 1", "Page 2", "Page 3","Page 4","Page 5","Page 6" 

  @ 2, 3 GROUP oGrp TO 150, 150 PROMPT " Group Text " OF oFld:aDialogs[ 1 ] PIXEL TRANSPARENT;
  	FONT oFnt

	@ 15,10 SAY oSay PROMPT "No" OF oFld:aDialogs[1] PIXEL
	@ 13,68 GET oGet1 VAR xVEKNO OF oFld:aDialogs[1] PIXEL RIGHT PICT "@Z 9999999"

	@ 15,160 SAY oSay PROMPT "Referans No" OF oFld:aDialogs[1] PIXEL
	@ 13,218 GET oGet5 VAR xREFNO OF oFld:aDialogs[1] PIXEL SIZE 60,12

	@ 28,10 SAY "Remarks" OF oFld:aDialogs[1] PIXEL
	@ 26,68 GET oGet2 VAR xNOTER OF oFld:aDialogs[1] PIXEL SIZE 80,12 

	@ 100,10 BUTTON obtnCancel PROMPT "&Cancel" OF oDlg PIXEL SIZE 50,13 ;
		ACTION oDlg:End()

  oDlg:bResized := {|| ONINIT_VEKALET(oDlg, oFld, oGrp, obtnCancel) }
	ACTIVATE DIALOG oDlg CENTERED ON INIT ONINIT_VEKALET(oDlg, oFld, oGrp, obtnCancel)
	
	oFnt:End()
	oFnt1:End()

return nil 

PROCEDURE ONINIT_VEKALET(oDlg, oFld, oGrp, obtnCancel)
LOCAL i
	oFld:nHeight := oDlg:nHeight-80
	oFld:nWidth := oDlg:nWidth-29
	FOR i:=1 TO LEN(oFld:aDialogs)
  oFld:aDialogs[i]:SetColor(, oDlg:nClrPane)
  Next
  oFld:Refresh()
  
  oGrp:nHeight := oFld:nHeight-35
  oGrp:nWidth  := oFld:nWidth-17
  
  obtnCancel:nTop := oDlg:nHeight-70
	obtnCancel:nLeft := oDlg:nWidth-125

return
.rc file:

Code: Select all

1 24 "WindowsXP.Manifest"
I think you can test with it.

Rick : I also agreed with you. But I could not. There may be some restrictions on Tabs.

Posted: Wed Dec 03, 2008 9:10 am
by Antonio Linares
Hakan,

This example is working fine here without any changes. Could you please try it ? thanks,

Code: Select all

#include "FiveWin.ch" 

function Main() 

   local oDlg, oFld 
    
   DEFINE DIALOG oDlg SIZE 400, 300 COLOR "W/B" TRANSPARENT

   @ 0.5, 1 FOLDER oFld OF oDlg SIZE 188, 138 ; 
      PROMPTS "One", "Two", "Three" 
      
   ACTIVATE DIALOG oDlg CENTERED 

return nil

Posted: Wed Dec 03, 2008 9:42 am
by Horizon
Hi Antonio,

There isn't any problem without Manifest. If you use it
"WindowsXP.Manifest", you will see the problem.