Evaluating WHEN clauses after moving the browse pointer

This forum is for eXpress++ general support.
Post Reply
Message
Author
Piotr D
Posts: 131
Joined: Mon Jul 28, 2014 1:26 am
Location: Poznań, Poland

Evaluating WHEN clauses after moving the browse pointer

#1 Post by Piotr D »

Hi Roger,
I have problem with refreshing buttons when browsing an array. Below is a test program:

#include "dcdialog.ch"
#include "dcmsg.ch"
#include "appevent.ch"
#include "Nls.ch"

procedure appsys
return

PROCEDURE Main
Local aTest:={},GetList:={},GetOptions,oBrowse,oToolBar
PRIVATE Zbior,Zmienna
AAdd(aTest,{.T.,.F.,.F.,.F.})
AAdd(aTest,{.F.,.T.,.F.,.F.})
AAdd(aTest,{.F.,.F.,.T.,.F.})
AAdd(aTest,{.F.,.F.,.F.,.T.})

DC_GUI(.T.)
dc_msgboxgui(.t.)
dc_LangSet(DCLANG_POLISH)

nPos:=1
@1.0, 0 DCTOOLBAR oToolBar SIZE 16,1.5 BUTTONSIZE 4,1.5
DCADDBUTTON CAPTION '1' WHEN {||aTest[nPos,1]} PARENT oToolBar
DCADDBUTTON CAPTION '2' WHEN {||aTest[nPos,2]} PARENT oToolBar
DCADDBUTTON CAPTION '3' WHEN {||aTest[nPos,3]} PARENT oToolBar
DCADDBUTTON CAPTION '4' WHEN {||aTest[nPos,4]} PARENT oToolBar

@2.5,0 DCBROWSE oBrowse DATA aTest SIZE 20,10 FIT POINTER nPos CURSORMODE XBPBRW_CURSOR_ROW PRESENTATION DC_BrowPres()
DCBROWSECOL DATA {||IF(DC_GetColArray(1,oBrowse),'T','N')} HEADER '1' PARENT oBrowse WIDTH 5
DCBROWSECOL DATA {||IF(DC_GetColArray(2,oBrowse),'T','N')} HEADER '2' PARENT oBrowse WIDTH 5
DCBROWSECOL DATA {||IF(DC_GetColArray(3,oBrowse),'T','N')} HEADER '3' PARENT oBrowse WIDTH 5
DCBROWSECOL DATA {||IF(DC_GetColArray(4,oBrowse),'T','N')} HEADER '4' PARENT oBrowse WIDTH 5

DCGETOPTIONS NOMAXBUTTON NOMINBUTTON
DCREAD GUI MODAL FIT OPTIONS GetOptions TITLE CHR(255) EVAL {|o|SetAppFocus(oBrowse),SetAppWindow(o)}

RETURN

In an old program (with Express 242) this work correct: DCAddButtons are refreshed when moving the browse pointer. But when I use new version of Express (264) the WHEN clause of DCADDBUTTONS don't work. I look'd an one another version of Express (252) effect was the same - don't work. This is only when browsing an array.
Probably this is another case of problem corrected in varsion 249:
---------------- New to 1.9 (build 249) ----------

1026. Fixed a regression that started in build 244. The itemmarked callback
of DCBROWSE was not calling DC_GetWhen() thereby not properly
evaluating WHEN clauses after moving the browse pointer.

Regards
Piotr

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

Re: Evaluating WHEN clauses after moving the browse pointer

#2 Post by rdonnay »

This will work:

Code: Select all

@2.5,0 DCBROWSE oBrowse DATA aTest SIZE 20,10 FIT ;
       POINTER nPos ;
       CURSORMODE XBPBRW_CURSOR_ROW ;
       PRESENTATION DC_BrowPres() ;
       ITEMMARKED {||DC_GetWhen(GetList)}  <<<<<<<<<<<<<<<<<<
The eXpress train is coming - and it has more cars.

Post Reply