- int new_width = (int)(wxMax(min_len, max_len));
- int valueHeight = (int)cyf;
-#ifdef __WIN32__
- // For some reason, under Win95, the text edit control has
- // a lot of space before the first character
- new_width += 3*cx;
-#endif
- // The height needs to be a bit bigger under Win95 if using native
- // 3D effects.
- valueHeight = (int) (valueHeight * 1.5) ;
- MoveWindow((HWND) m_staticValue, x_offset, y_offset, new_width, valueHeight, TRUE);
- x_offset += new_width + cx;
+ lMsStyle |= WS_VISIBLE | SS_TEXT | DT_VCENTER;
+
+ //
+ // If the parent is a scrolled window the controls must
+ // have this style or they will overlap the scrollbars
+ //
+ if (pParent)
+ if (pParent->IsKindOf(CLASSINFO(wxScrolledWindow)) ||
+ pParent->IsKindOf(CLASSINFO(wxGenericScrolledWindow)))
+ lMsStyle |= WS_CLIPSIBLINGS;
+
+ m_hStaticValue = (WXHWND)::WinCreateWindow( (HWND)GetHwndOf(pParent) // Parent window handle
+ ,WC_STATIC // Window class
+ ,(PSZ)NULL // Initial Text
+ ,(ULONG)lMsStyle // Style flags
+ ,0L, 0L, 0L, 0L // Origin -- 0 size
+ ,(HWND)GetHwndOf(pParent) // owner window handle (same as parent
+ ,HWND_TOP // initial z position
+ ,(ULONG)NewControlId() // Window identifier
+ ,NULL // no control data
+ ,NULL // no Presentation parameters
+ );
+
+ //
+ // Now create min static control
+ //
+ sprintf(wxBuffer, "%d", nMinValue);
+ lWstyle = SS_TEXT|DT_LEFT|WS_VISIBLE;
+ if (m_windowStyle & wxCLIP_SIBLINGS)
+ lWstyle |= WS_CLIPSIBLINGS;
+ //
+ // If the parent is a scrolled window the controls must
+ // have this style or they will overlap the scrollbars
+ //
+ if (pParent)
+ if (pParent->IsKindOf(CLASSINFO(wxScrolledWindow)) ||
+ pParent->IsKindOf(CLASSINFO(wxGenericScrolledWindow)))
+ lWstyle |= WS_CLIPSIBLINGS;
+
+ m_hStaticMin = (WXHWND)::WinCreateWindow( (HWND)GetHwndOf(pParent) // Parent window handle
+ ,WC_STATIC // Window class
+ ,(PSZ)wxBuffer // Initial Text
+ ,(ULONG)lWstyle // Style flags
+ ,0L, 0L, 0L, 0L // Origin -- 0 size
+ ,(HWND)GetHwndOf(pParent) // owner window handle (same as parent
+ ,HWND_TOP // initial z position
+ ,(ULONG)NewControlId() // Window identifier
+ ,NULL // no control data
+ ,NULL // no Presentation parameters
+ );