Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 25
  1. #1
    Join Date
    Mar 2007
    Posts
    452

    read from folder and write it to menubar

    is it possible to show all exe files in the folder on menubar ?
    Last edited by GoOgLe; 03-18-2008 at 01:30 PM.

  2. #2
    Join Date
    Jan 2001
    Location
    Anderson Island, WA, USA
    Posts
    2,863
    Quote Originally Posted by GoOgLe View Post
    is it possible to show all exe files in the folder on menubar ?
    at design time or runtime?

    I don't have ams -- but reading the docs; it looks like something like this might work:

    Code:
    local cFolder = Dialog.FolderBrowse("Which folder to fill from?",_SourceFolder);
    
    if Folder.DoesExist( cFolder ) then
    	local tFiles = File.Find(cFolder,"*.exe");
    	if Table.Count( tFiles ) > 0 then 
    		local x = 0;
    	    local tMenu= Application.GetMenu();
    	    tMenu.ID=200;
    	    tMenu.Text="Available EXE's";
    	    tMenu.Enabled = true;
    	    tMenu.Checked = false;
    	    tMenu.SubMenu={};
    		for x=1,Table.Count(tFiles) do
    		  tMenu.SubMenu[x]={};
    		  tMenu.SubMenu[x].Text= tFiles[x];
    		  tMenu.SubMenu[x].ID = 200+x;
    		  tMenu.SubMenu[x].Checked = false;
    		  tMenu.SubMenu[x].Enabled=true;
    		end
    		Application.SetLastError(0);
    		Application.SetMenu( tMenu );
    		local nErr = Application.GetLastError();
    		if nErr > 0 then
    			Dialog.Message("Error",_tblErrorMessages[ nErr ] );
    		end
    	else
    		Dialog.Message("Oops","No files found");
    	end
    end
    100% untested, I don't have ams -- and suf7 doesn't have a menubar.


    (Click here to contact me)
    Providing Independent Professional Consulting Services for
    IndigoRose products, World Wide.
    Located in -8:00 (-7:00 DST) GMT Timezone (Western United States)

  3. #3
    Join Date
    Mar 2007
    Posts
    452
    thanks for reply jassing

    on preload but i got error


  4. #4
    Join Date
    Jan 2001
    Location
    Anderson Island, WA, USA
    Posts
    2,863
    Looks like this line is erroring out:

    local tMenu= Application.GetMenu();

    Try changing it to

    local tMenu={};

    or better; find out why GetMenu is failing...


    (Click here to contact me)
    Providing Independent Professional Consulting Services for
    IndigoRose products, World Wide.
    Located in -8:00 (-7:00 DST) GMT Timezone (Western United States)

  5. #5
    Join Date
    Mar 2007
    Posts
    452
    when i choose desktop i get error but when i choose my documents no error but no item on menu bar...

  6. #6
    Join Date
    Jan 2001
    Location
    Anderson Island, WA, USA
    Posts
    2,863
    Quote Originally Posted by GoOgLe View Post
    when i choose desktop i get error but when i choose my documents no error but no item on menu bar...
    What error do you get? I would think that no exe's would be in the desktop or my documents...

    Like I said; 100% untested; I just did that from reading the documents. I'll request a demo download and try it -- I probably won't get the download until today; but I'm leaving for the weekend early tomorrow... so might not be until monday or tuesday.


    (Click here to contact me)
    Providing Independent Professional Consulting Services for
    IndigoRose products, World Wide.
    Located in -8:00 (-7:00 DST) GMT Timezone (Western United States)

  7. #7
    Join Date
    Mar 2007
    Posts
    452
    thanks alot jassin

    i think eroor i get on desktop is because i have no exe file but in my documents i have exe file but i cant write to menubar

  8. #8
    Join Date
    Jan 2001
    Location
    Anderson Island, WA, USA
    Posts
    2,863
    Quote Originally Posted by GoOgLe View Post
    thanks alot jassin

    i think eroor i get on desktop is because i have no exe file but in my documents i have exe file but i cant write to menubar
    What error are you getting?
    The fact that it doesn't work doesn't suprise me since I've never worked with menu bars; but errors? I can't find anything that would generate an error...

    My repairs just took a turn for the worst, and I have to head off island to pick up some materials. This will push back when I can get to this -- I will put in for a eval donwload request before I leave.
    -josh


    (Click here to contact me)
    Providing Independent Professional Consulting Services for
    IndigoRose products, World Wide.
    Located in -8:00 (-7:00 DST) GMT Timezone (Western United States)

  9. #9
    Join Date
    Mar 2007
    Posts
    452
    this didnt work... !!!

    Code:
    local cFolder = Dialog.FolderBrowse("Which folder to fill from?",_SourceFolder);
    
    if Folder.DoesExist( cFolder ) then
    	local tFiles = File.Find(cFolder,"*.exe");
    	if Table.Count( tFiles ) > 0 then 
    		local x = 0;
    	    local tMenu={};
    	    tMenu.ID=200;
    	    tMenu.Text="Available EXE's";
    	    tMenu.Enabled = true;
    	    tMenu.Checked = false;
    	    tMenu.SubMenu={};
    		for x=1,Table.Count(tFiles) do
    		  tMenu.SubMenu[x]={};
    		  tMenu.SubMenu[x].Text= tFiles[x];
    		  tMenu.SubMenu[x].ID = 200+x;
    		  tMenu.SubMenu[x].Checked = false;
    		  tMenu.SubMenu[x].Enabled=true;
    		end
    		Application.SetLastError(0);
    		Application.SetMenu( tMenu );
    		local nErr = Application.GetLastError();
    		if nErr > 0 then
    			Dialog.Message("Error",_tblErrorMessages[ nErr ] );
    		end
    	else
    		Dialog.Message("Oops","No files found");
    	end
    end

  10. #10
    Join Date
    Jan 2001
    Location
    Anderson Island, WA, USA
    Posts
    2,863
    Yes you've said that; which line is giving you an ERROR and what is the error?


    (Click here to contact me)
    Providing Independent Professional Consulting Services for
    IndigoRose products, World Wide.
    Located in -8:00 (-7:00 DST) GMT Timezone (Western United States)

  11. #11
    Join Date
    Mar 2007
    Posts
    452
    i dont get error but i dont files listed either !!!

  12. #12
    Join Date
    Jan 2001
    Location
    Anderson Island, WA, USA
    Posts
    2,863
    Quote Originally Posted by GoOgLe View Post
    i dont get error but i dont files listed either !!!
    OK - you had said it errored for you; that supprised me; but not getting files; that doesn't -- as I don't fully know how to work with Menu's yet. I'll check it out. be patient; might not be until next week.

    -josh


    (Click here to contact me)
    Providing Independent Professional Consulting Services for
    IndigoRose products, World Wide.
    Located in -8:00 (-7:00 DST) GMT Timezone (Western United States)

  13. #13
    Join Date
    Jan 2001
    Location
    Anderson Island, WA, USA
    Posts
    2,863
    You're lucky, I had to pay for it; but there was wifi at the place I'm at...

    This works for me... hope it does for you.

    Code:
    tblMenu = Application.GetMenu();
    local nNewitem = Table.Count(tblMenu)+1;
    tblMenu[nNewitem] ={};
    tblMenu[nNewitem].Text = "&Available Files";
    tblMenu[nNewitem].ID = 1000;
    tblMenu[nNewitem].Checked = false;
    tblMenu[nNewitem].Enabled = true;
    tblMenu[nNewitem].SubMenu = {};
    
    local tFiles = File.Find( _SystemFolder, "*.exe");
    local x = 0;
    for x = 1,Table.Count(tFiles) do
    	tblMenu[nNewitem].SubMenu[x] = {};
    	tblMenu[nNewitem].SubMenu[x].Text = tFiles[x];
    	tblMenu[nNewitem].SubMenu[x].ID = 1000+x;
    	tblMenu[nNewitem].SubMenu[x].Checked = false;
    	tblMenu[nNewitem].SubMenu[x].Enabled = true;
    end
    
    Application.SetMenu(tblMenu);


    (Click here to contact me)
    Providing Independent Professional Consulting Services for
    IndigoRose products, World Wide.
    Located in -8:00 (-7:00 DST) GMT Timezone (Western United States)

  14. #14
    Join Date
    Mar 2007
    Location
    HeaveN
    Posts
    534
    jassing thanks alot alot for answering
    but i have one more problem with it... if i the folder doesnt include any exe file i get that error !!!


  15. #15
    Join Date
    Mar 2007
    Posts
    452
    thanks jassing

    @jackdaniels
    i would say the same thing;
    perfect code but if no exe in folder u get error

Similar Threads

  1. Folder Permissions Being Replaced
    By JXBURNS in forum MSI Factory 2.0 Discussion
    Replies: 3
    Last Post: 08-11-2008, 11:29 PM
  2. Help status dialog
    By mustafa06 in forum AutoPlay Media Studio 7.5
    Replies: 9
    Last Post: 02-05-2008, 03:22 PM
  3. Sticky folder
    By Sergio_S in forum Setup Factory 7.0
    Replies: 5
    Last Post: 08-29-2006, 09:56 AM
  4. Quick Launch Folder
    By csd214 in forum Setup Factory 7.0
    Replies: 1
    Last Post: 01-03-2005, 12:43 AM
  5. HOWTO: Build and Burn Your AutoPlay Application
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-28-2002, 03:43 PM

Posting Permissions

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