No Clear method when pressing "." in a listbox cel

Post Reply
angelo.c
Posts: 36
Joined: Thu Mar 30, 2006 11:19 am

No Clear method when pressing "." in a listbox cel

Post by angelo.c »

Hello everyone,

I have just upgraded from "FiveWin++ 1.82 - February 2004" to FW++ 7.01 and upgraded Alaska XBase++ Intl V1.81 to Intl V1.90.331. I use BorlandC Resource Compiler brcc32 V5.02 to manage my resources.

When I edit a numeric field in a Browse list box using Cell Edit,I get the following error when I press "." decimal point.



------------------------------------------------------------------------------
ERROR LOG of "D:\ac\fivedb_ac_ph\test_src\gettst1.exe" Date: 03/23/2007 15:09:31

Xbase++ version : Xbase++ (R) Version 1.90.331
Operating system : Windows XP 05.01 Build 02600 Service Pack 2
------------------------------------------------------------------------------
oError:args :
-> VALTYPE: O CLASS: TClipGet
oError:canDefault : N
oError:canRetry : N
oError:canSubstitute: Y
oError:cargo : NIL
oError:description : Object has no method with this name
oError:filename :
oError:genCode : 23
oError:operation : Clear
oError:osCode : 0
oError:severity : 2
oError:subCode : 2220
oError:subSystem : BASE
oError:thread : 1
oError:tries : 0
------------------------------------------------------------------------------
CALLSTACK:
------------------------------------------------------------------------------
Called from TGET:KEYCHAR(916)
Called from TWINDOW:HANDLEEVEN(3000)
Called from TCONTROL:HANDLEEVEN(1360)
Called from TGET:HANDLEEVEN(478)
Called from _XBPP(3164)
Called from TDIALOG:ACTIVATE(279)
Called from TWBROWSE:LEDITCOL(807)
Called from COLVARCHG(63)
Called from (B)SHOW_LIST(37)
Called from TWINDOW:LDBLCLICK(1753)
Called from TWBROWSE:LDBLCLICK(1039)
Called from TWINDOW:HANDLEEVEN(3063)
Called from TCONTROL:HANDLEEVEN(1360)
Called from _XBPP(3164)
Called from TDIALOG:ACTIVATE(279)
Called from SHOW_LIST(43)
Called from (B)MAIN(14)
Called from TWINDOW:ACTIVATE(876)
Called from MAIN(14)

The source code for gettst1.prg follows:
//GET testing in 32 bit mode using resource redefine....

#include "FiveWin.ch"
#define COST_LBX 1000
#define COSTINVT_ACCEPT 1001
static oWin

//----------------------------------------------------------------------------//
function Main()

DEFINE WINDOW oWin FROM 7,5 to 15,63 TITLE "Test Cell Edit in Browse Listbox"
ACTIVATE WINDOW oWin ON INIT Show_List()
return nil
//----------------------------------------------------------------------------//

procedure Show_List()
local oDlg2, oLbx
local aItems

aItems := { {"AA100", 20, 30},{"AA110", 20, 30},{"BA150", 20.5, 30.5},{"CD200", 25.1, 30.5}}

DEFINE DIALOG oDlg2 RESOURCE "BrwseCostInvt" of oWin

REDEFINE LISTBOX oLbx FIELDS aItems[oLbx:nAt,1], str(aItems[oLbx:nAt,2]), str(aItems[oLbx:nAt,3]), "" ;
ID COST_LBX ON DBLCLICK oDlg2:End() HEADER "Prod Code", "%Cost", "Sel Price", "" ;
FIELDSIZES 80, 60, 60, 0 of oDlg2

oLbx:SetArray(aItems)

// This enables the Cell navigation style for the browse
oLbx:lCellStyle := .T.

// To perform and edit Cell operation using left double click
oLbx:bLDBLclick := { |nRow, nCol, nKeyFlags| ;
ColVarChg(@oLbx, @aItems), oLbx:Refresh()}


REDEFINE BUTTON ID COSTINVT_ACCEPT OF oDlg2;
ACTION (oDlg2:end())

ACTIVATE DIALOG oDlg2

return

//----------------------------------------------------------------------------//

procedure ColVarChg(oLbx, aItems)
local lColNumber, lRowNumber, lVarToEdit

lColNumber := oLbx:nColAct // Get actual Column in focus
lRowNumber := oLbx:nAt // Get actual Row in focus
DO CASE // Check which column edit is to be performed
CASE lColNumber == 1 // Column 1 is a string Prod ID value
// Make a temporary String copy of selected string field.
lVarToEdit := Eval(olbx:bLine)[lColNumber]
oLbx:lEditCol(lColNumber, @lVarToEdit, Replicate("X",10), NIL, CLR_YELLOW, CLR_BLUE)

CASE (lColNumber == 2) .OR. (lColNumber == 3) // Edit Numeric Fields
// Make a temporary NUMERIC copy of selected numeric field.
lVarToEdit := VAL(Eval(olbx:bLine)[lColNumber])
oLbx:lEditCol(lColNumber, @lVarToEdit, replicate("9",5)+".99", NIL, CLR_YELLOW, CLR_BLUE)

ENDCASE
//Now save new edited value
aItems[lRowNumber, lColNumber] := lVarToEdit
return


//32 bits Alaska XPP Initialisation source code here...
procedure AppSys()
return

-------------------------------------------------------------------------------
The resource file gettst1.rc used with the above program follows:
#define COST_LBX 1000
#define COSTINVT_ACCEPT 1001

BrwseCostInvt DIALOG -5, 6, 282, 229
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Inventory Browse Showing Some Fields"
FONT 8, "MS Sans Serif"
{
LISTBOX COST_LBX, 2, 14, 279, 185, LBS_NOTIFY | WS_BORDER | LBS_NOINTEGRALHEIGHT | WS_BORDER | WS_TABSTOP
PUSHBUTTON "&OK to Accept [F2]", COSTINVT_ACCEPT, 110, 212, 71, 14, NOT WS_TABSTOP
}
__________________________________________________________

Any help would be appreciated. I have used the standard FiveWin and Alaska XBase++ libararies for the above example.

For the future, I need to modify the Tget Class for my application (such as automatically highlighting entries when the <CR> key is pressed plus other minor changes), so would it be possible the get the corrected Tget.prg and TClipGet.prg class source code?


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

Post by Antonio Linares »

Angelo,

We are currently at Holland on a FWPPC seminar. Next sunday we will be back at our offices so we will review this issue, thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
angelo.c
Posts: 36
Joined: Thu Mar 30, 2006 11:19 am

Post by angelo.c »

Thank you Antonio.

I Hope all went well in Holland.

I have received a new modified FW++ library that fixes the later CreateToolTip function reference and the extra debug message problem. However I still have this "Clear" method not available problem when I press the decimal point "." in a get field.

I also asked if it would be possible the get the latest and corrected Tget.prg and TClipGet.prg class source code? I intent to modify it slightly for my application.


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

Post by Antonio Linares »

Angelo,

It was a great FWPPC seminar :-)

We have just emailed you the source code for those classes
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply