la clase xbrowse produce este error la presionar la columna 2 veces para ordenar
Time from start: 0 hours 0 mins 11 secs
Error occurred at: 10-10-2012, 10:13:06
Error description: Error DBCMD/1034 Dynamic descend not supported in this version: ORDDESCEND
Stack Calls
===========
Called from: => ORDDESCEND( 0 )
Called from: c:\fwh\source\classes\xbrowse.prg => TXBRWCOLUMN:SETORDER( 11353 )
Called from: c:\fwh\source\classes\xbrowse.prg => TXBRWCOLUMN:HEADERLBUTTONUP( 10186 )
Called from: c:\fwh\source\classes\xbrowse.prg => TXBROWSE:LBUTTONUP( 3303 )
Called from: c:\fwh\source\classes\CONTROL.prg => TCONTROL:HANDLEEVENT( 1691 )
Called from: c:\fwh\source\classes\xbrowse.prg => TXBROWSE:HANDLEEVENT( 11633 )
Called from: c:\fwh\source\classes\WINDOW.prg => _FWH( 3152 )
adjunto un ejemplo sacado de xbrwAdt.prg
- Code: Select all Expand view
#include "fivewin.ch"
#include "ads.ch"
#include "xbrowse.ch"
#include "richedit.ch"
//----------------------------------------------------------------------------//
field CAMPO1, CAMPO2
function Main()
local oWnd, oFont, aRddList, i
SET DATE ITALIAN
SET CENTURY ON
SET EXCLUSIVE OFF
RddRegister( "ADS", 1 )
AdsSetServerType( ADS_LOCAL_SERVER )
if AScan( aRddList := RddList(), 'ADT' ) > 0
RDDSetDefault( 'ADT' )
elseif AScan( aRddList, 'ADSADT' ) > 0
RDDSetDefault( 'ADSADT' )
else
MsgInfo( 'RDD ADT not linked' )
endif
if !file( "flds1.adt" )
dbcreate( "flds1", {{ "campo1", "C", 15,0 },;
{ "campo2", "N", 10,0 },;
{ "campo3", "D", 08,0 },;
{ "campo4", "C", 15,0 },;
{ "fmemo", "M", 10, 0} } )
USE FLDS1 exclusive
index on campo1 tag campo1
index on campo4 tag campo4
for i := 1 TO 10
dbAppend()
field->campo1 := ltrim(str(i)) + " indice.."
field->campo2 := i
field->campo3 := date()+i
field->campo4 := ltrim(str(11-i)) + " indice.."
field->fmemo := "indice numero "+ltrim(str(i) )
next i
dbcommitall()
dbCloseAll()
endif
USE FLDS1
GO TOP
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-12
DEFINE WINDOW oWnd MDI TITLE "Xbrowse with ADT" ;
MENU MakeMenu()
oWnd:SetFont( oFont )
ACTIVATE WINDOW oWnd ON RIGHT CLICK xbrowse( ownd )
RELEASE FONT oFont
return nil
//----------------------------------------------------------------------------//
static function MakeMenu
local oMenu
MENU oMenu 2007
MENUITEM "ADT"
MENU
MENUITEM "Data" ACTION xbrData()
MENUITEM "Structure" ACTION xBrStruct()
SEPARATOR
MENUITEM "e&Xit" ACTION WndMain():End()
ENDMENU
oMenu:AddMdi()
ENDMENU
return oMenu
//----------------------------------------------------------------------------//
static function xbrStruct
local aStruct := dbStruct()
local oWnd, oBrw, n
xbrowse( astruct )
for n := 1 to len( astruct )
asize( astruct[ n ], 6 )
astruct[ n ][ 6 ] := ValType( FieldGet( n ) )
next
DEFINE WINDOW oWnd MDICHILD OF WndMain() TITLE 'Structure'
@ 0,0 XBROWSE oBrw ;
HEADERS "Name", "Type", "Len", "Dec", "Ext", "Read" ;
OF ownd ;
ARRAY aStruct ;
AUTOCOLS CELL LINES
oBrw:CreateFromCode()
oWnd:oClient := oBrw
ACTIVATE WINDOW oWnd ON INIT oBrw:SetFocus()
return nil
//----------------------------------------------------------------------------//
static function xbrData
local oWnd, oBrw
local c
DEFINE WINDOW oWnd MDICHILD OF WndMain()
@ 0,0 XBROWSE oBrw;
OF oWnd ;
ALIAS Alias() ;
AUTOCOLS CELL LINES
WITH OBJECT oBrw
:nStretchCol := STRETCHCOL_WIDEST
:nColDividerStyle := LINESTYLE_RAISED
:nRowDividerStyle := LINESTYLE_RAISED
:nMarqueeStyle := MARQSTYLE_HIGHLROW
:LAllowColSwapping := .f.
:lColDividerComplete := .f.
:lAllowRowSizing := .f.
:lAllowColHiding := .f.
:lKineticBrw := .f.
:nRowHeight := 24
:nHeaderHeight := 22
:aCols[1]:cSortOrder := "campo1"
:aCols[4]:cSortOrder := "campo4"
:lRecordSelector := .f.
END
WITH OBJECT oBrw:fmemo
:nEditType := EDIT_GET
:bLDClickData := { |r,c,f,o| c:= flds->fmemo, MemoEdit( @c ), flds->fmemo := c }
END
oBrw:CreateFromCode()
oWnd:oClient := oBrw
ACTIVATE WINDOW oWnd ON INIT oBrw:SetFocus()
return nil
//----------------------------------------------------------------------------//
function Rtf2text( cRtf )
local oWnd, hDll, oRich
local cText
if cRtf != nil
hDll := LoadLibrary( 'riched20.dll' )
DEFINE WINDOW oWnd
@ 0,0 RICHEDIT oRich VAR cRtf OF oWnd PIXEL SIZE 50,50
cText := oRich:GetText()
ACTIVATE WINDOW oWnd HIDDEN ON INIT oWnd:End()
FreeLibrary( hDll )
endif
return cText
//------------------------------------------------------------------//
external hb_decode