Winbutton Plugin Help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • ButtonMaker
    Forum Member
    • Mar 2007
    • 172

    Winbutton Plugin Help

    I want to set the winbutton plugin "enable = false" but it doesnt work with self command...
    I have a winbutton named "Plugin20" and code in that button is
    Code:
    Plugin.SetEnabled("Plugin20", false);
    and i also tried
    Code:
    Plugin.SetEnabled(this, false);
    but none of them works... it doesnt make it disable !!!

    why is that ?
  • andulek
    Forum Member
    • Feb 2009
    • 30

    #2
    It works allright, make sure you put this code "ON CLICK" event. and that your object is really "Plugin20", and that it is ENABLED at startup.

    Comment

    • ButtonMaker
      Forum Member
      • Mar 2007
      • 172

      #3
      well it is enabled from properties but i have that code on show of the page

      Code:
      Winbutton1 = INIFile.GetValue("AutoPlay\\Docs\\Buttons.ini", "Winbutton", "Enable");
      if (Winbutton1 == "") then 
      Plugin.SetEnabled("Plugin20", false);
      else 
      Plugin.SetEnabled("Plugin20", true);
      end
      and when i click Winbutton(Plugin20) it doesnt enable it...
      i have that code on click

      Code:
      Plugin.SetEnabled("Plugin20", true);

      Comment

      • andulek
        Forum Member
        • Feb 2009
        • 30

        #4
        if at startup time you "Plugin20" is disabled by reading INI vaule ON SHOW, you know what means disabled? it means that you cannot do the code ON CLICK event of this button, there must be another enabled button presed example can be another button "Plugin21" with enabling code.

        Comment

        • ButtonMaker
          Forum Member
          • Mar 2007
          • 172

          #5
          yes yes thats what it is anyway, i am sorry i wrote it wrong

          this is the code but it doesnt work

          page on show:
          Code:
          Winbutton1 = INIFile.GetValue("AutoPlay\\Docs\\Buttons.ini", "Winbutton", "Enable");
          if (Winbutton1 == "") then 
          Plugin.SetEnabled("Plugin20", false);
          else 
          Plugin.SetEnabled("Plugin20", true);
          end
          Plugin19 on click:
          Code:
          Plugin.SetEnabled("Plugin20", true);
          Plugin.SetEnabled("Plugin19", false);

          Comment

          • andulek
            Forum Member
            • Feb 2009
            • 30

            #6
            okay, lets clear this out, plugin19 ON CLICK event is allright, it disables plugin19 and enables the plugin20. now i want to know is your INI file allright? what situation you get at startup time? is plugin20 already disabled?

            Comment

            • ButtonMaker
              Forum Member
              • Mar 2007
              • 172

              #7
              ok here it is using registry...

              on show :
              Code:
              Registered = Registry.DoesKeyExist(HKEY_LOCAL_MACHINE, "Software\\Player\\Users");
              if Registered then
              		Plugin.SetEnabled("Plugin19", false);
              		Plugin.SetEnabled("Plugin20", true);
              		else
              		Plugin.SetEnabled("Plugin19", true);
              		Plugin.SetEnabled("Plugin20", false);
              end

              Clear Registry and make button19 enable onclick plugin20:
              Code:
              Registry.DeleteKey(HKEY_LOCAL_MACHINE, "Software\\Player\\Users");
              Plugin.SetEnabled("Plugin20", false);
              Plugin.SetEnabled("Plugin19", true);

              add user and make button20 enable onclick plugin19:
              Code:
              Registry.SetValue(HKEY_LOCAL_MACHINE, "Software\\Player\\Users", "User", REG_SZ);
              Plugin.SetEnabled("Plugin20", true);
              Plugin.SetEnabled("Plugin19", false);

              if i click enable button it writes the registry but it doesnt make itself disable and other enable
              Last edited by ButtonMaker; 03-06-2009, 06:58 AM.

              Comment

              • andulek
                Forum Member
                • Feb 2009
                • 30

                #8
                in ALL codes change all TRUE to FALSE
                and all FALSE to TRUE

                Comment

                • ButtonMaker
                  Forum Member
                  • Mar 2007
                  • 172

                  #9
                  it is the same... i think winbutton doesnt make itself enable or disable onruntime...

                  Comment

                  • andulek
                    Forum Member
                    • Feb 2009
                    • 30

                    #10
                    i really tried your code, and it worked jus fine. and i use this feature alot in my applications that one button disables other, and so on. maybe you just try reinstalling AMS

                    Comment

                    • ButtonMaker
                      Forum Member
                      • Mar 2007
                      • 172

                      #11
                      or mayeb it has something to do with on show code

                      Comment

                      • andulek
                        Forum Member
                        • Feb 2009
                        • 30

                        #12
                        it works, try it
                        Attached Files

                        Comment

                        • ButtonMaker
                          Forum Member
                          • Mar 2007
                          • 172

                          #13
                          no no i found the problem i think

                          i have these buttons on dialog window(dialogex)

                          ur example works good but if u move them to a dialog then they dont work either ...

                          am i wrong ? try please

                          Comment

                          • andulek
                            Forum Member
                            • Feb 2009
                            • 30

                            #14
                            you should start explainig your problem from THIS
                            next time describe it more carefully!
                            i cannot try it now, becaus im not at home and my AMS here is old, it doesnt have dialogex. as far as i remeber, there are different methods of setting object's properties, it is true for Checkboxes, i can remember it. though, i dont know about winbutton, try looking throughout DialogEx's all functions
                            and maybe you find the answer there

                            Comment

                            • ButtonMaker
                              Forum Member
                              • Mar 2007
                              • 172

                              #15
                              how does button enable works on dialogex ?

                              Comment

                              Working...
                              X