[Closed] Getting mad about ISpinnerControl and CC_SPINNER_CHANGE
I’ve test all ideas I have I tried to put my spinner control in any parts and so but I didn’t manage to get a CC_SPINNER_CHANGE signal but I ever get a WM_NOTIFY one and the LOWORD(wParam) is my proper value IDC_SPINTEST.
I mean
static INT_PTR CALLBACK testParamsDlgProc(
HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
{
switch (msg) {
case CC_SPINNER_CHANGE:
//never called
break;
case WM_NOTIFY:
//called on clicking over the spinner
break;
}
Unfortunatly
ISpinnerControl * sp=( ISpinnerControl *)lParam;
sp->GetIVal();
doesn’t work neither (but it doesn’t crash or something like that.
Also testing:
ISpinnerControl * sp=( ISpinnerControl *)lParam;
sp->GetIVal();
MessageBox (NULL,"HI", "TITTLE", NULL)
The messagebox is not shown.
case WM_INITDIALOG:
mSpinner= ( ISpinnerControl *)GetISpinner(GetDlgItem(hWnd,IDC_SPINTEST));
MessageBox (NULL, "HEY!", "START", NULL);
mSpinner->SetLimits(1,100000,1);
MessageBox (NULL, "Hey B!", "START", NULL);
Hey message box is shown, Hey B! is NOT shown but remember that LOWORD(wParam) is correctly equal to IDC_SPINTEST when WM_NOTIFY happens.
Really really weird for me.
looks like mSpinner is NULL…
make sure to use the correct resource-id, the one with class = “SpinnerControl” (not the edit field)
maybe it’s IDC_SPINTEST_SPIN ??
guruware
No, I’m trying to limit it on loading.
Notice that other controls like buttons, checks and so are working fine in the same panel.
I’ve not much experience in this area but I notice 3dsmax plugins use these commands to set up spinners:
CoreExport ISpinnerControl *SetupIntSpinner(HWND hwnd, int idSpin, int idEdit, int min, int max, int val);
CoreExport ISpinnerControl *SetupFloatSpinner(HWND hwnd, int idSpin, int idEdit, float min, float max, float val, float scale = 0.1f);
CoreExport ISpinnerControl *SetupUniverseSpinner(HWND hwnd, int idSpin, int idEdit, float min, float max, float val, float scale = 0.1f);
from custcont.h:
*! \brief Handy routines for setting up Integer Spinners.
This global function (not part of class ISpinnerControl) is used
for setting up Spinners. It performs the equivalent of GetISpinner(), SetLimits(), SetValue(), and
LinkToEdit().
WARNING: To prevent a Memory Leak, be sure to call ReleaseISpinner on the pointer that this function returns.
\param HWND hwnd – The handle of the dialog box in which the spinner appears.
\param int idSpin – The ID of the spinner.
\param int idEdit – The ID of the edit control.
\param int min – The minimum allowable value.
\param int max – The maximum allowable value.
\param int val – The initial value for the spinner.
\return – A pointer to the spinner control. */
In the rc file is defined as:
CONTROL "",IDC_SPINTEST,"msctls_updown32",UDS_AUTOBUDDY | UDS_ARROWKEYS
| UDS_HOTTRACK | WS_TABSTOP,56,18,9,11,WS_EX_TRANSPARENT
and in resource.h
#define IDC_SPINTEST 1052
As i said I can recive WM_NOTIFY so it is exists and is correctly named.
This is really a dev. nightmare
you need to use a custom control type “SpinnerControl” not “msctls_updown32” check out other panels in samples
You are right!!! also I had to change the text edit controls to “CustEdit”
Really thank you for your time to everyone.