Page 1 of 1

xBrowse ON OFF checkbox does not work in FWH1203

PostPosted: Thu Apr 05, 2012 8:14 pm
by Rick Lipkin
To ALL

I have noticed that inserting a check box in xBrowse has changed .. Please review my code and let me know what I am doing wrong ?

The Ado Fieldtype is YesNo .. and has worked in prior versions ..

Thanks
Rick Lipkin

ps TestXbr3.prg is not working either .. just have a column .T. or .F. for Married Column

Code: Select all  Expand view


 REDEFINE xBROWSE oLBXB        ;
         RECORDSET oRsDetail         ;
         COLUMNS "QTY",              ;
                 "INVENTORY ID",     ;
                 "INVENTORY TYPE",   ;
                 "ITEM DESCRIPTION", ;
                 "PRICE",            ;
                 "LOCATION",         ;
                 "COVERED BY WARRANTY" ;
         COLSIZES 45,120,70,310,65,80,50   ;
         HEADERS "Qty",              ;
                 "Part Number",      ;
                 "Type",             ;
                 "Description",      ;
                 "Price",            ;
                 "Location",         ;
                 "Warranty"          ;
         ID 172 of oWorkB            ;
       AUTOCOLS LINES CELL

          // row numbers
       ADD oCol to oLbxB AT 1 DATA oLbxB:KeyNo() HEADER 'Ln' size 23 //PICTURE '9999'
       oLbxB:aCols[1]:nDataStrAlign := AL_LEFT
       oLbxB:aCols[1]:nHeadStrAlign := AL_LEFT
          // extention
       ADD oCol TO oLbxB AT 7 DATA {|x| x :=  _CalcExt( oRsDetail:Fields("Qty"):Value,;
                                                  oRsDetail:Fields("Price"):Value )} HEADER 'Ext' size 65

       if ! empty(oCol := oLbxB:oCol( "COVERED BY WARRANTY" ))
          oCol:SetCheck( { "ON", "OFF" } )
          oCol:cSortOrder  := nil
       endif


 


Image

Re: xBrowse ON OFF checkbox does not work in FWH1203

PostPosted: Fri Apr 06, 2012 3:07 pm
by nageswaragunupudi
Instead of
Code: Select all  Expand view
if ! empty(oCol := oLbxB:oCol( "COVERED BY WARRANTY" ))

please substitute
Code: Select all  Expand view
if ! empty(oCol := oLbxB:oCol( "WARRANTY" ))


Parameter of oCol() should be either HeaderName or CreationOrder as numeric.

Re: xBrowse ON OFF checkbox does not work in FWH1203

PostPosted: Fri Apr 06, 2012 3:54 pm
by Rick Lipkin
Rao

I tried your suggestion yesterday without success .. what I found interesting today is that by default .. "on", "off" used to work displaying an xbrowse checkbox in older ( 9.11 ) versions of FWH ( without resource support ) but for the xbrowse checkboxes to work in current versions.. you MUST import an "on" and "off" bitmap in your resource file... did not have to do that previously... and that is ok now that I know :)

If you take a look at the sample testxbr3.prg, you will notice the column Married only shows .T. or .F. .. with no code to control the checkbox .. and if I am correct .. you will also need to at the appropriate bitmap to the resource ??

Rick Lipkin

Re: xBrowse ON OFF checkbox does not work in FWH1203

PostPosted: Fri Apr 06, 2012 4:03 pm
by nageswaragunupudi
oCol:SetCheck()
without any parameters uses internal bitmaps by default.

If an array is specified as the first parameter, the two elements of the array should be either valid resource names or bitmap filenames.

Because you called oCol:SetCheck( { "ON", "OFF" } ), ON and OFF should be valid resource names.

Re: xBrowse ON OFF checkbox does not work in FWH1203

PostPosted: Fri Apr 06, 2012 4:33 pm
by Rick Lipkin
Rao

Thanks for the excellent advice .. Appreciate your help!

Rick