|
 |
|
|
There is a bit of a flaw in the api in that its not easy to simply say, GetNumericInputData() and return a negative int if someone types in -500 , you get simply 500 back.
Many functions such as OnGetText etc.. do insert a negative symbol (tho not using the negativeSymbol variable, but hardcoded to _T("-"), but others such as OnCopy do not (which is less usefull)
It just means adding a wrapped function to do a GetValue() which handles these, which should have been in there at the start.
SetNumericInputData() too is a little misleading in that by default it ignores a negative value, which is not right, as if it knows its value, negative should be as easily handled.
Other than that its ok.
_______________________________ Raul Software Engineer (www.ac3dec.com
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
First, thanx for you nice control. I used it in many projects succesfuly. Currentlly I encountered with a problem: It is impossible to copy data to clipboard by context menu. Please try: 1) right click in control 2) from context menu select 'copy'
Thanx
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
I can`t use LimitText(nMax) to limit he number of the input chars~? Can I change the code like that? void CXrNumericEdit::CharNumeric(UINT nChar, UINT nRepCnt, UINT nFlags) { // Added by 9ft UINT nMax = GetLimitText(); int nText = GetStringContents().GetLength(); BOOL bLimit = ( nText < nMax ); //---end int nSelectionStart=0; int nSelectionEnd =0;
GetSel(nSelectionStart, nSelectionEnd); TRACE(_T(" %2d, %2d Before\n"), nSelectionStart, nSelectionEnd);
if(nSelectionStart== nSelectionEnd) { int nActualI :- önsertionPoint= RPtoLP(nSelectionStart); BOOL bIsPrompt= IsPromptPosition(nActualInsertionPoint); //modifyed by 9ft if(m_bInsertMode && !bIsPrompt && bLimit ) nActualInsertionPoint= InsertAt(nActualInsertionPoint, (TCHAR)nChar); else if (IsValidInputPosition(nActualInsertionPoint)) nActualInsertionPoint= SetAt (nActualInsertionPoint, (TCHAR)nChar);
if (nActualInsertionPoint>= 0) nSelectionStart= LPtoRP(nActualInsertionPoint + 1);
Update(nSelectionStart); } else { int nActualInsertionPoint= RPtoLP(nSelectionStart); POSITION pos= m_listNumericData.FindIndex(nActualInsertionPoint); if (pos== NULL) return;
CXrNumericData* pobjData=new CXrNumericData(); pobjData->m_chValue= (TCHAR)nChar; m_listNumericData.InsertBefore(pos, pobjData);
if(DeleteRange(RPtoLP(nSelectionStart)+ 1, RPtoLP(nSelectionEnd)+ 1)) { if(nActualInsertionPoint >= 0) nSelectionStart= LPtoRP(nActualInsertionPoint + 1);
Update(nSelectionStart); } } }
hero hero
|
| Sign In·View Thread·PermaLink | 5.00/5 (1 vote) |
|
|
|
 |
|
|
Hi, I want to mention your name in a application I'm working on, and I don't known your full name. Can you please tell me? Thanks in advance. You made a very good edit control!
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
There are actually a couple of bugs when the format is set to where the decimal value is another other than a period '.', both on displaying and entering the data. On the display side, supposing you have say a COMMA set for the decimal value in the regional settings, then no values beyond the decimal point are displayed, only 0. On the entry side, it is impossible to enter ',' as the decimal point. I've managed to get all of these items fixed with several small patches throughout the code, if anyone is interested drop me an email (see my profile settings). This really is a very, very nice class.
- Jeff Donovan
|
| Sign In·View Thread·PermaLink | 5.00/5 (2 votes) |
|
|
|
 |
|
|
 |
|
|
This is a great class and thank you! There is a small error in that if the edit control has an attached buddy control, the keyboard arrows will now no longer work with the spinner. The solution is to:
1) In the xrnumericedit.cpp file, goto the function "OnKeyDown()", and remark out the VK_DOWN and VK_UP cases.
2) In the same function, same case, add a default handler to pass the message on to the base control, as in:
default: CEdit::OnKeyDown(nChar, nRepCnt, nFlags); break;
That will fix it and allow the keyboard arrows to again control the spinner.
Thanks again for providing the class,
Cheers!
- Jeff Donovan
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
There is also aboug when i do the setting as below:
m_edit.SetCountDigitsAfterDecimals(0); m_edit.SetCountDigitsDecimals(2); m_edit.SetDisplayDigitsDecimalsFormat(xrDDDFDataTypeFull); m_edit.SetDisplayLeadingZero(xrDLZDataTypeParcial);
The edit will not catch the 0(zero) at first digit.
|
| Sign In·View Thread·PermaLink | 5.00/5 (1 vote) |
|
|
|
 |
|
|
Maybe a bug? when I Set Focus to the Control it can't set properly sel with the text. how can i modify it?
Jenny Lover
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Congratulation for you great job! 
But you could perhaps document the different functions the users can use to setup the control; and to explain a little bit in your article which technologies and methods you applied to create that fantastic control!
|
| Sign In·View Thread·PermaLink | 5.00/5 (1 vote) |
|
|
|
 |
|
|
Hi, I found a bug regarding the digit grouping symbol. To reproduce it, run the demo project. First, change the decimal symbol to "," (comma), then change the digit grouping symbol to "." (dot). MessageBox "Please enter a number" will keep appearing from then on (try changing the input number after closing several MessageBoxes). Anyone knows how to fix this?
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
 | Create |  | Anonymous | 3:50 22 Feb '02 |
|
|
 |
|
|
 |
|
|
The file xrnumericedit.h appears to be missing...?
John Curtis. Software guy. Fatlab Software.
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
|
It is in the source file .... And you do create an include directory or change in projectthe path for this files.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |