FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour CheckBox in a column xbrowse
Posts: 598
Joined: Tue Apr 15, 2008 04:51 PM
CheckBox in a column xbrowse
Posted: Mon Apr 19, 2010 03:39 PM

I have an xbrowse that I need to mark serveral records to change their currency. I thought of having a column of check boxes. The user can check off as many records as the like then convert to the currency those that are checked.

The browse is NOT from code.

I'm looking for some xbrowse code or direction where I can read up on the subject. Thanks all.

Using Harbour

Thank you

Harvey
Posts: 389
Joined: Mon Oct 13, 2008 11:26 AM
Re: CheckBox in a column xbrowse
Posted: Mon Apr 19, 2010 08:20 PM

http://www.fivewin.com.br/forum/topic.a ... C_ID=17222

A link to the same question in the brazilian forum

Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: CheckBox in a column xbrowse
Posted: Tue Apr 20, 2010 12:42 AM
Mr Hag
Probably this sample code may be the starting point for you.
Code (fw): Select all Collapse
#include 'fivewin.ch'
#include 'xbrowse.ch'

function Main()

   local oDlg, oBrw, oFont
   local nExch := 1.348
   local aData := { ;
         { 'One',    .t.,  1000 }, ;
         { 'Two',    .f.,  2000 }, ;
         { 'Three',  .t.,  3000 }, ;
         { 'Four',   .f.,  4000 }  }

   DEFINE FONT oFont NAME 'TAHOMA' SIZE 0,-14
   DEFINE DIALOG oDlg RESOURCE 'TEST' FONT oFont

   REDEFINE XBROWSE oBrw ID 101 OF oDlg ;
      AUTOCOLS ;
      ARRAY aData ;
      HEADERS 'Customer', 'Euros', 'Amount' ;
      PICTURES nil, nil, '999,999.99' ;
      CELL LINES

   WITH OBJECT oBrw:Euros
      :SetCheck( , .t. )
      :bOnChange  := { || If( oBrw:Euros:Value, oBrw:Amount:Value /= nExch, oBrw:Amount:Value *= nExch ), ;
                              oBrw:RefreshCurrent() }
   END

   oBrw:nStretchCol  := STRETCHCOL_WIDEST

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont

return nil


RC File
Code (fw): Select all Collapse
TEST DIALOG 6, 15, 306, 227
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "TXBrowse demo"
FONT 8, "MS Sans Serif"
{
 DEFPUSHBUTTON "OK", IDOK, 252, 211, 50, 14
 CONTROL "", 101, "TXBrowse", 0 | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP, 4, 5, 297, 202
}


ScreenShot:
Regards



G. N. Rao.

Hyderabad, India
Posts: 598
Joined: Tue Apr 15, 2008 04:51 PM
Re: CheckBox in a column xbrowse
Posted: Tue Apr 20, 2010 02:54 AM

Great stuff thanks to both.

Thank you

Harvey

Continue the discussion