Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Pass control back to main window from popup window

Posted on 2006-04-27
2
Medium Priority
?
395 Views
Last Modified: 2013-12-26
I want to pass control back to main window from popup window and then save all the info from the popup window back to the main window. There is a apply button in the popup window which saves all the info in a global structure. Now how do I run the save function again in the main window. Please note that the main window brings up the popup window when the save button is clicked on the main window. So the save function is already executed once. Please help....
0
Comment
Question by:MonNerd
2 Comments
 
LVL 6

Accepted Solution

by:
tr1l0b1t earned 2000 total points
ID: 16561337
You could :

1.- Make the popup window as response type so execution line in main window stops when response is opened and continues when response window is closed.
Then check the returned value by response :

// Main Window save processing :

    Open(w_popup)
    If Not IsNull(Message.LongParm)
      If Message.LongParm < 0 Then
            // Operation cancelled, terminate save process.
            Return -1
      End If
    End If

    // remaining save processing
    // ...


// --------------------------------
// window  : Response Window
// control : 'OK' Command Button
// event   : clicked
// --------------------------------

    // Validation routines
    // ...

    CloseWithReturn(parent, 1)


// --------------------------------
// window  : Response Window
// control : 'CANCEL' Command Button
// event   : clicked
// --------------------------------

    CloseWithReturn(parent, -1)


2.- If you simply want to execute code in main window (w_main) from
popup window (w_popup), create a function in w_main and issolate there
the update processing (i.e.: wf_update()), then :

// Main Window save processing :

    Open(w_popup)


// --------------------------------
// window  : popup Window
// control : 'OK' Command Button
// event   : clicked
// --------------------------------
   
    Long ll_Ret

    // Validation routines
    // ...

    // Call to the wf_update function in w_main
    If IsValid(w_main) Then
      ll_Ret = w_main.wf_update()
      If ll_Ret > 0 Then
            // Successfull Update
            // ...
      Else
            // Error
            // ...
      End If
    End If

    Close(parent)


// --------------------------------
// window  : popup Window
// control : 'CANCEL' Command Button
// event   : clicked
// --------------------------------

    Close(parent)


Let me know if you have any question
Regards
0
 
LVL 1

Author Comment

by:MonNerd
ID: 16562865
You are just awesome... I wish I could give you more than 500 points..You were very clear in your thoughts. This really helped me. Thanks a bunch. But I would like to keep this open just for another day maybe till I'm done with testing it completely. Thanks for the patience in advance..
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand column That will then direct you to their download page. From that p…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question