Jump to content

Implement search popup with multiple controls


 Share

Recommended Posts

I'm trying to implement a Ctl-F popup box that looks something like the one that Notepad uses, but I'm not havine much luck.  I intend to get it working, then beef up the popup's contents to add several checkboxes, buttons and radio boxes.
What my example code does is to use InputBox(), but that's not what I want.
Here is my test code:

#include <Array.au3>
#include <GUIConstantsEx.au3>

#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
Opt("GUICloseOnESC", 1)
Opt("GUIOnEventMode", 1)
Opt('MustDeclareVars', 1)
OnAutoItExitRegister("ExitStageLeft")
Opt("WinTitleMatchMode", -2)

Global $hGUI

_Main()

Func _Main()

    $hGUI = GUICreate("Test ^F", 300, 200)

    setupSpecialKeysHandlers()

    GUISetOnEvent($GUI_EVENT_CLOSE, "Event_GUIClose")

    GUISetState()

    While (1)
        Sleep(157)
    WEnd
EndFunc   ;==>_Main

Func handle_CTRL_F_key()
    Local $str

    $str = InputBox("Search", "Enter the string to search for:")
    ConsoleWrite("+++: $str ==>" & $str & "<==" & @CRLF)

EndFunc   ;==>handle_CTRL_F_key

Func ExitStageLeft()
    Exit (99)
EndFunc   ;==>ExitStageLeft

Func Event_GUIClose()
    Exit (1)
EndFunc   ;==>Event_GUIClose

Func setupSpecialKeysHandlers()
    Local $ar, $parts, $key, $handler, $id
    Local $aAccelKeys[1][2]

    ; Create a table of Special keys and their handlers
    $ar = StringSplit("", "")
    _ArrayAdd($ar, "^f - handle_CTRL_F_key ")
    ReDim $aAccelKeys[UBound($ar) - 1][2]

    ; Now, create $aAccelKeys array with the table data.
    ; For each entry, create a Dummy GUI and associate its
    ; ID with the special key.
    For $ndx = 1 To UBound($ar) - 1
        $parts = StringSplit($ar[$ndx], "-", 2)
        $key = StringStripWS($parts[0], 8)
        $handler = StringStripWS($parts[1], 8)
        $id = GUICtrlCreateDummy()

        $aAccelKeys[$ndx - 1][0] = $key
        $aAccelKeys[$ndx - 1][1] = $id
        GUICtrlSetOnEvent($id, $handler)
    Next

    GUISetAccelerators($aAccelKeys) ; Setup the Special keys hooks
EndFunc   ;==>setupSpecialKeysHandlers

 

Link to comment
Share on other sites

  • Moderators

So what is your question? You have identified the problem; an inputbox is an inputbox, you need to create a child gui

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Maybe someone did it, but if you do it, you'll learn a lot. Try something and post back issues you may have.

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

  • 2 weeks later...

Maybe what you really need is to create a gui just for the search and then put an editbox

GUICtrlCreateEdit, then in the main loop keep reading the contents and change accordingly..

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

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

×
×
  • Create New...