xBrowse ON OFF checkbox does not work in FWH1203

xBrowse ON OFF checkbox does not work in FWH1203

Postby Rick Lipkin » Thu Apr 05, 2012 8: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: 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
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: xBrowse ON OFF checkbox does not work in FWH1203

Postby nageswaragunupudi » Fri Apr 06, 2012 3:07 pm

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

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: xBrowse ON OFF checkbox does not work in FWH1203

Postby Rick Lipkin » Fri Apr 06, 2012 3: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
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: xBrowse ON OFF checkbox does not work in FWH1203

Postby nageswaragunupudi » Fri Apr 06, 2012 4: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
User avatar
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: xBrowse ON OFF checkbox does not work in FWH1203

Postby Rick Lipkin » Fri Apr 06, 2012 4:33 pm

Rao

Thanks for the excellent advice .. Appreciate your help!

Rick
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 114 guests