Sign in to follow this  
Followers 0
Tasmania

Menu Items

7 posts in this topic

Ok, so my script looks something like this... and right now my menu looks as follows

File

&New

&Open

&Save

-

E&xit

and what I would like to do is make it as follows:

File

&New ^n

&Open ^o

&Save ^s

-

E&xit ^x

and appear like this:

File

&New Ctrl-N

&Open Ctrl-O

&Save Ctrl-S

-

E&xit Ctrl-x

Anyone know how to do that? The problem is that they are not aligned at this moment...

HotKeySet("{ESC}", "panic")
HotKeySet("!{F4}", "panic")
HotKeySet("^x", "panic")
HotKeySet("^s", "save")
HotKeySet("^n", "new")
;HotKeySet("^o", "open")

Func panic()
    Exit
EndFunc

Func new()
    GUICtrlSetData($txtAttn, "")
    GUICtrlSetData($txtEmail, "")
    GUICtrlSetData($txtPwo, "")
    GUICtrlSetData($txtInum, "")
    GUICtrlSetData($txtSca, "")
    GUICtrlSetData($txtDesc, "")
    GUICtrlSetData($dteRstdate, "")
    GUICtrlSetData($cmbType, "CONCEPT")
    GUICtrlSetData($cmbPcode, "SAM-CONCPT")
    GUICtrlSetData($txtPO, "N/C")
    GUICtrlSetData($txtPOamt, "0")
    GUICtrlSetData($txtPOdiscount, "")
    GUICtrlSetData($txtPE, "")
    GUICtrlSetData($txtPM, "")
    GUICtrlSetData($txtCharge, "")
    GUICtrlSetData($txtQty, "1.00")
    GUICtrlSetData($txtMaterial, "")
    GUICtrlSetData($txtGauge, "0.0")
    GUICtrlSetData($edtExNotes, "")
    
    ControlFocus("Syte Line Automation", "", $txtAttn)
EndFunc

