Changeset 17 for trunk


Ignore:
Timestamp:
04/08/10 11:14:19 (14 years ago)
Author:
pinwc4
Message:

Changed controls on advanced screen to use text changed events instead of keydown events

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/desktop/mainWindow.rbfrm

    r16 r17  
    138138      Top             =   32 
    139139      Underline       =   "" 
    140       Value           =   0 
     140      Value           =   3 
    141141      Visible         =   True 
    142142      Width           =   637 
     
    34393439#tag Events EditField_Byte17 
    34403440        #tag Event 
    3441                 Function KeyDown(Key As String) As Boolean 
     3441                Sub TextChange() 
    34423442                  //Make sure we have a valid value if not then set it to something 
    3443                   if val(me.Text) > 255 or val(me.Text) < 0 then 
    3444                     me.Text = "255" 
     3443                  if me.Text <> "" then 
     3444                    if val(me.Text) > 255 or val(me.Text) < 0 then 
     3445                      me.Text = "255" 
     3446                    end if 
    34453447                  end if 
    34463448                   
     
    34503452                  i = d 
    34513453                  ICSSerialPort1.Byte17 = chrb(i) 
    3452                 End Function 
     3454                End Sub 
    34533455        #tag EndEvent 
    34543456#tag EndEvents 
    34553457#tag Events EditField_Byte16 
    34563458        #tag Event 
    3457                 Function KeyDown(Key As String) As Boolean 
     3459                Sub TextChange() 
    34583460                  //Make sure we have a valid value if not then set it to something 
    3459                   if val(me.Text) > 255 or val(me.Text) < 0 then 
    3460                     me.Text = "255" 
     3461                  if me.Text <> "" then 
     3462                    if val(me.Text) > 255 or val(me.Text) < 0 then 
     3463                      me.Text = "255" 
     3464                    end if 
    34613465                  end if 
    34623466                   
     
    34663470                  i = d 
    34673471                  ICSSerialPort1.Byte16 = chrb(i) 
    3468                 End Function 
     3472                End Sub 
    34693473        #tag EndEvent 
    34703474#tag EndEvents 
    34713475#tag Events EditField_Byte15 
    34723476        #tag Event 
    3473                 Function KeyDown(Key As String) As Boolean 
     3477                Sub TextChange() 
    34743478                  //Make sure we have a valid value if not then set it to something 
    3475                   if val(me.Text) > 255 or val(me.Text) < 0 then 
    3476                     me.Text = "255" 
     3479                  if me.Text <> "" then 
     3480                    if val(me.Text) > 255 or val(me.Text) < 0 then 
     3481                      me.Text = "255" 
     3482                    end if 
    34773483                  end if 
    34783484                   
     
    34823488                  i = d 
    34833489                  ICSSerialPort1.Byte15 = chrb(i) 
    3484                 End Function 
     3490                End Sub 
    34853491        #tag EndEvent 
    34863492#tag EndEvents 
    34873493#tag Events EditField_Byte14 
    34883494        #tag Event 
    3489                 Function KeyDown(Key As String) As Boolean 
     3495                Sub TextChange() 
    34903496                  //Make sure we have a valid value if not then set it to something 
    3491                   if val(me.Text) > 255 or val(me.Text) < 0 then 
    3492                     me.Text = "255" 
     3497                  if me.Text <> "" then 
     3498                    if val(me.Text) > 255 or val(me.Text) < 0 then 
     3499                      me.Text = "255" 
     3500                    end if 
    34933501                  end if 
    34943502                   
     
    34983506                  i = d 
    34993507                  ICSSerialPort1.Byte14 = chrb(i) 
    3500                 End Function 
     3508                End Sub 
    35013509        #tag EndEvent 
    35023510#tag EndEvents 
    35033511#tag Events EditField_Byte13 
    35043512        #tag Event 
    3505                 Function KeyDown(Key As String) As Boolean 
     3513                Sub TextChange() 
    35063514                  //Make sure we have a valid value if not then set it to something 
    3507                   if val(me.Text) > 255 or val(me.Text) < 0 then 
    3508                     me.Text = "255" 
     3515                  if me.Text <> "" then 
     3516                    if val(me.Text) > 255 or val(me.Text) < 0 then 
     3517                      me.Text = "255" 
     3518                    end if 
    35093519                  end if 
    35103520                   
     
    35143524                  i = d 
    35153525                  ICSSerialPort1.Byte13 = chrb(i) 
    3516                 End Function 
     3526                End Sub 
    35173527        #tag EndEvent 
    35183528#tag EndEvents 
    35193529#tag Events EditField_Byte12 
    35203530        #tag Event 
    3521                 Function KeyDown(Key As String) As Boolean 
     3531                Sub TextChange() 
    35223532                  //Make sure we have a valid value if not then set it to something 
    3523                   if val(me.Text) > 255 or val(me.Text) < 0 then 
    3524                     me.Text = "255" 
     3533                  if me.Text <> "" then 
     3534                    if val(me.Text) > 255 or val(me.Text) < 0 then 
     3535                      me.Text = "255" 
     3536                    end if 
    35253537                  end if 
    35263538                   
     
    35303542                  i = d 
    35313543                  ICSSerialPort1.Byte12 = chrb(i) 
    3532                 End Function 
     3544                End Sub 
    35333545        #tag EndEvent 
    35343546#tag EndEvents 
    35353547#tag Events EditField_Byte11 
    35363548        #tag Event 
    3537                 Function KeyDown(Key As String) As Boolean 
     3549                Sub TextChange() 
    35383550                  //Make sure we have a valid value if not then set it to something 
    3539                   if val(me.Text) > 255 or val(me.Text) < 0 then 
    3540                     me.Text = "255" 
     3551                  if me.Text <> "" then 
     3552                    if val(me.Text) > 255 or val(me.Text) < 0 then 
     3553                      me.Text = "255" 
     3554                    end if 
    35413555                  end if 
    35423556                   
     
    35463560                  i = d 
    35473561                  ICSSerialPort1.Byte11 = chrb(i) 
    3548                 End Function 
     3562                End Sub 
    35493563        #tag EndEvent 
    35503564#tag EndEvents 
    35513565#tag Events EditField_Byte10 
    35523566        #tag Event 
    3553                 Function KeyDown(Key As String) As Boolean 
     3567                Sub TextChange() 
    35543568                  //Make sure we have a valid value if not then set it to something 
    3555                   if val(me.Text) > 255 or val(me.Text) < 0 then 
    3556                     me.Text = "255" 
     3569                  if me.Text <> "" then 
     3570                    if val(me.Text) > 255 or val(me.Text) < 0 then 
     3571                      me.Text = "255" 
     3572                    end if 
    35573573                  end if 
    35583574                   
     
    35623578                  i = d 
    35633579                  ICSSerialPort1.Byte10 = chrb(i) 
    3564                 End Function 
     3580                End Sub 
    35653581        #tag EndEvent 
    35663582#tag EndEvents 
    35673583#tag Events EditField_Byte9 
    35683584        #tag Event 
    3569                 Function KeyDown(Key As String) As Boolean 
     3585                Sub TextChange() 
    35703586                  //Make sure we have a valid value if not then set it to something 
    3571                   if val(me.Text) > 255 or val(me.Text) < 0 then 
    3572                     me.Text = "255" 
     3587                  if me.Text <> "" then 
     3588                    if val(me.Text) > 255 or val(me.Text) < 0 then 
     3589                      me.Text = "255" 
     3590                    end if 
    35733591                  end if 
    35743592                   
     
    35783596                  i = d 
    35793597                  ICSSerialPort1.Byte09 = chrb(i) 
    3580                 End Function 
     3598                End Sub 
    35813599        #tag EndEvent 
    35823600#tag EndEvents 
    35833601#tag Events EditField_Byte8 
    35843602        #tag Event 
    3585                 Function KeyDown(Key As String) As Boolean 
     3603                Sub TextChange() 
    35863604                  //Make sure we have a valid value if not then set it to something 
    3587                   if val(me.Text) > 255 or val(me.Text) < 0 then 
    3588                     me.Text = "255" 
     3605                  if me.Text <> "" then 
     3606                    if val(me.Text) > 255 or val(me.Text) < 0 then 
     3607                      me.Text = "255" 
     3608                    end if 
    35893609                  end if 
    35903610                   
     
    35943614                  i = d 
    35953615                  ICSSerialPort1.Byte08 = chrb(i) 
    3596                 End Function 
     3616                End Sub 
    35973617        #tag EndEvent 
    35983618#tag EndEvents 
    35993619#tag Events EditField_Byte7 
    36003620        #tag Event 
    3601                 Function KeyDown(Key As String) As Boolean 
     3621                Sub TextChange() 
    36023622                  //Make sure we have a valid value if not then set it to something 
    3603                   if val(me.Text) > 255 or val(me.Text) < 0 then 
    3604                     me.Text = "255" 
     3623                  if me.Text <> "" then 
     3624                    if val(me.Text) > 255 or val(me.Text) < 0 then 
     3625                      me.Text = "255" 
     3626                    end if 
    36053627                  end if 
    36063628                   
     
    36103632                  i = d 
    36113633                  ICSSerialPort1.Byte07 = chrb(i) 
    3612                 End Function 
     3634                End Sub 
    36133635        #tag EndEvent 
    36143636#tag EndEvents 
    36153637#tag Events EditField_Byte6 
    36163638        #tag Event 
    3617                 Function KeyDown(Key As String) As Boolean 
     3639                Sub TextChange() 
    36183640                  //Make sure we have a valid value if not then set it to something 
    3619                   if val(me.Text) > 255 or val(me.Text) < 0 then 
    3620                     me.Text = "255" 
     3641                  if me.Text <> "" then 
     3642                    if val(me.Text) > 255 or val(me.Text) < 0 then 
     3643                      me.Text = "255" 
     3644                    end if 
    36213645                  end if 
    36223646                   
     
    36263650                  i = d 
    36273651                  ICSSerialPort1.Byte06 = chrb(i) 
    3628                 End Function 
     3652                End Sub 
    36293653        #tag EndEvent 
    36303654#tag EndEvents 
    36313655#tag Events EditField_Byte5 
    36323656        #tag Event 
    3633                 Function KeyDown(Key As String) As Boolean 
     3657                Sub TextChange() 
    36343658                  //Make sure we have a valid value if not then set it to something 
    3635                   if val(me.Text) > 255 or val(me.Text) < 0 then 
    3636                     me.Text = "255" 
     3659                  if me.Text <> "" then 
     3660                    if val(me.Text) > 255 or val(me.Text) < 0 then 
     3661                      me.Text = "255" 
     3662                    end if 
    36373663                  end if 
    36383664                   
     
    36423668                  i = d 
    36433669                  ICSSerialPort1.Byte05 = chrb(i) 
    3644                 End Function 
     3670                End Sub 
    36453671        #tag EndEvent 
    36463672#tag EndEvents 
    36473673#tag Events EditField_Byte4 
    36483674        #tag Event 
    3649                 Function KeyDown(Key As String) As Boolean 
     3675                Sub TextChange() 
    36503676                  //Make sure we have a valid value if not then set it to something 
    3651                   if val(me.Text) > 255 or val(me.Text) < 0 then 
    3652                     me.Text = "255" 
     3677                  if me.Text <> "" then 
     3678                    if val(me.Text) > 255 or val(me.Text) < 0 then 
     3679                      me.Text = "255" 
     3680                    end if 
    36533681                  end if 
    36543682                   
     
    36583686                  i = d 
    36593687                  ICSSerialPort1.Byte04 = chrb(i) 
    3660                 End Function 
     3688                End Sub 
    36613689        #tag EndEvent 
    36623690#tag EndEvents 
     
    36653693                Sub TextChange() 
    36663694                  //Make sure we have a valid value if not then set it to something 
    3667                   if val(me.Text) > 255 or val(me.Text) < 0 then 
    3668                     me.Text = "255" 
     3695                  if me.Text <> "" then 
     3696                    if val(me.Text) > 255 or val(me.Text) < 0 then 
     3697                      me.Text = "255" 
     3698                    end if 
    36693699                  end if 
    36703700                   
Note: See TracChangeset for help on using the changeset viewer.