Page 1 of 1

Refresh quesion

Posted: Mon Apr 17, 2017 12:18 pm
by omni
Roger,

You may have shown me this before, but a user has requested to have the screen refresh just by changing selection on a pulldown. Right now he has to hit enter. The entire screen descriptions change based on selection and displays initially the default items.

DCCOMBOBOX TYPE XBPCOMBO_DROPDOWNLIST cStyp31 LIST aLIST31 SIZE 40,pc2+1 ;
ITEMSELECTED {||cpayor:=cList31[ASCAN(aList31,cStyp31)],dc_getrefresh(getlist) } ;
VALID {||ValidatePAYR(cPAYOR,getlist)} ;
F
irstItem as an example

@ 05,01 dcsay alltrim(cert1) saysize 30 sayrighbottom
@ 05,32 dccheckbox certok1
@ 05,40 dcsay "Date" get certdate1 saysize 6 sayrightbottom



Not sure how to do the validate/refresh without input of some sort, if that is even possible.

Normally the list is only 1-3 items. In this case its 3.

Fred
Omni

Re: Refresh quesion

Posted: Mon Apr 17, 2017 12:28 pm
by Cliff Wiernik
You would use the ITEMMARKED clause. That is trigger when you move through the list in the combobox. I use it to refresh screen descriptions, etc. without the user pressing enter or double clicking

Code: Select all

  @ nRow-iif(m->G_l1024,.05,0), DCGUI_COL+5 DCCOMBOBOX m->cequiptype ;          // PC FIS 03-02-06
            TYPE XBPCOMBO_DROPDOWNLIST                          ;
            LIST DC_AConvert(aEquipType)[1]                     ;
            ITEMMARKED   {|a,b,o| o:xbpsle:getdata(),           ;
                                  DC_GetRefresh(GetList,'CEQUIPDESC') }         ;
            ITEMSELECTED {|a,b,o| iif(!o:listboxfocus(),                        ;
                                      (o:xbpsle:getdata(),DC_GetRefresh(GetList,'CEQUIPDESC')), ;
                                       NIL)}


Re: Refresh quesion

Posted: Thu Apr 20, 2017 7:27 am
by omni
Cannot get in to work in my example. The combo box list will not move..tried various commands to validate/refresh.

Roger, cannot find any examples of this to match my combobox.

Any suggestions?

Fred

Re: Refresh quesion

Posted: Thu Apr 20, 2017 8:29 am
by Cliff Wiernik
Try this:

Code: Select all

#include 'dcdialog.ch'
#include 'appevent.ch'
#include 'xbp.ch'
#include "common.ch"

function main()

LOCAL aArray := {'1','2','3'}, cSelect := '1', GetOptions, GetList := {}
LOCAL bBlock

  @ 1,4 DCCOMBOBOX cSelect              ;
            LIST aArray                 ;
            TYPE XBPCOMBO_DROPDOWNLIST  ;
            SIZE 5.7,4                  ;
            ITEMMARKED   {|a,b,o| (WTF 'marked'), o:xbpsle:getdata(), DC_GetRefresh(GetList,'CSELECTION1')} ;
            ITEMSELECTED {|a,b,o| (WTF 'selected'), iif(!o:listboxfocus(),            ;
                                                        (o:xbpsle:getdata(),DC_GetRefresh(GetList,'CSELECTION2')) ;
                                                         ,NIL)}

  bBlock := {|| cSelect}
  @ 3,1 DCSAY bBlock ;
          ID 'CSELECTION1' ;
          SAYSIZE 25


  bBlock := {|| cSelect}
  @ 4,1 DCSAY bBlock ;
          ID 'CSELECTION2';
          SAYSIZE 25

  DCREAD GUI FIT

  RETURN NIL

PROCEDURE APPSYS()
  RETURN

Code: Select all

//
// Project - Definition - File created by PBUILD Version  1.70.267
// Date: 01/31/2002 Time: 20:10:28
//

[PROJECT]
    COMPILE       = xpp
    COMPILE_FLAGS = /q
    DEBUG         = yes
    GUI           = yes
    LINKER        = alink
    LINK_FLAGS    =
    RC_COMPILE    = arc
    RC_FLAGS      = /v
    testcombo.XPJ

[testcombo.XPJ]
    testcombo.EXE

[testcombo.EXE]
// $START-AUTODEPEND
    dclipx.lib
// $STOP-AUTODEPEND
    testcombo.prg

Re: Refresh quesion

Posted: Thu Apr 20, 2017 11:40 am
by rdonnay
Look at the below thread.
Maybe it will answer your question.

http://bb.donnay-software.com/donnay/vi ... f=2&t=2177