Sign in to follow this  
Followers 0
Adamrv1

Opening Second GUI Form & GroupBox Questions

7 posts in this topic

Question #1: GUI Forms

How do I open one GUI form by pressing a button on another

;Passwords Main Form
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=c:\users\brian\desktop\autoitpasssaver\passwordgui.kxf
$Form1_1 = GUICreate("Passwords", 299, 187, 304, 522)
$LookupB = GUICtrlCreateButton("Lookup Password", 24, 88, 97, 33, 0)
$AddPassB = GUICtrlCreateButton("Add Password", 24, 40, 97, 33, 0)
$DeleteB = GUICtrlCreateButton("Delete", 24, 136, 97, 33, 0)
$Password = GUICtrlCreateLabel("Password Options", 16, 16, 113, 20)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$Label1 = GUICtrlCreateLabel("Set Master Password", 144, 16, 131, 20)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$Pas = GUICtrlCreateGroup("PassWord", 136, 40, 145, 89)
$Pass = GUICtrlCreateInput("Password", 152, 64, 113, 21)
$Confirm = GUICtrlCreateInput("Confirm", 152, 96, 113, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button1 = GUICtrlCreateButton("Set", 136, 144, 65, 25, 0)
$Button2 = GUICtrlCreateButton("Reset", 216, 144, 65, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

;Website Form
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$WebsiteF = GUICreate("Website", 202, 268, 292, 193)
$List1 = GUICtrlCreateList("", 16, 0, 169, 201)
GUICtrlSetData(-1, "Website1|Website2")
$SelectBw = GUICtrlCreateButton("Select", 16, 224, 169, 33, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

;Username Form
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=C:\Users\Brian\Desktop\AutoitPassSaver\PasswordGUI.kxf
$UsernameF = GUICreate("Username", 202, 265, 574, 186)
$List1 = GUICtrlCreateList("", 16, 8, 169, 201)
GUICtrlSetData(-1, "User1|User2")
$SelectBu = GUICtrlCreateButton("Select", 16, 224, 169, 33, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd
more specifically how do i open $WebsiteF by Clicking $AddPassB

Question #2: Koda and GroupBoxes

If I already have two buttons open, and then add a GroupBox, how do i get the buttons to work in it properly.


Share this post


Link to post
Share on other sites



#1

(I was bored and got a bit carried away, but hey, extra features never hurt anyone!)

#include<guiconstants.au3>

Opt("guioneventmode", 1)

Dim $newgui[1]

$gui = GUICreate("", 151, 91, 192, 124)
GUISetOnEvent($GUI_EVENT_CLOSE, "close")
$newguibutton = GUICtrlCreateButton("New GUI", 5, 5, 141, 26)
GUICtrlSetOnEvent(-1, "newgui")
$websiteinput = GUICtrlCreateInput("", 5, 35, 141, 21)
$websitebutton = GUICtrlCreateButton("Open Website", 5, 60, 141, 26)
GUICtrlSetOnEvent(-1, "opensite")
GUISetState(@SW_SHOW)

While 1
    Sleep(100)
WEnd

Func newgui()
    $newgui[UBound($newgui) - 1] = GUICreate("GUI " & UBound($newgui))
    GUISetOnEvent($GUI_EVENT_CLOSE, "close")
    GUISetState()
    ReDim $newgui[UBound($newgui) + 1]
EndFunc

Func opensite()
    If StringInStr(GUICtrlRead($websiteinput), "http://") Then
        ShellExecute(GUICtrlRead($websiteinput))
    Else
        MsgBox(0, "", "Not a valid URL")
    EndIf
EndFunc

Func close()
    If WinActive($gui) Then
        GUIDelete($gui)
    Else
        For $i = 0 To UBound($newgui - 1)
            If WinActive($newgui[$i]) Then
                GUIDelete($newgui[$i])
                ExitLoop
            EndIf
        Next
    EndIf
EndFunc

#2 In Koda, you must create a groupbox first and then create any buttons you want grouped inside the groupbox. If you screwed it up and don't want to redo it, export the code, change the order in which you create the buttons/groupbox, and then import it back into Koda. There may be a better way to do it, but if there is, I don't know it.


The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again.

Share this post


Link to post
Share on other sites

#2 In Koda, you must create a groupbox first and then create any buttons you want grouped inside the groupbox. If you screwed it up and don't want to redo it, export the code, change the order in which you create the buttons/groupbox, and then import it back into Koda. There may be a better way to do it, but if there is, I don't know it.

I used to move the buttons (or other type of controls) away from where the group will be, draw the group and then cut & paste the controls inside the group. Check if his work for you.


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

Cool, that does work! Thanks! It would be nice if you could move stuff into groups in the treeview though.


The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again.

Share this post


Link to post
Share on other sites

Cool, that does work! Thanks! It would be nice if you could move stuff into groups in the treeview though.

Umm treeviews definitely are a different guy! You can ask the author about dark areas.

Enjoy Koda, it's a great tool.


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

I was speeking of Koda's object treeview that has all of the controls in a treeview. I wish you could use it to change the order of controls and move controls in and out of groups. Should have made myself more clear.


The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again.

Share this post


Link to post
Share on other sites

Oh yes, sorry to have missed what you were really talking about.

True, it doesn't offer every shortcut like payware products typically would, but Koda is still _very_ useable as it is.

And I'm sure you agree. But if you don't, then you can always ask the author for a full refund! :D


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

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