ashley Posted July 8, 2007 Share Posted July 8, 2007 ok as some of you know im working on a text editor... i have a func to lock the GUI but it not working... Any body know why... Im using GUICtrlSetState(-1, $GUI_DISABLE) thanks in advance... Free icons for your programs Link to comment Share on other sites More sharing options...
Zedna Posted July 8, 2007 Share Posted July 8, 2007 Instead of GUICtrlSetState(-1, $GUI_DISABLE)oÝ÷ ÚÚòjëh×6GUISetState($Form1, $GUI_DISABLE) Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
ashley Posted July 8, 2007 Author Share Posted July 8, 2007 Instead of GUICtrlSetState(-1, $GUI_DISABLE)oÝ÷ ÚÚòjëh×6GUISetState($Form1, $GUI_DISABLE)thanks Free icons for your programs Link to comment Share on other sites More sharing options...
ashley Posted July 8, 2007 Author Share Posted July 8, 2007 so here is my code so far... what do you think expandcollapse popup;~# includes #include <GUIConstants.au3> #include <file.au3> #NoTrayIcon ;~# includes-end ;~# hotkeys HotKeySet("{esc}", "close") HotKeySet("^s", "save") HotKeySet("^o", "open") HotKeySet("^p", "print") Hotkeyset("^l", "linecount") HotKeySet("{F9}", "lock" ) HotKeySet("{F10}", "UnLock") ;~# hotkeys-end ;at start unlock() ;at start-end Func UnLock () GUIDelete() ;gui MsgBox(262160, "Unlocked", " unlocked... ") #Region ### START Koda GUI section ### Form=c:\documents and settings\windows\desktop\koda\forms\typepad v.1.0.0.kxf $Form1 = GUICreate("TypePad- By Ashley", 635, 457, 203, 127) GUISetCursor (0) GUISetFont(8, 400, 0, "Arial Black") GUISetBkColor(0x0000FF) GUICtrlCreateEdit("", 8, 8, 617, 409) GUICtrlSetColor(-1, 0xFF0000) $Label1 = GUICtrlCreateLabel("Typepad By Ashley", 512, 424, 119, 19, BitOR($SS_SUNKEN,$WS_BORDER)) GUICtrlSetColor(-1, 0xFF0000) $Funcbar = GUICtrlCreateProgress(288, 424, 222, 17, BitOR($PBS_SMOOTH,$WS_BORDER)) GUICtrlSetColor(-1, 0xFF0000) $Quicklist = GUICtrlCreateCombo("QUICKLIST", 8, 424, 273, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL,$CBS_SORT,$CBS_UPPERCASE)) GUICtrlSetData(-1, "TO COUNT LINE IN A FILE PRSS CRTL + L|TO OPEN A FILE PRESS CTRL + O|TO PRINT A FILE PRESS CTRL + P|TO QUIT PRESS ESC|TO SAVE PRESS CTRL + S|TO LOCK PRESS F9") GUICtrlSetTip(-1, "All the Quick keys are listed here") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd ;gui-end EndFunc ; Func list Func Save() FileSaveDialog("Save", "", "TypePad- files (*.TYP)", 1) EndFunc Func Open() FileOpenDialog("Open", "", "TypePad- files (*.TYP)", 1) EndFunc Func print() $file = FileOpenDialog("Print File", "", "TypePad- files (*.TYP)", 1) If @error Then Exit $print = _FilePrint($file) If $print Then MsgBox(0, "Print", "The file was sent to the printer.") Else MsgBox(0, "Print", "Error: " & @error & @CRLF & "The file was not sent to printer.") EndIf EndFunc Func linecount() $CountLines = _FileCountLines("TypePad.au3") MsgBox(64, "Lines in file", "There are " & $CountLines & " in this file") endFunc Func close() Exit EndFunc ; Func list-end Func lock() ;gui lock GUIDelete() MsgBox(262160, "Locked", " Locked... ") #Region ### START Koda GUI section ### Form=c:\documents and settings\windows\desktop\koda\forms\typepad v.1.0.0.kxf $Form1 = GUICreate("TypePad- By Ashley", 635, 457, 203, 127) GUISetState($Form1, $GUI_DISABLE) GUISetCursor (0) GUISetFont(8, 400, 0, "Arial Black") GUISetBkColor(0x0000FF) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd ;gui lock-end EndFunc Free icons for your programs Link to comment Share on other sites More sharing options...
Zedna Posted July 8, 2007 Share Posted July 8, 2007 so here is my code so far... what do you think Here is optimized concept for avoid duplicate create/destroy whole GUI. Instead only set it's parametres by GUISetState() But unfortunatelly GUISetState() didn't work as I expected and I don't know why expandcollapse popup;~# includes #include <GUIConstants.au3> #include <file.au3> #NoTrayIcon ;~# includes-end ;~# hotkeys HotKeySet("{esc}", "close") HotKeySet("^s", "save") HotKeySet("^o", "open") HotKeySet("^p", "print") Hotkeyset("^l", "linecount") HotKeySet("{F9}", "lock" ) HotKeySet("{F10}", "UnLock") ;~# hotkeys-end ;at start #Region ### START Koda GUI section ### Form=c:\documents and settings\windows\desktop\koda\forms\typepad v.1.0.0.kxf $Form1 = GUICreate("TypePad- By Ashley", 635, 457, 203, 127) GUISetCursor (0) GUISetFont(8, 400, 0, "Arial Black") GUISetBkColor(0x0000FF) GUICtrlCreateEdit("", 8, 8, 617, 409) GUICtrlSetColor(-1, 0xFF0000) $Label1 = GUICtrlCreateLabel("Typepad By Ashley", 512, 424, 119, 19, BitOR($SS_SUNKEN,$WS_BORDER)) GUICtrlSetColor(-1, 0xFF0000) $Funcbar = GUICtrlCreateProgress(288, 424, 222, 17, BitOR($PBS_SMOOTH,$WS_BORDER)) GUICtrlSetColor(-1, 0xFF0000) $Quicklist = GUICtrlCreateCombo("QUICKLIST", 8, 424, 273, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL,$CBS_SORT,$CBS_UPPERCASE)) GUICtrlSetData(-1, "TO COUNT LINE IN A FILE PRSS CRTL + L|TO OPEN A FILE PRESS CTRL + O|TO PRINT A FILE PRESS CTRL + P|TO QUIT PRESS ESC|TO SAVE PRESS CTRL + S|TO LOCK PRESS F9") GUICtrlSetTip(-1, "All the Quick keys are listed here") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func UnLock () MsgBox(262160, "Unlocked", " unlocked... ") GUISetState($Form1, @SW_ENABLE) ;~ GUISetState($Form1, @SW_SHOW) EndFunc Func lock() MsgBox(262160, "Locked", " Locked... ") GUISetState($Form1, @SW_DISABLE) ;~ GUISetState($Form1, @SW_HIDE) EndFunc ; Func list Func Save() FileSaveDialog("Save", "", "TypePad- files (*.TYP)", 1) EndFunc Func Open() FileOpenDialog("Open", "", "TypePad- files (*.TYP)", 1) EndFunc Func print() $file = FileOpenDialog("Print File", "", "TypePad- files (*.TYP)", 1) If @error Then Exit $print = _FilePrint($file) If $print Then MsgBox(0, "Print", "The file was sent to the printer.") Else MsgBox(0, "Print", "Error: " & @error & @CRLF & "The file was not sent to printer.") EndIf EndFunc Func linecount() $CountLines = _FileCountLines("TypePad.au3") MsgBox(64, "Lines in file", "There are " & $CountLines & " in this file") endFunc Func close() Exit EndFunc ; Func list-end Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
ashley Posted July 8, 2007 Author Share Posted July 8, 2007 Here is optimized concept for avoid duplicate create/destroy whole GUI. Instead only set it's parametres by GUISetState() But unfortunatelly GUISetState() didn't work as I expected and I don't know why expandcollapse popup;~# includes #include <GUIConstants.au3> #include <file.au3> #NoTrayIcon ;~# includes-end ;~# hotkeys HotKeySet("{esc}", "close") HotKeySet("^s", "save") HotKeySet("^o", "open") HotKeySet("^p", "print") Hotkeyset("^l", "linecount") HotKeySet("{F9}", "lock" ) HotKeySet("{F10}", "UnLock") ;~# hotkeys-end ;at start #Region ### START Koda GUI section ### Form=c:\documents and settings\windows\desktop\koda\forms\typepad v.1.0.0.kxf $Form1 = GUICreate("TypePad- By Ashley", 635, 457, 203, 127) GUISetCursor (0) GUISetFont(8, 400, 0, "Arial Black") GUISetBkColor(0x0000FF) GUICtrlCreateEdit("", 8, 8, 617, 409) GUICtrlSetColor(-1, 0xFF0000) $Label1 = GUICtrlCreateLabel("Typepad By Ashley", 512, 424, 119, 19, BitOR($SS_SUNKEN,$WS_BORDER)) GUICtrlSetColor(-1, 0xFF0000) $Funcbar = GUICtrlCreateProgress(288, 424, 222, 17, BitOR($PBS_SMOOTH,$WS_BORDER)) GUICtrlSetColor(-1, 0xFF0000) $Quicklist = GUICtrlCreateCombo("QUICKLIST", 8, 424, 273, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL,$CBS_SORT,$CBS_UPPERCASE)) GUICtrlSetData(-1, "TO COUNT LINE IN A FILE PRSS CRTL + L|TO OPEN A FILE PRESS CTRL + O|TO PRINT A FILE PRESS CTRL + P|TO QUIT PRESS ESC|TO SAVE PRESS CTRL + S|TO LOCK PRESS F9") GUICtrlSetTip(-1, "All the Quick keys are listed here") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func UnLock () MsgBox(262160, "Unlocked", " unlocked... ") GUISetState($Form1, @SW_ENABLE) ;~ GUISetState($Form1, @SW_SHOW) EndFunc Func lock() MsgBox(262160, "Locked", " Locked... ") GUISetState($Form1, @SW_DISABLE) ;~ GUISetState($Form1, @SW_HIDE) EndFunc ; Func list Func Save() FileSaveDialog("Save", "", "TypePad- files (*.TYP)", 1) EndFunc Func Open() FileOpenDialog("Open", "", "TypePad- files (*.TYP)", 1) EndFunc Func print() $file = FileOpenDialog("Print File", "", "TypePad- files (*.TYP)", 1) If @error Then Exit $print = _FilePrint($file) If $print Then MsgBox(0, "Print", "The file was sent to the printer.") Else MsgBox(0, "Print", "Error: " & @error & @CRLF & "The file was not sent to printer.") EndIf EndFunc Func linecount() $CountLines = _FileCountLines("TypePad.au3") MsgBox(64, "Lines in file", "There are " & $CountLines & " in this file") endFunc Func close() Exit EndFunc ; Func list-end urm.. sorry but NO... dont work next time test plz anyways look at my sig help me there... from now on... Free icons for your programs Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now