Code: Select all
#include 'dcdialog.ch'
#pragma library("dclipx.lib")
proc main
LOCAL GetList := {}, aBez1 := {"aktiv","inaktiv"}, i := 1
/* * Wenn nicht auskommentiert keine Caption */
oConfig := DC_XbpPushButtonXPConfig():new()
oConfig:radius := 20
oConfig:bgColor := GRA_CLR_CYAN
* Workaround:
@ 02,12 dcpushbuttonxp caption {||abez1[IF(i=1,1,2)]} size 10,1 ;
action {||nil} when {||i=1} config oConfig
@ 02,23 dcpushbuttonxp caption {||abez1[IF(i=2,1,2)]} size 10,1 ;
action {||nil} when {||i=2} config oConfig
* Legacy buttons:
@ 02,34 dcpushbutton caption abez1 size 10,1 ;
action {||nil} when {||i=1}
@ 02,45 dcpushbutton caption abez1 size 10,1 ;
action {||nil} when {||i=2}
* ButtonsXP without workaround:
@ 02,56 dcpushbuttonxp caption abez1 size 10,1 ;
action {||nil} when {||i=1} config oConfig
@ 02,67 dcpushbuttonxp caption abez1 size 10,1 ;
action {||nil} when {||i=2} config oConfig
@ 04,12 DCPUSHBUTTON CAPTION 'Toggle' SIZE 10,1 ACTION {||i++,IF(i>2,i:=1,NIL),DC_GetRefresh(GetList)}
DCREAD GUI fit ADDBUTTONS
RETURN
*------------------
proc appsys
return