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
40 // ---------------------------------------------------------------------------
42 // ---------------------------------------------------------------------------
44 // the pointer to standard radio button wnd proc
45 static WXFARPROC fnWndProcRadioBtn
= NULL
;
47 // ===========================================================================
49 // ===========================================================================
51 // ---------------------------------------------------------------------------
53 // ---------------------------------------------------------------------------
56 wxRadioBox::wxRadioBox()
58 m_nSelectedButton
= -1;
61 m_ahRadioButtons
= NULL
;
63 m_pnRadioWidth
= NULL
;
64 m_pnRadioHeight
= NULL
;
65 } // end of wxRadioBox::wxRadioBox
67 wxRadioBox::~wxRadioBox()
69 m_isBeingDeleted
= TRUE
;
74 for (i
= 0; i
< m_nNoItems
; i
++)
75 ::WinDestroyWindow((HWND
)m_ahRadioButtons
[i
]);
76 delete[] m_ahRadioButtons
;
79 delete[] m_pnRadioWidth
;
81 delete[] m_pnRadioHeight
;
82 } // end of wxRadioBox::~wxRadioBox
84 void wxRadioBox::AdjustButtons(
94 int nYOffset
= nY
+ nHeight
;
104 wxGetCharSize( m_hWnd
109 vMaxSize
= GetMaxButtonSize();
110 nMaxWidth
= vMaxSize
.x
;
111 nMaxHeight
= vMaxSize
.y
;
114 nYOffset
-= (nMaxHeight
+ ((3*nCy1
)/2));
119 for (int i
= 0; i
< m_nNoItems
; i
++)
122 // The last button in the row may be wider than the other ones as the
123 // radiobox may be wider than the sum of the button widths (as it
124 // happens, for example, when the radiobox label is very long)
126 bool bIsLastInTheRow
;
128 if (m_windowStyle
& wxRA_SPECIFY_COLS
)
131 // Item is the last in its row if it is a multiple of the number of
132 // columns or if it is just the last item
136 bIsLastInTheRow
= ((n
% m_nMajorDim
) == 0) || (n
== m_nNoItems
);
138 else // winRA_SPECIFY_ROWS
141 // Item is the last in the row if it is in the last columns
143 bIsLastInTheRow
= i
>= (m_nNoItems
/m_nMajorDim
) * m_nMajorDim
;
147 // Is this the start of new row/column?
149 if (i
&& (i
% m_nMajorDim
== 0))
151 if (m_windowStyle
& wxRA_SPECIFY_ROWS
)
155 // Start of new column
158 nXOffset
+= nMaxWidth
+ nCx1
;
160 else // start of new row
163 nYOffset
-= nMaxHeight
;
164 if (m_pnRadioWidth
[0] > 0L)
174 // Make the button go to the end of radio box
176 nWidthBtn
= nStartX
+ nWidth
- nXOffset
- (2 * nCx1
);
177 if (nWidthBtn
< nMaxWidth
)
178 nWidthBtn
= nMaxWidth
;
183 // Normal button, always of the same size
185 nWidthBtn
= nMaxWidth
;
189 // Make all buttons of the same, maximal size - like this they
190 // cover the radiobox entirely and the radiobox tooltips are always
191 // shown (otherwise they are not when the mouse pointer is in the
192 // radiobox part not beYInt32ing to any radiobutton)
194 ::WinSetWindowPos( (HWND
)m_ahRadioButtons
[i
]
200 ,SWP_ZORDER
| SWP_SIZE
| SWP_MOVE
| SWP_SHOW
203 // Where do we put the next button?
205 if (m_windowStyle
& wxRA_SPECIFY_ROWS
)
210 nYOffset
-= nMaxHeight
;
211 if (m_pnRadioWidth
[0] > 0)
217 // To the right of this one
219 nXOffset
+= nWidthBtn
+ nCx1
;
222 } // end of wxRadioBox::AdjustButtons
224 void wxRadioBox::Command (
225 wxCommandEvent
& rEvent
228 SetSelection (rEvent
.GetInt());
229 ProcessCommand(rEvent
);
230 } // end of wxRadioBox::Command
232 bool wxRadioBox::ContainsHWND(
236 size_t nCount
= GetCount();
239 for (i
= 0; i
< nCount
; i
++)
241 if (GetRadioButtons()[i
] == hWnd
)
245 } // end of wxRadioBox::ContainsHWND
247 bool wxRadioBox::Create(
250 , const wxString
& rsTitle
251 , const wxPoint
& rPos
252 , const wxSize
& rSize
254 , const wxString asChoices
[]
258 , const wxValidator
& rVal
260 , const wxString
& rsName
264 // System fonts are too big in OS/2 and they are blue
265 // We want smaller fonts and black by default.
267 wxFont
& rFont
= *wxSMALL_FONT
;
271 vColour
.Set(wxString("BLACK"));
272 lColor
= (LONG
)vColour
.GetPixel();
273 m_nSelectedButton
= -1;
276 m_nMajorDim
= nMajorDim
== 0 ? nNum
: nMajorDim
;
277 m_nNoRowsOrCols
= nMajorDim
;
280 // Common initialization
282 if (!OS2CreateControl( pParent
296 if (!OS2CreateControl( "STATIC"
297 #if RADIOBTN_PARENT_IS_RADIOBOX
298 ,SS_GROUPBOX
| WS_GROUP
| WS_CLIPCHILDREN
300 ,SS_GROUPBOX
| WS_GROUP
| WS_CLIPSIBLINGS
307 #if RADIOBTN_PARENT_IS_RADIOBOX
308 HWND hWndParent
= GetHwnd();
310 HWND hWndParent
= GetHwndOf(pParent
);
315 // Some radio boxes test consecutive id.
317 (void)NewControlId();
318 m_ahRadioButtons
= new WXHWND
[nNum
];
319 m_pnRadioWidth
= new int[nNum
];
320 m_pnRadioHeight
= new int[nNum
];
324 hFont
= rFont
.GetResourceHandle();
327 for (int i
= 0; i
< nNum
; i
++)
329 m_pnRadioWidth
[i
] = m_pnRadioHeight
[i
] = -1;
331 long lStyleBtn
= BS_AUTORADIOBUTTON
| WS_TABSTOP
| WS_VISIBLE
;
332 int nNewId
= NewControlId();
334 if (i
== 0 && lStyle
== 0)
335 lStyleBtn
|= WS_GROUP
;
337 HWND hWndBtn
= (WXHWND
)::WinCreateWindow ( GetHwndOf(pParent
)
348 lColor
= (LONG
)vColour
.GetPixel();
349 ::WinSetPresParam( hWndBtn
354 lColor
= (LONG
)m_backgroundColour
.GetPixel();
356 ::WinSetPresParam( hWndBtn
365 m_ahRadioButtons
[i
] = (WXHWND
)hWndBtn
;
366 SubclassRadioButton((WXHWND
)hWndBtn
);
367 wxOS2SetFont( hWndBtn
370 ::WinSetWindowULong(hWndBtn
, QWL_USER
, (ULONG
)this);
371 m_aSubControls
.Add(nNewId
);
375 // Create a dummy radio control to end the group.
377 (void)::WinCreateWindow ( GetHwndOf(pParent
)
380 ,WS_GROUP
| BS_AUTORADIOBUTTON
384 ,(HMENU
)NewControlId()
388 SetFont(*wxSMALL_FONT
);
389 lColor
= (LONG
)vColour
.GetPixel();
390 ::WinSetPresParam( m_hWnd
395 lColor
= (LONG
)m_backgroundColour
.GetPixel();
397 ::WinSetPresParam( m_hWnd
409 } // end of wxRadioBox::Create
411 wxSize
wxRadioBox::DoGetBestSize() const
413 return (GetTotalButtonSize(GetMaxButtonSize()));
414 } // end of WinGuiBase_CRadioBox::DoGetBestSize
416 void wxRadioBox::DoSetSize(
430 #if RADIOBTN_PARENT_IS_RADIOBOX
439 wxSize vMaxSize
= GetMaxButtonSize();
448 m_nSizeFlags
= nSizeFlags
;
449 GetPosition( &nCurrentX
456 if (nX
== -1 && !(nSizeFlags
& wxSIZE_ALLOW_MINUS_ONE
))
458 if (nY
== -1 && !(nSizeFlags
& wxSIZE_ALLOW_MINUS_ONE
))
462 wxGetCharSize( m_hWnd
469 // Attempt to have a look coherent with other platforms: We compute the
470 // biggest toggle dim, then we align all items according this value.
472 vMaxSize
= GetMaxButtonSize();
473 nMaxWidth
= vMaxSize
.x
;
474 nMaxHeight
= vMaxSize
.y
;
476 vTotSize
= GetTotalButtonSize(vMaxSize
);
477 nTotWidth
= vTotSize
.x
;
478 nTotHeight
= vTotSize
.y
;
481 // Only change our width/height if asked for
485 if (nSizeFlags
& wxSIZE_AUTO_WIDTH
)
493 if (nSizeFlags
& wxSIZE_AUTO_HEIGHT
)
494 nHeight
= nTotHeight
;
496 nHeight
= nHeightOld
;
499 wxWindowOS2
* pParent
= (wxWindowOS2
*)GetParent();
503 int nOS2Height
= GetOS2ParentHeight(pParent
);
505 nYy
= nOS2Height
- (nYy
+ nHeight
);
506 nYOffset
= nYy
+ nHeight
;
512 ::WinQueryWindowRect(HWND_DESKTOP
, &vRect
);
513 nYy
= vRect
.yTop
- (nYy
+ nHeight
);
515 ::WinSetWindowPos( GetHwnd()
521 ,SWP_ZORDER
| SWP_SIZE
| SWP_MOVE
| SWP_SHOW
525 // Now position all the buttons: the current button will be put at
526 // wxPoint(x_offset, y_offset) and the new row/column will start at
527 // startX/startY. The size of all buttons will be the same wxSize(maxWidth,
528 // maxHeight) except for the buttons in the last column which should extend
529 // to the right border of radiobox and thus can be wider than this.
531 // Also, remember that wxRA_SPECIFY_COLS means that we arrange buttons in
532 // left to right order and m_majorDim is the number of columns while
533 // wxRA_SPECIFY_ROWS means that the buttons are arranged top to bottom and
534 // m_majorDim is the number of rows.
537 nYOffset
-= (nMaxHeight
+ ((3*nCy1
)/2));
542 for (int i
= 0; i
< m_nNoItems
; i
++)
545 // The last button in the row may be wider than the other ones as the
546 // radiobox may be wider than the sum of the button widths (as it
547 // happens, for example, when the radiobox label is very long)
549 bool bIsLastInTheRow
;
551 if (m_windowStyle
& wxRA_SPECIFY_COLS
)
554 // Item is the last in its row if it is a multiple of the number of
555 // columns or if it is just the last item
559 bIsLastInTheRow
= ((n
% m_nMajorDim
) == 0) || (n
== m_nNoItems
);
561 else // winRA_SPECIFY_ROWS
564 // Item is the last in the row if it is in the last columns
566 bIsLastInTheRow
= i
>= (m_nNoItems
/m_nMajorDim
) * m_nMajorDim
;
570 // Is this the start of new row/column?
572 if (i
&& (i
% m_nMajorDim
== 0))
574 if (m_windowStyle
& wxRA_SPECIFY_ROWS
)
578 // Start of new column
581 nXOffset
+= nMaxWidth
+ nCx1
;
583 else // start of new row
586 nYOffset
-= nMaxHeight
;
587 if (m_pnRadioWidth
[0] > 0L)
597 // Make the button go to the end of radio box
599 nWidthBtn
= nStartX
+ nWidth
- nXOffset
- (2 * nCx1
);
600 if (nWidthBtn
< nMaxWidth
)
601 nWidthBtn
= nMaxWidth
;
606 // Normal button, always of the same size
608 nWidthBtn
= nMaxWidth
;
612 // Make all buttons of the same, maximal size - like this they
613 // cover the radiobox entirely and the radiobox tooltips are always
614 // shown (otherwise they are not when the mouse pointer is in the
615 // radiobox part not beinting to any radiobutton)
617 ::WinSetWindowPos( (HWND
)m_ahRadioButtons
[i
]
623 ,SWP_ZORDER
| SWP_SIZE
| SWP_MOVE
| SWP_SHOW
626 // Where do we put the next button?
628 if (m_windowStyle
& wxRA_SPECIFY_ROWS
)
633 nYOffset
-= nMaxHeight
;
634 if (m_pnRadioWidth
[0] > 0)
640 // To the right of this one
642 nXOffset
+= nWidthBtn
+ nCx1
;
645 } // end of wxRadioBox::DoSetSize
647 void wxRadioBox::Enable(
652 wxCHECK_RET( nItem
>= 0 && nItem
< m_nNoItems
,
653 wxT("invalid item in wxRadioBox::Enable()") );
655 ::WinEnableWindow((HWND
) m_ahRadioButtons
[nItem
], bEnable
);
656 } // end of wxRadioBox::Enable
658 bool wxRadioBox::Enable(
662 if ( !wxControl::Enable(bEnable
) )
664 for (int i
= 0; i
< m_nNoItems
; i
++)
665 ::WinEnableWindow((HWND
)m_ahRadioButtons
[i
], bEnable
);
667 } // end of wxRadioBox::Enable
669 int wxRadioBox::FindString(
670 const wxString
& rsStr
673 for (int i
= 0; i
< m_nNoItems
; i
++)
675 if (rsStr
== wxGetWindowText(m_ahRadioButtons
[i
]) )
679 } // end of wxRadioBox::FindString
681 int wxRadioBox::GetColumnCount() const
684 } // end of wxRadioBox::GetColumnCount
686 int wxRadioBox::GetCount() const
689 } // end of wxRadioBox::GetCount
691 wxString
wxRadioBox::GetLabel(
695 wxCHECK_MSG(nItem
>= 0 && nItem
< m_nNoItems
, wxT(""), wxT("invalid radiobox index") );
697 return wxGetWindowText(m_ahRadioButtons
[nItem
]);
698 } // end of wxRadioBox::GetLabel
700 wxSize
wxRadioBox::GetMaxButtonSize() const
705 for (int i
= 0 ; i
< m_nNoItems
; i
++)
710 if (m_pnRadioWidth
[i
] < 0L)
712 GetTextExtent( wxGetWindowText(m_ahRadioButtons
[i
])
718 // Adjust the size to take into account the radio box itself
719 // FIXME this is totally bogus!
721 nWidth
+= RADIO_SIZE
;
727 nWidth
= m_pnRadioWidth
[i
];
728 nHeight
= m_pnRadioHeight
[i
];
730 if (nWidthMax
< nWidth
)
732 if (nHeightMax
< nHeight
)
733 nHeightMax
= nHeight
;
735 return(wxSize( nWidthMax
739 } // end of wxRadioBox::GetMaxButtonSize
741 int wxRadioBox::GetNumHor() const
743 if ( m_windowStyle
& wxRA_SPECIFY_ROWS
)
745 return (m_nNoItems
+ m_nMajorDim
- 1)/m_nMajorDim
;
751 } // end of wxRadioBox::GetNumHor
753 int wxRadioBox::GetNumVer() const
755 if ( m_windowStyle
& wxRA_SPECIFY_ROWS
)
761 return (m_nNoItems
+ m_nMajorDim
- 1)/m_nMajorDim
;
763 } // end of wxRadioBox::GetNumVer
765 void wxRadioBox::GetPosition(
770 wxWindowOS2
* pParent
= GetParent();
771 RECT vRect
= { -1, -1, -1, -1 };;
775 for (i
= 0; i
< m_nNoItems
; i
++)
776 wxFindMaxSize( m_ahRadioButtons
[i
]
780 wxFindMaxSize( m_hWnd
785 // Since we now have the absolute screen coords, if there's a parent we
786 // must subtract its top left corner
788 vPoint
.x
= vRect
.xLeft
;
789 vPoint
.y
= vRect
.yTop
;
794 ::WinQueryWindowPos((HWND
)pParent
->GetHWND(), &vSwp
);
800 // We may be faking the client origin. So a window that's really at (0, 30)
801 // may appear (to wxWin apps) to be at (0, 0).
805 wxPoint
vPt(GetParent()->GetClientAreaOrigin());
812 } // end of wxRadioBox::GetPosition
814 int wxRadioBox::GetRowCount() const
817 } // end of wxRadioBox::GetRowCount
819 // Get single selection, for single choice list items
820 int wxRadioBox::GetSelection() const
822 return m_nSelectedButton
;
823 } // end of wxRadioBox::GetSelection
825 void wxRadioBox::GetSize(
839 wxFindMaxSize( m_hWnd
843 for (i
= 0; i
< m_nNoItems
; i
++)
844 wxFindMaxSize( m_ahRadioButtons
[i
]
848 *pnWidth
= vRect
.xRight
- vRect
.xLeft
;
849 *pnHeight
= vRect
.yBottom
- vRect
.yTop
;
850 } // end of wxRadioBox::GetSize
852 // Find string for position
853 wxString
wxRadioBox::GetString(
857 return wxGetWindowText(m_ahRadioButtons
[nNum
]);
858 } // end of wxRadioBox::GetString
860 // For single selection items only
861 wxString
wxRadioBox::GetStringSelection() const
864 int nSel
= GetSelection();
867 sResult
= GetString(nSel
);
869 } // end of wxRadioBox::GetStringSelection
871 wxSize
wxRadioBox::GetTotalButtonSize(
872 const wxSize
& rSizeBtn
882 wxGetCharSize( m_hWnd
889 nHeight
= GetNumVer() * rSizeBtn
.y
+ (2 * nCy1
);
890 nWidth
= GetNumHor() * (rSizeBtn
.x
+ nCx1
) + nCx1
;
893 // And also wide enough for its label
895 GetTextExtent( GetTitle()
899 nWidthLabel
+= RADIO_SIZE
;
900 if (nWidthLabel
> nWidth
)
901 nWidth
= nWidthLabel
;
903 return(wxSize( nWidth
907 } // end of wxRadioBox::GetTotalButtonSize
909 WXHBRUSH
wxRadioBox::OnCtlColor(
918 HPS hPS
= (HPS
)hwinDC
; // pass in a PS handle in OS/2
920 if (GetParent()->GetTransparentBackground())
921 ::GpiSetBackMix(hPS
, BM_LEAVEALONE
);
923 ::GpiSetBackMix(hPS
, BM_OVERPAINT
);
925 wxColour vColBack
= GetBackgroundColour();
927 ::GpiSetBackColor(hPS
, vColBack
.GetPixel());
928 ::GpiSetColor(hPS
, vColBack
.GetPixel());
931 wxBrush
* pBrush
= wxTheBrushList
->FindOrCreateBrush( vColBack
934 return ((WXHBRUSH
)pBrush
->GetResourceHandle());
935 } // end of wxRadioBox::OnCtlColor
937 bool wxRadioBox::OS2Command(
942 int nSelectedButton
= -1;
944 if (uCmd
== BN_CLICKED
)
950 for (int i
= 0; i
< m_nNoItems
; i
++)
952 if (wId
== wxGetWindowId(m_ahRadioButtons
[i
]))
958 if (nSelectedButton
== -1)
961 // Just ignore it - due to a hack with WM_NCHITTEST handling in our
962 // wnd proc, we can receive dummy click messages when we click near
963 // the radiobox edge (this is ugly but Julian wouldn't let me get
967 if (nSelectedButton
!= m_nSelectedButton
)
969 m_nSelectedButton
= nSelectedButton
;
970 SendNotificationEvent();
976 } // end of wxRadioBox::OS2Command
978 void wxRadioBox::SendNotificationEvent()
980 wxCommandEvent
vEvent( wxEVT_COMMAND_RADIOBOX_SELECTED
984 vEvent
.SetInt( m_nSelectedButton
);
985 vEvent
.SetString( GetString(m_nSelectedButton
) );
986 vEvent
.SetEventObject(this);
987 ProcessCommand(vEvent
);
988 } // end of wxRadioBox::SendNotificationEvent
990 void wxRadioBox::SetFocus()
994 if (m_nSelectedButton
== -1)
995 ::WinSetFocus(HWND_DESKTOP
, (HWND
)m_ahRadioButtons
[0]);
997 ::WinSetFocus(HWND_DESKTOP
, (HWND
)m_ahRadioButtons
[m_nSelectedButton
]);
999 } // end of wxRadioBox::SetFocus
1001 bool wxRadioBox::SetFont(
1005 if (!wxControl::SetFont(rFont
))
1013 // Also set the font of our radio buttons
1015 WXHFONT hFont
= wxFont(rFont
).GetResourceHandle();
1017 for (int n
= 0; n
< (int)m_nNoItems
; n
++)
1019 HWND hWndBtn
= (HWND
)m_ahRadioButtons
[n
];
1021 wxOS2SetFont( hWndBtn
1024 ::WinInvalidateRect(hWndBtn
, NULL
, FALSE
);
1027 } // end of wxRadioBox::SetFont
1029 void wxRadioBox::SetSelection(
1033 wxCHECK_RET( (nNum
>= 0) && (nNum
< m_nNoItems
), wxT("invalid radiobox index") );
1035 if (m_nSelectedButton
>= 0 && m_nSelectedButton
< m_nNoItems
)
1036 ::WinSendMsg((HWND
)m_ahRadioButtons
[m_nSelectedButton
], BM_SETCHECK
, (MPARAM
)0, (MPARAM
)0);
1038 ::WinSendMsg((HWND
)m_ahRadioButtons
[nNum
], BM_SETCHECK
, (MPARAM
)1, (MPARAM
)0);
1039 ::WinSetFocus(HWND_DESKTOP
, (HWND
)m_ahRadioButtons
[nNum
]);
1040 m_nSelectedButton
= nNum
;
1041 } // end of wxRadioBox::SetSelection
1043 void wxRadioBox::SetString(
1045 , const wxString
& rsLabel
1048 wxCHECK_RET( nItem
>= 0 && nItem
< m_nNoItems
, wxT("invalid radiobox index") );
1050 m_pnRadioWidth
[nItem
] = m_pnRadioHeight
[nItem
] = -1;
1051 ::WinSetWindowText((HWND
)m_ahRadioButtons
[nItem
], rsLabel
.c_str());
1052 } // end of wxRadioBox::SetString
1054 bool wxRadioBox::SetStringSelection(
1055 const wxString
& rsStr
1058 int nSel
= FindString(rsStr
);
1067 } // end of wxRadioBox::SetStringSelection
1069 bool wxRadioBox::Show(
1075 if (!wxControl::Show(bShow
))
1078 for (int i
= 0; i
< m_nNoItems
; i
++)
1080 ::WinShowWindow((HWND
)m_ahRadioButtons
[i
], (BOOL
)bShow
);
1083 } // end of wxRadioBox::Show
1085 // Show a specific button
1086 void wxRadioBox::Show(
1091 wxCHECK_RET( nItem
>= 0 && nItem
< m_nNoItems
,
1092 wxT("invalid item in wxRadioBox::Show()") );
1094 ::WinShowWindow((HWND
)m_ahRadioButtons
[nItem
], bShow
);
1095 } // end of wxRadioBox::Show
1097 void wxRadioBox::SubclassRadioButton(
1101 HWND hwndBtn
= (HWND
)hWndBtn
;
1103 fnWndProcRadioBtn
= (WXFARPROC
)::WinSubclassWindow(hWndBtn
, (PFNWP
)wxRadioBtnWndProc
);
1104 } // end of wxRadioBox::SubclassRadioButton
1106 MRESULT
wxRadioBox::WindowProc(
1112 return (wxControl::OS2WindowProc( uMsg
1116 } // end of wxRadioBox::WindowProc
1118 // ---------------------------------------------------------------------------
1119 // window proc for radio buttons
1120 // ---------------------------------------------------------------------------
1122 MRESULT
wxRadioBtnWndProc(
1133 USHORT uKeyFlags
= SHORT1FROMMP((MPARAM
)wParam
);
1135 if (!(uKeyFlags
& KC_KEYUP
)) // Key Down event
1137 if (uKeyFlags
& KC_VIRTUALKEY
)
1139 wxRadioBox
* pRadiobox
= (wxRadioBox
*)::WinQueryWindowULong( hWnd
1142 USHORT uVk
= SHORT2FROMMP((MPARAM
)lParam
);
1143 bool bProcessed
= TRUE
;
1168 // Just to suppress the compiler warning
1175 int nSelOld
= pRadiobox
->GetSelection();
1176 int nSelNew
= pRadiobox
->GetNextItem( nSelOld
1178 ,pRadiobox
->GetWindowStyleFlag()
1181 if (nSelNew
!= nSelOld
)
1183 pRadiobox
->SetSelection(nSelNew
);
1186 // Emulate the button click
1188 pRadiobox
->SendNotificationEvent();
1198 return fnWndProcRadioBtn( hWnd
1203 } // end of wxRadioBtnWndProc