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

  • Thanks to wide spread cloud hosting and innovations small businesses can meet and exceed the legacy systems of goliath corporations. Explore the freedom to work how you want, with a phone system that will adapt to your evolving needs and actually save you lots of expense—read Get an Enterprise Phone System without High Cost and Complexity. The article clearly illustrates: The only hardware you'll need is phone equipment for advanced voice and fax. How to join all your employees, mobile devices, …

  • To help companies compete in this constantly changing business world, finance executives and their teams must be more responsive and focus on delivering greater value. Along with a unique, enterprise-wide business perspective, finance needs simple and agile solutions to solve the next decade's challenges and accommodate the shift to becoming a service organization within the company. This eBook outlines some of the challenges facing organizations like yours and discusses how the right financial management …

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date