MKI_DialogHandleSpinDouble (Dialogs) New in Version 2022.2

www.CAD6.com

C++ Syntax

bool

MKI_DialogHandleSpinDouble(

 HWND f_hWindow,

 WPARAM f_wParam,

 LPARAM f_lParam,

 __int32 f_nPlusCtl,

 __int32 f_nMinusCtl,

 __int32 f_nEditCtl,

 double f_dMin,

 double f_dMax,

 double f_dStep );

 

This procedure handles all messages belonging to a spin control pair associated with an edit control with any double value.

 

Windows 11 no longer supports scrollbars in a decent way (as the arrows are hidden unless hovered above) and official spin controls cannot be unlimited or use double values. So we replaced most scrollbars in dialog windows with sliders or custom spin controls made out of a '+' and a '–' button. We encourage you to use those replacements, too.

 

Parameters

f_hWindow

[HWND] Handle of the dialog window that contains the controls.

f_wParam

[WPARAM] The value of the wParam parameter passed to the window's callback procedure.

f_lParam

[LPARAM] The value of the lParam parameter passed to the window's callback procedure.

f_nCtlPlus

[__int32] Identification number of the '+' button.

f_nCtlMinus

[__int32] Identification number of the '–' button.

f_nCtlEdit

[__int32] Identification number of the edit control that shall be associated with the spin controls.

f_dMin

[double] Minimum value allowed in the edit control. Set to MKI_DOUBLE_NOVAL to ignore.

f_dMax

[double] Maximum value allowed in the edit control. Set to MKI_DOUBLE_NOVAL to ignore.

f_dStep

[double] Amount by which the current value shall be decreased/increased for each press of a button. Must be larger than MKI_EDIT_MIN.

 

Return Value

Returns true if the edit control's value was changed, else false.

 

Comment

This procedure should be called in the WM_COMMAND case of the dialog's window procedure:

 

INT_PTR CALLBACK

DialogProc( HWND f_hDlg, UINT f_unMessage, WPARAM f_wParam, LPARAM f_lParam )

{

  __int32 nValue;

 

  switch( f_unMessage )

  {

    case WM_COMMAND:

      switch( GET_WM_COMMAND_ID( f_wParam, f_lParam ) )

      {

        ...

 

        default:

          MKI_DialogHandleSpinDouble( f_hDlg, f_wParam, f_lParam,

                                      IDD_SCROLL0, IDD_SCROLL1, IDD_EDIT0, 5.0 );

          break;

      }

      break;

  }

  return( false );

}

 

CAD6interface 2025.0 - Copyright 2025 Malz++Kassner® GmbH