Announcement

Collapse
No announcement yet.

Variable slider problem

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

  • Variable slider problem

    I defined a variable slider to display the volume of car headunit. Also, I can adjust the headunit volume by clicking the silder. Now, the problem is that the slider can display the volume well just before clicking it. Once click the slider, it will always stay in the position mouse clicked.

    I traced the ReturnSlider(). It was called but the slider just does not refect the ReturnSlider value.

    -- SKIN
    Code:
    S01,9,440,390,35,9,440,390,35,H,01,"vslider1\pointer.gif",013"$CAR_MASTER$",
    -- ExecTBL.ini
    Code:
    "ONSLDCAR_MASTER","SETCARVOL;$CAR_MASTER$"
    -- ReturnSlider() in RRExtension
    Code:
    Case "$car_master$"
        Dim level As Integer = carVolume.getLevel()
        ReturnSlider = Int(65535 / CarVolume.MAX_VOLUME * level)
    -- ProcessCommand() in RRExtension
    Code:
    If InStr(CMD, "SETCARVOL") <> 0 Then
       'here is code to control car volume
    Endif

  • #2
    I believe that your ReturnSlider Case "$car_master$" is not correct. You are also mixing two different methods. If you are gonna use a Ext PI, then you don't need any of the variable stuff, as that is mostly for creating a custom slider in a skin and be able to use it w/o using an ext pi. You can also use the setSlider() in RRExtention as well which is called when you click the slider ie...

    -- SetSlider() in RRExtension
    Code:
    Case "car_master"
         rrsdk.execute("SETCARVOL;" & Value") 
         totally NOT recomended!!, reuse code from setcarvol cmd or better yet make it a func and then both can use it to set the volume
    RideRunner...The #1 FE, PERIOD.

    Current Project: DFXVoice [v1.0 Released]
    Next in line: RRMedia v2.0

    DFX 5.1.1 Skin
    Appstore Link

    My RideRunner Plugins
    RRMedia
    RRExtended
    DFXVoice

    "There are no bugs - only undocumented features."

    Comment


    • #3
      Yeah, it works well. Thanks!

      Comment


      • #4
        I have a little confuse about the SetSlider(). It seems that one click will invoke this method many times. The value in first call is correct, but the value in later calls has a value larger than 65535.

        Added a msgBox in this method. After one mouse click on the slider, the first message box showed value 17308 which is correct, but the next msg box showed value 83180




        Edit: SetSlider() works well, the code only execute once for one mouse click. Not sure why the msgbox comes

        Comment


        • #5
          I would suggest saving a log (and not showing messageboxes) to display the values returned. The value should never be more than 65536 -- this could be very well happening because of the messagebox (hard to explain but has to do with the position of the mouse after the first messagebox is displayed).
          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
            Good call G!
            RideRunner...The #1 FE, PERIOD.

            Current Project: DFXVoice [v1.0 Released]
            Next in line: RRMedia v2.0

            DFX 5.1.1 Skin
            Appstore Link

            My RideRunner Plugins
            RRMedia
            RRExtended
            DFXVoice

            "There are no bugs - only undocumented features."

            Comment


            • #7
              Originally posted by guino View Post
              I would suggest saving a log (and not showing messageboxes) to display the values returned. The value should never be more than 65536 -- this could be very well happening because of the messagebox (hard to explain but has to do with the position of the mouse after the first messagebox is displayed).
              Thanks guino! you are correct.

              Comment

              Working...
              X