Jump to content

main menu help


corey822
 Share

Recommended Posts

G'day yall

ok i hope somone can help me here but ive created a program that has a menu bar up the top for example the file,help but i want to be able to link the submenus when clicked on to an help file that is external and not in the actual script.

CODE
#include <guiconstants.au3>

#Region ### START Koda GUI section ### Form=

$Form1 = GUICreate("Form1", 424, 64, 228, 180)

$MenuItem3 = GUICtrlCreateMenu("MenuItem3")

$MenuItem2 = GUICtrlCreateMenuItem("link this", $MenuItem3)

$MenuItem5 = GUICtrlCreateMenu("MenuItem5", $MenuItem3)

$MenuItem8 = GUICtrlCreateMenuItem("link this", $MenuItem5)

$MenuItem7 = GUICtrlCreateMenu("MenuItem7", $MenuItem5)

$MenuItem9 = GUICtrlCreateMenuItem("link this aswell", $MenuItem7)

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

EndSwitch

WEnd

i hope that gives u an idea of wat i mean

just for the count i have searched the help file and forum but too no avail did i find anything i searched in programs but too no avail did i mangage to dld one that had the script set out so all the gui was in one spot

sorry for the truble

cheers C.W

C.Wnew rules:1.dont use plz in a post or title use please instead2.always use help file as it is now muchly over rated3. dont think where not watching u4.please wait 24 hours after last post ot bump XD i use to make that mistake

Link to comment
Share on other sites

G'day yall

ok i hope somone can help me here but ive created a program that has a menu bar up the top for example the file,help but i want to be able to link the submenus when clicked on to an help file that is external and not in the actual script.

i hope that gives u an idea of wat i mean

just for the count i have searched the help file and forum but too no avail did i find anything i searched in programs but too no avail did i mangage to dld one that had the script set out so all the gui was in one spot

sorry for the truble

cheers C.W

Try it like this as a demo:

#include <guiconstants.au3>

$Form1 = GUICreate("Form1", 424, 64, 228, 180)
$Menu1 = GUICtrlCreateMenu("Menu1")
$MenuItem1_1 = GUICtrlCreateMenuItem("AutoIt Help", $Menu1)
$Menu2 = GUICtrlCreateMenu("Menu2", $Menu1)
$MenuItem2_1 = GUICtrlCreateMenuItem("AutoIt Beta Help", $Menu2)
$Menu3 = GUICtrlCreateMenu("Menu3", $Menu2)
$MenuItem3_1 = GUICtrlCreateMenuItem("Pick a help file", $Menu3)
GUISetState(@SW_SHOW)

Global $sAuotItReg = "HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt"
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $MenuItem1_1
            $sAutoItInstallDir = RegRead($sAuotItReg, "InstallDir")
            If $sAutoItInstallDir <> "" Then ShellExecute($sAutoItInstallDir & "\AutoIt3.chm")
        Case $MenuItem2_1
            $sAutoItBetaDir = RegRead($sAuotItReg, "betaInstallDir")
            If $sAutoItBetaDir <> "" Then ShellExecute($sAutoItBetaDir & "\AutoIt3.chm")
        Case $MenuItem3_1
            $sHelpFile = FileOpenDialog("Help File", "", "Compiled Help Files (*.chm)|All Files (*.*)", 1)
            If Not @error Then ShellExecute($sHelpFile, "", "", "Open")
    EndSwitch
WEnd

:blink:

P.S. You bumped after only 37 minutes...? :P

That's a bad habit that could get you into trouble around here. :)

Edited by PsaltyDS
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Try it like this as a demo:

#include <guiconstants.au3>

$Form1 = GUICreate("Form1", 424, 64, 228, 180)
$Menu1 = GUICtrlCreateMenu("Menu1")
$MenuItem1_1 = GUICtrlCreateMenuItem("AutoIt Help", $Menu1)
$Menu2 = GUICtrlCreateMenu("Menu2", $Menu1)
$MenuItem2_1 = GUICtrlCreateMenuItem("AutoIt Beta Help", $Menu2)
$Menu3 = GUICtrlCreateMenu("Menu3", $Menu2)
$MenuItem3_1 = GUICtrlCreateMenuItem("Pick a help file", $Menu3)
GUISetState(@SW_SHOW)

Global $sAuotItReg = "HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt"
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $MenuItem1_1
            $sAutoItInstallDir = RegRead($sAuotItReg, "InstallDir")
            If $sAutoItInstallDir <> "" Then ShellExecute($sAutoItInstallDir & "\AutoIt3.chm")
        Case $MenuItem2_1
            $sAutoItBetaDir = RegRead($sAuotItReg, "betaInstallDir")
            If $sAutoItBetaDir <> "" Then ShellExecute($sAutoItBetaDir & "\AutoIt3.chm")
        Case $MenuItem3_1
            $sHelpFile = FileOpenDialog("Help File", "", "Compiled Help Files (*.chm)|All Files (*.*)", 1)
            If Not @error Then ShellExecute($sHelpFile, "", "", "Open")
    EndSwitch
WEnd

:blink:

P.S. You bumped after only 37 minutes...? :P

That's a bad habit that could get you into trouble around here. :)

lol at 2:07 am everything looks good to do

hmmm still doesnt seem to be clicking in my head

Edited by corey822

C.Wnew rules:1.dont use plz in a post or title use please instead2.always use help file as it is now muchly over rated3. dont think where not watching u4.please wait 24 hours after last post ot bump XD i use to make that mistake

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...