Announcement

Collapse
No announcement yet.

Need help for a toogle function around the indclick plugin option

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Need help for a toogle function around the indclick plugin option

    I try to have a toogle function with an indicator but without success.


    This is my code
    Code:
    Public Sub IndicatorClick(IND As String)
    Dim iniFile As New ClsIniFile
    Dim SpeedType As String
    Dim GpxUnits As String
    iniFile.Filename = App.Path & "/Settings.ini"
    iniFile.ApplicationKey = "SETTINGS"
    
    
        'If one of our indicators
        Select Case LCase(IND)
            Case "!gpsexec1"
                'Displays message box
                'MsgBox "MYINDICATOR has been clicked!"
                RRSDK.Execute ("load;" & iniFile.GetValue("Screen", ""))
                
            Case "!alarmall"
                If RRSDK.GetInfo("=$SLDSTATUS$") = "1" Then
                    RRSDK.Execute ("SAVETOSKIN;SLDSTATUS;0||SETIND;!AlarmAll;Off")
                ElseIf RRSDK.GetInfo("=$SLDSTATUS$") = "0" Then
                    RRSDK.Execute ("SAVETOSKIN;SLDSTATUS;1||SETIND;!AlarmAll;On")
                End If
                
    
        End Select
    
    End Sub
    Thanks for your help !!!

  • #3
    Originally posted by Enforcer View Post
    Where else do you use SLDSTATUS?

    and why are you putting ! before those variables?


    Indicators should be true or false not yes or no.
    Ok,

    So i need to have a variable =0 or 1 when an indicator is false or true !
    I want to use a screen like that:

    Comment


    • #4
      Ok,

      I have tried to test the indicat and not the var:
      Code:
      Public Sub IndicatorClick(IND As String)
      Dim iniFile As New ClsIniFile
      Dim SpeedType As String
      Dim GpxUnits As String
      iniFile.Filename = App.Path & "/Settings.ini"
      iniFile.ApplicationKey = "SETTINGS"
      
      
          'If one of our indicators
          Select Case LCase(IND)
              Case "!gpsexec1"
                  'Displays message box
                  'MsgBox "MYINDICATOR has been clicked!"
                  RRSDK.Execute ("load;" & iniFile.GetValue("Screen", ""))
                  
              Case "!alarmall"
                  If RRSDK.GetInd("!AlarmAll") = "True" Then
                      RRSDK.Execute ("SAVETOSKIN;SLDSTATUS;0||SETIND;!AlarmAll;Off")
                  Else
                      RRSDK.Execute ("SAVETOSKIN;SLDSTATUS;1||SETIND;!AlarmAll;On")
                  End If
      And all is ok now !

      Comment


      • #5
        Unless you use $SLDSTATUS$ in your skin or somewhere else in the plugin, this is not needed: SAVETOSKIN;SLDSTATUS;0/1, meaning that this alone should work to toggle the !Alarmall indicator:

        Code:
        Case "!alarmall"
                    If RRSDK.GetInd("!AlarmAll") = "True" Then
                        RRSDK.Execute "SETIND;!AlarmAll;Off"
                    Else
                        RRSDK.Execute "SETIND;!AlarmAll;On"
                    End If
        Ride Runner RR's Myspace

        "Being happy is not about having what you want, it's about wanting what you have."
        "The best things in life are always free - but that doesn't mean money can't buy you good things."

        Comment


        • #6
          Originally posted by guino View Post
          Unless you use $SLDSTATUS$ in your skin or somewhere else in the plugin, this is not needed: SAVETOSKIN;SLDSTATUS;0/1, meaning that this alone should work to toggle the !Alarmall indicator:

          Code:
          Case "!alarmall"
                      If RRSDK.GetInd("!AlarmAll") = "True" Then
                          RRSDK.Execute "SETIND;!AlarmAll;Off"
                      Else
                          RRSDK.Execute "SETIND;!AlarmAll;On"
                      End If
          The $SLDSTATUS$ is just read when the plugin is launched.
          But i think that i shall change that by a save into a settings.ini file

          Comment

          Working...
          X