 |
|
 |
Masked Edit control is a native Shell32 control for ages !
You just have to call the exported function by its ordinal value.
No code needed.
Newbie and useless article...
|
|
|
|
 |
|
 |
I was just about to write my own masked edit, when I realized that perhaps someone at CP has already written one. I couldn't believe my eyes when there was a commercial grade component up for grabs..
Thanks!
--
Verletzen zerfetzen zersetzen zerstören
Doch es darf nicht mir gehören
Ich muss zerstören
|
|
|
|
 |
|
 |
My VC 6.0 project is MDI based and there are several dialogs.I want to add an mask edit control to one of those dialogs. I have got to input a series of characters with fixed format to this control.
Can the mask edit control act like this?
Once I want to input and click its edit area, a list with all contents that I can input(eg.0,1,...F) pops up so I can choose one(a character) from the associate list.Then,the mask edit pops up another list atomatically and wait my chosen for the next character.Each character was input in this way.I have experienced the convenience in an BCB project and want to know how to do with my vc60 projects to achieve my goal.
see reference pictures here
Thanks for your help.
|
|
|
|
 |
|
 |
My VC 6.0 project is MDI based and there are several dialogs.I want to add an mask edit control to one of those dialogs. I have got to input a series of characters with fixed format to this control.
Can the mask edit control act like this?
Once I want to input and click its edit area, a list with all contents that I can input(eg.0,1,...F) pops up so I can choose one(a character) from the associate list.Then,the mask edit pops up another list atomatically and wait my chosen for the next character.Each character was input in this way.I have experienced the convenience in an BCB project and want to know how to do with my vc60 projects to achieve my goal.
Thanks for your help.
|
|
|
|
 |
|
 |
