diff options
Diffstat (limited to 'app/bin/cswitchmotor.c')
| -rw-r--r-- | app/bin/cswitchmotor.c | 29 | 
1 files changed, 15 insertions, 14 deletions
diff --git a/app/bin/cswitchmotor.c b/app/bin/cswitchmotor.c index 7bdbbcf..8748b97 100644 --- a/app/bin/cswitchmotor.c +++ b/app/bin/cswitchmotor.c @@ -605,7 +605,9 @@ static void NewSwitchMotorDialog(track_p trk)  	if ( !switchmotorW ) {  		ParamRegister( &switchmotorPG );  		switchmotorW = ParamCreateDialog (&switchmotorPG, -		                                  MakeWindowTitle(_("Create switch motor")), _("Ok"), SwitchMotorOk, wHide, TRUE, +		                                  MakeWindowTitle(_("Create switch motor")), +		                                  ("Ok"), SwitchMotorOk, +		                                  ParamCancel_Current, TRUE,  		                                  NULL, F_BLOCK, NULL );  		switchmotorD.dpi = mainD.dpi;  	} @@ -763,10 +765,14 @@ static void SwitchMotorEditOk ( void * junk )  static void EditSwitchMotor (track_p trk)  {  	switchmotorData_p xx = GetswitchmotorData(trk); -	strncpy(switchmotorEditName,xx->name,STR_SHORT_SIZE); -	strncpy(switchmotorEditNormal,xx->normal,STR_LONG_SIZE); -	strncpy(switchmotorEditReverse,xx->reverse,STR_LONG_SIZE); -	strncpy(switchmotorEditPointSense,xx->pointsense,STR_LONG_SIZE); +	strncpy(switchmotorEditName,xx->name,STR_SHORT_SIZE - 1); +	switchmotorEditName[STR_SHORT_SIZE - 1] = '\0'; +	strncpy(switchmotorEditNormal,xx->normal,STR_LONG_SIZE - 1); +	switchmotorEditNormal[STR_LONG_SIZE - 1] = '\0'; +	strncpy(switchmotorEditReverse,xx->reverse,STR_LONG_SIZE - 1); +	switchmotorEditReverse[STR_LONG_SIZE - 1] = '\0'; +	strncpy(switchmotorEditPointSense,xx->pointsense,STR_LONG_SIZE - 1); +	switchmotorEditPointSense[STR_LONG_SIZE - 1] = '\0';  	if (xx->turnout == NULL) { switchmotorEditTonum = 0; }  	else { switchmotorEditTonum = GetTrkIndex(xx->turnout); }  	switchmotorEditTrack = trk; @@ -775,7 +781,7 @@ static void EditSwitchMotor (track_p trk)  		switchmotorEditW = ParamCreateDialog (&switchmotorEditPG,  		                                      MakeWindowTitle(_("Edit switch motor")),  		                                      _("Ok"), SwitchMotorEditOk, -		                                      wHide, TRUE, NULL, F_BLOCK, +		                                      ParamCancel_Current, TRUE, NULL, F_BLOCK,  		                                      NULL );  	}  	ParamLoadControls( &switchmotorEditPG ); @@ -857,12 +863,7 @@ static int SwitchmotorMgmProc ( int cmd, void * data )  	return FALSE;  } -//#include "bitmaps/switchmotor.xpm" - -//#include "bitmaps/switchmnew.xpm" -//#include "bitmaps/switchmedit.xpm" -//#include "bitmaps/switchmdel.xpm" -#include "bitmaps/switch-motor.xpm3" +#include "bitmaps/switch-motor.image3"  EXPORT void SwitchmotorMgmLoad( void )  { @@ -870,7 +871,7 @@ EXPORT void SwitchmotorMgmLoad( void )  	static wIcon_p switchmI = NULL;  	if ( switchmI == NULL) { -		switchmI = wIconCreatePixMap( switch_motor_xpm3[iconSize] ); +		switchmI = wIconCreatePixMap( switch_motor_image3[iconSize] );  	}  	TRK_ITERATE(trk) { @@ -886,7 +887,7 @@ EXPORT void InitCmdSwitchMotor( wMenu_p menu )  	switchmotorReverse[0] = '\0';  	switchmotorPointSense[0] = '\0';  	AddMenuButton( menu, CmdSwitchMotorCreate, "cmdSwitchMotorCreate", -	               _("Switch Motor"), wIconCreatePixMap( switch_motor_xpm3[iconSize] ), +	               _("Switch Motor"), wIconCreatePixMap( switch_motor_image3[iconSize] ),  	               LEVEL0_50, IC_STICKY|IC_POPUP2, ACCL_SWITCHMOTOR1,  	               NULL );  	ParamRegister( &switchmotorPG );  | 
