1 /////////////////////////////////////////////////////////////////////////////
4 // Author: David Webster
8 // Copyright: (c) David Webster
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // For compilers that support precompilation, includes "wx.h".
13 #include "wx/wxprec.h"
18 #include "wx/wxchar.h"
19 #include "wx/string.h"
20 #include "wx/bitmap.h"
22 #include "wx/radiobox.h"
25 #include "wx/os2/private.h"
27 IMPLEMENT_DYNAMIC_CLASS(wxRadioBox
, wxControl
)
29 // ---------------------------------------------------------------------------
31 // ---------------------------------------------------------------------------
33 // wnd proc for radio buttons
34 MRESULT EXPENTRY
wxRadioBtnWndProc( HWND hWnd
39 MRESULT EXPENTRY
wxRadioBoxWndProc( HWND hWnd
45 // ---------------------------------------------------------------------------
47 // ---------------------------------------------------------------------------
49 // the pointer to standard radio button wnd proc
50 extern void wxAssociateWinWithHandle( HWND hWnd
53 static WXFARPROC fnWndProcRadioBtn
= NULL
;
54 static WXFARPROC fnWndProcRadioBox
= NULL
;
56 // ===========================================================================
58 // ===========================================================================
60 // ---------------------------------------------------------------------------
62 // ---------------------------------------------------------------------------
65 wxRadioBox::wxRadioBox()
67 m_nSelectedButton
= -1;
70 m_ahRadioButtons
= NULL
;
72 m_pnRadioWidth
= NULL
;
73 m_pnRadioHeight
= NULL
;
74 } // end of wxRadioBox::wxRadioBox
76 wxRadioBox::~wxRadioBox()
78 m_isBeingDeleted
= TRUE
;
83 for (i
= 0; i
< m_nNoItems
; i
++)
84 ::WinDestroyWindow((HWND
)m_ahRadioButtons
[i
]);
85 delete[] m_ahRadioButtons
;
88 delete[] m_pnRadioWidth
;
90 delete[] m_pnRadioHeight
;
91 } // end of wxRadioBox::~wxRadioBox
93 void wxRadioBox::AdjustButtons(
103 int nYOffset
= nY
+ nHeight
;
113 wxGetCharSize( m_hWnd
118 vMaxSize
= GetMaxButtonSize();
119 nMaxWidth
= vMaxSize
.x
;
120 nMaxHeight
= vMaxSize
.y
;
123 nYOffset
-= (nMaxHeight
+ ((3*nCy1
)/2));
128 for (int i
= 0; i
< m_nNoItems
; i
++)
131 // The last button in the row may be wider than the other ones as the
132 // radiobox may be wider than the sum of the button widths (as it
133 // happens, for example, when the radiobox label is very long)
135 bool bIsLastInTheRow
;
137 if (m_windowStyle
& wxRA_SPECIFY_COLS
)
140 // Item is the last in its row if it is a multiple of the number of
141 // columns or if it is just the last item
145 bIsLastInTheRow
= ((n
% m_nMajorDim
) == 0) || (n
== m_nNoItems
);
147 else // winRA_SPECIFY_ROWS
150 // Item is the last in the row if it is in the last columns
152 bIsLastInTheRow
= i
>= (m_nNoItems
/m_nMajorDim
) * m_nMajorDim
;
156 // Is this the start of new row/column?
158 if (i
&& (i
% m_nMajorDim
== 0))
160 if (m_windowStyle
& wxRA_SPECIFY_ROWS
)
164 // Start of new column
167 nXOffset
+= nMaxWidth
+ nCx1
;
169 else // start of new row
172 nYOffset
-= nMaxHeight
;
173 if (m_pnRadioWidth
[0] > 0L)
183 // Make the button go to the end of radio box
185 nWidthBtn
= nStartX
+ nWidth
- nXOffset
- (2 * nCx1
);
186 if (nWidthBtn
< nMaxWidth
)
187 nWidthBtn
= nMaxWidth
;
192 // Normal button, always of the same size
194 nWidthBtn
= nMaxWidth
;
198 // Make all buttons of the same, maximal size - like this they
199 // cover the radiobox entirely and the radiobox tooltips are always
200 // shown (otherwise they are not when the mouse pointer is in the
201 // radiobox part not beYInt32ing to any radiobutton)
203 ::WinSetWindowPos( (HWND
)m_ahRadioButtons
[i
]
209 ,SWP_ZORDER
| SWP_SIZE
| SWP_MOVE
| SWP_SHOW
212 // Where do we put the next button?
214 if (m_windowStyle
& wxRA_SPECIFY_ROWS
)
219 nYOffset
-= nMaxHeight
;
220 if (m_pnRadioWidth
[0] > 0)
226 // To the right of this one
228 nXOffset
+= nWidthBtn
+ nCx1
;
231 } // end of wxRadioBox::AdjustButtons
233 void wxRadioBox::Command (
234 wxCommandEvent
& rEvent
237 SetSelection (rEvent
.GetInt());
238 ProcessCommand(rEvent
);
239 } // end of wxRadioBox::Command
241 bool wxRadioBox::ContainsHWND(
245 size_t nCount
= GetCount();
248 for (i
= 0; i
< nCount
; i
++)
250 if (GetRadioButtons()[i
] == hWnd
)
254 } // end of wxRadioBox::ContainsHWND
256 bool wxRadioBox::Create(
259 , const wxString
& rsTitle
260 , const wxPoint
& rPos
261 , const wxSize
& rSize
262 , const wxArrayString
& asChoices
265 , const wxValidator
& rVal
266 , const wxString
& rsName
269 wxCArrayString
chs(asChoices
);
271 return Create(pParent
, vId
, rsTitle
, rPos
, rSize
, chs
.GetCount(),
272 chs
.GetStrings(), nMajorDim
, lStyle
, rVal
, rsName
);
275 bool wxRadioBox::Create(
278 , const wxString
& rsTitle
279 , const wxPoint
& rPos
280 , const wxSize
& rSize
282 , const wxString asChoices
[]
285 , const wxValidator
& rVal
286 , const wxString
& rsName
292 vColour
.Set(wxString("BLACK"));
293 m_backgroundColour
= pParent
->GetBackgroundColour();
294 m_nSelectedButton
= -1;
297 m_nMajorDim
= nMajorDim
== 0 ? nNum
: nMajorDim
;
298 m_nNoRowsOrCols
= nMajorDim
;
301 // Common initialization
303 if (!CreateControl( pParent
312 if (!OS2CreateControl( "STATIC"
320 wxAssociateWinWithHandle(m_hWnd
, this);
321 #if RADIOBTN_PARENT_IS_RADIOBOX
322 HWND hWndParent
= GetHwnd();
324 HWND hWndParent
= GetHwndOf(pParent
);
329 // Some radio boxes test consecutive id.
332 (void)NewControlId();
333 m_ahRadioButtons
= new WXHWND
[nNum
];
334 m_pnRadioWidth
= new int[nNum
];
335 m_pnRadioHeight
= new int[nNum
];
337 for (int i
= 0; i
< nNum
; i
++)
339 m_pnRadioWidth
[i
] = m_pnRadioHeight
[i
] = -1;
341 long lStyleBtn
= BS_AUTORADIOBUTTON
| WS_TABSTOP
| WS_VISIBLE
;
342 int nNewId
= NewControlId();
344 if (i
== 0 && lStyle
== 0)
345 lStyleBtn
|= WS_GROUP
;
347 HWND hWndBtn
= (WXHWND
)::WinCreateWindow ( GetHwndOf(pParent
)
358 lColor
= (LONG
)vColour
.GetPixel();
359 ::WinSetPresParam( hWndBtn
364 lColor
= (LONG
)m_backgroundColour
.GetPixel();
366 ::WinSetPresParam( hWndBtn
375 m_ahRadioButtons
[i
] = (WXHWND
)hWndBtn
;
376 SubclassRadioButton((WXHWND
)hWndBtn
);
377 wxAssociateWinWithHandle(hWndBtn
, this);
378 wxOS2SetFont( hWndBtn
381 ::WinSetWindowULong(hWndBtn
, QWL_USER
, (ULONG
)this);
382 m_aSubControls
.Add(nNewId
);
386 // Create a dummy radio control to end the group.
388 (void)::WinCreateWindow ( GetHwndOf(pParent
)
391 ,WS_GROUP
| BS_AUTORADIOBUTTON
395 ,(HMENU
)NewControlId()
399 SetFont(*wxSMALL_FONT
);
400 fnWndProcRadioBox
= (WXFARPROC
)::WinSubclassWindow( GetHwnd()
401 ,(PFNWP
)wxRadioBoxWndProc
403 ::WinSetWindowULong(GetHwnd(), QWL_USER
, (ULONG
)this);
404 lColor
= (LONG
)vColour
.GetPixel();
405 ::WinSetPresParam( m_hWnd
410 ::WinSetPresParam( m_hWnd
415 lColor
= (LONG
)m_backgroundColour
.GetPixel();
417 ::WinSetPresParam( m_hWnd
422 ::WinSetPresParam( m_hWnd
436 } // end of wxRadioBox::Create
438 wxSize
wxRadioBox::DoGetBestSize() const
440 return (GetTotalButtonSize(GetMaxButtonSize()));
441 } // end of WinGuiBase_CRadioBox::DoGetBestSize
443 void wxRadioBox::DoSetSize(
457 #if RADIOBTN_PARENT_IS_RADIOBOX
466 wxSize vMaxSize
= GetMaxButtonSize();
475 m_nSizeFlags
= nSizeFlags
;
476 GetPosition( &nCurrentX
483 if (nX
== -1 && !(nSizeFlags
& wxSIZE_ALLOW_MINUS_ONE
))
485 if (nY
== -1 && !(nSizeFlags
& wxSIZE_ALLOW_MINUS_ONE
))
492 wxGetCharSize( m_hWnd
499 // Attempt to have a look coherent with other platforms: We compute the
500 // biggest toggle dim, then we align all items according this value.
502 vMaxSize
= GetMaxButtonSize();
503 nMaxWidth
= vMaxSize
.x
;
504 nMaxHeight
= vMaxSize
.y
;
506 vTotSize
= GetTotalButtonSize(vMaxSize
);
507 nTotWidth
= vTotSize
.x
;
508 nTotHeight
= vTotSize
.y
;
511 // Only change our width/height if asked for
515 if (nSizeFlags
& wxSIZE_AUTO_WIDTH
)
523 if (nSizeFlags
& wxSIZE_AUTO_HEIGHT
)
524 nHeight
= nTotHeight
;
526 nHeight
= nHeightOld
;
529 wxWindowOS2
* pParent
= (wxWindowOS2
*)GetParent();
533 int nOS2Height
= GetOS2ParentHeight(pParent
);
535 nYy
= nOS2Height
- (nYy
+ nHeight
);
536 nYOffset
= nYy
+ nHeight
;
542 ::WinQueryWindowRect(HWND_DESKTOP
, &vRect
);
543 nYy
= vRect
.yTop
- (nYy
+ nHeight
);
545 ::WinSetWindowPos( GetHwnd()
551 ,SWP_ZORDER
| SWP_SIZE
| SWP_MOVE
| SWP_SHOW
555 // Now position all the buttons: the current button will be put at
556 // wxPoint(x_offset, y_offset) and the new row/column will start at
557 // startX/startY. The size of all buttons will be the same wxSize(maxWidth,
558 // maxHeight) except for the buttons in the last column which should extend
559 // to the right border of radiobox and thus can be wider than this.
561 // Also, remember that wxRA_SPECIFY_COLS means that we arrange buttons in
562 // left to right order and m_majorDim is the number of columns while
563 // wxRA_SPECIFY_ROWS means that the buttons are arranged top to bottom and
564 // m_majorDim is the number of rows.
567 nYOffset
-= (nMaxHeight
+ ((3*nCy1
)/2));
572 for (int i
= 0; i
< m_nNoItems
; i
++)
575 // The last button in the row may be wider than the other ones as the
576 // radiobox may be wider than the sum of the button widths (as it
577 // happens, for example, when the radiobox label is very long)
579 bool bIsLastInTheRow
;
581 if (m_windowStyle
& wxRA_SPECIFY_COLS
)
584 // Item is the last in its row if it is a multiple of the number of
585 // columns or if it is just the last item
589 bIsLastInTheRow
= ((n
% m_nMajorDim
) == 0) || (n
== m_nNoItems
);
591 else // winRA_SPECIFY_ROWS
594 // Item is the last in the row if it is in the last columns
596 bIsLastInTheRow
= i
>= (m_nNoItems
/m_nMajorDim
) * m_nMajorDim
;
600 // Is this the start of new row/column?
602 if (i
&& (i
% m_nMajorDim
== 0))
604 if (m_windowStyle
& wxRA_SPECIFY_ROWS
)
608 // Start of new column
611 nXOffset
+= nMaxWidth
+ nCx1
;
613 else // start of new row
616 nYOffset
-= nMaxHeight
;
617 if (m_pnRadioWidth
[0] > 0L)
627 // Make the button go to the end of radio box
629 nWidthBtn
= nStartX
+ nWidth
- nXOffset
- (2 * nCx1
);
630 if (nWidthBtn
< nMaxWidth
)
631 nWidthBtn
= nMaxWidth
;
636 // Normal button, always of the same size
638 nWidthBtn
= nMaxWidth
;
642 // Make all buttons of the same, maximal size - like this they
643 // cover the radiobox entirely and the radiobox tooltips are always
644 // shown (otherwise they are not when the mouse pointer is in the
645 // radiobox part not beinting to any radiobutton)
647 ::WinSetWindowPos( (HWND
)m_ahRadioButtons
[i
]
653 ,SWP_ZORDER
| SWP_SIZE
| SWP_MOVE
| SWP_SHOW
655 GetParent()->Refresh();
657 // Where do we put the next button?
659 if (m_windowStyle
& wxRA_SPECIFY_ROWS
)
664 nYOffset
-= nMaxHeight
;
665 if (m_pnRadioWidth
[0] > 0)
671 // To the right of this one
673 nXOffset
+= nWidthBtn
+ nCx1
;
676 } // end of wxRadioBox::DoSetSize
678 void wxRadioBox::Enable(
683 wxCHECK_RET( nItem
>= 0 && nItem
< m_nNoItems
,
684 wxT("invalid item in wxRadioBox::Enable()") );
686 ::WinEnableWindow((HWND
) m_ahRadioButtons
[nItem
], bEnable
);
687 } // end of wxRadioBox::Enable
689 bool wxRadioBox::Enable(
693 if ( !wxControl::Enable(bEnable
) )
695 for (int i
= 0; i
< m_nNoItems
; i
++)
696 ::WinEnableWindow((HWND
)m_ahRadioButtons
[i
], bEnable
);
698 } // end of wxRadioBox::Enable
700 int wxRadioBox::FindString(
701 const wxString
& rsStr
704 for (int i
= 0; i
< m_nNoItems
; i
++)
706 if (rsStr
== wxGetWindowText(m_ahRadioButtons
[i
]) )
710 } // end of wxRadioBox::FindString
712 int wxRadioBox::GetColumnCount() const
715 } // end of wxRadioBox::GetColumnCount
717 int wxRadioBox::GetCount() const
720 } // end of wxRadioBox::GetCount
722 wxString
wxRadioBox::GetLabel(
726 wxCHECK_MSG(nItem
>= 0 && nItem
< m_nNoItems
, wxT(""), wxT("invalid radiobox index") );
728 return wxGetWindowText(m_ahRadioButtons
[nItem
]);
729 } // end of wxRadioBox::GetLabel
731 wxSize
wxRadioBox::GetMaxButtonSize() const
736 for (int i
= 0 ; i
< m_nNoItems
; i
++)
741 if (m_pnRadioWidth
[i
] < 0L)
743 GetTextExtent( wxGetWindowText(m_ahRadioButtons
[i
])
749 // Adjust the size to take into account the radio box itself
750 // FIXME this is totally bogus!
752 nWidth
+= RADIO_SIZE
;
758 nWidth
= m_pnRadioWidth
[i
];
759 nHeight
= m_pnRadioHeight
[i
];
761 if (nWidthMax
< nWidth
)
763 if (nHeightMax
< nHeight
)
764 nHeightMax
= nHeight
;
766 return(wxSize( nWidthMax
770 } // end of wxRadioBox::GetMaxButtonSize
772 int wxRadioBox::GetNumHor() const
774 if ( m_windowStyle
& wxRA_SPECIFY_ROWS
)
776 return (m_nNoItems
+ m_nMajorDim
- 1)/m_nMajorDim
;
782 } // end of wxRadioBox::GetNumHor
784 int wxRadioBox::GetNumVer() const
786 if ( m_windowStyle
& wxRA_SPECIFY_ROWS
)
792 return (m_nNoItems
+ m_nMajorDim
- 1)/m_nMajorDim
;
794 } // end of wxRadioBox::GetNumVer
796 void wxRadioBox::GetPosition(
801 wxWindowOS2
* pParent
= GetParent();
802 RECT vRect
= { -1, -1, -1, -1 };;
806 for (i
= 0; i
< m_nNoItems
; i
++)
807 wxFindMaxSize( m_ahRadioButtons
[i
]
811 wxFindMaxSize( m_hWnd
816 // Since we now have the absolute screen coords, if there's a parent we
817 // must subtract its top left corner
819 vPoint
.x
= vRect
.xLeft
;
820 vPoint
.y
= vRect
.yTop
;
825 ::WinQueryWindowPos((HWND
)pParent
->GetHWND(), &vSwp
);
831 // We may be faking the client origin. So a window that's really at (0, 30)
832 // may appear (to wxWin apps) to be at (0, 0).
836 wxPoint
vPt(GetParent()->GetClientAreaOrigin());
843 } // end of wxRadioBox::GetPosition
845 int wxRadioBox::GetRowCount() const
848 } // end of wxRadioBox::GetRowCount
850 // Get single selection, for single choice list items
851 int wxRadioBox::GetSelection() const
853 return m_nSelectedButton
;
854 } // end of wxRadioBox::GetSelection
856 void wxRadioBox::GetSize(
870 wxFindMaxSize( m_hWnd
874 for (i
= 0; i
< m_nNoItems
; i
++)
875 wxFindMaxSize( m_ahRadioButtons
[i
]
879 *pnWidth
= vRect
.xRight
- vRect
.xLeft
;
880 *pnHeight
= vRect
.yBottom
- vRect
.yTop
;
881 } // end of wxRadioBox::GetSize
883 // Find string for position
884 wxString
wxRadioBox::GetString(
888 return wxGetWindowText(m_ahRadioButtons
[nNum
]);
889 } // end of wxRadioBox::GetString
891 // For single selection items only
892 wxString
wxRadioBox::GetStringSelection() const
895 int nSel
= GetSelection();
898 sResult
= GetString(nSel
);
900 } // end of wxRadioBox::GetStringSelection
902 wxSize
wxRadioBox::GetTotalButtonSize(
903 const wxSize
& rSizeBtn
913 wxGetCharSize( m_hWnd
920 nHeight
= GetNumVer() * rSizeBtn
.y
+ (2 * nCy1
);
921 nWidth
= GetNumHor() * (rSizeBtn
.x
+ nCx1
) + nCx1
;
924 // And also wide enough for its label
926 GetTextExtent( GetTitle()
930 nWidthLabel
+= RADIO_SIZE
;
931 if (nWidthLabel
> nWidth
)
932 nWidth
= nWidthLabel
;
934 return(wxSize( nWidth
938 } // end of wxRadioBox::GetTotalButtonSize
940 WXHBRUSH
wxRadioBox::OnCtlColor(
949 HPS hPS
= (HPS
)hwinDC
; // pass in a PS handle in OS/2
951 if (GetParent()->GetTransparentBackground())
952 ::GpiSetBackMix(hPS
, BM_LEAVEALONE
);
954 ::GpiSetBackMix(hPS
, BM_OVERPAINT
);
956 wxColour vColBack
= GetBackgroundColour();
958 ::GpiSetBackColor(hPS
, vColBack
.GetPixel());
959 ::GpiSetColor(hPS
, vColBack
.GetPixel());
962 wxBrush
* pBrush
= wxTheBrushList
->FindOrCreateBrush( vColBack
965 return ((WXHBRUSH
)pBrush
->GetResourceHandle());
966 } // end of wxRadioBox::OnCtlColor
968 bool wxRadioBox::OS2Command(
973 int nSelectedButton
= -1;
975 if (uCmd
== BN_CLICKED
)
981 for (int i
= 0; i
< m_nNoItems
; i
++)
983 if (wId
== wxGetWindowId(m_ahRadioButtons
[i
]))
989 if (nSelectedButton
== -1)
996 if (nSelectedButton
!= m_nSelectedButton
)
998 m_nSelectedButton
= nSelectedButton
;
999 SendNotificationEvent();
1005 } // end of wxRadioBox::OS2Command
1007 void wxRadioBox::SendNotificationEvent()
1009 wxCommandEvent
vEvent( wxEVT_COMMAND_RADIOBOX_SELECTED
1013 vEvent
.SetInt( m_nSelectedButton
);
1014 vEvent
.SetString( GetString(m_nSelectedButton
) );
1015 vEvent
.SetEventObject(this);
1016 ProcessCommand(vEvent
);
1017 } // end of wxRadioBox::SendNotificationEvent
1019 void wxRadioBox::SetFocus()
1023 if (m_nSelectedButton
== -1)
1024 ::WinSetFocus(HWND_DESKTOP
, (HWND
)m_ahRadioButtons
[0]);
1026 ::WinSetFocus(HWND_DESKTOP
, (HWND
)m_ahRadioButtons
[m_nSelectedButton
]);
1028 } // end of wxRadioBox::SetFocus
1030 bool wxRadioBox::SetFont(
1034 if (!wxControl::SetFont(rFont
))
1042 // Also set the font of our radio buttons
1044 WXHFONT hFont
= wxFont(rFont
).GetResourceHandle();
1046 for (int n
= 0; n
< (int)m_nNoItems
; n
++)
1048 HWND hWndBtn
= (HWND
)m_ahRadioButtons
[n
];
1050 wxOS2SetFont( hWndBtn
1053 ::WinInvalidateRect(hWndBtn
, NULL
, FALSE
);
1056 } // end of wxRadioBox::SetFont
1058 void wxRadioBox::SetSelection(
1062 wxCHECK_RET( (nNum
>= 0) && (nNum
< m_nNoItems
), wxT("invalid radiobox index") );
1064 if (m_nSelectedButton
>= 0 && m_nSelectedButton
< m_nNoItems
)
1065 ::WinSendMsg((HWND
)m_ahRadioButtons
[m_nSelectedButton
], BM_SETCHECK
, (MPARAM
)0, (MPARAM
)0);
1067 ::WinSendMsg((HWND
)m_ahRadioButtons
[nNum
], BM_SETCHECK
, (MPARAM
)1, (MPARAM
)0);
1068 ::WinSetFocus(HWND_DESKTOP
, (HWND
)m_ahRadioButtons
[nNum
]);
1069 m_nSelectedButton
= nNum
;
1070 } // end of wxRadioBox::SetSelection
1072 void wxRadioBox::SetString(
1074 , const wxString
& rsLabel
1077 wxCHECK_RET( nItem
>= 0 && nItem
< m_nNoItems
, wxT("invalid radiobox index") );
1079 m_pnRadioWidth
[nItem
] = m_pnRadioHeight
[nItem
] = -1;
1080 ::WinSetWindowText((HWND
)m_ahRadioButtons
[nItem
], rsLabel
.c_str());
1081 } // end of wxRadioBox::SetString
1083 bool wxRadioBox::SetStringSelection(
1084 const wxString
& rsStr
1087 int nSel
= FindString(rsStr
);
1096 } // end of wxRadioBox::SetStringSelection
1098 bool wxRadioBox::Show(
1104 if (!wxControl::Show(bShow
))
1107 for (int i
= 0; i
< m_nNoItems
; i
++)
1109 ::WinShowWindow((HWND
)m_ahRadioButtons
[i
], (BOOL
)bShow
);
1112 } // end of wxRadioBox::Show
1114 // Show a specific button
1115 void wxRadioBox::Show(
1120 wxCHECK_RET( nItem
>= 0 && nItem
< m_nNoItems
,
1121 wxT("invalid item in wxRadioBox::Show()") );
1123 ::WinShowWindow((HWND
)m_ahRadioButtons
[nItem
], bShow
);
1124 } // end of wxRadioBox::Show
1126 void wxRadioBox::SubclassRadioButton(
1130 HWND hwndBtn
= (HWND
)hWndBtn
;
1132 fnWndProcRadioBtn
= (WXFARPROC
)::WinSubclassWindow(hWndBtn
, (PFNWP
)wxRadioBtnWndProc
);
1133 } // end of wxRadioBox::SubclassRadioButton
1135 MRESULT
wxRadioBox::WindowProc(
1141 return (wxControl::OS2WindowProc( uMsg
1145 } // end of wxRadioBox::WindowProc
1147 // ---------------------------------------------------------------------------
1148 // window proc for radio buttons
1149 // ---------------------------------------------------------------------------
1151 MRESULT
wxRadioBtnWndProc(
1162 USHORT uKeyFlags
= SHORT1FROMMP((MPARAM
)wParam
);
1164 if (!(uKeyFlags
& KC_KEYUP
)) // Key Down event
1166 if (uKeyFlags
& KC_VIRTUALKEY
)
1168 wxRadioBox
* pRadiobox
= (wxRadioBox
*)::WinQueryWindowULong( hWnd
1171 USHORT uVk
= SHORT2FROMMP((MPARAM
)lParam
);
1172 bool bProcessed
= TRUE
;
1197 // Just to suppress the compiler warning
1204 int nSelOld
= pRadiobox
->GetSelection();
1205 int nSelNew
= pRadiobox
->GetNextItem( nSelOld
1207 ,pRadiobox
->GetWindowStyleFlag()
1210 if (nSelNew
!= nSelOld
)
1212 pRadiobox
->SetSelection(nSelNew
);
1215 // Emulate the button click
1217 pRadiobox
->SendNotificationEvent();
1227 return fnWndProcRadioBtn( hWnd
1232 } // end of wxRadioBtnWndProc
1234 MRESULT EXPENTRY
wxRadioBoxWndProc(
1241 return (fnWndProcRadioBox( hWnd
1247 } // end of wxRadioBoxWndProc