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
* pTextFont
= new wxFont( 10
275 vColour
.Set(wxString("BLACK"));
276 lColor
= (LONG
)vColour
.GetPixel();
277 m_backgroundColour
= pParent
->GetBackgroundColour();
278 m_nSelectedButton
= -1;
281 m_nMajorDim
= nMajorDim
== 0 ? nNum
: nMajorDim
;
282 m_nNoRowsOrCols
= nMajorDim
;
285 // Common initialization
287 if (!CreateControl( pParent
298 if (!OS2CreateControl( "STATIC"
299 #if RADIOBTN_PARENT_IS_RADIOBOX
300 ,SS_GROUPBOX
| WS_GROUP
| WS_CLIPCHILDREN
302 ,SS_GROUPBOX
| WS_GROUP
| WS_CLIPSIBLINGS
310 #if RADIOBTN_PARENT_IS_RADIOBOX
311 HWND hWndParent
= GetHwnd();
313 HWND hWndParent
= GetHwndOf(pParent
);
318 // Some radio boxes test consecutive id.
321 (void)NewControlId();
322 m_ahRadioButtons
= new WXHWND
[nNum
];
323 m_pnRadioWidth
= new int[nNum
];
324 m_pnRadioHeight
= new int[nNum
];
328 hFont
= pTextFont
->GetResourceHandle();
331 for (int i
= 0; i
< nNum
; i
++)
333 m_pnRadioWidth
[i
] = m_pnRadioHeight
[i
] = -1;
335 long lStyleBtn
= BS_AUTORADIOBUTTON
| WS_TABSTOP
| WS_VISIBLE
;
336 int nNewId
= NewControlId();
338 if (i
== 0 && lStyle
== 0)
339 lStyleBtn
|= WS_GROUP
;
341 HWND hWndBtn
= (WXHWND
)::WinCreateWindow ( GetHwndOf(pParent
)
352 lColor
= (LONG
)vColour
.GetPixel();
353 ::WinSetPresParam( hWndBtn
358 lColor
= (LONG
)m_backgroundColour
.GetPixel();
360 ::WinSetPresParam( hWndBtn
369 m_ahRadioButtons
[i
] = (WXHWND
)hWndBtn
;
370 SubclassRadioButton((WXHWND
)hWndBtn
);
371 wxOS2SetFont( hWndBtn
374 ::WinSetWindowULong(hWndBtn
, QWL_USER
, (ULONG
)this);
375 m_aSubControls
.Add(nNewId
);
379 // Create a dummy radio control to end the group.
381 (void)::WinCreateWindow ( GetHwndOf(pParent
)
384 ,WS_GROUP
| BS_AUTORADIOBUTTON
388 ,(HMENU
)NewControlId()
393 lColor
= (LONG
)vColour
.GetPixel();
394 ::WinSetPresParam( m_hWnd
399 lColor
= (LONG
)m_backgroundColour
.GetPixel();
401 ::WinSetPresParam( m_hWnd
416 } // end of wxRadioBox::Create
418 wxSize
wxRadioBox::DoGetBestSize() const
420 return (GetTotalButtonSize(GetMaxButtonSize()));
421 } // end of WinGuiBase_CRadioBox::DoGetBestSize
423 void wxRadioBox::DoSetSize(
437 #if RADIOBTN_PARENT_IS_RADIOBOX
446 wxSize vMaxSize
= GetMaxButtonSize();
455 m_nSizeFlags
= nSizeFlags
;
456 GetPosition( &nCurrentX
463 if (nX
== -1 && !(nSizeFlags
& wxSIZE_ALLOW_MINUS_ONE
))
465 if (nY
== -1 && !(nSizeFlags
& wxSIZE_ALLOW_MINUS_ONE
))
472 wxGetCharSize( m_hWnd
479 // Attempt to have a look coherent with other platforms: We compute the
480 // biggest toggle dim, then we align all items according this value.
482 vMaxSize
= GetMaxButtonSize();
483 nMaxWidth
= vMaxSize
.x
;
484 nMaxHeight
= vMaxSize
.y
;
486 vTotSize
= GetTotalButtonSize(vMaxSize
);
487 nTotWidth
= vTotSize
.x
;
488 nTotHeight
= vTotSize
.y
;
491 // Only change our width/height if asked for
495 if (nSizeFlags
& wxSIZE_AUTO_WIDTH
)
503 if (nSizeFlags
& wxSIZE_AUTO_HEIGHT
)
504 nHeight
= nTotHeight
;
506 nHeight
= nHeightOld
;
509 wxWindowOS2
* pParent
= (wxWindowOS2
*)GetParent();
513 int nOS2Height
= GetOS2ParentHeight(pParent
);
515 nYy
= nOS2Height
- (nYy
+ nHeight
);
516 nYOffset
= nYy
+ nHeight
;
522 ::WinQueryWindowRect(HWND_DESKTOP
, &vRect
);
523 nYy
= vRect
.yTop
- (nYy
+ nHeight
);
525 ::WinSetWindowPos( GetHwnd()
531 ,SWP_ZORDER
| SWP_SIZE
| SWP_MOVE
| SWP_SHOW
535 // Now position all the buttons: the current button will be put at
536 // wxPoint(x_offset, y_offset) and the new row/column will start at
537 // startX/startY. The size of all buttons will be the same wxSize(maxWidth,
538 // maxHeight) except for the buttons in the last column which should extend
539 // to the right border of radiobox and thus can be wider than this.
541 // Also, remember that wxRA_SPECIFY_COLS means that we arrange buttons in
542 // left to right order and m_majorDim is the number of columns while
543 // wxRA_SPECIFY_ROWS means that the buttons are arranged top to bottom and
544 // m_majorDim is the number of rows.
547 nYOffset
-= (nMaxHeight
+ ((3*nCy1
)/2));
552 for (int i
= 0; i
< m_nNoItems
; i
++)
555 // The last button in the row may be wider than the other ones as the
556 // radiobox may be wider than the sum of the button widths (as it
557 // happens, for example, when the radiobox label is very long)
559 bool bIsLastInTheRow
;
561 if (m_windowStyle
& wxRA_SPECIFY_COLS
)
564 // Item is the last in its row if it is a multiple of the number of
565 // columns or if it is just the last item
569 bIsLastInTheRow
= ((n
% m_nMajorDim
) == 0) || (n
== m_nNoItems
);
571 else // winRA_SPECIFY_ROWS
574 // Item is the last in the row if it is in the last columns
576 bIsLastInTheRow
= i
>= (m_nNoItems
/m_nMajorDim
) * m_nMajorDim
;
580 // Is this the start of new row/column?
582 if (i
&& (i
% m_nMajorDim
== 0))
584 if (m_windowStyle
& wxRA_SPECIFY_ROWS
)
588 // Start of new column
591 nXOffset
+= nMaxWidth
+ nCx1
;
593 else // start of new row
596 nYOffset
-= nMaxHeight
;
597 if (m_pnRadioWidth
[0] > 0L)
607 // Make the button go to the end of radio box
609 nWidthBtn
= nStartX
+ nWidth
- nXOffset
- (2 * nCx1
);
610 if (nWidthBtn
< nMaxWidth
)
611 nWidthBtn
= nMaxWidth
;
616 // Normal button, always of the same size
618 nWidthBtn
= nMaxWidth
;
622 // Make all buttons of the same, maximal size - like this they
623 // cover the radiobox entirely and the radiobox tooltips are always
624 // shown (otherwise they are not when the mouse pointer is in the
625 // radiobox part not beinting to any radiobutton)
627 ::WinSetWindowPos( (HWND
)m_ahRadioButtons
[i
]
633 ,SWP_ZORDER
| SWP_SIZE
| SWP_MOVE
| SWP_SHOW
635 GetParent()->Refresh();
637 // Where do we put the next button?
639 if (m_windowStyle
& wxRA_SPECIFY_ROWS
)
644 nYOffset
-= nMaxHeight
;
645 if (m_pnRadioWidth
[0] > 0)
651 // To the right of this one
653 nXOffset
+= nWidthBtn
+ nCx1
;
656 } // end of wxRadioBox::DoSetSize
658 void wxRadioBox::Enable(
663 wxCHECK_RET( nItem
>= 0 && nItem
< m_nNoItems
,
664 wxT("invalid item in wxRadioBox::Enable()") );
666 ::WinEnableWindow((HWND
) m_ahRadioButtons
[nItem
], bEnable
);
667 } // end of wxRadioBox::Enable
669 bool wxRadioBox::Enable(
673 if ( !wxControl::Enable(bEnable
) )
675 for (int i
= 0; i
< m_nNoItems
; i
++)
676 ::WinEnableWindow((HWND
)m_ahRadioButtons
[i
], bEnable
);
678 } // end of wxRadioBox::Enable
680 int wxRadioBox::FindString(
681 const wxString
& rsStr
684 for (int i
= 0; i
< m_nNoItems
; i
++)
686 if (rsStr
== wxGetWindowText(m_ahRadioButtons
[i
]) )
690 } // end of wxRadioBox::FindString
692 int wxRadioBox::GetColumnCount() const
695 } // end of wxRadioBox::GetColumnCount
697 int wxRadioBox::GetCount() const
700 } // end of wxRadioBox::GetCount
702 wxString
wxRadioBox::GetLabel(
706 wxCHECK_MSG(nItem
>= 0 && nItem
< m_nNoItems
, wxT(""), wxT("invalid radiobox index") );
708 return wxGetWindowText(m_ahRadioButtons
[nItem
]);
709 } // end of wxRadioBox::GetLabel
711 wxSize
wxRadioBox::GetMaxButtonSize() const
716 for (int i
= 0 ; i
< m_nNoItems
; i
++)
721 if (m_pnRadioWidth
[i
] < 0L)
723 GetTextExtent( wxGetWindowText(m_ahRadioButtons
[i
])
729 // Adjust the size to take into account the radio box itself
730 // FIXME this is totally bogus!
732 nWidth
+= RADIO_SIZE
;
738 nWidth
= m_pnRadioWidth
[i
];
739 nHeight
= m_pnRadioHeight
[i
];
741 if (nWidthMax
< nWidth
)
743 if (nHeightMax
< nHeight
)
744 nHeightMax
= nHeight
;
746 return(wxSize( nWidthMax
750 } // end of wxRadioBox::GetMaxButtonSize
752 int wxRadioBox::GetNumHor() const
754 if ( m_windowStyle
& wxRA_SPECIFY_ROWS
)
756 return (m_nNoItems
+ m_nMajorDim
- 1)/m_nMajorDim
;
762 } // end of wxRadioBox::GetNumHor
764 int wxRadioBox::GetNumVer() const
766 if ( m_windowStyle
& wxRA_SPECIFY_ROWS
)
772 return (m_nNoItems
+ m_nMajorDim
- 1)/m_nMajorDim
;
774 } // end of wxRadioBox::GetNumVer
776 void wxRadioBox::GetPosition(
781 wxWindowOS2
* pParent
= GetParent();
782 RECT vRect
= { -1, -1, -1, -1 };;
786 for (i
= 0; i
< m_nNoItems
; i
++)
787 wxFindMaxSize( m_ahRadioButtons
[i
]
791 wxFindMaxSize( m_hWnd
796 // Since we now have the absolute screen coords, if there's a parent we
797 // must subtract its top left corner
799 vPoint
.x
= vRect
.xLeft
;
800 vPoint
.y
= vRect
.yTop
;
805 ::WinQueryWindowPos((HWND
)pParent
->GetHWND(), &vSwp
);
811 // We may be faking the client origin. So a window that's really at (0, 30)
812 // may appear (to wxWin apps) to be at (0, 0).
816 wxPoint
vPt(GetParent()->GetClientAreaOrigin());
823 } // end of wxRadioBox::GetPosition
825 int wxRadioBox::GetRowCount() const
828 } // end of wxRadioBox::GetRowCount
830 // Get single selection, for single choice list items
831 int wxRadioBox::GetSelection() const
833 return m_nSelectedButton
;
834 } // end of wxRadioBox::GetSelection
836 void wxRadioBox::GetSize(
850 wxFindMaxSize( m_hWnd
854 for (i
= 0; i
< m_nNoItems
; i
++)
855 wxFindMaxSize( m_ahRadioButtons
[i
]
859 *pnWidth
= vRect
.xRight
- vRect
.xLeft
;
860 *pnHeight
= vRect
.yBottom
- vRect
.yTop
;
861 } // end of wxRadioBox::GetSize
863 // Find string for position
864 wxString
wxRadioBox::GetString(
868 return wxGetWindowText(m_ahRadioButtons
[nNum
]);
869 } // end of wxRadioBox::GetString
871 // For single selection items only
872 wxString
wxRadioBox::GetStringSelection() const
875 int nSel
= GetSelection();
878 sResult
= GetString(nSel
);
880 } // end of wxRadioBox::GetStringSelection
882 wxSize
wxRadioBox::GetTotalButtonSize(
883 const wxSize
& rSizeBtn
893 wxGetCharSize( m_hWnd
900 nHeight
= GetNumVer() * rSizeBtn
.y
+ (2 * nCy1
);
901 nWidth
= GetNumHor() * (rSizeBtn
.x
+ nCx1
) + nCx1
;
904 // And also wide enough for its label
906 GetTextExtent( GetTitle()
910 nWidthLabel
+= RADIO_SIZE
;
911 if (nWidthLabel
> nWidth
)
912 nWidth
= nWidthLabel
;
914 return(wxSize( nWidth
918 } // end of wxRadioBox::GetTotalButtonSize
920 WXHBRUSH
wxRadioBox::OnCtlColor(
929 HPS hPS
= (HPS
)hwinDC
; // pass in a PS handle in OS/2
931 if (GetParent()->GetTransparentBackground())
932 ::GpiSetBackMix(hPS
, BM_LEAVEALONE
);
934 ::GpiSetBackMix(hPS
, BM_OVERPAINT
);
936 wxColour vColBack
= GetBackgroundColour();
938 ::GpiSetBackColor(hPS
, vColBack
.GetPixel());
939 ::GpiSetColor(hPS
, vColBack
.GetPixel());
942 wxBrush
* pBrush
= wxTheBrushList
->FindOrCreateBrush( vColBack
945 return ((WXHBRUSH
)pBrush
->GetResourceHandle());
946 } // end of wxRadioBox::OnCtlColor
948 bool wxRadioBox::OS2Command(
953 int nSelectedButton
= -1;
955 if (uCmd
== BN_CLICKED
)
961 for (int i
= 0; i
< m_nNoItems
; i
++)
963 if (wId
== wxGetWindowId(m_ahRadioButtons
[i
]))
969 if (nSelectedButton
== -1)
972 // Just ignore it - due to a hack with WM_NCHITTEST handling in our
973 // wnd proc, we can receive dummy click messages when we click near
974 // the radiobox edge (this is ugly but Julian wouldn't let me get
978 if (nSelectedButton
!= m_nSelectedButton
)
980 m_nSelectedButton
= nSelectedButton
;
981 SendNotificationEvent();
987 } // end of wxRadioBox::OS2Command
989 void wxRadioBox::SendNotificationEvent()
991 wxCommandEvent
vEvent( wxEVT_COMMAND_RADIOBOX_SELECTED
995 vEvent
.SetInt( m_nSelectedButton
);
996 vEvent
.SetString( GetString(m_nSelectedButton
) );
997 vEvent
.SetEventObject(this);
998 ProcessCommand(vEvent
);
999 } // end of wxRadioBox::SendNotificationEvent
1001 void wxRadioBox::SetFocus()
1005 if (m_nSelectedButton
== -1)
1006 ::WinSetFocus(HWND_DESKTOP
, (HWND
)m_ahRadioButtons
[0]);
1008 ::WinSetFocus(HWND_DESKTOP
, (HWND
)m_ahRadioButtons
[m_nSelectedButton
]);
1010 } // end of wxRadioBox::SetFocus
1012 bool wxRadioBox::SetFont(
1016 if (!wxControl::SetFont(rFont
))
1024 // Also set the font of our radio buttons
1026 WXHFONT hFont
= wxFont(rFont
).GetResourceHandle();
1028 for (int n
= 0; n
< (int)m_nNoItems
; n
++)
1030 HWND hWndBtn
= (HWND
)m_ahRadioButtons
[n
];
1032 wxOS2SetFont( hWndBtn
1035 ::WinInvalidateRect(hWndBtn
, NULL
, FALSE
);
1038 } // end of wxRadioBox::SetFont
1040 void wxRadioBox::SetSelection(
1044 wxCHECK_RET( (nNum
>= 0) && (nNum
< m_nNoItems
), wxT("invalid radiobox index") );
1046 if (m_nSelectedButton
>= 0 && m_nSelectedButton
< m_nNoItems
)
1047 ::WinSendMsg((HWND
)m_ahRadioButtons
[m_nSelectedButton
], BM_SETCHECK
, (MPARAM
)0, (MPARAM
)0);
1049 ::WinSendMsg((HWND
)m_ahRadioButtons
[nNum
], BM_SETCHECK
, (MPARAM
)1, (MPARAM
)0);
1050 ::WinSetFocus(HWND_DESKTOP
, (HWND
)m_ahRadioButtons
[nNum
]);
1051 m_nSelectedButton
= nNum
;
1052 } // end of wxRadioBox::SetSelection
1054 void wxRadioBox::SetString(
1056 , const wxString
& rsLabel
1059 wxCHECK_RET( nItem
>= 0 && nItem
< m_nNoItems
, wxT("invalid radiobox index") );
1061 m_pnRadioWidth
[nItem
] = m_pnRadioHeight
[nItem
] = -1;
1062 ::WinSetWindowText((HWND
)m_ahRadioButtons
[nItem
], rsLabel
.c_str());
1063 } // end of wxRadioBox::SetString
1065 bool wxRadioBox::SetStringSelection(
1066 const wxString
& rsStr
1069 int nSel
= FindString(rsStr
);
1078 } // end of wxRadioBox::SetStringSelection
1080 bool wxRadioBox::Show(
1086 if (!wxControl::Show(bShow
))
1089 for (int i
= 0; i
< m_nNoItems
; i
++)
1091 ::WinShowWindow((HWND
)m_ahRadioButtons
[i
], (BOOL
)bShow
);
1094 } // end of wxRadioBox::Show
1096 // Show a specific button
1097 void wxRadioBox::Show(
1102 wxCHECK_RET( nItem
>= 0 && nItem
< m_nNoItems
,
1103 wxT("invalid item in wxRadioBox::Show()") );
1105 ::WinShowWindow((HWND
)m_ahRadioButtons
[nItem
], bShow
);
1106 } // end of wxRadioBox::Show
1108 void wxRadioBox::SubclassRadioButton(
1112 HWND hwndBtn
= (HWND
)hWndBtn
;
1114 fnWndProcRadioBtn
= (WXFARPROC
)::WinSubclassWindow(hWndBtn
, (PFNWP
)wxRadioBtnWndProc
);
1115 } // end of wxRadioBox::SubclassRadioButton
1117 MRESULT
wxRadioBox::WindowProc(
1123 return (wxControl::OS2WindowProc( uMsg
1127 } // end of wxRadioBox::WindowProc
1129 // ---------------------------------------------------------------------------
1130 // window proc for radio buttons
1131 // ---------------------------------------------------------------------------
1133 MRESULT
wxRadioBtnWndProc(
1144 USHORT uKeyFlags
= SHORT1FROMMP((MPARAM
)wParam
);
1146 if (!(uKeyFlags
& KC_KEYUP
)) // Key Down event
1148 if (uKeyFlags
& KC_VIRTUALKEY
)
1150 wxRadioBox
* pRadiobox
= (wxRadioBox
*)::WinQueryWindowULong( hWnd
1153 USHORT uVk
= SHORT2FROMMP((MPARAM
)lParam
);
1154 bool bProcessed
= TRUE
;
1179 // Just to suppress the compiler warning
1186 int nSelOld
= pRadiobox
->GetSelection();
1187 int nSelNew
= pRadiobox
->GetNextItem( nSelOld
1189 ,pRadiobox
->GetWindowStyleFlag()
1192 if (nSelNew
!= nSelOld
)
1194 pRadiobox
->SetSelection(nSelNew
);
1197 // Emulate the button click
1199 pRadiobox
->SendNotificationEvent();
1209 return fnWndProcRadioBtn( hWnd
1214 } // end of wxRadioBtnWndProc