Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 10 of 10
  1. #1
    Join Date
    Mar 2009
    Location
    Athens, Greece
    Posts
    31

    Grin How to reference buttons or other objects, in other pages?

    Consider the following code (lets say inside an 'On Show' event)

    --this will return the text displayed on Button1 on the current page
    Button.GetText ("Button1");

    How can i do this?
    Specific_Page.Button.GetText("Button1");

    I hope somebody can help

  2. #2
    Join Date
    Mar 2009
    Location
    Athens, Greece
    Posts
    31

    Just to be a little more clear...

    Similarly,

    object_names = Page.EnumerateObjects(); --this will get the names of all of the objects on the current page.

    -- How can i do the same but for a specific page?
    i.e. Specific_Page.EnumerateObjects();

  3. #3
    Join Date
    Aug 2003
    Posts
    2,427
    The page doesn't exist and can't be referenced until it is displayed (a.f.a.i.k.)

    If it's essential to do this, then one method would be to dynamically populate objects on a page from say a text/ini file. This could be referenced at any time, via the text/ini file.

    Dependant on the number of pages in your project, it may be possible to use a single page and simply hide/show objects when required which obviously would mean that they could then be referenced directly. Although I don't produce large projects, the ones that I do are now almost always a single page using this method whereas I used to produce 10 or 20 pages doing what I now do on 1 page. Dynamic loading of text and hiding/showing objects works really well once you get into it.

  4. #4
    Join Date
    Mar 2009
    Location
    Athens, Greece
    Posts
    31
    Quote Originally Posted by longedge View Post
    The page doesn't exist and can't be referenced until it is displayed (a.f.a.i.k.)
    In this example we can reference all the pages in our project (well only the names, not the pages themselves)

    --Get the names of all pages in the app
    all_pages=Application.GetPages();

    So if we can reference all the names of our pages in the project, there must be a way of referencing the pages themselves,
    probably my means of overriding some of the built-in functions say?


    Quote Originally Posted by longedge View Post
    If it's essential to do this, then one method would be to dynamically populate objects on a page from say a text/ini file. This could be referenced at any time, via the text/ini file.
    Could you give an example code of this to get me started?

    Quote Originally Posted by longedge View Post
    the ones that I do are now almost always a single page using this method whereas I used to produce 10 or 20 pages doing what I now do on 1 page. Dynamic loading of text and hiding/showing objects works really well once you get into it.
    In some of my pages i use the idea of dynamically hiding/showing objects.
    But doesn't this clutter up your design view a lot???
    Last edited by hliobasilema; 03-31-2009 at 05:49 AM.

  5. #5
    Join Date
    Aug 2003
    Posts
    2,427
    In some of my pages i use the idea of dynamically hiding/showing objects.
    But doesn't this clutter up your design view a lot???
    Speaking personally I don't have a problem and I understand that for some people when designing a very 'busy' page it wouldn't be practical. I tend to have a paragraph, video a couple of labels and two or three buttons visible and I stack alternative objects.

    I keep the project explorer pane open and for what I do it works fine.

    If I have a moment, I'll look at making a small example.

  6. #6
    Join Date
    Mar 2009
    Location
    Athens, Greece
    Posts
    31
    Longedge i want to thank you for you quick and informative replies!
    I really appreciate all people like you who have the spirit of helping out their fellows.
    Thanks to all of you guys and to indigorose for providing us this forum

  7. #7
    Join Date
    Mar 2009
    Location
    Athens, Greece
    Posts
    31

    Lightbulb What i really try to achieve...Maybe somebody can suggest a different roadpath?

    The underlying need for requiring me to reference other pages from within other pages, is that i have built a project so far containing about 50 pages.
    Then i decided to create a keyword index using the Application.MakeKeywordIndex built-in functionality. But to my surprise i had forgotten to manually enter info in the keyword field of the pages.

    So ultimately i am trying to automate the process of initialising all keyword fields
    at runtime. I want the keywords for each page to be the text displayed on the buttons of that page.
    I provide you with some pseudocode:

    loop_though_all_pages_of_the_project();
    for each page
    do
    -find all button objects and retrieve their text value
    -store the result to a variable
    -initialise the keyword field of the page with our variable above



    p.s. IF you feel this should be the subject of a new thread, please advise me
    Last edited by hliobasilema; 03-31-2009 at 06:40 AM.

  8. #8
    Join Date
    Aug 2003
    Posts
    2,427
    Quote Originally Posted by hliobasilema View Post
    Longedge i want to thank you for you quick and informative replies!
    I really appreciate all people like you who have the spirit of helping out their fellows.
    Thanks to all of you guys and to indigorose for providing us this forum
    You're very welcome. The inmportant thing about the forum is that there are people of every level of ability in here. I'm not a programmer, just been using AMS a long time but we have the safety net of other members who are more capable than me.

    That said, here's a small example of dynamic population of text in the objects on a page.

  9. #9
    Join Date
    Aug 2003
    Posts
    2,427
    After your further explanation, I would look at creating a global function to do this, although this is still dependant on the user visiting each page first. I can't think of an easy way off the top of my head.

    You cerainly don't want to be trying to implement something like I suggested at this stage
    Last edited by longedge; 03-31-2009 at 06:51 AM.

  10. #10
    Join Date
    Mar 2009
    Location
    Athens, Greece
    Posts
    31
    Thanks once again!

    I see what you mean about dynamic population of text. The problem is that in my case i would
    still have to manually create that text file(containing the displayed button names) for each page.
    The only way of automating it would be to visit the page, as you said in your last post.

    All suggestions are welcome, and bravo to you for not being a programmer and still knowing quite a lot.

Similar Threads

  1. Replies: 8
    Last Post: 12-28-2008, 04:21 PM
  2. Resize all buttons and text for different screen resolutions
    By p-rposters in forum AutoPlay Media Studio 6.0
    Replies: 2
    Last Post: 02-19-2008, 03:32 PM
  3. Interact with other page's objects
    By Magellan in forum AutoPlay Media Studio 6.0
    Replies: 3
    Last Post: 08-19-2006, 02:54 PM
  4. Parent buttons not addressing other page objects
    By eric_darling in forum AutoPlay Media Studio 5.0
    Replies: 5
    Last Post: 06-26-2005, 08:57 PM
  5. instantiate and reference registered com objects
    By kenzo in forum Setup Factory 6.0
    Replies: 0
    Last Post: 01-07-2004, 01:07 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