DCGET PICTURE "(999)999-9999" problem
DCGET PICTURE "(999)999-9999" problem
When a DCGET with a PICTURE "(999)999-9999" is first entered, the cursor is correctly positioned in the first blank spot immediately after the (. However, when you start typing a number, the cursor moves back to the ( position and no numbers are displayed. You have to use an arrow key or mouse to move the cursor back to the position after the ( before numbers can be entered. (The variable in the DCGET is initially set to all blanks.)
Re: DCGET PICTURE "(999)999-9999" problem
Use this all the time. i set the initial variable to that format. so it would be "( ) - ".
Goes right past the non-numbers.
Do that on all my phone numbers.
Fred
Omni
Goes right past the non-numbers.
Do that on all my phone numbers.
Fred
Omni
Re: DCGET PICTURE "(999)999-9999" problem
Alas, that did not work. I am using Version 2.0 build 266 with Xbase++ 2.0 build 1023. I've attached a very simple program to demonstrate.
- Attachments
-
- EXAMPLE.ZIP
- (1.18 KiB) Downloaded 986 times
Re: DCGET PICTURE "(999)999-9999" problem
It works properly in build 264 but fails with 265 and 266.
Here is the solution.
The function DC_XbpGetSetInputFocusBlock() was added in build 265 because it was requested by several eXpress++ users that they want to control the behavior of DCGET objects when they get focus and kill focus.
Unfortunately, the new default behavior is messing with your picture clause.
I will work on a solution in build 267.
Here is the workaround you need to put in your code (build 265 or later) to force it to the original behavior :
Here is the solution.
The function DC_XbpGetSetInputFocusBlock() was added in build 265 because it was requested by several eXpress++ users that they want to control the behavior of DCGET objects when they get focus and kill focus.
Unfortunately, the new default behavior is messing with your picture clause.
I will work on a solution in build 267.
Here is the workaround you need to put in your code (build 265 or later) to force it to the original behavior :
Code: Select all
Function MAIN()
oRootWindow:=SetAppWindow()
nMaxCol:=oRootWindow:maxCol
nFontWidth:=oRootWindow:fontWidth
DC_XbpGetKillInputFocusBlock( {|x,y,o| ;
IIF(o:isGetDataOnLostFocus,o:getData(),nil), ;
IIF(o:isGetDataOnLostFocus,o:setData(),nil), ;
o:home(), ;
DC_HiliteGets(o,2,o:getList:getOptions[nGETOPT_HILITECOLOR]), ;
DC_ColorGets(o,2,o:getList:getOptions[aGETOPT_COLORGETS]), ;
DC_PopupButtonShow(o,.f.)})
DC_XbpGetSetInputFocusBlock( {|x,y,o| ;
o:DateFlag := .T., ;
o:Home(), ;
DC_HiliteGets(o,1,o:getList:getOptions[nGETOPT_HILITECOLOR]), ;
DC_ColorGets(o,1,o:getList:getOptions[aGETOPT_COLORGETS]), ;
DC_PopupButtonShow(o,.t.)})
MyPanApp()
RETURN (Nil)
The eXpress train is coming - and it has more cars.
Re: DCGET PICTURE "(999)999-9999" problem
Roger,
because I have the same Problem I tried to use your solution, but the Compiler reports the error "unresolved external Symbol DC_popupbuttonshow".
My express-Version is 266.
Werner
because I have the same Problem I tried to use your solution, but the Compiler reports the error "unresolved external Symbol DC_popupbuttonshow".
My express-Version is 266.
Werner
Re: DCGET PICTURE "(999)999-9999" problem
It appears that you are using build 265."unresolved external Symbol DC_popupbuttonshow"
DC_PopupButtonShow() was added in build 266.
This workaround will also require that you add this small function to your code.
Code: Select all
FUNCTION DC_PopupButtonShow( oGet, lShow )
IF !DC_GetPopupAutoHide() .OR. Empty(oGet:popupButton)
RETURN nil
ENDIF
IF lShow
oGet:popupButton:show()
ELSEIF SetAppFocus() # oGet:popupButton
oGet:popupButton:hide()
ENDIF
RETURN nil
The eXpress train is coming - and it has more cars.
Re: DCGET PICTURE "(999)999-9999" problem
Roger,
thank you for this completion. Now the Compiler is satisfied.
I bought the current Express++ build 266 in August 31, 2018 so it's strange you suppose I work with 265.
Maybe you added this function DC_popupbuttonshow later to build 266?
Regards, Werner
thank you for this completion. Now the Compiler is satisfied.
I bought the current Express++ build 266 in August 31, 2018 so it's strange you suppose I work with 265.
Maybe you added this function DC_popupbuttonshow later to build 266?
Regards, Werner
Re: DCGET PICTURE "(999)999-9999" problem
I must have been mistaken.Maybe you added this function DC_popupbuttonshow later to build 266
I guess I added it to my current build which is not yet released.
The eXpress train is coming - and it has more cars.
Re: DCGET PICTURE "(999)999-9999" problem
OK, kindly let me know when build 267 is available.
-
- Posts: 176
- Joined: Thu Nov 05, 2020 10:51 am
- Location: DOMINICAN REPUBLIC
Re: DCGET PICTURE "(999)999-9999" problem
Hello Roger, hello everyone.
I have started using version 2.0 of Express, which I bought last year. And, the only problem I have is precisely this, the picture in the phone numbers. I have added the source code you indicate to my project, but it doesn't work for me. I must be doing something wrong.
Could you help me please?
IF !DC_GetPopupAutoHide() .OR. Empty(oGet:popupButton)
RETURN nil
ENDIF
IF lShow
oGet:popupButton:show()
ELSEIF SetAppFocus() # oGet:popupButton
oGet:popupButton:hide()
ENDIF
RETURN nil
I have started using version 2.0 of Express, which I bought last year. And, the only problem I have is precisely this, the picture in the phone numbers. I have added the source code you indicate to my project, but it doesn't work for me. I must be doing something wrong.
Could you help me please?
IF !DC_GetPopupAutoHide() .OR. Empty(oGet:popupButton)
RETURN nil
ENDIF
IF lShow
oGet:popupButton:show()
ELSEIF SetAppFocus() # oGet:popupButton
oGet:popupButton:hide()
ENDIF
RETURN nil