dc_mergegetlists() and captionarray

This forum is for eXpress++ general support.
Post Reply
Message
Author
c-tec
Posts: 379
Joined: Tue Apr 20, 2010 1:36 am
Location: SALZBURG/AUSTRIA
Contact:

dc_mergegetlists() and captionarray

#1 Post by c-tec »

Hello,
I would like to merge getlists with buttons where the caption is definde with CAPTIONARRAY. In my sample I use the same caption array, but the result is different. What could be wrong ?
regards
Rudolf



Code: Select all

FUNCTION xxxMenu()
******************************************************************
LOCAL GetList[0],aCaption
aCaption :=  { ;
  {chr(74) , GRA_CLR_WHITE,15,15, , ,                                   ,"50.Wingdings",,}, ; // Symbol
  {"Test 1", GRA_CLR_WHITE,65,  , , ,XBPALIGN_BOTTOM + XBPALIGN_HCENTER ,"8.Arial",,}} // Label bottom
@ 1,1 DCPUSHBUTTONXP SIZE 80,80 CAPTIONARRAY aCaption PIXEL CONFIG BUCFG1 ACTION {||DC_ReadGuiEvent(DCGUI_EXIT_OK,GetList)}

getlist := DC_MergeGetLists(get_buttons(),GetList)
DCREAD GUI
RETURN nil

function get_buttons()
******************************************************************
LOCAL GetList[0],aCaption
aCaption :=  { ;
  {chr(74) , GRA_CLR_WHITE,15,15, , ,                                   ,"50.Wingdings",,}, ; // Symbol
  {"Test 2", GRA_CLR_WHITE,65,  , , ,XBPALIGN_BOTTOM + XBPALIGN_HCENTER ,"8.Arial",,}} // Label bottom
@ 1,85 DCPUSHBUTTONXP SIZE 80,80 CAPTIONARRAY aCaption PIXEL CONFIG BUCFG1 ACTION {||DC_ReadGuiEvent(DCGUI_EXIT_OK,GetList)}
DCREAD GUI EXIT SAVE
return getlist

Attachments
2014-12-28_20h11_11.jpg
2014-12-28_20h11_11.jpg (6.27 KiB) Viewed 5846 times
Rudolf Reinthaler
digital pen & paper systems
http://www.formcommander.net

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: dc_mergegetlists() and captionarray

#2 Post by rdonnay »

Wolfgang -

You are using DC_MergeGetlists() in a way that it was not intended. You do not need to use this function to add items to a GetList in a subroutine. Look at the below code. DC_MergeGetLists() is designed to improve performance when creating large dialogs with lots of tabpages. The idea is to create dialog elements on the screen "on demand", i.e. only when the user clicks on the tabpage, and after the dialog has been already created. If you want to build dialogs from multiple subroutines, all you need to do is pass the GetList array to the subroutine.

Code: Select all

#INCLUDE "dcdialog.CH"

FUNCTION Main()

LOCAL GetList[0], aCaption
LOCAL BUCFG1 := DC_XbpPushButtonXPDefault()

BUCFG1:bgColor := GRA_CLR_DARKBLUE

aCaption :=  { ;
  {chr(74) , GRA_CLR_WHITE,60,13, , , ,"50.Wingdings",,}, ; // Symbol
  {"Test 1", GRA_CLR_WHITE,75,  , , ,XBPALIGN_BOTTOM + XBPALIGN_HCENTER ,"8.Arial",,}} // Label bottom

@ 1,1 DCPUSHBUTTONXP SIZE 80,80 CAPTIONARRAY aCaption PIXEL ;
      CONFIG BUCFG1 ;
      ACTION {||DC_ReadGuiEvent(DCGUI_EXIT_OK,GetList)}

Get_Buttons( GetList, BUCFG1 )

DCREAD GUI FIT

RETURN nil

* -------------

function get_buttons( GetList, BUCFG1 )

LOCAL aCaption

aCaption :=  { ;
  {chr(74) , GRA_CLR_WHITE,60,13, , ,,"50.Wingdings",,}, ; // Symbol
  {"Test 2", GRA_CLR_WHITE,75,  , , ,XBPALIGN_BOTTOM + XBPALIGN_HCENTER ,"8.Arial",,}} // Label bottom

@ 1,85 DCPUSHBUTTONXP SIZE 80,80 CAPTIONARRAY aCaption PIXEL ;
       CONFIG BUCFG1 ;
       ACTION {||DC_ReadGuiEvent(DCGUI_EXIT_OK,GetList)}

return nil

* -----------

PROC appsys ; RETURN
The eXpress train is coming - and it has more cars.

c-tec
Posts: 379
Joined: Tue Apr 20, 2010 1:36 am
Location: SALZBURG/AUSTRIA
Contact:

Re: dc_mergegetlists() and captionarray

#3 Post by c-tec »

Hello Roger,
thank you, works perfect now. I use it already on tabpages and works also perfect, this is why I thougt that I also have to use dc_mergegetlists()
regards
Rudolf
Rudolf Reinthaler
digital pen & paper systems
http://www.formcommander.net

Post Reply