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
DCADDBUTTONXP
Re: DCADDBUTTONXP
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."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Re: DCADDBUTTONXP
I don't see any reason why this would not work.
The eXpress train is coming - and it has more cars.
-
- Posts: 38
- Joined: Mon Feb 15, 2010 4:01 am
Re: DCADDBUTTONXP
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
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
Re: DCADDBUTTONXP
This is very strange.
Is this true for both buttons or only for one of them?
Is this true for both buttons or only for one of them?
The eXpress train is coming - and it has more cars.
-
- Posts: 38
- Joined: Mon Feb 15, 2010 4:01 am
Re: DCADDBUTTONXP
Yes, i have the same effect on both buttons (that means no ACTION).
The buttons self are displayed correctly.
Dieter
The buttons self are displayed correctly.
Dieter
Re: DCADDBUTTONXP
I compiled the code that you posted and there is no problem.
Can you give me a sample that demonstrates the problem?
Can you give me a sample that demonstrates the problem?
The eXpress train is coming - and it has more cars.
-
- Posts: 38
- Joined: Mon Feb 15, 2010 4:01 am
Re: DCADDBUTTONXP
DCADDBUTTONXP works perfectly!
The mistake came from some lines before with an exit.
Thanks for the help and sorry for my mistake.
Dieter
The mistake came from some lines before with an exit.
Thanks for the help and sorry for my mistake.
Dieter