Jump to content
Sign in to follow this  
Ysengrim

Menu

Recommended Posts

Ysengrim

I got a problem using the menu while processing anything

When i first use the menu evrything goes well

but when i choose something and the subscript is running i cant use menu anymore till the subscript is fully done

whats wrong

#include <GUIConstants.au3>

$KaderBreedte=600

$KaderHoogte=400

GUICreate("Ysengrim Software v1.1",$Kaderbreedte,$KaderHoogte,-1,-1)

$MenuProgramma=GuiCtrlCreateMenu ("Programma")

$MenuItemInfo=GuiCtrlCreateMenuitem ("Info",$MenuProgramma)

$MenuSeparator=GuiCtrlCreateMenuitem ("",$MenuProgramma)

$MenuItemAfsluiten=GuiCtrlCreateMenuitem ("Afsluiten",$MenuProgramma)

$MenuMetastock=GuiCtrlCreateMenu ("Metastock")

$MenuWisTijdelijkeBestanden=GuiCtrlCreateMenuitem ("Tijdelijke bestanden verwijderen",$MenuMetastock)

$MenuDatabank=GuiCtrlCreateMenu ("Databank Ysengrim")

$MenuKoersdataInladen=GuiCtrlCreateMenuitem ("Koersdata inladen",$MenuDatabank)

GUISetState(@SW_SHOW)

While 1

$MenuKeuze = GUIGetMsg()

Select

Case $MenuKeuze = $GUI_EVENT_CLOSE

ExitLoop

Case $MenuKeuze = $MenuItemInfo

MsgBox(0, "","Created by Eggermont Patrick")

Case $MenuKeuze = $MenuItemAfsluiten

ExitLoop

Case $MenuKeuze = $MenuWisTijdelijkeBestanden

beep(1000,100)

_Test()

Case $MenuKeuze = $MenuKoersdataInladen

EndSelect

Wend

Func _Test()

For $i = 5 to 1 Step -1

MsgBox(0, "Count down!", $i)

Next

EndFunc

Share this post


Link to post
Share on other sites
martin

I got a problem using the menu while processing anything

When i first use the menu evrything goes well

but when i choose something and the subscript is running i cant use menu anymore till the subscript is fully done

whats wrong

#include <GUIConstants.au3>

$KaderBreedte=600

$KaderHoogte=400

GUICreate("Ysengrim Software v1.1",$Kaderbreedte,$KaderHoogte,-1,-1)

$MenuProgramma=GuiCtrlCreateMenu ("Programma")

$MenuItemInfo=GuiCtrlCreateMenuitem ("Info",$MenuProgramma)

$MenuSeparator=GuiCtrlCreateMenuitem ("",$MenuProgramma)

$MenuItemAfsluiten=GuiCtrlCreateMenuitem ("Afsluiten",$MenuProgramma)

$MenuMetastock=GuiCtrlCreateMenu ("Metastock")

$MenuWisTijdelijkeBestanden=GuiCtrlCreateMenuitem ("Tijdelijke bestanden verwijderen",$MenuMetastock)

$MenuDatabank=GuiCtrlCreateMenu ("Databank Ysengrim")

$MenuKoersdataInladen=GuiCtrlCreateMenuitem ("Koersdata inladen",$MenuDatabank)

GUISetState(@SW_SHOW)

While 1

$MenuKeuze = GUIGetMsg()

Select

Case $MenuKeuze = $GUI_EVENT_CLOSE

ExitLoop

Case $MenuKeuze = $MenuItemInfo

MsgBox(0, "","Created by Eggermont Patrick")

Case $MenuKeuze = $MenuItemAfsluiten

ExitLoop

Case $MenuKeuze = $MenuWisTijdelijkeBestanden

beep(1000,100)

_Test()

Case $MenuKeuze = $MenuKoersdataInladen

EndSelect

Wend

Func _Test()

For $i = 5 to 1 Step -1

MsgBox(0, "Count down!", $i)

Next

EndFunc

The part of your program which responds to the menu choice is in your while/wend loop, but that part of the program is not executing when the _Test function is running.

If you want a function to run and then still be able to use other controls then one way is to convert the function into another program which you run. It depends on what you want to do.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
Ysengrim

i want to use same screen

so if i make new program it cant work

Share this post


Link to post
Share on other sites
youknowwho4eva

#include <GUIConstants.au3>

Local $m
$KaderBreedte=600
$KaderHoogte=400
GUICreate("Ysengrim Software v1.1",$Kaderbreedte,$KaderHoogte,-1,-1)
$MenuProgramma=GuiCtrlCreateMenu ("Programma")
$MenuItemInfo=GuiCtrlCreateMenuitem ("Info",$MenuProgramma)
$MenuSeparator=GuiCtrlCreateMenuitem ("",$MenuProgramma)
$MenuItemAfsluiten=GuiCtrlCreateMenuitem ("Afsluiten",$MenuProgramma)
$MenuMetastock=GuiCtrlCreateMenu ("Metastock")
$MenuWisTijdelijkeBestanden=GuiCtrlCreateMenuitem ("Tijdelijke bestanden verwijderen",$MenuMetastock)
$MenuDatabank=GuiCtrlCreateMenu ("Databank Ysengrim")
$MenuKoersdataInladen=GuiCtrlCreateMenuitem ("Koersdata inladen",$MenuDatabank)
GUISetState(@SW_SHOW)
$sec = @SEC + 1
call("mine")
Func mine()
While 1
$MenuKeuze = GUIGetMsg()
Select
Case $sec = @SEC
    If $m = 1 Then
        ExitLoop
        EndIf
        $sec = @SEC + 1
    
Case $MenuKeuze = $GUI_EVENT_CLOSE
Exit
Case $MenuKeuze = $MenuItemInfo
MsgBox(0, "","Created by Eggermont Patrick")
ExitLoop
Case $MenuKeuze = $MenuItemAfsluiten
Exit
Case $MenuKeuze = $MenuWisTijdelijkeBestanden
    If $m = 1 Then
        Else
beep(1000,100)
_Test()
EndIf
Case $MenuKeuze = $MenuKoersdataInladen

EndSelect
Wend
EndFunc
Func _Test()
For $i = 5 to 1 Step -1
    $m = 1
MsgBox(0, "Count down!", $i)
    $sec = @SEC + 1
Call ("mine")
Next
$m = 0
EndFunc

I made up this, it only works after you hit ok on the message box though kinda cool though


Giggity

Share this post


Link to post
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
Sign in to follow this  

×