Andromo - Start Making Apps - Free Signup

Announcement

Collapse

New Forum Software

If you're here, you've found the new home for our forums. There will be some bugs to iron out, so thanks for your patience...
See more
See less

Example: XP ExlorerBar and Grouping Objects

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

  • Example: XP ExlorerBar and Grouping Objects

    This project groups objects together to perform actions on the group. The key to this is to have the objects name within a group start with a "group name".

    For example: if you have a label named: lblTitle and another named lblAuthor, to group them, simple rename the objects to grp1_lblTitle and grp1_lblAuthor. The included function shows how to enumerate the page objects, then perform the needed action on all objects within the group.
    Attached Files
    Last edited by Desmond; 06-27-2005, 12:39 PM.

  • #2
    That's fantastic Worm, thanks for sharing. I see what you mean about input and listbix objects flickering but I think for the most part as a menu system you would use labels buttons or images.

    Dermot
    Dermot

    I am so out of here :yes

    Comment


    • #3
      Thanks!
      You're right. When using Labels, Buttons, Images and I think Paragraphs, the Application.Redraw trick makes it work fairly smooth.

      With the other objects I had to turn the redraw on before performing any actions on them or the actions didn't take. Keeping these objects to a minimum should allow it to be smooth.

      Originally posted by Dermot
      That's fantastic Worm, thanks for sharing. I see what you mean about input and listbix objects flickering but I think for the most part as a menu system you would use labels buttons or images.

      Dermot

      Comment


      • #4
        Very nice job! Just when you think you've seen it all, Worm impresses once again.
        AutoPlay Media Studio 8.5 is Windows 10 compatible today!

        Comment


        • #5
          Here is another function that could be used in the project to enable/disable the group

          Code:
          --[[
          	Function to set a group of objects Enabled/Disabled
          ]]--
          function SetGroupEnabled(sGroupName, blnEnabled)
          	-- get all objects on the page
          	tblObjects = Page.EnumerateObjects()
          	--set the app to not redraw until we're ready
          	Application.SetRedraw(false)
          	--loop through the object on the page
          	for index, object in tblObjects do
          		--if the object is part of the group that was passed to the function
          		if String.Left(object, String.Length(sGroupName)) == sGroupName then
          			--get the objects type
          			ObjectType = Page.GetObjectType(object)
          			--once we have the type, we can use a series of
          			--IF statements to run the correct actions
          			if ObjectType == OBJECT_BUTTON then
           				Button.SetEnabled(object, blnHide)
          			elseif ObjectType == OBJECT_LABEL then
          			 	Label.SetEnabled(object, blnHide)
          			elseif ObjectType == OBJECT_PARAGRAPH then
          			 	Paragraph.SetEnabled(object, blnHide)
          			elseif ObjectType == OBJECT_IMAGE then
          				Image.SetEnabled(object, blnHide)
          			elseif ObjectType == OBJECT_FLASH then
          				Application.SetEnabled(true)			
          				Flash.SetVisible(object, blnHide)			 
          				Application.SetEnabled(false)
          			elseif ObjectType == OBJECT_VIDEO then
          				Application.SetEnabled(true)			
          				Video.SetVisible(object, blnHide)
          				Application.SetEnabled(false)
          			elseif ObjectType == OBJECT_WEB then 
          				Application.SetEnabled(true)
          				Web.SetVisible(object, blnHide)
          				Application.SetEnabled(false)
          			elseif ObjectType == OBJECT_INPUT then
          				Application.SetEnabled(true)
          				Input.SetVisible(object, blnHide)	
          				Application.SetEnabled(false)
          			elseif ObjectType == OBJECT_HOTSPOT then 
          				HotSpot.SetVisible(object, blnHide)
          			elseif ObjectType == OBJECT_LISTBOX then
          				Application.SetEnabled(true)			
          			 	ListBox.SetVisible(object, blnHide)
          			 	Application.SetEnabled(false)
          			elseif ObjectType == OBJECT_PLUGIN then
          				Application.SetEnabled(true)			
          				Plugin.SetVisible(object, blnHide)
          				Application.SetEnabled(false)
          			end
          		end
          	end
          	--space out the buttons
          	SpaceXPBars()
          	--let the app redraw
          	Application.SetRedraw(true)
          end

          Comment


          • #6
            That's pretty neat, useful! Nice looking demo as well. :yes
            Intrigued

            Comment


            • #7
              Looks as if you spent a lot of time on that. Awesome stuff.
              Regards,

              -Ron

              Music | Video | Pictures

              Comment


              • #8
                VERY neat project.
                It WILL come handy. Thanks for sharing, Worm.

                Yossi

                Comment


                • #9
                  Wow! What a useful set of functions for GUI design. Thank you for sharing. As usual, your code always makes the task seem so trivial. I couldnít do in 600 lines of code, what youíve done in less than 150. I sure wished I had some of your talent when it comes to really distilling a problem down to itís core, like you are able to do.

                  We can even change the physical size, add or subtract groups, and your functions still work. This means that we are free to customize the GUI, without changing a single line of code, and still have everything work properly. This is good stuff, Iím sure that your wonderful gift will find a home in more than one of my future projects.

                  Whoída thunk it could be so easy?

                  It has my mind racing with thoughts of what kind of cool GUIís could be created by combining these functions, with the power of your SetMask DLL.

                  Worm, thank you for the more than gracious, and quite blatant promotion of my AMS addon and website. You are more than a gentleman, sir, and abundantly kind.



                  .

                  Comment


                  • #10
                    Originally posted by JimS
                    This means that we are free to customize the GUI, without changing a single line of code
                    I wish that were true, but the FOR loop in SpaceXPBars needs to be adjusted to the number of buttons Bars you have minus one. So if you decide to have 5 ExplorerBars, then the loop needs to be

                    for n=1, 4 do -- 5 bars less 1 bar = 4

                    Other than that, the rest of the functions should work without too much modificiation if any.

                    As for the promo of your tools, what can I say, it's good stuff!! I can definitely thank those of you who are gifted in design for helping someone who's "creatively challenged" like myself. I have a much nicer looking version that uses your kit, but didn't post it to avoid giving away your work

                    Comment


                    • #11
                      Thanks for the clarification Worm. I resized the groups in your example, and it worked fine, although I posted before I actually tried adding more groups.

                      Iím still trying to get my head around the math you use for repositioning the groups. You make it look so easy. Thanks for taking the extra time to comment your code so thoroughly, it makes it so much easier for numbskulls like me to follow.

                      Maybe if I can tear apart, enough of your code examples, Iíll eventually be able to teach my brain to think more as you do. I hope so, but Iím not placing any bets.

                      Perhaps if Iím lucky, I can persuade the I-man into giving me a swig of whatever juice heís been drinking lately, so I too will be able to learn new stuff with the speed, and apparent ease, of a child. Go Intrigued!



                      .

                      Comment


                      • #12
                        Perhaps if Iím lucky, I can persuade the I-man into giving me a swig of whatever juice heís been drinking lately, so I too will be able to learn new stuff with the speed, and apparent ease, of a child. Go Intrigued!
                        Well, I have to thank Worm for violently shaking me at the shoulders and getting me motivated in a different direction (but still indirectly related to AMS 5 coding!)

                        The juice... well it's currently under Tradmark status. *hands Jim a Non Disclosure Agreement laden clipboard*

                        Intrigued

                        Comment


                        • #13
                          Worm, donít sell yourself short on the graphical design side. Making the whole Explorer Bar a single button, instead of just an arrow button as I did, was simply ingenious my friend. It more correctly emulates the way each Explorer bar works, with fewer pieces, and less code.

                          Iím embarrassed to say, but Iíve always clicked on the arrows of an Explorer bar, and didnít realize until I tried your example, that the whole Explorer bar is clickable. Your Explorer Bar button is unquestionably superior, and thatís not even the coolest part of your example.

                          Your code is so cool, that it is easy to overlook how smart your graphics are. Thanks again for sharing. :yes

                          Intrigued, whatever the cause, keep it up. Itís uplifting to see someone tearing through new material with the ferocity that you have been showing lately. Well, it is uplifting, until I compare it with what Iíve accomplished lately, then it becomes a bit depressing. Oh well, at least itís good to know someone who is motivated. :yes



                          .

                          Comment


                          • #14
                            Bah! I didn't realize it either Jimbo, when I read your post, I had to go and try it to see

                            How 'bout that... I did good :lol

                            Comment


                            • #15
                              Another "That'a boy" award!

                              Woot'saaa!
                              Intrigued

                              Comment

                              Working...
                              X