FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour xBrowse ON OFF checkbox does not work in FWH1203
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
xBrowse ON OFF checkbox does not work in FWH1203
Posted: Thu Apr 05, 2012 08:14 PM
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 (fw): Select all Collapse
 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


Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xBrowse ON OFF checkbox does not work in FWH1203
Posted: Fri Apr 06, 2012 03:07 PM
Instead of
Code (fw): Select all Collapse
if ! empty(oCol := oLbxB:oCol( "COVERED BY WARRANTY" ))

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


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



G. N. Rao.

Hyderabad, India
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: xBrowse ON OFF checkbox does not work in FWH1203
Posted: Fri Apr 06, 2012 03:54 PM

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

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xBrowse ON OFF checkbox does not work in FWH1203
Posted: Fri Apr 06, 2012 04:03 PM

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.

Regards



G. N. Rao.

Hyderabad, India
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: xBrowse ON OFF checkbox does not work in FWH1203
Posted: Fri Apr 06, 2012 04:33 PM

Rao

Thanks for the excellent advice .. Appreciate your help!

Rick

Continue the discussion