DCADDBUTTONXP

This forum is for eXpress++ general support.
Post Reply
Message
Author
D. Schuster
Posts: 38
Joined: Mon Feb 15, 2010 4:01 am

DCADDBUTTONXP

#1 Post by D. Schuster »

Hello,

i have a problem, i can not solve it.

In a part of the program, I would like to assign a value to the variable cPP with DCADDBUTTONXP.
But it does’nt work. In other parts of program it works. What’s my mistake? Please see the example.

/** @package

ERROR01.PRG
Copyright(c) 2000
Author: DIETER SCHUSTER
Created: DS 18.09.2018 10:42:09
Last Change: DS 18.09.2018 10:42:09
*/
FUNCTION AUSW_VER(UNR1,EING11,aLage)
LOCAL GetList:={}, aFiles:={},cUNR:="", aTA:={},bColor,bColor1, ;
oBrowDirs, oBrowFiles, nPointer := 1, oTool, ;
bItemMarked, nPoint_N:=1, lXU:=.F.,lVar:=.F., i, nHS:=0,GetOptions,aColors
LOCAL cKo_Ver:=SUCH_T(717)+SPACE(24)+SUCH_T(718) ,;
cZIEL10:="", cZIEL11:="", cTitel,nAnz,cHS
LOCAL cSort:="KZ"
LOCAL oStatTop, oMenuBar, oFileMenu, oEditMenu, oEditMenuSub, ;
oConfig := DC_XbpPushButtonXPConfig():new(), ;
aParams, cButtonFont := '12.Arial Fett', bEval, oButton
PUBLIC cPP:="XX"

aParams := { MENU_SUB_BGCOLOR, ;
MENU_SUB_BARCOLORFG, ;
MENU_SUB_BARCOLORBG, ;
MENU_SUB_OUTLINECOLOR, ;
MENU_SUB_VERTBARFONT, ;
.F., ;
MENU_SUB_CHECKFONT, ;
MENU_SUB_CHECKCHAR, ;
MENU_BAR_FGCOLOR, ;
MENU_BAR_BGCOLOR, ;
MENU_SUB_FGCOLOR, ;
MENU_BAR_BARFONT, ;
MENU_SUB_ITEMFONT }
DC_XbpMenuConfig( aParams )
oConfig:radius := 10
oConfig:bgColor := GRA_CLR_PALEGRAY

DCSTATUSBAR oStatTop HEIGHT 29 ALIGN DCGUI_ALIGN_TOP
@ 0,0 DCTOOLBAR oMenuBar SIZE 300,29 PIXEL PARENT oStatTop BUTTONSIZE 80,29 ;
COLOR nil, GRA_CLR_PALEGRAY FONT '14.Arial Fett'

DCHOTKEY xbeK_RIGHT ACTION {||PostAppEvent(xbeP_Keyboard,xbeK_TAB,,oMenuBar)}
DCHOTKEY xbeK_LEFT ACTION {||PostAppEvent(xbeP_Keyboard,xbeK_SH_TAB,,oMenuBar)}

DCADDBUTTONXP CAPTION ' ok ' PARENT oMenuBar CONFIG oConfig ;
COLOR GRA_CLR_BLACK,GRA_CLR_YELLOW MOUSECOLOR nil,GRA_CLR_WHITE ;
ACTION {||cPP:="OK",DC_ReadGuiEvent(DCGUI_EXIT_OK,Getlist) }


DCADDBUTTONXP CAPTION SUCH_T(133) PARENT oMenuBar CONFIG oConfig ;
COLOR GRA_CLR_WHITE,GRA_CLR_RED MOUSECOLOR GRA_CLR_RED,GRA_CLR_WHITE ;
ACTION {||cPP:="EN",DC_ReadGuiEvent(DCGUI_EXIT_ABORD,Getlist) }

DCGETOPTIONS FONT "8.Courier New" SAYFONT "9.Arial" ;
SCALEFACTOR aScale AUTORESIZE

DCREAD GUI FIT OPTIONS Getoptions ;
TITLE cTitel ;
EVAL {|o|SetAppWindow(o)} CLEAREVENTS

User avatar
Tom
Posts: 1205
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: DCADDBUTTONXP

#2 Post by Tom »

You are doing this two times, but there's a typo at the second button: "DCGUI_EXIT_ABORD" should be "DCGUI_EXIT_ABORT". Remember DC_ReadGuiEvent(DCGUI_EXIT_ABORT,GetList) restores the values of the GetList items to there initial values, but this shouldn't be your problem, since "cPP" is a public variable.
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

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

Re: DCADDBUTTONXP

#3 Post by rdonnay »

I don't see any reason why this would not work.
The eXpress train is coming - and it has more cars.

D. Schuster
Posts: 38
Joined: Mon Feb 15, 2010 4:01 am

Re: DCADDBUTTONXP

#4 Post by D. Schuster »

Hello Roger,
it seems to me that in my case the part ACTION of DCADDBUTTONXP does'nt work.
I have tried
Instead of .. ACTION{||cPP:="OK", ....}
with ACTION{||MsgBox("Test"),.....}
but the message was not displayed!
It is curious, because in other parts of the complete program
there are no problems with DCADDBUTTONXP.

Dieter

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

Re: DCADDBUTTONXP

#5 Post by rdonnay »

This is very strange.
Is this true for both buttons or only for one of them?
The eXpress train is coming - and it has more cars.

D. Schuster
Posts: 38
Joined: Mon Feb 15, 2010 4:01 am

Re: DCADDBUTTONXP

#6 Post by D. Schuster »

Yes, i have the same effect on both buttons (that means no ACTION).
The buttons self are displayed correctly.
Dieter

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

Re: DCADDBUTTONXP

#7 Post by rdonnay »

I compiled the code that you posted and there is no problem.
Can you give me a sample that demonstrates the problem?
The eXpress train is coming - and it has more cars.

D. Schuster
Posts: 38
Joined: Mon Feb 15, 2010 4:01 am

Re: DCADDBUTTONXP

#8 Post by D. Schuster »

DCADDBUTTONXP works perfectly!

The mistake came from some lines before with an exit.
Thanks for the help and sorry for my mistake.
Dieter

Post Reply