Notifications
Clear all

[Closed] Spinner increment/decrement value

Is there a way to specify a spinner’s “increment/decrement” value. For instance, have a spinner only increment/decrement by 4.
4, 8, 12, 16, 20, etc.

Something like "p_increment VAL" would be nice..

I have a ghetto workaround that I do in BuildMesh, but I was just wondering if there was a better way.

  int segs;
    pblock2->GetValue(pb_segs, t, segs, ivalid);
    if (segs % 4 != 0) {
  	  switch (segs % 4){
  		 case 1:		  segs += 3; break;
  		 case 2:		  segs += 2; break;
  		 default: segs -= 3; break;
  	}
  	pblock2->SetValue(pb_segs, t, segs);
    }
    
Thanks.
1 Reply

When you specify your spinner parameters in ParamBlockDesc2 – it’s the fifth parameter after p_ui :

p_ui,             TYPE_SPINNER,        EDITTYPE_UNIVERSE, IDC_LEFT_EDIT,    IDC_LEFT_SPIN, 0.50f, //this 0.50f value is the step size