Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    May 2007
    Location
    Sydney, Australia
    Posts
    1,546

    Create an ImageObject on Page2 from button on Page1 (need some help!)

    Hey,

    I'm trying to get my application to create an image on Page2, from the On-Click event of a button that resides on Page1.

    This is the code I'm using to create the image, but how in the heck do I send the command to a different page from which it's run? Could really use some help with this.

    Code:
    -- Load image of 'homer'
    -- Initialize the properties table
    tImageProperties = {};
    tImageProperties.ImageFile = _SourceFolder .. "\\AutoPlay\\Images\\homer.png";
    tImageProperties.UseTransColor = false;
    tImageProperties.Opacity = 100;
    tImageProperties.HitTest = HITTEST_STANDARD;
    tImageProperties.Enabled = false;
    tImageProperties.Visible = true;
    tImageProperties.X = 236;
    tImageProperties.Y = 112;
    tImageProperties.Width = 157;
    tImageProperties.Height = 201;
    tImageProperties.TooltipText = "";
    tImageProperties.Cursor = CURSOR_ARROW;
    tImageProperties.HighlightSound = SND_NONE;
    tImageProperties.ClickSound = SND_NONE;
    
    -- Create the image object
    Page.CreateObject(OBJECT_IMAGE, "homer", tImageProperties);

  2. #2
    Join Date
    May 2007
    Location
    Sydney, Australia
    Posts
    1,546
    D'oh! Never mind ... just figured it out.

    This is what I did:

    Globals
    Code:
    -- Load image of 'homer'
    -- Initialize the properties table
    tImageProperties = {};
    tImageProperties.ImageFile = _SourceFolder .. "\\AutoPlay\\Images\\homer.png";
    tImageProperties.UseTransColor = false;
    tImageProperties.Opacity = 100;
    tImageProperties.HitTest = HITTEST_STANDARD;
    tImageProperties.Enabled = false;
    tImageProperties.Visible = true;
    tImageProperties.X = 236;
    tImageProperties.Y = 112;
    tImageProperties.Width = 157;
    tImageProperties.Height = 201;
    tImageProperties.TooltipText = "";
    tImageProperties.Cursor = CURSOR_ARROW;
    tImageProperties.HighlightSound = SND_NONE;
    tImageProperties.ClickSound = SND_NONE;
    Page1 (On Show)
    Code:
    bState = Button.GetState("Button1");
    Page2 (On Show)
    Code:
    -- Create the image object
    Page.CreateObject(OBJECT_IMAGE, "homer", tImageProperties);
    Or is there a better way to do it ???
    Last edited by mystica; 07-30-2009 at 01:41 PM.

  3. #3
    Join Date
    May 2007
    Location
    Sydney, Australia
    Posts
    1,546
    Actually, can we revisit this issue please!

    Okay ... I can populate images to page2 of my app, via a button on page1 ... but I don't want the button to populate it with all my images at once; rather, just one image from each button on page1

    ... and, each time a different button is pressed, the image on page2 should change accordingly (because I want each image to appear in the same spot).

    I know how to do this by using a different page for each image, or by simply using the Image.SetVisible command but I'd much prefer to have just the 2 pages, and use the Page.CreateObject function, from the table of tImageProperties. Can this even be done???

    PS.
    I've been trying to figure how this might be possible, via controlling the image-selection with an INI-file or something. But I'm finding the logic absolutely mind-numbing. Please help!
    Last edited by mystica; 07-30-2009 at 07:02 PM.

  4. #4
    Join Date
    Jun 2007
    Location
    Delphi II
    Posts
    1,534
    I'm finding it a bit difficult to understand what exactly it is that you're trying to do and why (to help with my logic).

    But, if I understand you correctly, then the solution should be rather simple. Build your project with the image object already in place, and every time you call the function which would create the image, have that image object destroyed first and then recreated it using your image properties table.

    Then again, why not just use a slide show object for your entire procedure?
    Action Plugins
    AllOn | Box | Class | Code | Cursor | DXML | Error | Frames | GlobalPaths | Group | INIPlus |KeyBind | KeyLock | MathEx | Menu | Name | Project | Resize | StatusBar
    Download

  5. #5
    Join Date
    May 2007
    Location
    Sydney, Australia
    Posts
    1,546
    Ah, never mind Centauri.

    I've just realized I've been going about this whole thing ass-backwards ... no wonder you were having trouble following what I was on about. You know, I sat down and mapped out what I was trying to diagramatically, with pencil and paper ... and lo and behold, all of a sudden I could see where I was messing up.

    Amazing how the logic that binds all programming-commands becomes so much clearer, if you just take the time to map it out on paper, first. Live and learn, yeh?

Posting Permissions

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