bb.donnay-software.com

Donnay Software Web Forums
It is currently Wed Dec 11, 2019 1:52 am

All times are UTC - 7 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: DCLISTBOX and DataObject
PostPosted: Tue Nov 26, 2019 12:25 pm 
Offline

Joined: Sun Jul 22, 2012 12:10 am
Posts: 4
Location: Wesel
Hi,
is it possible to use DCLISTBOX with Dataobjects?


Top
 Profile  
 
PostPosted: Tue Nov 26, 2019 1:06 pm 
Offline
Site Admin
User avatar

Joined: Wed Jan 27, 2010 6:58 pm
Posts: 4013
Location: Boise, Idaho USA
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

_________________
The eXpress train is coming - and it has more cars.


Top
 Profile  
 
PostPosted: Wed Nov 27, 2019 12:38 am 
Offline

Joined: Sun Jul 22, 2012 12:10 am
Posts: 4
Location: Wesel
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


Top
 Profile  
 
PostPosted: Wed Nov 27, 2019 9:03 am 
Offline
Site Admin
User avatar

Joined: Wed Jan 27, 2010 6:58 pm
Posts: 4013
Location: Boise, Idaho USA
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.

_________________
The eXpress train is coming - and it has more cars.


Top
 Profile  
 
PostPosted: Wed Nov 27, 2019 9:37 am 
Offline

Joined: Sun Jul 22, 2012 12:10 am
Posts: 4
Location: Wesel
thanks a lot. it was a little test. Thats life..... :lol:


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group