![]() |
Desktop Development »
Miscellaneous »
Custom Controls
Intermediate
A Spin Edit control with popup trackbarBy John GonzalezAn implementation of the spin-edit control used in Jasc Paint Shop Pro |
VC6, VC7, VC7.1, Windows, MFC, VS.NET2003, Dev
|
|
Advanced Search Add to IE Search |
|
|
|
||||||||||||||||

I've wanted to post an item for some time, so when I started working on this
component, I decided it was going to be it. The image editing software "Paint
Shop Pro" from Jasc software utilizes a unique combination of an edit, spin, and
trackbar functionality. I decided to try to derive my own version of this and
this is the result. Check the upper left are on the screenshot. I used VS 2003
but I see no reason why it can't be compiled and used with an earlier version.
The only requirement is that IE5 is required because it requires 32 bit calls
such as the GetPos32() API.
int GetValue() - Get the current value
void SetValue(int nValue) - Sets the current value
BOOL GetReadOnly() - Gets the readonly state of the edit field
void SetReadOnly(BOOL fReadOnly) - Sets the readonly state of
the edit field
void GetRange(int& nMin,int& nMax) - Gets the allowed
value range
void SetRange(int nMin,int nMax) - Sets the allowed value
rangeNES_SPIN - Includes the spin control
NES_POPUP - Includes the button on the far right that pops up a
floating trackbar
NES_LIVEUPDATE - Updates the parent about the value while
tracking. NEW
NES_METER - Includes the small bar underneath the edit
field.NEWNEM_GETPOS - Returns the current value as return value
NEM_SETPOS - Sets the current value. Passed in
LPARAM
NEM_GETRANGE - Returns allowed range. WPARAM and
LPARAM are treated as pointers to int's
NEM_SETRANGE - Sets the allowed range. Min is in
WPARAM and max in LPARAM
NEM_GETREADONLY - Gets the readonly state of the edit field.
NEW
NEM_SETREADONLY - Sets the readonly state of the edit field.
NEWNEN_CHANGED - Sent to the owner window when the value
changes// Declare a CNumericEdit CNumericEdit m_Edit; // // Creating the control // CRect rcRect(10,10,142,40); m_Edit.Create(WS_VISIBLE | WS_TABSTOP | NES_SPIN | NES_POPUP,rcRect,this,0); m_Edit.SetValue(50); m_Edit.SetRange(0,100);
4/13/2004 - 1.0
4/20/2004 - 1.01
NES_METER style to make the small bar under the edit
field optional
NES_LIVEUPDATE style. This style allows the control to
notify it's parent during value tracking. Without this style, the parent is
updated only at the end of tracking
DDX_NumericEdit() function for DDX support
| You must Sign In to use this message board. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
General
News
Question
Answer
Joke
Rant
Admin
Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+PgUp/PgDown to switch pages.
|
PermaLink |
Privacy |
Terms of Use
Last Updated: 22 Apr 2004 Editor: Nishant Sivakumar |
Copyright 2004 by John Gonzalez Everything else Copyright © CodeProject, 1999-2010 Web18 | Advertise on the Code Project |