An E Notation Numeric Edit Control

NumEdit is a simple edit control that forces the user to enter a double value in e notation, such as 1.23, 12e4, -12E4, and so forth. The member functions GetValue() and SetValue() make working with doubles in the edit field a bit easier.

Just declare a variable as type CNumEdit, and off you go.

Download demo project - 28 KB

Download source - 2 KB



About the Author

Mike Scanlon

Visit http://mike.pricklysoft.com.

Comments

  • Thanks

    Posted by lukecodeguru on 02/22/2006 12:26am

    I appreciate that code. Thanks to you!

    Reply
  • Thanks

    Posted by sangamesha on 10/28/2004 08:22am

    I found it is helpfull.

    Reply
  • ExEditors Library

    Posted by Legacy on 03/19/2002 12:00am

    Originally posted by: Mike Philips

    A complete collection of editors in a single file:
    
    

    http://www.exontrol.com/sg.jsp?content=products/exeditors

    Regards,
    Mike

    Reply
  • NumEdit: for VC++ newbies

    Posted by Legacy on 08/08/2000 12:00am

    Originally posted by: Eric Hurtebis

    Many thanks for NumEdit: that's all what I was looking for...

    Just to tell about how I used it in my project:

    Copy the 2 files NumEdit.cpp and NumEdit.h in your project directory. Include them in your project (Project, Add).
    (the class CNumEdit will appear in ClassView).

    Add a Edit control in your dialog ressource.
    Add a member variable, CEdit type (e.g. m_x).

    In ClassView, class C...Dlg, double-click on m_x to modify C...Dlg.h:
    change CEdit m_x into CNumEdit m_x.
    also #include NumEdit.h

    In OnInitDialog, you can initialize m_x:
    m_x.SetValue(3.1415).

    Possible enhancements:
    the format string "%G" can be a private member; and can be user-tunable, e.g. "%8.3f", usable for SetValue or UpdateValue (for display, as soon as killfocus).

    Thanks,
    Eric.

    Reply
  • NumEdit

    Posted by Legacy on 03/07/2000 12:00am

    Originally posted by: Boris

    Found Bugs:
    1. on Paste - lets you make paste
    2. lets insert chars(numeric) before "-"
    :)

    Reply
  • Thanks!

    Posted by Legacy on 12/03/1999 12:00am

    Originally posted by: Carlos Melo

    It's just what I need!
    Thanks a lot.
    Keep up the good work.

    Greetings from Portugal,
    Carlos

    Reply
  • A bug found in CPrinter::PrintText(PRTTYPE *ps,double LineSpacing)

    Posted by Legacy on 04/23/1999 12:00am

    Originally posted by: Joseph Kiernan

    ----------------------------------
    
    If you want to use display text in CScrollView::OnDraw(),
    you must change
    ps->pDC->LPtoDP((LPPOINT)&rc, 2);
    ==> ps->pDC->LPtoDP((CRect)rc);

    --------------------------------------

    This may no work as intended. The cast to a CRect causes
    the RECT rc to be copied into a temporary object. This
    temp object is passed to the LP2DP(), changed, then
    discarded. The original rc is not changed! This has the
    exact same effect as not calling the LPtoDP at all.

    The proposed solution (or commenting out the LPtoDP) does
    seem to work for CScrollView but not for any print
    previews. The solution we ended up with (to support both
    view classes)was

    extern BOOL g_bUsingScrollView;
    if (! g_bUsingScrollView)
    ps->pDC->LPtoDP(&rc);

    // don't forget about LastPos at the end of the function

    Reply
  • res dir added

    Posted by Legacy on 02/02/1999 12:00am

    Originally posted by: Mike Scanlon

    The res dir has been added to the demo project.

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Live Event Date: October 29, 2014 @ 11:00 a.m. ET / 8:00 a.m. PT Are you interested in building a cognitive application using the power of IBM Watson? Need a platform that provides speed and ease for rapidly deploying this application? Join Chris Madison, Watson Solution Architect, as he walks through the process of building a Watson powered application on IBM Bluemix. Chris will talk about the new Watson Services just released on IBM bluemix, but more importantly he will do a step by step cognitive …

  • Live Event Date: October 29, 2014 @ 1:00 p.m. ET / 10:00 a.m. PT It's well understood how critical version control is for code. However, its importance to DevOps isn't always recognized. The 2014 DevOps Survey of Practice shows that one of the key predictors of DevOps success is putting all production environment artifacts into version control. In this eSeminar, Gene Kim will discuss these survey findings and will share woeful tales of artifact management gone wrong! Gene will also share examples of how …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds