Sign in to follow this  
Followers 0
JavaScript_Freek

End Select | WEnd HELP

6 posts in this topic

;***********************
; Sample GUI Menu V2
; Coded by: Dan
; August 2, 2006
;Special Thanks to: gafrost, Paulie, and codemyster!
;***********************

#include <GuiConstants.au3>
#include <Misc.au3>
#include <File.au3>
#include <GuiListView.au3>
FileWrite("c:/blank.txt", "")
Global $oRP

$name = InputBox("Log In", "Please enter your name:")

; GUI
GUICreate("Sample GUI Menu", 400, 400)
GUISetIcon(@SystemDir & " notepad.exe", 0)
$TagsPageC = GUICtrlCreateLabel('Visit AutoIt Homepage', 5, 399, 100, 15, $SS_CENTER)
GUICtrlSetFont($TagsPageC, 9, 400, 4)
GUICtrlSetColor($TagsPageC, 0x0000ff)
GUICtrlSetCursor($TagsPageC, 0)

; BANNER
$s_TempFile = _TempFile()
InetGet("http://i37.photobucket.com/albums/e91/Zombie1992/logo4.gif", $s_TempFile)
GUICtrlCreatePic($s_TempFile, 0, 0, 400, 67)

; SLIDER
GUICtrlCreateLabel("Slider:", 235, 325)
GUICtrlCreateSlider(270, 325, 120, 30)
GUICtrlSetData(-1, 30)

; TEXT
GUICtrlCreateLabel("This is the text for a Main Menu! This is the text for a Main Menu! This is the text for a Main Menu! This is the text for a Main Menu! This is the text for a Main Menu! This is the text for a Main MenuV2!", 10, 275, 389, 37)
$label = GUICtrlCreateLabel("Logged in as: " & $name, 150, 75, 400, 14)
;GUICtrlSetStyle (-1, $SS_RIGHT )

; MENU
$filemenu = GUICtrlCreateMenu("File")
$fileitem = GUICtrlCreateMenuitem("Open...", $filemenu)
$recentfilesmenu = GUICtrlCreateMenu("Recent Files", $filemenu)
$separator1 = GUICtrlCreateMenuitem("", $filemenu)
$exititem = GUICtrlCreateMenuitem("Exit", $filemenu)
$helpmenu = GUICtrlCreateMenu("About")
$aboutitem = GUICtrlCreateMenuitem("About", $helpmenu)

; TAB
GUICtrlCreateTab(1, 70, 400, 190)
$tab1 = GUICtrlCreateTabItem("Intro")
GUICtrlCreateLabel("Welcome to Sample GUI Menu V2." & @CRLF & " " & @CRLF & "Sample Gui Program Is In Launch. This is a sample gui with features such as login, tabs, clickable links, and NotePad Feature! ", 20, 120, 385, 100)
GUICtrlCreateTabItem("Info")
$Edit_1 = GuiCtrlCreateEdit("Welcome to SimpleEdit 1.1 Created by: codemyster", 15, 100, 373, 120)
$Button_2 = GuiCtrlCreateButton("New", 20, 220, 100, 30)
$Button_3 = GuiCtrlCreateButton("Save", 220, 220, 100, 30)
$Button_7 = GuiCtrlCreateButton("Open", 120, 220, 100, 30)
GUICtrlCreateTabItem("AutoIt")
$treeview       = GUICtrlCreateTreeView(15, 100, 100, 150, BitOr($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS), $WS_EX_CLIENTEDGE)
$generalitem    = GUICtrlCreateTreeViewitem("General", $treeview)
GUICtrlSetColor(-1, 0x0000C0)
$displayitem    = GUICtrlCreateTreeViewitem("Users", $treeview)
GUICtrlSetColor(-1, 0x0000C0)
$compitem       = GUICtrlCreateTreeViewitem("Computer", $generalitem)
$useritem       = GUICtrlCreateTreeViewitem("User", $generalitem)
$resitem        = GUICtrlCreateTreeViewitem("Resolution", $displayitem)
$otheritem      = GUICtrlCreateTreeViewitem("Other", $displayitem)

