sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    FredoBend | Powerful new bending tool for SketchUp Download

    Using the Cancel btn, to return to previous menu?

    Scheduled Pinned Locked Moved Developers' Forum
    22 Posts 5 Posters 1.3k Views 5 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • TIGT Offline
      TIG Moderator
      last edited by

      Here's an example I know works as I have tested it...

      require('sketchup.rb')
      module CANCEL_TEST
      	#Set default settings
      	@height = 9.feet if not @height # floor to floor height   
      	@riser = 16 if not @riser       # no. risers total   
      		
      	def self.run()   
      		self.dialog1()
      	end
      	# Dialog box #1
      	def self.dialog1()
      		prompts = ["Floor/Floor Height ", "No. Risers"]
      		values = [@height, @riser]
      		@results1 = inputbox prompts, values, "Dialog Box #1"
      		if @results1
      			@height, @riser = @results1
      			@riserheight=@height/@riser  # riser height
      			self.dialog2()
      		else
      			return nil
      		end
      	end
      
      	# Dialog box #2
      	def self.dialog2()
      		prompts = ["My RiserHeight  ", "--------"]
      		values = [@riserheight, @any_entry]
      		@results2 = inputbox prompts, values, "Dialog Box #2"
      		if @results2
      			@riserheight, @any_entry = @results2
      			puts "Got here !"
      			[@height,@riser,@riserheight,@any_entry].each{|e| puts e}
      		else
      			self.dialog1()
      			return nil
      		end   
      	end
      
      	###
      	unless file_loaded?(__FILE__)
      		UI.menu("Plugins").add_item("Cancel") { CANCEL_TEST.run() }
      	end
      	###
      	file_loaded(__FILE__)
      
      	# load"CANCEL_TEST.rb"
      end#module
      
      

      IT is now properly structured to loop back into itself is needs be... πŸ˜’

      TIG

      1 Reply Last reply Reply Quote 0
      • T Offline
        tomot
        last edited by

        Thanks TIG:

        I would never have been able to figure out the self.run routine on my own! πŸŽ‰

        my plugins
        tomot

        1 Reply Last reply Reply Quote 0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better πŸ’—

        Register Login
        • 1
        • 2
        • 2 / 2
        • First post
          Last post
        Buy SketchPlus
        Buy SUbD
        Buy WrapR
        Buy eBook
        Buy Modelur
        Buy Vertex Tools
        Buy SketchCuisine
        Buy FormFonts

        Advertisement