Please login or register.

Login with username, password and session length
Advanced search  

News:

Forum rules - please read before posting, it can save you a lot of time.

Author Topic: nested window - how to get control?  (Read 4119 times)

0 Members and 1 Guest are viewing this topic.

pakhpakh64

  • Lurker
  • *
  • Karma: -1
  • Offline Offline
  • Gender: Male
  • Posts: 28
    • View Profile
nested window - how to get control?
« on: March 06, 2013, 03:07:00 PM »

hi every body
I have a ParentWindow and a ChildWindow witch is nested inside ParentWindow, inside ChildWindow I have butten like "open".
the question is how can I handle clicking on "open" button INSIDE ParentWindow's script?
I hope I've made myself clear!  :P
thanks in advance.
Logged

2.0

  • Regular poster
  • ***
  • Karma: 4
  • Offline Offline
  • Posts: 217
    • View Profile
Re: nested window - how to get control?
« Reply #1 on: March 06, 2013, 06:53:52 PM »

For example, you need to attach the script file to the ChildWindow.
In there try to use something like that:

Code: WME Script
  1. on "open"
  2. {
  3.   var ParentWindow = this.Parent
  4.   ParentWindow.ApplyEvent("open");
  5. }

and catch the "open" event in the parent's script.

hi every body
I have a ParentWindow and a ChildWindow witch is nested inside ParentWindow, inside ChildWindow I have butten like "open".
the question is how can I handle clicking on "open" button INSIDE ParentWindow's script?
I hope I've made myself clear!  :P
thanks in advance.
Logged

pakhpakh64

  • Lurker
  • *
  • Karma: -1
  • Offline Offline
  • Gender: Male
  • Posts: 28
    • View Profile
Re: nested window - how to get control?
« Reply #2 on: March 07, 2013, 02:20:25 PM »

thanks, I will try this.
Logged

pakhpakh64

  • Lurker
  • *
  • Karma: -1
  • Offline Offline
  • Gender: Male
  • Posts: 28
    • View Profile
Re: nested window - how to get control?
« Reply #3 on: March 12, 2013, 03:35:46 PM »

This didn't worked for me neither. I used the method in one template project of WME for handling menu windows (suck as main menu and save/reload window), and it worked fine.
Logged

Jose

  • Regular poster
  • ***
  • Karma: 2
  • Offline Offline
  • Posts: 134
    • View Profile
Re: nested window - how to get control?
« Reply #4 on: March 12, 2013, 05:41:41 PM »

The method posted by 2.0 works fine.

First of all you need to set to 'True' the ParentNotify attribute of the 'open' button (let's assume the name of the button is 'open') control in your Child Window. Then in the script attached to your Child Window you have to define the following event handler:
Code: [Select]
on "open"
{
  var parentWindow = this.Parent;
  parentWindow.ApplyEvent("open");
}

Finally, in the script attached to your Parent Window you have to define the event handler for the 'open' event:
Code: [Select]
on "open"
{
   // Handle the event...
}
Logged

pakhpakh64

  • Lurker
  • *
  • Karma: -1
  • Offline Offline
  • Gender: Male
  • Posts: 28
    • View Profile
Re: nested window - how to get control?
« Reply #5 on: April 09, 2013, 02:03:45 PM »

sry for the late reply, I did it and it works fine, Thanks.
Logged
 

Page created in 0.042 seconds with 21 queries.