Func save()
    DirCreate(@MyDocumentsDir & "\Syte Line Automation\")
    
    $filesaveloc = FileSaveDialog("Save...", @MyDocumentsDir & "\Syte Line Automation\", "Syte Line Automation Files (*.sla)", 16, @MON & @MDAY & @YEAR & @HOUR & @MIN & @SEC & ".sla")
    
    $file = FileOpen($filesaveloc, 10)
    
    If $file = -1 Then
        MsgBox(64, "Error", "Unable to open file.")
        Exit
    EndIf
    
    FileWriteLine($file, GUICtrlRead($txtAttn))
    FileWriteLine($file, GUICtrlRead($txtEmail))
    FileWriteLine($file, GUICtrlRead($txtPwo))
    FileWriteLine($file, GUICtrlRead($txtInum))
    FileWriteLine($file, GUICtrlRead($txtSca))
    FileWriteLine($file, GUICtrlRead($txtDesc))
    FileWriteLine($file, GUICtrlRead($dteRstdate))
    FileWriteLine($file, GUICtrlRead($cmbType))
    FileWriteLine($file, GUICtrlRead($cmbPcode))
    FileWriteLine($file, GUICtrlRead($txtPO))
    FileWriteLine($file, GUICtrlRead($txtPOamt))
    FileWriteLine($file, GUICtrlRead($txtPOdiscount))
    FileWriteLine($file, GUICtrlRead($txtPE))
    FileWriteLine($file, GUICtrlRead($txtPM))
    FileWriteLine($file, GUICtrlRead($txtCharge))
    FileWriteLine($file, GUICtrlRead($txtQty))
    FileWriteLine($file, GUICtrlRead($txtMaterial))
    FileWriteLine($file, GUICtrlRead($txtGauge))
    FileWriteLine($file, GUICtrlRead($edtExNotes))
    
    FileClose($file)
    
    MsgBox(64, "Save Complete", "File has been saved.")
EndFunc

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=C:\Documents and Settings\USPJEFE\Desktop\Projects\frmQuestions.kxf
$frmCInfo = GUICreate("Syte Line Automation", 420, 333, -1, -1)
$grpInfo = GUICtrlCreateGroup("Information", 0, 0, 417, 241)
$lblAttn = GUICtrlCreateLabel("Attn:", 8, 17, 32, 17)
$txtAttn = GUICtrlCreateInput("", 96, 17, 105, 21, BitOR($ES_UPPERCASE,$ES_AUTOHSCROLL))
$lblEmail = GUICtrlCreateLabel("Email:", 8, 41, 38, 17)
$txtEmail = GUICtrlCreateInput("", 96, 41, 105, 21, BitOR($ES_UPPERCASE,$ES_AUTOHSCROLL))
$lblPwo = GUICtrlCreateLabel("PWO #:", 8, 65, 49, 17)
$txtPwo = GUICtrlCreateInput("", 96, 65, 105, 21, BitOR($ES_UPPERCASE,$ES_AUTOHSCROLL))
$lblInum = GUICtrlCreateLabel("Full Item Num:", 8, 89, 77, 17)
$txtInum = GUICtrlCreateInput("", 96, 89, 105, 21, BitOR($ES_UPPERCASE,$ES_AUTOHSCROLL))
$lblSca = GUICtrlCreateLabel("SCA # (No 0):", 8, 113, 76, 17)
$txtSca = GUICtrlCreateInput("", 96, 113, 105, 21, BitOR($ES_UPPERCASE,$ES_AUTOHSCROLL))
$lblDesc = GUICtrlCreateLabel("Description:", 8, 137, 66, 17)
$txtDesc = GUICtrlCreateInput("", 96, 137, 105, 21, BitOR($ES_UPPERCASE,$ES_AUTOHSCROLL))
$lblRstdate = GUICtrlCreateLabel("Request Date:", 8, 161, 79, 17)
$dteRstdate = GUICtrlCreateDate("", 96, 161, 105, 21, $WS_TABSTOP)
$lblType = GUICtrlCreateLabel("Type:", 8, 184, 37, 17)
$cmbType = GUICtrlCreateCombo("CONCEPT", 96, 184, 105, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL,$CBS_UPPERCASE))
GUICtrlSetData(-1, "RECONCEPT|SAMPLE|RESAMPLE|ADDL SMPL|HEAT SEAL TOOL|BLISTR FRM TOOL")
$lblProdCode = GUICtrlCreateLabel("Product Code:", 8, 208, 78, 17)
$cmbPcode = GUICtrlCreateCombo("SAM-CONCPT", 96, 208, 105, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL,$CBS_UPPERCASE))
GUICtrlSetData(-1, "SAM-SAMPL|SAM-ADDL|MAH-FAC|MAH-FAM|BFT-VAC|BFT-PRESS")
$lblPO = GUICtrlCreateLabel("PO Number:", 216, 17, 68, 17)
$txtPO = GUICtrlCreateInput("N/C", 304, 17, 105, 21, BitOR($ES_UPPERCASE,$ES_AUTOHSCROLL))
$lblPOamt = GUICtrlCreateLabel("PO Amount:", 216, 41, 67, 17)
$txtPOamt = GUICtrlCreateInput("0", 304, 41, 105, 21, BitOR($ES_UPPERCASE,$ES_AUTOHSCROLL))
$lblPOdiscount = GUICtrlCreateLabel("PO Discount:", 216, 64, 73, 17)
$txtPOdiscount = GUICtrlCreateInput("", 304, 64, 105, 21, BitOR($ES_UPPERCASE,$ES_AUTOHSCROLL))
$lblPE = GUICtrlCreateLabel("Project Enj:", 216, 89, 64, 17)
$txtPE = GUICtrlCreateInput("", 304, 89, 105, 21, BitOR($ES_UPPERCASE,$ES_AUTOHSCROLL))
$lblPM = GUICtrlCreateLabel("Project Mngr:", 216, 113, 73, 17)
$txtPM = GUICtrlCreateInput("", 304, 113, 105, 21, BitOR($ES_UPPERCASE,$ES_AUTOHSCROLL))
$lblCharge = GUICtrlCreateLabel("Charge:", 216, 137, 47, 17)
$txtCharge = GUICtrlCreateInput("", 304, 137, 105, 21, BitOR($ES_UPPERCASE,$ES_AUTOHSCROLL))
$lblQty = GUICtrlCreateLabel("Quantity:", 216, 160, 52, 17)
$txtQty = GUICtrlCreateInput("1.00", 304, 160, 105, 21, BitOR($ES_UPPERCASE,$ES_AUTOHSCROLL))
$lblMaterial = GUICtrlCreateLabel("Material:", 216, 184, 50, 17)
$txtMaterial = GUICtrlCreateInput("", 304, 184, 105, 21, BitOR($ES_UPPERCASE,$ES_AUTOHSCROLL))
$lblGauge = GUICtrlCreateLabel("Gauge:", 216, 208, 45, 17)
$txtGauge = GUICtrlCreateInput("0.0", 304, 208, 105, 21, BitOR($ES_UPPERCASE,$ES_AUTOHSCROLL))
GUICtrlCreateGroup("", -99, -99, 1, 1)
$lblExNotes = GUICtrlCreateLabel("Extra Notes:", 8, 248, 68, 17)
$edtExNotes = GUICtrlCreateEdit("", 80, 248, 241, 57, BitOR($ES_UPPERCASE,$ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN,$WS_HSCROLL,$WS_VSCROLL))
GUICtrlSetData(-1, "")
$btnContinue = GUICtrlCreateButton("Continue", 336, 248, 75, 25)
$btnExit = GUICtrlCreateButton("Exit", 336, 280, 75, 25)
$mnuFile = GUICtrlCreateMenu("&File")
$mnuNew = GUICtrlCreateMenuItem("&New", $mnuFile)
$mnuOpen = GUICtrlCreateMenuItem("&Open", $mnuFile)
$mnuSave = GUICtrlCreateMenuItem("&Save", $mnuFile)
$mnuSep1 = GUICtrlCreateMenuItem("", $mnuFile)
$mnuExit = GUICtrlCreateMenuItem("E&xit", $mnuFile)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

Share this post


Link to post
Share on other sites



Hehe, okay, so basically - not available at the moment?

Share this post


Link to post
Share on other sites

Hehe, okay, so basically - not available at the moment?

Use:

$mnuNew = GUICtrlCreateMenuItem("&New" & @TAB & "Ctrl+N", $mnuFile)
$mnuOpen = GUICtrlCreateMenuItem("&Open"  & @TAB & "Ctrl+O", $mnuFile)

Share this post


Link to post
Share on other sites

AH! That's how you tab! Thank you :)

Share this post


Link to post
Share on other sites

I think this is on Jon's TODO list as "Accelerator table for GUI."

Look here

That post is from Aug '06. Priorities might have changed since then...

:)


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

Share this post


Link to post
Share on other sites

That post is from Aug '06. Priorities might have changed since then...

:)

Hahaha. I didn't find it very useful either, but I figured if it was on the To-Do list, that meant it wasn't incorporated yet ;)

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  
Followers 0