English
Forum

How bekomm I the window with a Click closed?

 
- Page 1 -



Deaktiviert
Hi,
i'm on the consider To XProfan to change and Try first with the FreeProfan a little bit around I The functions bzgl. Firebird first testing would like these however into Freeware versions not are. The 11.2 wished I me now not extra only for Test buy, because if I To XProfan wechsele then Better get going same The actually X3 Version. there FreeProfan on the stood the X3 his should bid it itself to that testing accordingly from of my visibility on. this only as small Hintergrundinfo there this my first Posting here's, now To my trouble:

I have one Mainwindow which a Button one second Window with a Text and Editfeld open should. so far functions The thing too wonderful. If the User now in the second Window on X (for close) clicking should itself the second Window close and simply to that Mainwindow return, first if the User in the Haupfenster again on X (for close) clicking should itself the program terminate.

the works now too so far, if I though the Editfeld in the 2. Window activate and then the window close wants must I two time on X clicking To the window itself closes, in the Normalfall should the same at first klick to go ...

I habs time angehangen, possible have your a Tipp for me.
thanks !
Declare end%
Ende% = 0

Proc WndMain

    Declare hMain&,hBtn1&
    Window Style 8
    hMain&=Create ("Window",%hWnd,"Hauptfenster",100,100,320,320)
    hBtn1&=Create("Button",hMain&,"Klick me feste",10,10,125,23)

    WhileNot end% = 1

        WaitMouse

        If %MenuItem = -2

            If MessageBox("Programm terminate?","Frage",36) = 6

                end% = 1

            EndIf

        EndIf

        If %GetFocus = hBtn1&

            wndDlg

        EndIf

    EndWhile

ENDPROC

Proc wndDlg

    Declare hEdit&,hDlg&
    Window Style 8
    hDlg& = Create("Window",hMain&,"Cooles Fenster",120,120,320,320)
    Create("Text",hDlg&,"Textfeld",10,10,125,23)
    hEdit& = Create("Edit",hDlg&,"",10,33,125,23)

    WhileNot %MenuItem = -2

        WaitMouse

        If %MenuItem = -2

            DestroyWindow(hDlg&)

        EndIf

    EndWhile

ENDPROC

If end% = 1

    End

Else

    WndMain

EndIf

 
02/05/17  
 



« this Posting watts as Solution marked. »


E.T.
so time on The speedy :
Declare end%
Declare hMain&,hBtn1&
Ende% = 0

Proc WndMain

    Window Style 8+512
    hMain&=Create ("Window",%hWnd,"Hauptfenster",100,100,320,320)
    hBtn1&=Create("Button",hMain&,"Klick me feste",10,10,125,23)

ENDPROC

Proc wndDlg

    Declare hEdit&,hDlg&, hDlgEnde%
    Window Style 8+512
    hDlg& = Create("Window",hMain&,"Cooles Fenster",120,120,320,320)
    Create("Text",hDlg&,"Textfeld",10,10,125,23)
    hEdit& = Create("Edit",hDlg&,"",10,33,125,23)

    WhileNot hDlgEnde%

        Waitinput

        If %Key=2

            DestroyWindow(hDlg&)
            hDlgEnde% = 1

        EndIf

    EndWhile

ENDPROC

WndMain

WhileNot end% = 1

    WaitInput

    If %Key = 2

        If MessageBox("Programm terminate?","Frage",36) = 6

            end% = 1

        EndIf

    ElseIf %GetFocus = hBtn1&

        wndDlg

    EndIf

EndWhile


can unfortunately not FreeProfan testing, only with X3
 
XProfan X3
Grüße aus Sachsen... Mario
WinXP, Win7 (64 Bit),Win8(.1),Win10, Win 11, Profan 6 - X4, XPSE, und 'nen schwarzes, blinkendes Dingens, wo ich das alles reinschütte...
02/05/17  
 




Deaktiviert
Hello E.T.,
ersteinmal thanks for Help. in the integral hung it well on WaitInput and %Key=2 for Profis trivial but for a beginner even first a real Hürde if one The delicacies of XProfan not yet knows. Since I The Solution understand wished Have so did i again a Version gebastelt.
Declare end%
Ende% = 0

Proc WndMain

    Declare hMain&,hBtn1&
    Window Style 8
    hMain&=Create ("Window",%hWnd,"Hauptfenster",100,100,320,320)
    hBtn1&=Create("Button",hMain&,"Klick me feste",10,10,125,23)

    WhileNot end% = 1

        Waitinput

        If %Key = 2

            If MessageBox("Programm terminate?","Frage",36) = 6

                end% = 1

            EndIf

        EndIf

        If %GetFocus = hBtn1&

            wndDlg

        EndIf

    EndWhile

ENDPROC

Proc wndDlg

    Declare hEdit&,hDlg&,inh$
    Window Style 8
    hDlg& = Create("Window",hMain&,"Cooles Fenster",120,120,320,320)
    Create("Text",hDlg&,"Textfeld",10,10,125,23)
    hEdit& = Create("Edit",hDlg&,"",10,33,125,23)

    WhileNot %Key = 2

        Waitinput

        If %Key = 2

            DestroyWindow(hDlg&)

        EndIf

    EndWhile

ENDPROC

If end% = 1

    End

Else

    WndMain

EndIf

 
02/05/17  
 




E.T.
so on the side angemerkt:

The master-Program-Loop ought to (likewise How declare's for Mainwindow) not of/ one PROC lying (having it in my Bsp. indeed changed). the create the Fensters can without Problems in a own Proc erfolgen. there in a Proc decl. variables (How with you the Button and the window) eig. too only in Proc validly are, can this integrally quick to that chaos lead.
 
XProfan X3
Grüße aus Sachsen... Mario
WinXP, Win7 (64 Bit),Win8(.1),Win10, Win 11, Profan 6 - X4, XPSE, und 'nen schwarzes, blinkendes Dingens, wo ich das alles reinschütte...
02/07/17  
 




Deaktiviert
Hello E.T.,
is correct, because pub declared variables, Global then not visible are, ex the third Window would the To Problemen lead. my example has well yet functions because to leave the second Proc directly The first continued and is accordingly The local Deklarationen yet validly are. I mach me time whom nodes from the brain and beherzige the for future

thanks for Info !
 
02/07/17  
 




H.Brill
here time an example, How one it too can make.
with several Windows must one hold with GetActiveWindow()
first the active Window inquire.
Declare end%, hMain&, hDlg&, hBtn1&, hBtn2&
Ende% = 0
Window Style 8
hMain&=Create ("Window",%hWnd,"Hauptfenster",100,100,320,320)
hBtn1&=Create("Button",hMain&,"Klick me feste",10,10,125,23)

WhileNot end%

    Waitinput

    If %Key = 2

        If GetActiveWindow() = hMain&

            If MessageBox("Programm terminate?","Frage",36) = 6

                end% = 1

            EndIf

        EndIf

        If GetActiveWindow() = hDlg&

            DestroyWindow(hDlg&)

        EndIf

    EndIf

    If GetActiveWindow() = hDlg&

        If Clicked(hBtn2&)

            DestroyWindow(hDlg&)

        EndIf

    EndIf

    If Clicked(hBtn1&)

        wndDlg

    EndIf

EndWhile

Proc wndDlg

    Declare hEdit&,inh$
    Window Style 8
    hDlg& = Create("Window",hMain&,"Cooles Fenster",120,120,320,320)
    Create("Text",hDlg&,"Textfeld",10,10,125,23)
    hEdit& = Create("Edit",hDlg&,"",10,33,125,23)
    hBtn2& = Create("Button", hDlg&, "Ende", 10, 60, 60, 23)

ENDPROC

End

and the Mainwindow must not absolutely in a Proc.
 
Benutze XPROFAN X3 + FREEPROFAN
Wir sind die XProfaner.
Sie werden von uns assimiliert.
Widerstand ist zwecklos!
Wir werden alle ihre Funktionen und Algorithmen den unseren hinzufügen.

Was die Borg können, können wir schon lange.
02/12/17  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

10.700 Views

Untitledvor 0 min.
Frank Reibold11/25/22
p.specht05/31/21
Normann Strübli03/31/20
E.T.11/06/19
More...

Themeninformationen

this Topic has 3 subscriber:

Deaktiviert (3x)
E.T. (2x)
H.Brill (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie