Jump to content

newbie here


Recommended Posts

I am very new to this language and im already addicted. I am trying to create a program and whenever I try and run it, the gui doesn't appear. It only shows up in the system tray. Plz can anyone answer my dumb newbie question. How do I get this window to appear so I can actually see my GUI.

Thanks in advance.

Webber

Here is the code

#include <GuiConstantsEx.au3>

#include <AVIConstants.au3>

#include <TreeViewConstants.au3>

#include <colorchecks.au3>

#include <settings.au3>

#include <ftpclient.au3>

#include <windows.au3>

#include <frmSchedule.au3>

#include <frmAddSchedule.au3>

Opt('MustDeclareVars', 1)

Local $mnuFile, $mnuStart, $mnuPause, $mnuHide, $mnuExit

Local $mnuSchedules

Local $mnuAbout, $mnuAboutProgram

Local $PauseBtn, $StartBtn, $SchedulesBtn, $SNG

Local $frmLog, $lstTables, $Label7, $lblTotalNetIncomeReallblTotalNetIncomeReal

Local $lblgamesnow, $Label1, $Label2, $Label3, $Label4, $Label9, $Label11, $lblGames, $lblmins

Local $nMsg, $smsg

StartClient()

;GUI will be shown here i believe

GuiCreate("FTP SnG Auto-Pilot", 425, 605)

; File Menu

$mnuFile = GuiCtrlCreateMenu("&File")

$mnuStart = GUICtrlCreateMenuItem("&Start", $mnuFile)

$mnuPause = GUICtrlCreateMenuItem("&Pause", $mnuFile)

$mnuHide = GUICtrlCreateMenuItem("&Hide", $mnuFile)

$mnuExit = GUICtrlCreateMenuItem("E&xit", $mnuFile)

; Schedule Menu

$mnuSchedules = GuiCtrlCreateMenu("&Schedules")

; About Menu

$mnuAbout = GuiCtrlCreateMenu("&About")

$mnuAboutProgram = GUICtrlCreateMenuItem("&About", $mnuAbout)

; Log Label

GuiCtrlCreateLabel("Log", 5, 5)

$frmLog = GUICtrlCreateEdit("", 3, 20, 419, 273)

; Tournament Status Label

$lblTotalNetIncomeReallblTotalNetIncomeReal = GUICtrlCreateLabel("Real-time Stats", -1, 297, 100, 15)

$Label7 = GUICtrlCreateLabel("Tournament Status:", 5, 311, 100, 15)

GUICtrlSetColor(-1, 0xff0000)

$lblgamesnow = GUICtrlCreateLabel("Number of games currently open: 0", 250, 311, 200, 15)

$lstTables = GUICtrlCreateEdit("", 3, 330, 419, 100)

; Current Session Stats Label

$Label1 = GUICtrlCreateLabel("Current Session Stats:", 5, 440, 150, 15)

GUICtrlSetColor(-1, 0xff0000)

$Label2 = GUICtrlCreateLabel("Overall Stats:", 220, 440, 150, 15)

GUICtrlSetColor(-1, 0xff0000)

$Label3 = GUICtrlCreateLabel("Number of games opened: 0", 12, 460, 150, 15)

$Label4 = GUICtrlCreateLabel("Number of minutes elapsed: 0", 12, 475, 150, 15)

$Label9 = GUICtrlCreateLabel("Net Income: 0", 12, 490, 150, 15)

$lblGames = GUICtrlCreateLabel("Total number of games opened: 0", 230, 460, 170, 15)

$lblmins = GUICtrlCreateLabel("Total number of minutes elapsed: 0", 230, 475, 170, 15)

$Label11 = GUICtrlCreateLabel("Total Net Income: 0/$0.00", 230, 490, 170, 15)

; 3 buttons

$PauseBtn = GUICtrlCreateButton("Pause", 10, 530, 120, 33)

$StartBtn = GUICtrlCreateButton("Start", 150, 530, 120, 33)

$SchedulesBtn = GUICtrlCreateButton("Schedules", 290, 530, 120, 33)

GuiSetState(@SW_Show)

While GuiGetMsg() <> $GUI_EVENT_CLOSE

WEnd

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $mnuExit, $GUI_EVENT_CLOSE

ExitLoop

Case $SchedulesBtn

;ShowShedule()

PrepareFTP()

Case $mnuAboutProgram

MsgBox(0,"About","FTP starter v0.1 GUI by Webber04 coded by RonaldNL")

EndSwitch

WEnd

Do

$smsg = GUIGetMsg()

If $smsg = $StartBtn Then

Run("frmAddSchedule.exe")

EndIf

Until $msg = $GUI_EVENT_CLOSE

; LogIt

Func LogIt($thetext)

GUICtrlSetData($frmLog, $thetext,1)

EndFunc

Link to comment
Share on other sites

Welcome to the Forum.

Firstly put into code tags

#include <GuiConstantsEx.au3>
#include <AVIConstants.au3>
#include <TreeViewConstants.au3>

#include <colorchecks.au3>
#include <settings.au3>
#include <ftpclient.au3>
#include <windows.au3>
#include <frmSchedule.au3>
#include <frmAddSchedule.au3>


Opt('MustDeclareVars', 1)

Local $mnuFile, $mnuStart, $mnuPause, $mnuHide, $mnuExit
Local $mnuSchedules
Local $mnuAbout, $mnuAboutProgram
Local $PauseBtn, $StartBtn, $SchedulesBtn, $SNG
Local $frmLog, $lstTables, $Label7, $lblTotalNetIncomeReallblTotalNetIncomeReal
Local $lblgamesnow, $Label1, $Label2, $Label3, $Label4, $Label9, $Label11, $lblGames, $lblmins

Local $nMsg, $smsg

StartClient()

;GUI will be shown here i believe
GUICreate("FTP SnG Auto-Pilot", 425, 605)

; File Menu
$mnuFile = GUICtrlCreateMenu("&File")
$mnuStart = GUICtrlCreateMenuItem("&Start", $mnuFile)
$mnuPause = GUICtrlCreateMenuItem("&Pause", $mnuFile)
$mnuHide = GUICtrlCreateMenuItem("&Hide", $mnuFile)
$mnuExit = GUICtrlCreateMenuItem("E&xit", $mnuFile)

; Schedule Menu
$mnuSchedules = GUICtrlCreateMenu("&Schedules")

; About Menu
$mnuAbout = GUICtrlCreateMenu("&About")
$mnuAboutProgram = GUICtrlCreateMenuItem("&About", $mnuAbout)

; Log Label
GUICtrlCreateLabel("Log", 5, 5)
$frmLog = GUICtrlCreateEdit("", 3, 20, 419, 273)

; Tournament Status Label
$lblTotalNetIncomeReallblTotalNetIncomeReal = GUICtrlCreateLabel("Real-time Stats", -1, 297, 100, 15)
$Label7 = GUICtrlCreateLabel("Tournament Status:", 5, 311, 100, 15)
GUICtrlSetColor(-1, 0xff0000)
$lblgamesnow = GUICtrlCreateLabel("Number of games currently open: 0", 250, 311, 200, 15)
$lstTables = GUICtrlCreateEdit("", 3, 330, 419, 100)

; Current Session Stats Label
$Label1 = GUICtrlCreateLabel("Current Session Stats:", 5, 440, 150, 15)
GUICtrlSetColor(-1, 0xff0000)
$Label2 = GUICtrlCreateLabel("Overall Stats:", 220, 440, 150, 15)
GUICtrlSetColor(-1, 0xff0000)
$Label3 = GUICtrlCreateLabel("Number of games opened: 0", 12, 460, 150, 15)
$Label4 = GUICtrlCreateLabel("Number of minutes elapsed: 0", 12, 475, 150, 15)
$Label9 = GUICtrlCreateLabel("Net Income: 0", 12, 490, 150, 15)
$lblGames = GUICtrlCreateLabel("Total number of games opened: 0", 230, 460, 170, 15)
$lblmins = GUICtrlCreateLabel("Total number of minutes elapsed: 0", 230, 475, 170, 15)
$Label11 = GUICtrlCreateLabel("Total Net Income: 0/$0.00", 230, 490, 170, 15)

