Commit b27d2f93 authored by Olivier Teulière's avatar Olivier Teulière

 * Fixed a stupid bug in the Network dialog.
parent 35070dfc
...@@ -48,6 +48,8 @@ __fastcall TNetworkDlg::TNetworkDlg( TComponent* Owner ) ...@@ -48,6 +48,8 @@ __fastcall TNetworkDlg::TNetworkDlg( TComponent* Owner )
{ {
char *psz_channel_server; char *psz_channel_server;
OldRadioValue = 0;
/* server port */ /* server port */
UpDownUDPPort->Position = config_GetIntVariable( "server-port" ); UpDownUDPPort->Position = config_GetIntVariable( "server-port" );
UpDownMulticastPort->Position = config_GetIntVariable( "server-port" ); UpDownMulticastPort->Position = config_GetIntVariable( "server-port" );
...@@ -56,6 +58,7 @@ __fastcall TNetworkDlg::TNetworkDlg( TComponent* Owner ) ...@@ -56,6 +58,7 @@ __fastcall TNetworkDlg::TNetworkDlg( TComponent* Owner )
if( config_GetIntVariable( "network-channel" ) ) if( config_GetIntVariable( "network-channel" ) )
{ {
RadioButtonCS->Checked = true; RadioButtonCS->Checked = true;
RadioButtonCSEnter( RadioButtonCS );
} }
psz_channel_server = config_GetPszVariable( "channel-server" ); psz_channel_server = config_GetPszVariable( "channel-server" );
...@@ -66,8 +69,6 @@ __fastcall TNetworkDlg::TNetworkDlg( TComponent* Owner ) ...@@ -66,8 +69,6 @@ __fastcall TNetworkDlg::TNetworkDlg( TComponent* Owner )
} }
UpDownCSPort->Position = config_GetIntVariable( "channel-port" ); UpDownCSPort->Position = config_GetIntVariable( "channel-port" );
OldRadioValue = 0;
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void __fastcall TNetworkDlg::FormShow( TObject *Sender ) void __fastcall TNetworkDlg::FormShow( TObject *Sender )
...@@ -203,28 +204,28 @@ void __fastcall TNetworkDlg::ChangeEnabled( int i_selected ) ...@@ -203,28 +204,28 @@ void __fastcall TNetworkDlg::ChangeEnabled( int i_selected )
} }
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void __fastcall TNetworkDlg::RadioButtonUDPClick( TObject *Sender ) void __fastcall TNetworkDlg::RadioButtonUDPEnter( TObject *Sender )
{ {
ChangeEnabled( OldRadioValue ); ChangeEnabled( OldRadioValue );
OldRadioValue = 0; OldRadioValue = 0;
ChangeEnabled( OldRadioValue ); ChangeEnabled( OldRadioValue );
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void __fastcall TNetworkDlg::RadioButtonMulticastClick( TObject *Sender ) void __fastcall TNetworkDlg::RadioButtonMulticastEnter( TObject *Sender )
{ {
ChangeEnabled( OldRadioValue ); ChangeEnabled( OldRadioValue );
OldRadioValue = 1; OldRadioValue = 1;
ChangeEnabled( OldRadioValue ); ChangeEnabled( OldRadioValue );
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void __fastcall TNetworkDlg::RadioButtonCSClick( TObject *Sender ) void __fastcall TNetworkDlg::RadioButtonCSEnter( TObject *Sender )
{ {
ChangeEnabled( OldRadioValue ); ChangeEnabled( OldRadioValue );
OldRadioValue = 2; OldRadioValue = 2;
ChangeEnabled( OldRadioValue ); ChangeEnabled( OldRadioValue );
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void __fastcall TNetworkDlg::RadioButtonHTTPClick( TObject *Sender ) void __fastcall TNetworkDlg::RadioButtonHTTPEnter( TObject *Sender )
{ {
ChangeEnabled( OldRadioValue ); ChangeEnabled( OldRadioValue );
OldRadioValue = 3; OldRadioValue = 3;
......
...@@ -328,7 +328,7 @@ object NetworkDlg: TNetworkDlg ...@@ -328,7 +328,7 @@ object NetworkDlg: TNetworkDlg
Checked = True Checked = True
TabOrder = 0 TabOrder = 0
TabStop = True TabStop = True
OnClick = RadioButtonUDPClick OnEnter = RadioButtonUDPEnter
end end
object RadioButtonMulticast: TRadioButton object RadioButtonMulticast: TRadioButton
Left = 16 Left = 16
...@@ -337,7 +337,7 @@ object NetworkDlg: TNetworkDlg ...@@ -337,7 +337,7 @@ object NetworkDlg: TNetworkDlg
Height = 17 Height = 17
Caption = 'UDP Multicast' Caption = 'UDP Multicast'
TabOrder = 1 TabOrder = 1
OnClick = RadioButtonMulticastClick OnEnter = RadioButtonMulticastEnter
end end
object RadioButtonCS: TRadioButton object RadioButtonCS: TRadioButton
Left = 16 Left = 16
...@@ -346,7 +346,7 @@ object NetworkDlg: TNetworkDlg ...@@ -346,7 +346,7 @@ object NetworkDlg: TNetworkDlg
Height = 17 Height = 17
Caption = 'Channel Server' Caption = 'Channel Server'
TabOrder = 2 TabOrder = 2
OnClick = RadioButtonCSClick OnEnter = RadioButtonCSEnter
end end
object RadioButtonHTTP: TRadioButton object RadioButtonHTTP: TRadioButton
Left = 16 Left = 16
...@@ -355,7 +355,7 @@ object NetworkDlg: TNetworkDlg ...@@ -355,7 +355,7 @@ object NetworkDlg: TNetworkDlg
Height = 17 Height = 17
Caption = 'HTTP' Caption = 'HTTP'
TabOrder = 3 TabOrder = 3
OnClick = RadioButtonHTTPClick OnEnter = RadioButtonHTTPEnter
end end
object EditUDPPort: TEdit object EditUDPPort: TEdit
Left = 184 Left = 184
...@@ -384,7 +384,7 @@ object NetworkDlg: TNetworkDlg ...@@ -384,7 +384,7 @@ object NetworkDlg: TNetworkDlg
Width = 41 Width = 41
Height = 21 Height = 21
Enabled = False Enabled = False
TabOrder = 6 TabOrder = 7
Text = '1234' Text = '1234'
end end
object UpDownMulticastPort: TUpDown object UpDownMulticastPort: TUpDown
...@@ -397,7 +397,7 @@ object NetworkDlg: TNetworkDlg ...@@ -397,7 +397,7 @@ object NetworkDlg: TNetworkDlg
Min = 0 Min = 0
Max = 32767 Max = 32767
Position = 1234 Position = 1234
TabOrder = 7 TabOrder = 8
Thousands = False Thousands = False
Wrap = False Wrap = False
end end
...@@ -407,7 +407,7 @@ object NetworkDlg: TNetworkDlg ...@@ -407,7 +407,7 @@ object NetworkDlg: TNetworkDlg
Width = 41 Width = 41
Height = 21 Height = 21
Enabled = False Enabled = False
TabOrder = 8 TabOrder = 10
Text = '6010' Text = '6010'
end end
object UpDownCSPort: TUpDown object UpDownCSPort: TUpDown
...@@ -420,7 +420,7 @@ object NetworkDlg: TNetworkDlg ...@@ -420,7 +420,7 @@ object NetworkDlg: TNetworkDlg
Min = 0 Min = 0
Max = 32767 Max = 32767
Position = 6010 Position = 6010
TabOrder = 9 TabOrder = 11
Thousands = False Thousands = False
Wrap = False Wrap = False
end end
...@@ -431,7 +431,7 @@ object NetworkDlg: TNetworkDlg ...@@ -431,7 +431,7 @@ object NetworkDlg: TNetworkDlg
Height = 21 Height = 21
Enabled = False Enabled = False
ItemHeight = 13 ItemHeight = 13
TabOrder = 10 TabOrder = 6
end end
object ComboBoxCSAddress: TComboBox object ComboBoxCSAddress: TComboBox
Left = 184 Left = 184
...@@ -440,7 +440,7 @@ object NetworkDlg: TNetworkDlg ...@@ -440,7 +440,7 @@ object NetworkDlg: TNetworkDlg
Height = 21 Height = 21
Enabled = False Enabled = False
ItemHeight = 13 ItemHeight = 13
TabOrder = 11 TabOrder = 9
Text = '138.195.156.230' Text = '138.195.156.230'
Items.Strings = ( Items.Strings = (
'138.195.159.230') '138.195.159.230')
......
...@@ -63,10 +63,10 @@ __published: // IDE-managed Components ...@@ -63,10 +63,10 @@ __published: // IDE-managed Components
void __fastcall FormHide( TObject *Sender ); void __fastcall FormHide( TObject *Sender );
void __fastcall BitBtnCancelClick( TObject *Sender ); void __fastcall BitBtnCancelClick( TObject *Sender );
void __fastcall BitBtnOkClick( TObject *Sender ); void __fastcall BitBtnOkClick( TObject *Sender );
void __fastcall RadioButtonUDPClick( TObject *Sender ); void __fastcall RadioButtonUDPEnter( TObject *Sender );
void __fastcall RadioButtonMulticastClick( TObject *Sender ); void __fastcall RadioButtonMulticastEnter( TObject *Sender );
void __fastcall RadioButtonCSClick( TObject *Sender ); void __fastcall RadioButtonCSEnter( TObject *Sender );
void __fastcall RadioButtonHTTPClick( TObject *Sender ); void __fastcall RadioButtonHTTPEnter( TObject *Sender );
private: // User declarations private: // User declarations
int OldRadioValue; int OldRadioValue;
void __fastcall ChangeEnabled( int i_selected ); void __fastcall ChangeEnabled( int i_selected );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment