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

  • This paper introduces IBM Java on the IBM PowerLinux 7R2 server and describes IBM's implementation of the Java platform, which includes IBM's Java Virtual Machine and development toolkit.

  • Targeted attacks and advanced threats are customized to infiltrate your unique IT infrastructure, evade conventional defenses, and remain hidden while stealing your corporate data. To detect these criminal intrusions, analysts and security experts agree that organizations should deploy advanced threat protection as part of an expanded security monitoring strategy. For this comparative analysis of breach detection systems, product analysis reports and comparative analysis reports are used to create the security …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds