Xbrowse checkbox

Xbrowse checkbox

Postby Silvio.Falconi » Wed Jan 16, 2013 12:12 pm

I wish create a xbrowse with checkbox for a list of arrays :

sample

Local aItems4 := { "Disabilitare uno",;
"Disabilitare due",;
"Disabilitare tre",;
"Disabilitare quattro }

and for each text I want save the checkbox ( yes or not)

I wish save the congiguration sample ( yes,not ,not,yes) to call each record
sample IF oLbx:lChecked( n ) ->.....

I wish also a button "Default" to return the old config

Someone can help with a minimal sample ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6848
Joined: Thu Oct 18, 2012 7:17 pm

Re: Xbrowse checkbox

Postby James Bott » Thu Jan 17, 2013 2:57 am

From my notes here is an example using a database from an old post. You should be able to convert it to use an array. I have never used it so I can't answer any questions.

Regards,
James

Code: Select all  Expand view
Post subject: Re: Xbrowse newbiePosted: Fri Mar 20, 2009 11:07 am  
Joined: Fri Oct 07, 2005 5:50 am
Posts: 474
Location: Columbia, South Carolina USA  Here is the answer to my own question .. for all those folks like me .. Txbrowse is very powerful .. especially using the EDIT_GET code block and notice the

oCol:SetCheck( { "ON", "OFF" } )
oCol:nEditType := 1

where "ON", "OFF" is a bitmap .. which is a resource .. that shows the checkbox column ..

Very Nice
Rick Lipkin



Code:

// AttBrow.prg

#include "FiveWin.Ch"
#include "XBrowse.Ch"
#include "Ord.ch"

//------------------
function _Attbrow(cMODE, oWndmdi, dDATE )

LOCAL oDlg, oBrw, oCol  //, cAlias := cGetNewAlias( "ATTEND" )
LOCAL SAYING, oBTN

cFunc := ProcName( 0 )

IF empty( dDATE)
   SAYING := "Sorry .. there was a problem passing the Class Date .. Aborting"
   MsgInfo( SAYING )
   RETURN(.F.)
ENDIF

SELECT ATTEND
SET ORDER to TAG DATE
SET SCOPE to dDATE
GO TOP

DEFINE DIALOG oDlg RESOURCE "ATTEND";
       TITLE "DPO UPDATE for DATE  "+dtoc(Ddate) //FONT WndMain():oFont

   REDEFINE XBROWSE oBrw ID 101 OF oDlg ;
      COLUMNS "Lname", "Fname", "Attend", "Remove", "Program", "District", "Phone", "Notes" ;
      ALIAS "ATTEND"    ;
      AUTOSORT FASTEDIT LINES CELL

   oBrw:bClrRowFocus    := { || { CLR_BLACK, RGB(185,220,255) } }
   oBrw:nMarqueeStyle   := MARQSTYLE_HIGHLROWMS

   if ! Empty( oCol := oBrw:oCol( "Attend" ) )
      oCol:SetCheck( { "ON", "OFF" } )
      oCol:cSortOrder  := nil
   endif

   if ! Empty( oCol := oBrw:oCol( "Remove" ) )
      oCol:SetCheck( { "ON", "OFF" } )
      oCol:cSortOrder  := nil
   endif

   AEVAL( oBrw:aCols, { |o| o:nEditType := EDIT_GET } )

   REDEFINE BUTTON oBTN1 ID 120 of oDLG ;
            ACTION( oDLG:END() )

ACTIVATE DIALOG oDlg ;
          ON INIT oBrw:SetFocus()

SELECT ATTEND
dbCommit()

RETURN(.T.)

//- end attbrow.prg
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Xbrowse checkbox

Postby Silvio.Falconi » Sat Jan 19, 2013 8:26 am

thanks I need a function to reset the xbrowse and reassign the old value ( saved first on inifile) on the each array ...
I used tlbxcheck class of Paco but it not have seven style!!!
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6848
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

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