mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-26 06:08:17 +02:00
checking a radiobutton unchecks its siblibg radiobuttons
git-svn-id: trunk@5518 -
This commit is contained in:
parent
4731ba39ff
commit
e5c8fce19e
@ -2614,6 +2614,20 @@ Function TWin32WidgetSet.SetValue(Sender: TObject; Data: Pointer): Integer;
|
|||||||
Var
|
Var
|
||||||
Handle: HWnd;
|
Handle: HWnd;
|
||||||
ST: SystemTime;
|
ST: SystemTime;
|
||||||
|
|
||||||
|
procedure ClearSiblingRadioButtons(RadioButton: TRadioButton);
|
||||||
|
var
|
||||||
|
Parent: TWinControl;
|
||||||
|
Sibling: TControl;
|
||||||
|
i: Integer;
|
||||||
|
begin
|
||||||
|
Parent := RadioButton.Parent;
|
||||||
|
for i:= 0 to Parent.ControlCount - 1 do begin
|
||||||
|
Sibling := Parent.Controls[i];
|
||||||
|
if (Sibling is TRadioButton) and (Sibling<>RadioButton) then
|
||||||
|
Windows.SendMessage(TRadioButton(Sibling).Handle, BM_SETCHECK, Windows.WParam(BST_UNCHECKED), 0);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
Begin
|
Begin
|
||||||
Result := 0; // default if nobody sets it
|
Result := 0; // default if nobody sets it
|
||||||
@ -2647,10 +2661,13 @@ Begin
|
|||||||
Assert(False, 'TRACE:Setting the track bar value.');
|
Assert(False, 'TRACE:Setting the track bar value.');
|
||||||
Windows.SendMessage(Handle, TBM_SETPOS, Windows.WPARAM(True), Windows.LPARAM(Data^));
|
Windows.SendMessage(Handle, TBM_SETPOS, Windows.WPARAM(True), Windows.LPARAM(Data^));
|
||||||
End;
|
End;
|
||||||
csRadiobutton, csCheckbox:
|
csRadioButton, csCheckbox:
|
||||||
Begin
|
Begin
|
||||||
If TCheckBoxState(Data^) = cbChecked Then
|
If TCheckBoxState(Data^) = cbChecked Then Begin
|
||||||
Windows.SendMessage(Handle, BM_SETCHECK, Windows.WParam(BST_CHECKED), 0)
|
Windows.SendMessage(Handle, BM_SETCHECK, Windows.WParam(BST_CHECKED), 0);
|
||||||
|
If TControl(Sender).FCompStyle=csRadioButton Then
|
||||||
|
ClearSiblingRadioButtons(TRadioButton(Sender));
|
||||||
|
End
|
||||||
Else If TCheckboxState(Data^) = cbUnchecked Then
|
Else If TCheckboxState(Data^) = cbUnchecked Then
|
||||||
Windows.SendMessage(Handle, BM_SETCHECK, Windows.WParam(BST_UNCHECKED), 0)
|
Windows.SendMessage(Handle, BM_SETCHECK, Windows.WParam(BST_UNCHECKED), 0)
|
||||||
Else
|
Else
|
||||||
@ -2997,6 +3014,9 @@ End;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.199 2004/05/27 15:04:53 vincents
|
||||||
|
checking a radiobutton unchecks its siblibg radiobuttons
|
||||||
|
|
||||||
Revision 1.198 2004/05/21 11:18:30 micha
|
Revision 1.198 2004/05/21 11:18:30 micha
|
||||||
use unsigned integer for control styles; fixes compiler warning
|
use unsigned integer for control styles; fixes compiler warning
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user