Jump to content

Go from window to next window.


Recommended Posts

Hello,

I've problem with "going from window 1# to window 2#"

I want to have a script looks like it:

- two windows,

- first windows has button to: close first window and open second window,

- second window has button to: close second window and open first window,

Look at the picture:

Click

------------------

Sorry for my bad English. I'm waiting for posts.

Link to comment
Share on other sites

  • Moderators

Adrian777,

Welcome to the AutoIt forum. :D

Do you know the old saying: "Give a man a fish, you feed him for a day; give a man a net and you feed him forever"? We try to be net makers and repairers here, not fishmongers. :huggles:

So, what have you tried so far? What code have you produced to try to do this?

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Adrian777,

Welcome to the AutoIt forum. :D

Do you know the old saying: "Give a man a fish, you feed him for a day; give a man a net and you feed him forever"? We try to be net makers and repairers here, not fishmongers. :huggles:

So, what have you tried so far? What code have you produced to try to do this?

M23

Thanks for fast reply. I know it.

"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime."

My menu:

Click

I want to make menu looks like this. I don't want to make menu with functions

GUICtrlCreateContextMenu

or

GUICtrlCreateMenu

.

So how I can going from window to window?

Edited by Adrian777
Link to comment
Share on other sites

  • Moderators

Adrian777,

When you reply please use the "Add Reply" button at the top and bottom of the page rather then the "Reply" button in the post itself. That way you do not get the contents of the previous post quoted in your reply and the whole thread becomes easier to read. :D

Now, that was a nice picture of a menu GUI, but where is your code that you wrote to produce it? :huggles:

M23

P.S. Please use Code tags when you show us what you have done. Put [autoit ] before and [/autoit ] after your posted code (but omit the trailing space - it is only there so the tags display here).

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

#include <GUIConstantsEx.au3>

Menu()
Func Menu()
    Local $parent1, $ok1, $cancel1
    
    Opt("GUICoordMode", 2)
    Opt("GUIResizeMode", 1)
    Opt("GUIOnEventMode", 1)

    $parent1 = GUICreate("Nazwa", 235, 175)
    GUISetOnEvent($GUI_EVENT_CLOSE, "SpecialEvents")

    $Rozpocznij = GUICtrlCreateButton("Start.",  40, 10, 150, 30)
    GUICtrlSetOnEvent(-1, "Rozpocznij")

    $Zasady = GUICtrlCreateButton("Rules.",-1, 10, 150, 30)
    
    
    
    $adc = GUICtrlCreateButton("BUTTON.",-1, 10, 150, 30)
    GUICtrlSetOnEvent(-1, "CancelPressed")

    $Wyjscie = GUICtrlCreateButton("Wyjście.",-30, 15, 70, 40)
    GUICtrlSetOnEvent(-1, "WyjscieEvents")
    
    GUISetState(@SW_SHOW)

        While 1
        Sleep(10)
    WEnd
EndFunc

Func Rozpocznij()
EndFunc


Func WyjscieEvents()
   $Wyjscie = MsgBox(4, "Zamykanie...", "Tak czy nie?' ")
If $Wyjscie = 6 then
    Exit
Else   
EndIf
EndFunc 
    
Func SpecialEvents()
    Select
        Case @GUI_CtrlId = $GUI_EVENT_CLOSE
   $Wyjscie = MsgBox(4, "Zamykanie...", "Tak czy nie?' ")
If $Wyjscie = 6 then
    Exit
Else   
EndIf
    EndSelect
EndFunc

This is my code.

Link to comment
Share on other sites

  • Moderators

Adrian777,

This should give you the idea:

#include <GUIConstantsEx.au3>

Global $parent1, $Rozpocznij_child

Menu()

Func Menu()

    Local  $ok1, $cancel1

    Opt("GUICoordMode", 2)
    Opt("GUIResizeMode", 1)
    Opt("GUIOnEventMode", 1)

    $parent1 = GUICreate("Nazwa", 235, 175)
    GUISetOnEvent($GUI_EVENT_CLOSE, "WyjscieEvents") ; you can call the one exit function twice - see below

    $Rozpocznij = GUICtrlCreateButton("Start.", 40, 10, 150, 30)
    GUICtrlSetOnEvent(-1, "Rozpocznij") ; <<<<<<<<<<<<<<<<<< this is the new function

    $Zasady = GUICtrlCreateButton("Rules.", -1, 10, 150, 30)

    $adc = GUICtrlCreateButton("BUTTON.", -1, 10, 150, 30)
    ;GUICtrlSetOnEvent(-1, "CancelPressed")

    $Wyjscie = GUICtrlCreateButton("Wyjscie.", -30, 15, 70, 40)
    GUICtrlSetOnEvent(-1, "WyjscieEvents") ; calling the same function again here!

    GUISetState(@SW_SHOW)

    While 1
        Sleep(10)
    WEnd

EndFunc   ;==>Menu

Func Rozpocznij()

    ; Hide the parent GUI
    GUISetState(@SW_HIDE, $parent1)

    ; Cretae the child
    $Rozpocznij_child = GUICreate("Rozpocznij", 235, 175)
    GUISetOnEvent($GUI_EVENT_CLOSE, "Rozpocznij_WyjscieEvents") ; This gets us back to the parent

    $Rozpocznij = GUICtrlCreateButton("Child 1", 40, 10, 150, 30)

    $Zasady = GUICtrlCreateButton("Child 2", -1, 10, 150, 30)

    $adc = GUICtrlCreateButton("Child 3", -1, 10, 150, 30)

    $Wyjscie = GUICtrlCreateButton("Wyjscie.", -30, 15, 70, 40)
    GUICtrlSetOnEvent(-1, "Rozpocznij_WyjscieEvents") ; As does this

    GUISetState(@SW_SHOW)

EndFunc   ;==>Rozpocznij

Func Rozpocznij_WyjscieEvents()

    ; Delete the child and show the parent again!
    GUIDelete($Rozpocznij_child)
    GUISetState(@SW_Show, $parent1)

EndFunc

Func WyjscieEvents()

    $Wyjscie = MsgBox(4, "Zamykanie...", "Tak czy nie?' ")
    If $Wyjscie = 6 Then Exit

EndFunc   ;==>WyjscieEvents

If you are going to use the other windows often it would be best to create all the GUIs at the beginning and then just hide/show them as required.

Please ask if anything is unclear. :D

M23

Edit: Pressed "Post" too soon!

Edited by Melba23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...