Indigo Rose Software

Professional Software Development Tools

 
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 21
  1. #1
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,961

    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 Images
    Attached Files
    Last edited by Desmond; 06-27-2005 at 12:39 PM.

  2. #2
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790
    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

  3. #3
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,961
    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.

    Quote 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

  4. #4
    Join Date
    Oct 2003
    Posts
    915
    Very nice job! Just when you think you've seen it all, Worm impresses once again.

  5. #5
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,961
    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

  6. #6
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,135
    That's pretty neat, useful! Nice looking demo as well.
    Intrigued

  7. #7
    Join Date
    Aug 2003
    Location
    Maine, USA
    Posts
    1,695
    Looks as if you spent a lot of time on that. Awesome stuff.

  8. #8
    Join Date
    Jun 2002
    Location
    Israel
    Posts
    1,850
    VERY neat project.
    It WILL come handy. Thanks for sharing, Worm.

    Yossi

  9. #9
    Join Date
    May 2003
    Location
    Pendleton, Oregon
    Posts
    1,056
    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.



    .

  10. #10
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,961
    Quote 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

  11. #11
    Join Date
    May 2003
    Location
    Pendleton, Oregon
    Posts
    1,056
    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!



    .

  12. #12
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,135
    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

  13. #13
    Join Date
    May 2003
    Location
    Pendleton, Oregon
    Posts
    1,056
    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.

    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.



    .

  14. #14
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,961
    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

  15. #15
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,135
    Another "That'a boy" award!

    Woot'saaa!
    Intrigued

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts