bb.donnay-software.com
http://bb.donnay-software.com/Donnay/

DCLISTBOX and DataObject
http://bb.donnay-software.com/Donnay/viewtopic.php?f=2&t=2664
Page 1 of 1

Author:  Manfred [ Tue Nov 26, 2019 12:25 pm ]
Post subject:  DCLISTBOX and DataObject

Hi,
is it possible to use DCLISTBOX with Dataobjects?

Author:  rdonnay [ Tue Nov 26, 2019 1:06 pm ]
Post subject:  Re: DCLISTBOX and DataObject

Yes.

Here is some sample code:

Code:
#INCLUDE "dcdialog.ch"

FUNCTION Main()

LOCAL GetList[0], oDataObject, cVarName := ''

oDataObject := DataObject():new()

oDataObject:name := 'Roger Donnay'
oDataObject:street1 := '1486 S. Loggers Pond Place'
oDataObject:street1 := 'Apt. 11'
oDataObject:city := 'Boise'
oDataObject:state := 'Idaho'
oDataObject:country := 'U.s.A.'

@ 0,0 DCLISTBOX cVarName LIST oDataObject SIZE 30,10

DCREAD GUI FIT

RETURN nil

* ---------

PROC appsys ; RETURN

Author:  Manfred [ Wed Nov 27, 2019 12:38 am ]
Post subject:  Re: DCLISTBOX and DataObject

Sorry, it was my mistake. I mean this for example

Code:
LOCAL aJahre         := {}
       LOCAL aVerzeichnisse := {}
       LOCAL cJahre         := ""
       LOCAL cVerzeichnis   := oSysPAra:doParaWs:datenbestand + "jahresabschluss\*"aVerzeichnisse := Directory(cVerzeichnis,"D")                            // nur Directories der Jahre
       IF Len(aVerzeichnisse) > 0
          SELECT field1 AS name FROM (aVerzeichnisse) AS jahr WHERE jahr->field1 <> "." .AND. jahr->field1 <> ".." INTO objects aJahre
       ENDIF
//------------------------------------------------------------------------------
       @ oDialogZusatz:nOben,oDialogZusatz:nLinks DCSAY "Jahr:";
                                                 OBJECT oDialogZusatz:oText;
                                                 PARENT oDialogZusatz:oRahmenKopf;
                                                   SIZE 0
       @ DCGUI_ROW,DCGUI_COL DCLISTBOX cJahre;
                                  LIST aJahre;
                                OBJECT oListbox;
                                PARENT oDialogZusatz:oRahmenKopf;
                                  SIZE oSysPara:SkaliereXbParts(100),oDialogZusatz:nSayHoehe

Author:  rdonnay [ Wed Nov 27, 2019 9:03 am ]
Post subject:  Re: DCLISTBOX and DataObject

This will not work for you.
DCLISTBOX is built on the DC_XbpListBox() class (inherited from XbpListBox()) which only works with single dimensional arrays or data objects.

I am guessing that I could modify the class in eXpress++, but that would take some work.

You can get the same behavior as DCLISTBOX by using DCBROWSE instead. It already supports arrays of data objects.
Look at the sample in \exp20\samples\adssql\sqltest1.prg.

Author:  Manfred [ Wed Nov 27, 2019 9:37 am ]
Post subject:  Re: DCLISTBOX and DataObject

thanks a lot. it was a little test. Thats life..... :lol:

Page 1 of 1 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/