Page 1 of 1

How to get the current line number in DCBROWSE

Posted: Tue Jan 31, 2017 1:32 pm
by Eugene Lutsenko
How to get the current line number in DCBROWSE?

IIF(VAL(Num_Appl)=10
IIF(VAL(Num_Appl)=[the current line number]

Code: Select all

@ 1, 0 DCBROWSE WebAppls ALIAS 'WebAppls' SIZE 212,30 ;
       EDIT xbeBRW_ItemSelected MODE DCGUI_BROWSE_EDITDOWN ;            // Редактирование БД
       NOSOFTTRACK ;
       HEADLINES 2 ;                      // Кол-во строк в заголовке (перенос строки - ";")
       SCOPE ;
       ITEMMARKED bItems;
       COLOR {||IIF(VAL(Num_Appl)=10,{nil,aColor[107]},{nil,GRA_CLR_WHITE})}
[/size]

Re: How to get the current line number in DCBROWSE

Posted: Tue Jan 31, 2017 3:19 pm
by rdonnay
Is Num_Appl a field in the WebAppls database?

Re: How to get the current line number in DCBROWSE

Posted: Tue Jan 31, 2017 8:52 pm
by Eugene Lutsenko
Yes

Re: How to get the current line number in DCBROWSE

Posted: Wed Feb 01, 2017 6:29 am
by Eugene Lutsenko
Roger!
You give the example:

Code: Select all

FUNCTION XSample_100()

/*
This example shows how to use DCQUICKBROWSE for browsing
an array via the Data Access Chain.
*/

LOCAL GetList := {}, oBrowse, aDirectory := Directory(), aHeaders, ;
      aColumns, aColType, aColAlign, aColWidth

IF Val(Version(1)+'.'+Version(2)) < 1.3
  DC_WinAlert('Quick Browse not available in Version 1.2')
  RETURN nil
ENDIF

aColumns :=     { ;
      F_NAME          , ; // Display files as icons
      F_NAME          , ; // Display file names as text
      F_SIZE          , ;
      F_WRITE_DATE    , ;
      F_WRITE_TIME    , ;
      F_CREATION_DATE , ;
      F_CREATION_TIME   }

aHeaders :=     { ;
      " "             , ;
      "File name    " , ;
      "    File size" , ;
      "  Access date" , ;
      "  Access time" , ;
      "Creation date" , ;
      "Creation time"   }

aColType :=     { ;
      { 1, XBPCOL_TYPE_FILEMINIICON }, ;
      nil, ;
      nil, ;
      nil, ;
      nil, ;
      nil, ;
      nil  }

aColWidth :=    { ;
      20, ;
      175, ;
      150, ;
      150, ;
      150, ;
      150, ;
      150 }

aColAlign :=    { ;
   XBPALIGN_VCENTER + XBPALIGN_HCENTER, ;
   XBPALIGN_RIGHT + XBPALIGN_VCENTER, ;
   XBPALIGN_RIGHT + XBPALIGN_VCENTER, ;
   XBPALIGN_RIGHT + XBPALIGN_VCENTER, ;
   XBPALIGN_RIGHT + XBPALIGN_VCENTER, ;
   XBPALIGN_RIGHT + XBPALIGN_VCENTER, ;
   XBPALIGN_RIGHT + XBPALIGN_VCENTER  }

@ 1,1 DCQUICKBROWSE DATA aDirectory SIZE 90,20 ;
   OBJECT oBrowse ;
   COLUMNS aColumns ;
   FONT '10.Courier New' ;
   HEADERS aHeaders ;
   COLTYPE aColType ;
   COLWIDTH aColWidth ;
   COLALIGN aColAlign

DCREAD GUI FIT ADDBUTTONS ;
   MODAL ;
   TITLE 'Quick-Browsing an Array' ;
   EVAL {||oBrowse:setRowHeight(35)}

RETURN nil
*** END OF EXAMPLE ***
[/size]
This example does what I need: selects the current line. But I couldn't repeat when the table view. Can't understand