FWH 8.11 bKeyDown fails

FWH 8.11 bKeyDown fails

Postby Horizon » Mon Dec 01, 2008 9:30 pm

Hi,

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

Code: Select all  Expand view
   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  Expand view
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,
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1288
Joined: Fri May 23, 2008 1:33 pm

Postby Daniel Garcia-Gil » Mon Dec 01, 2008 10:20 pm

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
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Postby Horizon » Mon Dec 01, 2008 10:36 pm

Hi mcfox,

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

Thanks,
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1288
Joined: Fri May 23, 2008 1:33 pm

Postby Daniel Garcia-Gil » Mon Dec 01, 2008 10:43 pm

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
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Postby Horizon » Mon Dec 01, 2008 11:01 pm

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
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1288
Joined: Fri May 23, 2008 1:33 pm

Postby Antonio Linares » Tue Dec 02, 2008 10:07 am

Hakan,

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

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

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

Postby Horizon » Tue Dec 02, 2008 10:36 am

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  Expand view
      #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  Expand view
      #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  Expand view
#define Default_nCharSet 1


In TFont Class, METHOD new()
Code: Select all  Expand view
#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 := {}
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1288
Joined: Fri May 23, 2008 1:33 pm

Postby Antonio Linares » Tue Dec 02, 2008 10:51 am

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  Expand view
                     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
regards, saludos

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

Postby Horizon » Tue Dec 02, 2008 11:22 am

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.
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1288
Joined: Fri May 23, 2008 1:33 pm

Postby Antonio Linares » Tue Dec 02, 2008 1:09 pm

Hakan,

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

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

Postby Horizon » Tue Dec 02, 2008 2:19 pm

Hi Antonio,

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

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1288
Joined: Fri May 23, 2008 1:33 pm

Postby Rick Lipkin » Tue Dec 02, 2008 2:29 pm

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
User avatar
Rick Lipkin
 
Posts: 2629
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Postby Horizon » Tue Dec 02, 2008 3:31 pm

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  Expand view
         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  Expand view
            if !Empty( oDlg:oBrush:hBitmap )


This is also my working example.
Code: Select all  Expand view
#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  Expand view
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.
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1288
Joined: Fri May 23, 2008 1:33 pm

Postby Antonio Linares » Wed Dec 03, 2008 9:10 am

Hakan,

This example is working fine here without any changes. Could you please try it ? thanks,
Code: Select all  Expand view
#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
regards, saludos

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

Postby Horizon » Wed Dec 03, 2008 9:42 am

Hi Antonio,

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

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1288
Joined: Fri May 23, 2008 1:33 pm

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 21 guests