SetFont(* parent->GetFont());
- // Subclass again for purposes of dialog editing mode
SubclassWin((WXHWND)m_hWnd);
-/* Label will be the same as button font now.
- if (labelFont)
- {
- labelFont->RealizeResource();
- if (labelFont->GetResourceHandle())
- SendMessage(ms_handle,WM_SETFONT,
- (WPARAM)labelFont->GetResourceHandle(),0L);
- }
-*/
-
// Some radio boxes test consecutive id.
(void)NewControlId() ;
m_radioButtons = new WXHWND[n];
0,0,0,0,
(HWND) parent->GetHWND(), (HMENU) m_windowId, wxGetInstance(), NULL) ;
-/*
- if (labelFont)
- {
- labelFont->RealizeResource();
- if (labelFont->GetResourceHandle())
- SendMessage(ms_handle,WM_SETFONT,
- (WPARAM)labelFont->GetResourceHandle(),0L);
- }
-*/
the_handle = (HWND) parent->GetHWND();
#if CTL3D
if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
yy = currentY;
+ AdjustForParentClientOrigin(xx, yy, sizeFlags);
+
char buf[400];
int y_offset = yy;
int nbHor,nbVer;
- if (m_windowStyle & wxRA_VERTICAL)
+ if (m_windowStyle & wxRA_HORIZONTAL)
{
nbVer = m_majorDim ;
nbHor = (m_noItems+m_majorDim-1)/m_majorDim ;
// Bidimensional radio adjustment
if (i&&((i%m_majorDim)==0)) // Why is this omitted for i = 0?
{
- if (m_windowStyle & wxRA_VERTICAL)
+ if (m_windowStyle & wxRA_HORIZONTAL)
{
y_offset = startY;
x_offset += maxWidth + cx1 ;
}
MoveWindow((HWND) m_radioButtons[i],x_offset,y_offset,eachWidth,eachHeight,TRUE);
- if (m_windowStyle & wxRA_VERTICAL)
+ if (m_windowStyle & wxRA_HORIZONTAL)
{
y_offset += maxHeight;
if (m_radioWidth[0]>0)
{
::ScreenToClient((HWND) parent->GetHWND(), &point);
}
+ // We may be faking the client origin.
+ // So a window that's really at (0, 30) may appear
+ // (to wxWin apps) to be at (0, 0).
+ if (GetParent())
+ {
+ wxPoint pt(GetParent()->GetClientAreaOrigin());
+ point.x -= pt.x;
+ point.y -= pt.y;
+ }
*x = point.x;
*y = point.y;
void wxRadioBox::SetFocus(void)
{
-/*
- if (m_noItems > 0)
- ::SetFocus((HWND) m_radioButtons[0]);
-*/
-/* Begin Alberts Patch 26. 5. 1997*/
if (m_noItems > 0)
{
if (m_selectedButton == -1)
else
::SetFocus((HWND) m_radioButtons[m_selectedButton]);
}
-/* Ende Alberts Patch*/
}
return FALSE;
}
-/*
-void wxRadioBox::SetLabelFont(wxFont *font)
-{
- // Decrement the usage count of the old label font
- // (we may be able to free it up)
- if (labelFont)
- labelFont->ReleaseResource();
-
- labelFont = font;
-
- // Increment usage count
- if (font)
- font->UseResource();
-
- HWND hWnd = GetHWND();
- if (hWnd != 0)
- {
- if (font)
- {
- font->RealizeResource();
-
- if (font->GetResourceHandle())
- SendMessage(hWnd, WM_SETFONT,
- (WPARAM)font->GetResourceHandle(),TRUE);
- }
- }
-}
-
-*/
-
bool wxRadioBox::ContainsHWND(WXHWND hWnd) const
{
int i;
ProcessCommand (event);
}
+long wxRadioBox::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
+{
+ if (nMsg == WM_NCHITTEST)
+ {
+ int xPos = LOWORD(lParam); // horizontal position of cursor
+ int yPos = HIWORD(lParam); // vertical position of cursor
+
+ ScreenToClient(&xPos, &yPos);
+
+ // Make sure you can drag by the top of the groupbox, but let
+ // other (enclosed) controls get mouse events also
+ if (yPos < 10)
+ return (long)HTCLIENT;
+ }
+
+ return wxControl::MSWWindowProc(nMsg, wParam, lParam);
+}