Το popUp παράθυρο φτιάχνεται στην ρουτίνα που "Ακούει" το κλικ στο παράθυρο Form1.MouseDown και δίνει ταυτόχρονα και τη θέση που έγινε αυτό.
Δημιουργούμε το παράθυρο, βάζουμε ένα TextBox και όταν τερματίσει επιστρέφουμε μετά τη μέθοδο PopUp.
Και η Form1 έχει ανοίξει Modal, δηλαδή περιμένει το σύστημα να τερματίσει για να συνεχίσει παρακάτω!
Declare Form1 Form
With Form1, "Title", "Hello There"
Function Text1.Enter {
\\ If we press enter in textbox in popup form
\\ we change title in form1
With Form1, "Title", txt$
}
X=1000
Function Form1.MouseDown {
\* Use STACK to see stack in console...
\* ...before you decide what to do with the values
\* Stack is cleared by you or by system if foynd any value
\\ this function run as code in module, but with temporary space for variables/names
Rem 1 : Stack
Read button
If button<>2 Then Exit
Drop \\ drop shift
Read New X, Y \\ so in not only local but more fresh than X in module (1000)
Declare aPopUpForm Form
With aPopUpForm, "Title", "This is a PopUp Form", "Visible" as PopUpVisible
Declare Text1 TextBox Form aPopUpForm
Method Text1,"Move", 2000,2000,6000,600
With Text1,"Text" as txt$
Method Form1, "PopUp", aPopUpForm, X, Y
Declare Text1 Nothing
Declare aPopUpForm Nothing
\\ Now X and Y erased automatic
}
Method Form1,"Show", 1 \\ modal means wait to return
\\ we return focus to console
Show
Declare Form1 Nothing
Print X \\ so this X is 1000
Δημιουργούμε το παράθυρο, βάζουμε ένα TextBox και όταν τερματίσει επιστρέφουμε μετά τη μέθοδο PopUp.
Και η Form1 έχει ανοίξει Modal, δηλαδή περιμένει το σύστημα να τερματίσει για να συνεχίσει παρακάτω!
Declare Form1 Form
With Form1, "Title", "Hello There"
Function Text1.Enter {
\\ If we press enter in textbox in popup form
\\ we change title in form1
With Form1, "Title", txt$
}
X=1000
Function Form1.MouseDown {
\* Use STACK to see stack in console...
\* ...before you decide what to do with the values
\* Stack is cleared by you or by system if foynd any value
\\ this function run as code in module, but with temporary space for variables/names
Rem 1 : Stack
Read button
If button<>2 Then Exit
Drop \\ drop shift
Read New X, Y \\ so in not only local but more fresh than X in module (1000)
Declare aPopUpForm Form
With aPopUpForm, "Title", "This is a PopUp Form", "Visible" as PopUpVisible
Declare Text1 TextBox Form aPopUpForm
Method Text1,"Move", 2000,2000,6000,600
With Text1,"Text" as txt$
Method Form1, "PopUp", aPopUpForm, X, Y
Declare Text1 Nothing
Declare aPopUpForm Nothing
\\ Now X and Y erased automatic
}
Method Form1,"Show", 1 \\ modal means wait to return
\\ we return focus to console
Show
Declare Form1 Nothing
Print X \\ so this X is 1000
Δεν υπάρχουν σχόλια:
Δημοσίευση σχολίου
You can feel free to write any suggestion, or idea on the subject.