; 3 buttons
$PauseBtn = GUICtrlCreateButton("Pause", 10, 530, 120, 33)
$StartBtn = GUICtrlCreateButton("Start", 150, 530, 120, 33)
$SchedulesBtn = GUICtrlCreateButton("Schedules", 290, 530, 120, 33)

GUISetState(@SW_SHOW)
While GUIGetMsg() <> $GUI_EVENT_CLOSE
WEnd

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $mnuExit, $GUI_EVENT_CLOSE
            ExitLoop
        Case $SchedulesBtn
            ;ShowShedule()
            PrepareFTP()
        Case $mnuAboutProgram
            MsgBox(0, "About", "FTP starter v0.1 GUI by Webber04 coded by RonaldNL")
    EndSwitch
WEnd

Do
    $smsg = GUIGetMsg()
    If $smsg = $StartBtn Then
        Run("frmAddSchedule.exe")
    EndIf
Until $msg = $GUI_EVENT_CLOSE

; LogIt
Func LogIt($thetext)
    GUICtrlSetData($frmLog, $thetext, 1)
EndFunc   ;==>LogIt

Secondly, have a look at Example2() in the help file, notice the parent is specified and the placement of GUISetState(@SW_SHOW).

Thirdly, I could not compile as it would appear you custom UDFs. While nothing is wrong with that, I suggest you look at #include in the help again. ("" no <>)

Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

Link to comment
Share on other sites

Welcome to the Forum.

Firstly put into code tags

#include <GuiConstantsEx.au3>
#include <AVIConstants.au3>
#include <TreeViewConstants.au3>

#include <colorchecks.au3>
#include <settings.au3>
#include <ftpclient.au3>
#include <windows.au3>
#include <frmSchedule.au3>
#include <frmAddSchedule.au3>


Opt('MustDeclareVars', 1)

Local $mnuFile, $mnuStart, $mnuPause, $mnuHide, $mnuExit
Local $mnuSchedules
Local $mnuAbout, $mnuAboutProgram
Local $PauseBtn, $StartBtn, $SchedulesBtn, $SNG
Local $frmLog, $lstTables, $Label7, $lblTotalNetIncomeReallblTotalNetIncomeReal
Local $lblgamesnow, $Label1, $Label2, $Label3, $Label4, $Label9, $Label11, $lblGames, $lblmins

Local $nMsg, $smsg

StartClient()

;GUI will be shown here i believe
GUICreate("FTP SnG Auto-Pilot", 425, 605)

; File Menu
$mnuFile = GUICtrlCreateMenu("&File")
$mnuStart = GUICtrlCreateMenuItem("&Start", $mnuFile)
$mnuPause = GUICtrlCreateMenuItem("&Pause", $mnuFile)
$mnuHide = GUICtrlCreateMenuItem("&Hide", $mnuFile)
$mnuExit = GUICtrlCreateMenuItem("E&xit", $mnuFile)

; Schedule Menu
$mnuSchedules = GUICtrlCreateMenu("&Schedules")

; About Menu
$mnuAbout = GUICtrlCreateMenu("&About")
$mnuAboutProgram = GUICtrlCreateMenuItem("&About", $mnuAbout)

; Log Label
GUICtrlCreateLabel("Log", 5, 5)
$frmLog = GUICtrlCreateEdit("", 3, 20, 419, 273)

; Tournament Status Label
$lblTotalNetIncomeReallblTotalNetIncomeReal = GUICtrlCreateLabel("Real-time Stats", -1, 297, 100, 15)
$Label7 = GUICtrlCreateLabel("Tournament Status:", 5, 311, 100, 15)
GUICtrlSetColor(-1, 0xff0000)
$lblgamesnow = GUICtrlCreateLabel("Number of games currently open: 0", 250, 311, 200, 15)
$lstTables = GUICtrlCreateEdit("", 3, 330, 419, 100)

