Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2006
    Posts
    10

    Same data in ListBox

    I've doing an album with Vangelis discography
    first page is only links to subpages with vangelis albums
    But i have a big problem

    If i get into album and in listbox get songs everything is ok but if i go to other page and return to same page songs are again copied into list box and everything messing up

    how could i freeze this list that only when page loads will be 5 songs always the same not doubled if i again load this page

    sorry for my english

    Greetings

  2. #2
    Join Date
    May 2006
    Posts
    5,380
    make a switch so the code only runs once

    eg:
    Code:
    -- put in project startup event
    bAllow=true
    
    -- put in page onshow
    if bAllow then
        bAllow=false
        -- your listbox code here
    
    
    
    
    end
    Open your eyes to Narcissism, Don't let her destroy your life!!

  3. #3
    Join Date
    Nov 2006
    Posts
    10

    Don't know where this bAllow function must be place

    My code so far thats works

    On Show :

    --StatusDlg.SetMessage("Please wait while we search for mp3s in your My Documents folder");
    --StatusDlg.Show(0, false);
    tblFiles = File.Find("AutoPlay\\Audio\\Vangelis - Sex Power" , "*.wav", true , false , nil , nil);
    if tblFiles then
    for i,v in tblFiles do
    local tblSplit = String.SplitPath(v)
    ListBox.AddItem("ListBox1", tblSplit.Filename, v);
    end
    end
    --StatusDlg.Hide();



    On Audio

    if (e_Channel == CHANNEL_BACKGROUND) and (e_State == "Finish") then
    local tblSel = ListBox.GetSelected("ListBox1");
    if tblSel then
    local nNext = tblSel[1] +1;
    if nNext > ListBox.GetCount("ListBox1") then
    nNext = 1;
    end
    ListBox.SelectItem("ListBox1", nNext);
    local sLBData = ListBox.GetItemData("ListBox1", nNext);
    Audio.Load(CHANNEL_BACKGROUND, sLBData, true, false);
    Page.StartTimer(500);
    local tblSplit = String.SplitPath(sLBData);
    nLen = Audio.GetLength(CHANNEL_BACKGROUND)
    Label.SetText("Label2", tblSplit.Filename.. " - ".. SecondsToClock(nLen));
    end
    end

    ListBox On Dblclick

    tblSel = ListBox.GetSelected(this);
    if tblSel then
    local sLBData = ListBox.GetItemData(this, tblSel[1]);
    Audio.Load(CHANNEL_BACKGROUND, sLBData, true, false);
    ListBox.SetUpdate("ListBox1", false);
    Page.StartTimer(500);
    local tblSplit = String.SplitPath(sLBData);
    nLen = Audio.GetLength(CHANNEL_BACKGROUND)
    Label.SetText("Label2", tblSplit.Filename.. " - ".. SecondsToClock(nLen));
    end

    Project Gloobal Functions

    function SecondsToClock(sSeconds)
    local nSeconds = String.ToNumber(sSeconds)
    if nSeconds == 0 then
    --return nil;
    return "00:00:00";
    else
    local nHours = string.format("%02.f", Math.Floor(nSeconds/3600));
    local nMins = string.format("%02.f", Math.Floor(nSeconds/60 - (nHours*60)));
    local nSecs = string.format("%02.f", Math.Floor(nSeconds - nHours*3600 - nMins *60));
    return nHours..":"..nMins..":"..nSecs
    end
    end



    Please help !!!

Similar Threads

  1. Replies: 10
    Last Post: 07-05-2008, 10:07 AM
  2. ListBox indexing explained
    By Adam in forum AutoPlay Media Studio 7.5 FAQ
    Replies: 0
    Last Post: 11-01-2007, 01:58 PM
  3. ListBox read Data text
    By 336 in forum AutoPlay Media Studio 6.0
    Replies: 6
    Last Post: 09-26-2007, 06:22 PM
  4. Example: Using the ListBox object
    By Ted Sullivan in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 05-07-2004, 12:24 PM
  5. Question about ListBox and Data (delimited List)
    By SonG0han in forum AutoPlay Media Studio 5.0
    Replies: 9
    Last Post: 12-20-2003, 12:47 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