I not see the index tags on combobox
The Search ( get) run ok, I not understood why there are not the indexes
I open with tdatabase
::oPaziente := TDatabase():Open( , "paciente", "DBFCDX", .T. )
::oPaziente:SetOrder( "NOMBRE" )
::oPaziente:GoTop()
- Code: Select all Expand view
CLASS TPaziente
DATA oWin
DATA oBar
DATA oPaziente
DATA oLbx
DATA cTitulo
DATA oTabs
DATA oIcon
// ----------------------------------------------------//
METHOD New() CONSTRUCTOR
METHOD Activar()
METHOD Orden()
END CLASS
METHOD New() CLASS TPaziente
LOCAL oFont1
local cSeek:=Space(100)
local oGet
local oSay:=array(2)
local aCols := { ;
{ "Codigo", "Codigo" ,, 80, },;
{ "nombre", "Nombre" ,, 100, },;
{ "fono_casa", "F.Casa" ,, 90, },;
{ "fono_ofic", "F.Oficina" ,, 90, },;
{ "TRANSFORM( deuda, '99,999,999' ) ", "Deuda",, 100, },;
{ "DTOC( ultima )", "U.Atencion" ,, 90, }}
::oPaziente := TDatabase():Open( , "paciente", "DBFCDX", .T. )
::oPaziente:SetOrder( "NOMBRE" )
::oPaziente:GoTop()
::cTitulo := "Anagrafica pazienti"
DEFINE ICON ::oIcon RESOURCE "ventana"
DEFINE WINDOW ::oWin MDICHILD ;
FROM 0, 0 TO 24, 79 ;
TITLE ::cTitulo ;
ICON ::oIcon
DEFINE BUTTONBAR ::oBar TOP _3D OF ::oWin
SET FONT TO oApp:oFont OF ::oWin
DEFINE BUTTON RESOURCE "Nuevo" NOBORDER OF ::oBar ;
ACTION NIL
DEFINE BUTTON RESOURCE "editar" NOBORDER OF ::oBar ;
TOOLTIP "Editar" ;
ACTION NIL
DEFINE BUTTON RESOURCE "Elimin" NOBORDER OF ::oBar ;
TOOLTIP "Eliminar" ;
DEFINE BUTTON RESOURCE "SEARCH" NOBORDER OF ::oBar GROUP ;
TOOLTIP "Buscar" ;
DEFINE BUTTON RESOURCE "Repag" NOBORDER OF ::oBar GROUP ;
TOOLTIP "Volver Pagina" ;
ACTION ::oLbx:KeyDown(VK_PRIOR, 0)
DEFINE BUTTON RESOURCE "AvPag" NOBORDER OF ::oBar ;
TOOLTIP "Avanzar registro" ;
ACTION ::oLbx:KeyDown(VK_NEXT, 0)
DEFINE BUTTON RESOURCE "print" NOBORDER OF ::oBar GROUP ;
TOOLTIP "Imprimir" ;
DEFINE BUTTON RESOURCE "salir" NOBORDER OF ::oBar GROUP ;
TOOLTIP "Salir" ;
ACTION( ::oWin:End() )
DEFINE FONT oFont1 NAME "Tahoma" SIZE 0, -12
@ 2,280 say oSay[1] Prompt "Search :" SIZE 46,24 PIXEL OF ::oBar FONT oFont1
@ 2,500 say oSay[2] Prompt "in" SIZE 40,24 PIXEL OF ::oBar FONT oFont1
@ 2, 325 GET oGet VAR cSeek SIZE 150,20 PIXEL OF ::oBar ;
BITMAP "ELIMINA" ACTION (cSeek := Space( 100 ),;
::oLbx:Seek( "" ),::oLbx:refresh(),oGet:refresh())
oGet:lBtnTransparent :=.t.
::oBar:bRClicked := {|| 0 }
::oBar:bLClicked := {|| 0 }
@ 00, 00 TABS ::oTabs OF ::oWin PROMPT "Codigo", "Nombre" ;
ACTION ::Orden()
@ 0,0 XBROWSE ::oLbx OF ::oWin ;
DATASOURCE ::oPaziente COLUMNS aCols ;
AUTOSORT ;
NOBORDER CELL LINES
::oLbx:aCols[ 3 ]:cSortOrder := "" //no formato livello
::oLbx:aCols[ 4 ]:cSortOrder := "" //no formato livello
::oLbx:aCols[ 5 ]:cSortOrder := "" //no formato livello
::oLbx:aCols[ 6 ]:cSortOrder := "" //no formato livello
WITH OBJECT ::oLbx
:nRowHeight := 30
:l2007 := .F.
:l2015 := .T.
:nColDividerStyle := LINESTYLE_LIGHTGRAY
:nRowDividerStyle := LINESTYLE_LIGHTGRAY
:nStretchCol := STRETCHCOL_WIDEST
:lAllowRowSizing := .F.
:lAllowColSwapping := .F.
:lAllowColHiding := .F.
:nRecSelColor := nRgb( 245,244,234)
:lIncrFilter := .t.
:bOnSort := { |b,oCol| ::oLbx:Seek( "" ), ;
::oLbx:cFilterFld := oCol:cExpr, ;
::oLbx:SetFocus() }
:bClrStd := { || { CLR_BLACK, If( ::oLbx:oCol( 1 ):Value, 0x80ffff, CLR_WHITE ) } }
:bClrHeader := {|| { ,nRgb( 245,244,234) } }
:bClrFooter := {|| { ,nRgb( 245,244,234) } }
:lDrawBorder := .t.
:lHScroll := .f.
:SetMultiSelectCol()
:oSeek := oGet
:CreateFromCode()
END
::oWin:oClient := ::oLbx
@ 2, 550 COMBOBOX ::oLbx:oSortCbx VAR ::oLbx:cSortOrder;
SIZE 200,400 PIXEL OF ::oBar HEIGHTGET 18 STYLE CBS_DROPDOWN
::oWin:SetControl( ::oLbx )
::oTabs:nOption := 2
::oWin:oBottom := ::oTabs
RETURN Self
// ------------------------------------------------------------------------- //
METHOD Activar() CLASS TPaziente
ACTIVATE WINDOW ::oWin MAXIMIZED
RETURN NIL
// ------------------------------------------------------------------------- //
METHOD Orden() CLASS TPaziente
IF ::oTabs:nOption == 1 ; ::oPaziente:SetOrder( "CODIGO" )
ELSE ; ::oPaziente:SetOrder( "NOMBRE" )
ENDIF
::oLbx:refresh()
::oWin:Update()
RETURN NIL