Dim $listview, $button, $msg, $i, $ret, $s_item

GUICreate("ListView Set Item Count", 392, 254)
$listview = GUICtrlCreateListView("col1|col2|col3|col4", 100, 10, 200, 100, BitOR($LVS_SINGLESEL, $LVS_SHOWSELALWAYS, $LVS_NOSORTHEADER))
GUICtrlSendMsg($listview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES)
GUICtrlSendMsg($listview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_FULLROWSELECT, $LVS_EX_FULLROWSELECT)
GUICtrlSendMsg($listview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_HEADERDRAGDROP, $LVS_EX_HEADERDRAGDROP)
$button = GUICtrlCreateButton("Add Items", 150, 120, 90, 30)
_GUICtrlListViewSetItemCount($listview, 20)
; GUI MESSAGE        LOOP

GUICtrlCreateTabItem("")   ; end tabitem definition
GUICtrlSetState($tab1, $GUI_SHOW)   ; will be display first

GUISetState()

While 1
    $msg = GUIGetMsg()
   
    Select
        Case $msg = $fileitem
            $file = FileOpenDialog("Choose file...", @TempDir, "All (*.*)")
            If @error <> 1 Then GUICtrlCreateMenuitem($file, $recentfilesmenu)
        Case $msg = $exititem
            ExitLoop
        Case $msg = $GUI_EVENT_CLOSE
;~    $oRP.SaveFile (@ScriptDir & "RichText.rtf", 0)
            ExitLoop
           
        Case $msg = $TagsPageC
            Run(@ComSpec & ' /c start http://www.autoitscript.com/autoit3%27"]http://www.autoitscript.com/autoit3', '', @SW_HIDE)
           
        Case $msg = $aboutitem
            MsgBox(0, "About Sample GUI Menu V2", "Sample GUI Menu V2" & @CRLF & @CRLF & "Created by: Javascript_Freek" & @CRLF & "" & @CRLF & "©AutoIt")
        Case $msg = $GUI_EVENT_CLOSE
                $msg = GuiGetMsg()
        Case $msg = $Button_2
        GUICtrlSetData($Edit_1, "")
        Case $msg = $Button_3
       FileWrite(FilesaveDialog("Select a file to save",@ScriptDir, "All Files (*.*)"),GUICtrlRead($Edit_1))
       Case $msg = $Button_7
       GUICtrlSetData($Edit_1,Fileread(FileOpenDialog("Select a file to open",@ScriptDir, "All Files (*.*)")))
          $msg = GUIGetMsg()
   Select
      Case $msg = $GUI_EVENT_CLOSE
         ExitLoop
      Case $msg = $button
            For $i = 0 To 19
                $s_item = $i & "|" & $i & "|" & $i & "|" & $i
                GUICtrlCreateListViewItem($s_item, $listview)
    EndSelect
WEnd

Alright something is wrong and I don't know what they say to remove

EndSelect

WEnd

THen after i remove that its Line 88: Select

Help me please. :whistle:


[center]Cookyx.com :: Simple LAN Chat[/center]

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

remove the Select on line 119.

Edit:

Actually your missing a Next on the for loop, and I can't tell if your trying to stick something in the Case statement ... you also have 2 $msg = GUIGetMsg()(s).

While 1
    $msg = GUIGetMsg()
   
    Select
        Case $msg = $fileitem
            $file = FileOpenDialog("Choose file...", @TempDir, "All (*.*)")
            If @error <> 1 Then GUICtrlCreateMenuitem($file, $recentfilesmenu)
        Case $msg = $exititem
            ExitLoop
        Case $msg = $GUI_EVENT_CLOSE
;~    $oRP.SaveFile (@ScriptDir & "RichText.rtf", 0)
            ExitLoop
           
        Case $msg = $TagsPageC
            Run(@ComSpec & ' /c start [url=http://www.autoitscript.com/autoit3%27"]http://www.autoitscript.com/autoit3%27"[/url]]http://www.autoitscript.com/autoit3', '', @SW_HIDE)
           
        Case $msg = $aboutitem
            MsgBox(0, "About Sample GUI Menu V2", "Sample GUI Menu V2" & @CRLF & @CRLF & "Created by: Javascript_Freek" & @CRLF & "" & @CRLF & "©AutoIt")
        Case $msg = $GUI_EVENT_CLOSE
               $msg = GuiGetMsg()
        Case $msg = $Button_2
        GUICtrlSetData($Edit_1, "")
        Case $msg = $Button_3
       FileWrite(FilesaveDialog("Select a file to save",@ScriptDir, "All Files (*.*)"),GUICtrlRead($Edit_1))
       Case $msg = $Button_7
       GUICtrlSetData($Edit_1,Fileread(FileOpenDialog("Select a file to open",@ScriptDir, "All Files (*.*)")))
      Case $msg = $GUI_EVENT_CLOSE
         ExitLoop
      Case $msg = $button
            For $i = 0 To 19
                $s_item = $i & "|" & $i & "|" & $i & "|" & $i
                GUICtrlCreateListViewItem($s_item, $listview)
            Next
    EndSelect
WEnd
Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Now it says to remove WEnd on the very last line.

Btw line 119 is the second to last line. (End Select)

Edited by JavaScript_Freek

[center]Cookyx.com :: Simple LAN Chat[/center]

Share this post


Link to post
Share on other sites

Not sure what exactly you are trying to do, but it doesn't error anymore:

;***********************
; Sample GUI Menu V2
; Coded by: Dan
; August 2, 2006
;Special Thanks to: gafrost, Paulie, and codemyster!
;***********************
#include <GuiConstants.au3>
#include <Misc.au3>
#include <File.au3>
#include <GuiListView.au3>
;~ FileWrite("c:/blank.txt", "")
Global $oRP
$name = InputBox("Log In", "Please enter your name:")
; GUI
GUICreate("Sample GUI Menu", 400, 400)
GUISetIcon(@SystemDir & " notepad.exe", 0)
$TagsPageC = GUICtrlCreateLabel('Visit AutoIt Homepage', 5, 399, 100, 15, $SS_CENTER)
GUICtrlSetFont($TagsPageC, 9, 400, 4)
GUICtrlSetColor($TagsPageC, 0x0000ff)
GUICtrlSetCursor($TagsPageC, 0)
; BANNER
$s_TempFile = _TempFile()
InetGet("http://i37.photobucket.com/albums/e91/Zombie1992/logo4.gif", $s_TempFile)
GUICtrlCreatePic($s_TempFile, 0, 0, 400, 67)
; SLIDER
GUICtrlCreateLabel("Slider:", 235, 325)
GUICtrlCreateSlider(270, 325, 120, 30)
GUICtrlSetData(-1, 30)
; TEXT
GUICtrlCreateLabel("This is the text for a Main Menu! This is the text for a Main Menu! This is the text for a Main Menu! This is the text for a Main Menu! This is the text for a Main Menu! This is the text for a Main MenuV2!", 10, 275, 389, 37)
$label = GUICtrlCreateLabel("Logged in as: " & $name, 150, 75, 400, 14)
;GUICtrlSetStyle (-1, $SS_RIGHT )
; MENU
$filemenu = GUICtrlCreateMenu("File")
$fileitem = GUICtrlCreateMenuitem("Open...", $filemenu)
$recentfilesmenu = GUICtrlCreateMenu("Recent Files", $filemenu)
$separator1 = GUICtrlCreateMenuitem("", $filemenu)
$exititem = GUICtrlCreateMenuitem("Exit", $filemenu)
$helpmenu = GUICtrlCreateMenu("About")
$aboutitem = GUICtrlCreateMenuitem("About", $helpmenu)
; TAB
GUICtrlCreateTab(1, 70, 400, 190)
$tab1 = GUICtrlCreateTabItem("Intro")
GUICtrlCreateLabel("Welcome to Sample GUI Menu V2." & @CRLF & " " & @CRLF & "Sample Gui Program Is In Launch. This is a sample gui with features such as login, tabs, clickable links, and NotePad Feature! ", 20, 120, 385, 100)
GUICtrlCreateTabItem("Info")
$Edit_1 = GUICtrlCreateEdit("Welcome to SimpleEdit 1.1 Created by: codemyster", 15, 100, 373, 120)
$Button_2 = GUICtrlCreateButton("New", 20, 220, 100, 30)
$Button_3 = GUICtrlCreateButton("Save", 220, 220, 100, 30)
$Button_7 = GUICtrlCreateButton("Open", 120, 220, 100, 30)
GUICtrlCreateTabItem("AutoIt")
$treeview = GUICtrlCreateTreeView(15, 100, 100, 150, BitOR($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS), $WS_EX_CLIENTEDGE)
$generalitem = GUICtrlCreateTreeViewItem("General", $treeview)
GUICtrlSetColor(-1, 0x0000C0)
$displayitem = GUICtrlCreateTreeViewItem("Users", $treeview)
GUICtrlSetColor(-1, 0x0000C0)
$compitem = GUICtrlCreateTreeViewItem("Computer", $generalitem)
$useritem = GUICtrlCreateTreeViewItem("User", $generalitem)
$resitem = GUICtrlCreateTreeViewItem("Resolution", $displayitem)
$otheritem = GUICtrlCreateTreeViewItem("Other", $displayitem)
Dim $listview, $button, $msg, $i, $ret, $s_item
GUICreate("ListView Set Item Count", 392, 254)
$listview = GUICtrlCreateListView("col1|col2|col3|col4", 100, 10, 200, 100, BitOR($LVS_SINGLESEL, $LVS_SHOWSELALWAYS, $LVS_NOSORTHEADER))
GUICtrlSendMsg($listview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES)
GUICtrlSendMsg($listview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_FULLROWSELECT, $LVS_EX_FULLROWSELECT)
GUICtrlSendMsg($listview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_HEADERDRAGDROP, $LVS_EX_HEADERDRAGDROP)
$button = GUICtrlCreateButton("Add Items", 150, 120, 90, 30)
_GUICtrlListViewSetItemCount($listview, 20)
; GUI MESSAGE        LOOP
GUICtrlCreateTabItem("")   ; end tabitem definition
GUICtrlSetState($tab1, $GUI_SHOW)   ; will be display first
GUISetState()
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $fileitem
            $file = FileOpenDialog("Choose file...", @TempDir, "All (*.*)")
            If @error <> 1 Then GUICtrlCreateMenuitem($file, $recentfilesmenu)
        Case $msg = $exititem
            ExitLoop
        Case $msg = $GUI_EVENT_CLOSE
;~    $oRP.SaveFile (@ScriptDir & "RichText.rtf", 0)
            ExitLoop
        Case $msg = $TagsPageC
            Run(@ComSpec & ' /c start http://www.autoitscript.com/autoit3%27"]http://www.autoitscript.com/autoit3', '', @SW_HIDE)
        Case $msg = $aboutitem
            MsgBox(0, "About Sample GUI Menu V2", "Sample GUI Menu V2" & @CRLF & @CRLF & "Created by: Javascript_Freek" & @CRLF & "" & @CRLF & "©AutoIt")
        Case $msg = $GUI_EVENT_CLOSE
            $msg = GUIGetMsg()
        Case $msg = $Button_2
            GUICtrlSetData($Edit_1, "")
        Case $msg = $Button_3
            FileWrite(FileSaveDialog("Select a file to save", @ScriptDir, "All Files (*.*)"), GUICtrlRead($Edit_1))
        Case $msg = $Button_7
            GUICtrlSetData($Edit_1, FileRead(FileOpenDialog("Select a file to open", @ScriptDir, "All Files (*.*)")))
            $msg = GUIGetMsg()
            Select
                Case $msg = $GUI_EVENT_CLOSE
                    ExitLoop
                Case $msg = $button
                    For $i = 0 To 19
                        $s_item = $i & "|" & $i & "|" & $i & "|" & $i
                        GUICtrlCreateListViewItem($s_item, $listview)
                    Next
            EndSelect
    EndSelect
WEnd

"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Share this post


Link to post
Share on other sites

Now it says to remove WEnd on the very last line.

Btw line 119 is the second to last line. (End Select)

Read my edit, it was like 112, that was my mistake.

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

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