Hi,
First of all, I've seen in the comments that there was an update from Dundas software to this control freely available, but it's not there yet. ¿Does anybody have the lastest free version of this control? I've started to use it and I'd like to have the lastest version, as it seems the one in CP is somewhat buggy.
In second term, I've added a function to this control, just because someone is interested. It's a symmetrical one from IsIputEmpty() that tests that ALL the character placeholders have been used (this is, there's no "prompt" characters in the editbox).
BOOL COXMaskedEdit::IsInputFull()
{
if (m_listData.GetCount()==0)
{
// No mask -> not empty text means 'full':
CString csInputData;
GetWindowText(csInputData);
return !csInputData.IsEmpty();
}
CMaskData* pobjData=NULL;
for(POSITION pos = m_listData.GetHeadPosition(); pos;)
{
pobjData = m_listData.GetNext(pos);
if (!pobjData->IsInputData() || pobjData->m_chValue == m_chPromptSymbol)
return FALSE;
}
return TRUE;
}
Best regards,
Eduard Huguet
Cibercat SL
Eduard Huguet (eduard@cibercat.es)
Cibercat SL
|
|
|
|
 |
|
 |
This control is great but unfortunately
functions OnPaste and OnCopy don't work at all for
me. When I try to copy or paste text from clipboard
program never enter into this functions. It was
compiled by VC++6. Please help me!
|
|
|
|
 |
|
 |
How can I get the control text (typed data with mask signs, but without prompt signs). Does this class support a method to do this.
For example:
Control mask: ##-####-##-#
Control text: 12-34-_-__-_
GetInputText returned: 1234____
I want to get: 12-34- or 12-34
I know i can do somthing like this:
CString GetInputDataNoPromptSign()
{
CString strText;
GetWindowText(strText);
int nPos = strText.Find(GetPromptSymbol(), 0);
if (nPos > 0)
{
return strText.Left(nPos);
}
return "";
}
Is there some other (simplier) way do do this?
|
|
|
|
 |
|
 |
First of all, the bugfixes have not been posted here and they can no longer be downloaded from Dundas website (afaik). So the current version is buggy (at least in regard to the DEL key lockup).
Second, I find a masked edit control quite useless when you can not provide arbitrary length. It's silly to set the mask to 50 alfabetic characters when you do not want a maximum. The prompt should only be shown if the text length is fixed.
This control is useless for receiving let's say e-mail addresses:
@<optional multiple unknown length.>.<2 or 3 length>.
So, why not simply integrate RegularExpressions into the validation process? At LEAST provide a option.
Anyway, unfortunately due to bugs and limitations this control was useless to me. I expected more than this from Dundas, even if it is for free.
|
|
|
|
 |
|
 |
Try http://www.codeproject.com/editctrl/FilterEdit.asp
Cheers
Ben
|
|
|
|
 |
|
 |
Just a brilliantly designed class. Complies and runs on EVC3 without any modifications.
However, I was wondering if it's possible to set the direction input gets entered into the mask.
For example:
User wants to input currency. Lets say $40.00 and the mask for this would have to be $##.## right. But say I want to allow larger amounts then the 10s place. I would want up to thousands ($####.##) but that mask would start the 40 dollar user typing $40__.__ and he would have to figure out how to get his 40 to the decimal place before moving on.
Would it be feasible to set cursor direction along with position. so as the user types the input moves left of the mask until all spaces to the left are filled, mask is typed, or right arrow/manual position is moved to the other side of the mask in which case the direction moves right again.
$____|.__ cursor starts here
$___4|.__ typed "4"
$__40|.__ typed "0"
$__40.|__ typed "." or r-arrow or mouse click
$__40.0|_ typed "0"
$__40.00 typed "0"
Another suggestion would be tabbing to change the position to after the next literal for something like an IP mask
|___.___.___.___
192.|___.___.___ auto because requirement met
192.168.|___.___ " "
192.168.1__.|___ typed "1" and Tabbed or spaced
|
|
|
|
 |
|
 |
Just what I needed
"Two wrongs don't make a right, but three lefts do!" - Alex Barylski
|
|
|
|
 |
|
 |
Hello Dundas,
I would like to know whether this control can be used in commercial applications.
Thanks
Kannan
|
|
|
|
 |
|
 |
He says we have the rights to it, just as though we bought it. So I assume this means yes!
"Two wrongs don't make a right, but three lefts do!" - Alex Barylski
|
|
|
|
 |
|
 |
SetClipMode function referenced appears to be missing and the link to the website to download the most up to date version mentioned in a previous message is now non-functional and there doesn't appear to be a link to it anywhere anymore.
A nice improvement would be the ability to make a mask that allows the user to type a number of characters after the mask portion, for example:
If a phone number is entered and the mask is:
(###)###-####
You can only type those characters.
However sometimes you want the user to be able to type this:
"(555)555-5555 Extension 55"
Or be able to tell the mask to fill from the right side instead so that a user with a phone mask as above doesn't always have to type the area code to fill the control.
Ground Zero Tech-Works
http://www.ayanova.com
|
|
|
|
 |
|
 |
This works on PocketPC 2000 emulator, but does not work on a PocketPC 2002 actual device. If I use a regular MFC CEdit control everything is ok. But when I change it to a masked edit control the application will not even launch!
Is there an update to this control?
|
|
|
|
 |
|
 |
I was just reading the comments here, and decided to check Dundas' web site for an update. It turns out the the problems mentioned here are fixed in Dundas' current version of the control which can be downloaded for free.
John
|
|
|
|
 |
|
 |
i had some problems to find the download page for this control at dundas.com because there's no direct link at the page, but now i finally found it.
it's at http://www.dundas.com/downloads/free .
grusz, kolja
|
|
|
|
 |
|
 |
Steps to reproduce:
1-Move the cursor to the last position
of the edit ( pressing End Key ).
2-Press the Del key.
3-The program hangs.
void COXMaskedEdit::OnKeyDown(UINT nChar, UINT nRepCnt...
....
if(nChar==VK_DELETE)
{
....
if(nSelectionStart==nSelectionEnd)
{
....
**** nSelectionEnd is incremented one more than
**** m_listData length
nSelectionEnd++;
....
....
*** nSelectionEnd enters the loop with a
*** value greater than m_listData length
*** here should put nSelectionEnd < m_listData.GetCount()
while (nSelectionEnd != m_listData.GetCount())
{
nSelectionStart++;
nSelectionEnd++;
if(DeleteRange(nSelectionStart, nSelectionEnd))
{
Update(nSelectionStart);
break;
}
}
....
|
|
|
|
 |
|
 |
I tried the above fix and it is fine except that the cursor moves to the start of the field. This happens because the DeleteRange() function is still called. To make the control work as a standard edit control, in the same circumstances, simply add the following two lines instead:
void COXMaskedEdit::OnKeyDown(UINT nChar, UINT nRepCnt...
....
if(nChar==VK_DELETE)
{
....
if(nSelectionStart == nSelectionEnd)
{
*** This will check if we are at the end of the text.
*** Since no text is selected
*** (nSelectionStart == nSelectionEnd) we do not need
*** the rest of the function
if(nSelectionEnd == m_listData.GetCount()) // add
return; // these
....
}
}
The cursor will now stay where it is.
Thanks for the bug report - it probably saved me a bit of embarassment.
Phil Davis
|
|
|
|
 |
|
 |
The control is just what I needed to divide up the text in an edit control easily. The only problem I have is that I check, if cancelling an edit for example, whether the field has been modified by using the GetModify()function, but any changes are not registered by the COXMaskedEdit class.
I have tried adding a SetModify() call in the OnSetText() function but am unable to get the correct results that I need.
Any ideas would be welcome.
Apart from this the control is superb - Thanks.
|
|
|
|
 |
|
 |
I had the same problem, and I resolved in this manner.
I added a private boolean variable, something like m_bIsModified.
In the constructor I set this variable to FALSE, and I added in OnSetText() function the following piece of code
if(::IsWindowVisible(GetSafeHwnd()))
m_bIsModified = TRUE;
just after
UNREFERENCED_PARAMETER(wParam);
UNREFERENCED_PARAMETER(lParam);
I added the GetModify() function, that return the value of m_bIsModified.
That variable is set to FALSE in every point when the control is cleared or contents deleted.
Not added the SetModify()...
|
|
|
|
 |
|
 |
You can use ON_EN_CHANGE() like you would for any other edit control.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
 |
|
 |
I would be impressed if I had not done something similar before windows existed. I do not mind the blatant advertising, but I want a name other than the companies attached the article. The company did not create it, an individual (or possibly a group) created it.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
 |