Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2007
    Location
    Suffolk, UK
    Posts
    176

    ShowPopUpMenu problem

    Im using the following script to populate a table of which to create a menu with. the problem is, after you have used the menu once it wont work again, which is a rather big bug for what i am doing. heres the script:
    Code:
    tabs = 1;
    pObjects = Page.EnumerateObjects();
    tblMenu = {}
    tblMenu[1] ={};
    tblMenu[1].Text = "New Tab";
    tblMenu[1].ID = 99864;
    tblMenu[1].Checked = false;
    tblMenu[1].Enabled = true;
    tblMenu[2] ={};
    tblMenu[2].Text = "---";
    tblMenu[2].ID = 0;
    tblMenu[2].Checked = false;
    tblMenu[2].Enabled = true;
    for index, oName in pObjects do
    	if String.Left(oName, 3) == "Web" then
    		tblMenu[Tabs+2] ={};
    		tblMenu[Tabs+2].Text = Web.GetURL(oName);
    		tblMenu[Tabs+2].ID = String.ToNumber(String.Replace(oName, "Web", "", false));
    		tblMenu[Tabs+2].Checked = false;
    		tblMenu[Tabs+2].Enabled = true;
    		tblMenu[Tabs+2].SubMenu = {};
    		tblMenu[Tabs+2].SubMenu[1] = {};
    		tblMenu[Tabs+2].SubMenu[1].Text = "Open Tab";
    		tblMenu[Tabs+2].SubMenu[1].ID = String.ToNumber(String.Replace(oName, "Web", "", false));
    		tblMenu[Tabs+2].SubMenu[1].Checked = false;
    		tblMenu[Tabs+2].SubMenu[1].Enabled = true;
    		tblMenu[Tabs+2].SubMenu[2] = {};
    		tblMenu[Tabs+2].SubMenu[2].Text = "Close Tab";
    		tblMenu[Tabs+2].SubMenu[2].ID = 1001 .. String.ToNumber(String.Replace(oName, "Web", "", false));
    		tblMenu[Tabs+2].SubMenu[2].Checked = false;
    		tblMenu[Tabs+2].SubMenu[2].Enabled = true;
    		Tabs = Tabs+1;
    	end
    end
    bPos = Button.GetPos("Button11");
    tSelect = Application.ShowPopupMenu(bPos.X, bPos.Y, tblMenu, TPM_LEFTALIGN, TPM_TOPALIGN, true, true);
    if tSelect == 99864 then
    	-- Web object properties table.
    	tblWebProps = {};
    	tblWebProps.URL = "http://www.google.com";
    	tblWebProps.Width = 621;
    	tblWebProps.Height = 362;
    	tblWebProps.Y = 45;
    	tblWebProps.X = 4;
    	tblWebProps.ResizeLeft = true;
    	tblWebProps.ResizeRight = false;
    	tblWebProps.ResizeTop = false;
    	tblWebProps.ResizeBottom = true;
    	tblWebProps.Visible = true;
    	tblWebProps.Enabled = true;
    	Page.CreateObject(OBJECT_WEB, "Web"..Tabs, tblWebProps);
    elseif String.Left(tSelect, 4) == "1001" then
    	cID = String.Replace(tSelect, "1001", "", false);
    	Page.DeleteObject("Web"..cID);
    elseif tSelect ~= nil then
    	for index, oName in pObjects do
    		if String.Left(oName, 3) == "Web" then
    			Web.SetVisible(oName, false);
    		end
    	end
    	Web.SetVisible("Web"..tSelect, true);
    end
    any help would be appreciated.


    Note: you may have to test it out in a project with a web object to see whats going wrong.

  2. #2
    Join Date
    Apr 2007
    Location
    Suffolk, UK
    Posts
    176
    Don't worry. sovled it, i was using the wrong variable

  3. #3
    Join Date
    Dec 2006
    Location
    Colombia
    Posts
    62
    It is submitted that this error because there is a need to initialize objects before loading any judgement..

Similar Threads

  1. Problem installing fonts
    By ByronFS in forum Setup Factory 7.0
    Replies: 5
    Last Post: 05-08-2006, 12:23 PM
  2. Video Problem
    By ScottDuncan in forum AutoPlay Media Studio 5.0
    Replies: 0
    Last Post: 07-10-2004, 01:38 PM
  3. PROBLEM: Setup Starts and then Crashes
    By Support in forum Setup Factory 5.0
    Replies: 0
    Last Post: 10-15-2002, 03:02 PM
  4. PROBLEM: Setup Requests Disk 2 in a Single File Setup
    By Support in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 10-09-2002, 02:04 PM
  5. INFO: Tips for Debugging Action Lists in AutoPlay Media Studio 4.0
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-03-2002, 08:38 AM

Posting Permissions

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