Sign in to follow this  
Followers 0
Possessed

Help with GUI Tabs/Buttons~

5 posts in this topic

I have looked everywere for help to try and fix this problem but cant seem to find how to fix it. When I start my app the buttons mess up. A ghost image stay on the other tabs dont really know why. Anyways heres the code try it out and see for your self.

;Script By: Possessed.no-ip.org
;The Server~ Version 0.1
;------------------------
;GUI stuff
#include <Inet.au3>
#include <GUIConstants.au3>
;preload stuff
$getip = _GetIP()
$g_IP = "127.0.0.1"
$font="Lucida Console"

GUICreate("Possessed Portal", 300, 480)
GUISetBkColor(0x000000)
$output = GUICtrlCreateEdit('**************************Console V1.0***************************' & @CRLF, 0, 270, 300, 210, $ES_AUTOVSCROLL + $WS_VSCROLL + $ES_READONLY, $WS_EX_STATICEDGE)
GUICtrlSetFont (-1,7, 400, $font)
$font="Lucida Console"
$tab=GUICtrlCreateTab (0,0, 300,270)

$tab0=GUICtrlCreateTabitem ("Settings")
$tab0input=GUICtrlCreateInput ("", 130,40,70,20,$ES_NUMBER)
GUICtrlSetTip(-1,"Enter a Port number.")
$tabbutton1=GUICtrlCreateButton ("Start TCPListen", 10,40,100,20)
GUICtrlSetFont(-1, 8, 400, 0, "Lucida Console")
GUICtrlSetCursor($tabbutton1, 0)
GUISetState(@SW_SHOW)


$tab1=GUICtrlCreateTabitem ("Options")


$tab2=GUICtrlCreateTabitem ("Commands")


$tab3=GUICtrlCreateTabitem ("Tools")
$Button1 = GUICtrlCreateButton('Ping', 10, 40, 80, 20, 0)
GUICtrlSetFont(-1, 8, 400, 0, "Lucida Console")
GUICtrlSetCursor($Button1, 0)
GUISetState(@SW_SHOW)

$Button2 = GUICtrlCreateButton('Netstat -n', 10, 65, 80, 20, 0)
GUICtrlSetFont(-1, 8, 400, 0, "Lucida Console")
GUICtrlSetCursor($Button2, 0)
GUISetState(@SW_SHOW)

$Button3= GUICtrlCreateButton('Return IP', 10, 90, 80, 20, 0)
GUICtrlSetFont(-1, 8, 400, 0, "Lucida Console")
GUICtrlSetCursor($Button3, 0)
GUISetState(@SW_SHOW)



;Handling the GUI
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE;Exit form GUI
            ExitLoop
        Case $msg = $Button1
            GUICtrlSetData($output, GUICtrlRead($output) & Return_ping() & @CRLF)
        Case $msg = $tabbutton1
                GUICtrlSetData($output,GUICtrlRead($output) &  & @CRLF)
        Case $msg = $Button2
                GUICtrlSetData($output, GUICtrlRead($output) & Return_Netstats() & @CRLF)
        Case $msg = $Button3
                GUICtrlSetData($output, GUICtrlRead($output) & Return_IP () & @CRLF)
        Case Else
           ; Something else
    EndSelect
WEnd
;My Func's
Func Return_ping()
    Local $iPID = Run(@ComSpec & ' /c ping ' & $getip & ' -n 1', '', @SW_HIDE, 2), $sHold = ''
    While Not @error
        $sHold &= StdoutRead($iPID)
    WEnd
    Return $sHold
EndFunc  ;==>Return_ping

Func Return_Netstats()
    Local $netID = Run(@ComSpec & ' /c netstat ' & ' -n', '', @SW_HIDE, 2), $sHold1 = ''
    While Not @error
        $sHold1 &= StdoutRead($netID)
    WEnd
    Return $sHold1
EndFunc  ;==>Return_nestat -n info

Func Return_IP ()
  $IP = _GetIP()
  Return $IP
EndFunc  ;==>Return_Ip info

Share this post


Link to post
Share on other sites



