Sign in to follow this  
Followers 0
wizzardking

can't get the butoon to work?

4 posts in this topic

Ok, I'm probably soingsomething real stupid but...

here's a snipet of my relevant code:

#include <GuiConstants.au3>

$progbar = 1

$done = "never"

$postlink = "<p><a href = ../blog_general_post.htm> Post a Response</a></p>"

;If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000

Opt("GUICoordMode", 1)

;cleanup any files that might have been left behind beause of a power loss or abrupt shutdown

FileDelete("c:\inetpub\*.tmp")

FileDelete("c:\inetpub\wwroot\*.tmp")

FileDelete("c:\inetpub\privateroot\*.tmp")

FileDelete("c:\inetpub\bbsadmin\*.tmp")

FileDelete("c:\inetpub\data\*.tmp")

FileDelete("c:\inetpub\scripts\*.tmp")

FileDelete("c:\inetpub\privateroot\blogs\*.tmp")

GuiCreate("GABBS Control Interface version 1.0", 392, 323,(@DesktopWidth-392)/2, (@DesktopHeight-323)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)

$date = @MON &"/" & @MDAY &"/" & @YEAR

$time = @HOUR & ":" & @MIN

$date_1 = GuiCtrlCreateLabel($time,90,10,190,20)

$Label_2 = GuiCtrlCreateLabel("New Users", 60,25, 160, 20)

$button_1 = GUICtrlCreateButton ("See Log", 200, 50, 50, 30)

$progressbar1 = GuiCtrlCreateProgress(10, 300, 380, 20,$PBS_SMOOTH)

$List_3 = GuiCtrlCreateList("NONE", 10, 40, 160, 75)

$list_5 = GuiCtrlCreateList("© Copyright 2006 Mitch Stein, All Rights Reserved", 60, 275, 270, 25)

$cname = "Computer Name = " & @ComputerName

$list_6 = GUICtrlCreateList($cname,10,100,200,25)

$uname = "Current logged in user = " & @UserName

$list_7 = GUICtrlCreateList($uname,10,115,200,25)

$IPAddress = "Ip Address = " & @IPAddress1

$list_8 = GUICtrlCreateList($IPAddress,10,130,200,25)

$label_3 = GuiCtrlCreateLabel("New Blog Entries",140,155,190,20)

$list_9 = GUICtrlCreateList("",10,175,380,115)

Do

$msg = GUIGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

MsgBox(0, "", "Dialog was closed")

Exit

Case $msg = $GUI_EVENT_MINIMIZE

MsgBox(0,"", "Dialog minimized",2)

Case $msg = $GUI_EVENT_MAXIMIZE

MsgBox(0,"", "Dialog restored",2)

Case $msg = $button_1

MsgBox(0, "Default button clicked", "Radio " )

EndSelect

.................<snip>

but I can't get the button to work when you click $button_1 it's supposed to pop open a msg box but it does nothing..

I even told $msg to be displayed in one of the ctls and the most i get from it is if I mouse click -8 release the the mouse -7 (or vice versa) however the gui_events are working fine.

BTW I've been trying for 3 days to get the stupid button to work. AARRGH I feel like the brian from the breakfast club with his stupid lamp and when he pulled the cord the light didn't light up. (Sorry I guess I'm showing my age.)

Anyway I only posted about 2% of the whole program, I believe I posted everything relevant to the button problem.

If anyone is interested the rest of the code is to process .pl (perl) created text files to run a blog system.

the button is merely to display the log files of what the users of the site have been doing..

`Mitch

P.S. on a diferent topic, but part of my code snipet if anyone has ever used autoit to process smtp and pop3 mail I would very much like an audience with them, thats the next project :) for my website.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

this works for me

#include <GuiConstants.au3>
$progbar = 1
$done = "never"
$postlink = "<p><a href = ../blog_general_post.htm> Post a Response</a></p>"
;If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000
Opt("GUICoordMode", 1)
;cleanup any files that might have been left behind beause of a power loss or abrupt shutdown
FileDelete("c:\inetpub\*.tmp")
FileDelete("c:\inetpub\wwroot\*.tmp")
FileDelete("c:\inetpub\privateroot\*.tmp")
FileDelete("c:\inetpub\bbsadmin\*.tmp")
FileDelete("c:\inetpub\data\*.tmp")
FileDelete("c:\inetpub\scripts\*.tmp")
FileDelete("c:\inetpub\privateroot\blogs\*.tmp")
GUICreate("GABBS Control Interface version 1.0", 392, 323, (@DesktopWidth - 392) / 2, (@DesktopHeight - 323) / 2, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
$date = @MON & "/" & @MDAY & "/" & @YEAR
$time = @HOUR & ":" & @MIN
$date_1 = GUICtrlCreateLabel($time, 90, 10, 190, 20)
$Label_2 = GUICtrlCreateLabel("New Users", 60, 25, 160, 20)
$button_1 = GUICtrlCreateButton("See Log", 200, 50, 50, 30)

$progressbar1 = GUICtrlCreateProgress(10, 300, 380, 20, $PBS_SMOOTH)
$List_3 = GUICtrlCreateList("NONE", 10, 40, 160, 75)
$list_5 = GUICtrlCreateList("© Copyright 2006 Mitch Stein, All Rights Reserved", 60, 275, 270, 25)
$cname = "Computer Name = " & @ComputerName
$list_6 = GUICtrlCreateList($cname, 10, 100, 200, 25)
$uname = "Current logged in user = " & @UserName
$list_7 = GUICtrlCreateList($uname, 10, 115, 200, 25)
$IPAddress = "Ip Address = " & @IPAddress1
$list_8 = GUICtrlCreateList($IPAddress, 10, 130, 200, 25)
$label_3 = GUICtrlCreateLabel("New Blog Entries", 140, 155, 190, 20)
$list_9 = GUICtrlCreateList("", 10, 175, 380, 115)

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            MsgBox(0, "", "Dialog was closed")
            Exit
        Case $msg = $GUI_EVENT_MINIMIZE
            MsgBox(0, "", "Dialog minimized", 2)
        Case $msg = $GUI_EVENT_MAXIMIZE
            MsgBox(0, "", "Dialog restored", 2)
            
        Case $msg = $button_1
            MsgBox(0, "Default button clicked", "Radio ")
    EndSelect
WEnd
Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

this works for me

While 1

$msg = GUIGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

MsgBox(0, "", "Dialog was closed")

Exit

Case $msg = $GUI_EVENT_MINIMIZE

MsgBox(0, "", "Dialog minimized", 2)

Case $msg = $GUI_EVENT_MAXIMIZE

MsgBox(0, "", "Dialog restored", 2)

Case $msg = $button_1

MsgBox(0, "Default button clicked", "Radio ")

EndSelect

WEnd

If I'm not mistaking this while statement will cause everything else to pause until something is pressed?

If so, it won't work in my case, because there are about 12 other if statements that have to be in the loop. Hmmm, but I could them all as case statements I guess.

This is a huge script I'm working from thats why I didn't post all of it approx 500 lines of very sloppy code :0..

but everything except that button works, also I think maybe my loop might be too long, I had everything that needed to be done in one big if file exists then

... do 50 things

end if

I'm currently changing that to : if file exist then func statements to make it easier to edit, I think that will make my $msg = GUIGetMsg() statement be in a tighter loop. maybe that is why it doesn't work for me now.

I was under the assumption that guigetmsg worked like the inkey$ in gwhiz basic where it buffered the keystrokes. IE if I press g and then an inkey$ happens before something else reads the keyboard then inkey$ = g and it could have been a thousands lines of code later.

`Mitch

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