; Current Session Stats Label
$Label1 = GUICtrlCreateLabel("Current Session Stats:", 5, 440, 150, 15)
GUICtrlSetColor(-1, 0xff0000)
$Label2 = GUICtrlCreateLabel("Overall Stats:", 220, 440, 150, 15)
GUICtrlSetColor(-1, 0xff0000)
$Label3 = GUICtrlCreateLabel("Number of games opened: 0", 12, 460, 150, 15)
$Label4 = GUICtrlCreateLabel("Number of minutes elapsed: 0", 12, 475, 150, 15)
$Label9 = GUICtrlCreateLabel("Net Income: 0", 12, 490, 150, 15)
$lblGames = GUICtrlCreateLabel("Total number of games opened: 0", 230, 460, 170, 15)
$lblmins = GUICtrlCreateLabel("Total number of minutes elapsed: 0", 230, 475, 170, 15)
$Label11 = GUICtrlCreateLabel("Total Net Income: 0/$0.00", 230, 490, 170, 15)

; 3 buttons
$PauseBtn = GUICtrlCreateButton("Pause", 10, 530, 120, 33)
$StartBtn = GUICtrlCreateButton("Start", 150, 530, 120, 33)
$SchedulesBtn = GUICtrlCreateButton("Schedules", 290, 530, 120, 33)

GUISetState(@SW_SHOW)
While GUIGetMsg() <> $GUI_EVENT_CLOSE
WEnd

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $mnuExit, $GUI_EVENT_CLOSE
            ExitLoop
        Case $SchedulesBtn
            ;ShowShedule()
            PrepareFTP()
        Case $mnuAboutProgram
            MsgBox(0, "About", "FTP starter v0.1 GUI by Webber04 coded by RonaldNL")
    EndSwitch
WEnd

Do
    $smsg = GUIGetMsg()
    If $smsg = $StartBtn Then
        Run("frmAddSchedule.exe")
    EndIf
Until $msg = $GUI_EVENT_CLOSE

; LogIt
Func LogIt($thetext)
    GUICtrlSetData($frmLog, $thetext, 1)
EndFunc   ;==>LogIt

Secondly, have a look at Example2() in the help file, notice the parent is specified and the placement of GUISetState(@SW_SHOW).

Thirdly, I could not compile as it would appear you custom UDFs. While nothing is wrong with that, I suggest you look at #include in the help again. ("" no <>)

Link to comment
Share on other sites

Sorry about the lingo. The Example2 in the help file under GUICreate. Did you write the script?

Where do these come from?

#include <colorchecks.au3>

#include <settings.au3>

#include <ftpclient.au3>

#include <windows.au3>

#include <frmSchedule.au3>

#include <frmAddSchedule.au3>

Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

Link to comment
Share on other sites

Sorry about the lingo. The Example2 in the help file under GUICreate. Did you write the script?

Where do these come from?

#include <colorchecks.au3>

#include <settings.au3>

#include <ftpclient.au3>

#include <windows.au3>

#include <frmSchedule.au3>

#include <frmAddSchedule.au3>

those are other au3 files i plan on using with this form

but are not important right now.

except I want to have the StartBtn variable open up the frmAddSchedule form when clicked.

is there an easy way to do this and keep both windows up or not.

Link to comment
Share on other sites

Understand that "GUICreate("FTP SnG Auto-Pilot", 425, 605)" creates like a panel object that you then can put other GUI items on. You have created a bunch of GUI items but have not told AutoIt what to do with them. GUI items like buttons or labels require a high level container to sit in like a panel. If you are new at this I recommend you have a look at some simple examples or tutorials so you can get a better understanding of the code you have posted.

Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

Link to comment
Share on other sites

Understand that "GUICreate("FTP SnG Auto-Pilot", 425, 605)" creates like a panel object that you then can put other GUI items on. You have created a bunch of GUI items but have not told AutoIt what to do with them. GUI items like buttons or labels require a high level container to sit in like a panel. If you are new at this I recommend you have a look at some simple examples or tutorials so you can get a better understanding of the code you have posted.

thanks much for your help.

i appreciate it all.

I will look at some more examples.

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