CODE
;Script By: Possessed.no-ip.org
;The Server~ Version 0.1
;------------------------
;GUI stuff
#include <Inet.au3>
#include <GUIConstants.au3>
;preload stuff
$getip = _GetIP()
$g_IP = "127.0.0.1"
$font="Lucida Console"

$gui = GUICreate("Possessed Portal", 300, 480)
GUISetBkColor(0x000000)
$output = GUICtrlCreateEdit('**************************Console V1.0***************************' & @CRLF, 0, 270, 300, 210, $ES_AUTOVSCROLL + $WS_VSCROLL + $ES_READONLY, $WS_EX_STATICEDGE)
GUICtrlSetFont (-1,7, 400, $font)
$font="Lucida Console"
$tab=GUICtrlCreateTab (0,0, 300,270)

$tab0=GUICtrlCreateTabitem ("Settings")
$tab0input=GUICtrlCreateInput ("", 130,40,70,20,$ES_NUMBER)
GUICtrlSetTip(-1,"Enter a Port number.")
$tabbutton1=GUICtrlCreateButton ("Start TCPListen", 10,40,100,20)
GUICtrlSetFont(-1, 8, 400, 0, "Lucida Console")
GUICtrlSetCursor($tabbutton1, 0)

$tab1=GUICtrlCreateTabitem ("Options")

$tab2=GUICtrlCreateTabitem ("Commands")

$tab3=GUICtrlCreateTabitem ("Tools")
$Button1 = GUICtrlCreateButton('Ping', 10, 40, 80, 20, 0)
GUICtrlSetFont(-1, 8, 400, 0, "Lucida Console")
GUICtrlSetCursor($Button1, 0)

$Button2 = GUICtrlCreateButton('Netstat -n', 10, 65, 80, 20, 0)
GUICtrlSetFont(-1, 8, 400, 0, "Lucida Console")
GUICtrlSetCursor($Button2, 0)

$Button3= GUICtrlCreateButton('Return IP', 10, 90, 80, 20, 0)
GUICtrlSetFont(-1, 8, 400, 0, "Lucida Console")
GUICtrlSetCursor($Button3, 0)
GUICtrlCreateTabItem('')

GUISetState(@SW_SHOW)

;Handling the GUI
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE;Exit form GUI
            ExitLoop
        Case $msg = $Button1
            GUICtrlSetData($output, GUICtrlRead($output) & Return_ping() & @CRLF)
        Case $msg = $tabbutton1
                GUICtrlSetData($output,GUICtrlRead($output) &  & @CRLF)
        Case $msg = $Button2
                GUICtrlSetData($output, GUICtrlRead($output) & Return_Netstats() & @CRLF)
        Case $msg = $Button3
                GUICtrlSetData($output, GUICtrlRead($output) & Return_IP () & @CRLF)
        Case Else
           ; Something else
    EndSelect
WEnd
;My Func's
Func Return_ping()
    Local $iPID = Run(@ComSpec & ' /c ping ' & $getip & ' -n 1', '', @SW_HIDE, 2), $sHold = ''
    While Not @error
        $sHold &= StdoutRead($iPID)
    WEnd
    Return $sHold
EndFunc  ;==>Return_ping

Func Return_Netstats()
    Local $netID = Run(@ComSpec & ' /c netstat ' & ' -n', '', @SW_HIDE, 2), $sHold1 = ''
    While Not @error
        $sHold1 &= StdoutRead($netID)
    WEnd
    Return $sHold1
EndFunc  ;==>Return_nestat -n info

Func Return_IP ()
  $IP = _GetIP()
  Return $IP
EndFunc  ;==>Return_Ip info

[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

Its been doing that befor i put all that in and even tryed moving it. Still "ghosts" the buttons ????

Share this post


Link to post
Share on other sites

Its been doing that befor i put all that in and even tryed moving it. Still "ghosts" the buttons ????

The script I posted ran fine for me.... the one you posted was all over the place with a ton of GUISetState() (You only need one) and you didn't close the tab items.

[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

hehe thank you again i feel dumb now :whistle: thats what I get for learning haha. You know and i know ill be back with another dumb problem so untill next time thank you so much man.

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