Sign in to follow this  
Followers 0
Blue_Drache

Impossible Request?

6 posts in this topic

#1 ·  Posted (edited)

I'm not asking for anyone to code for me, so please don't get that into your head. I've illustrated what I'd like and want to know if it is possible to achieve.

I want a GUI that has a button that is the default in the case that enter is pressed in a text entry field and will take run the appropriate "CASE" statement as if the mouse button had clicked it. At the same time, the text entry field should have the focus by default with any default text entered selected for typing over.

See picture for any clarification (if needed)

Go...go...gadget PAINT!

Edited by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites



can DLLCall + SetWindowLong + BS_DEFPUSHBUTTON be used to change a button to a default at runtime?... this may be a start...

remember whenever using SetWindowLong use GetWindowLong first then BitOR in the BS_DEFPUSHBUTTON.

Lar.

<{POST_SNAPBACK}>

Uh...DLLCall is over my head at this time. Seriously. Majorly Greek to me.

I meant, can this be done with the standard routines currently built into AutoIt?

If not, then I suppose I could pull out the help file and start tackling DLLCall.


Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

Example: Note the $BS_DEFPUSHBUTTON and the $GUI_FOCUS.

#region --- GuiBuilder code Start ---
; Script generated by AutoBuilder 0.5 Prototype

#include <GuiConstants.au3>

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

GuiCreate("MyGUI", 392, 323,(@DesktopWidth-392)/2, (@DesktopHeight-323)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)

$Button_1 = GuiCtrlCreateButton("Button1", 30, 90, 80, 30, $BS_DEFPUSHBUTTON)
$Button_2 = GuiCtrlCreateButton("Button2", 30, 50, 80, 30)
$Button_3 = GuiCtrlCreateButton("Button3", 30, 10, 80, 30)
$Input_4 = GuiCtrlCreateInput("Input4", 120, 10, 200, 30)
$Input_5 = GuiCtrlCreateInput("Input5", 120, 50, 200, 30)
$Input_6 = GuiCtrlCreateInput("Input6", 120, 90, 200, 30)
GUICtrlSetState($Input_6, $GUI_FOCUS)
GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $Button_1
        msgbox(0, "Button1", "Button1 was selected")
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case Else
    ;;;
    EndSelect
WEnd
Exit
#endregion --- GuiBuilder generated code End ---

Share this post


Link to post
Share on other sites

Example:  Note the $BS_DEFPUSHBUTTON and the $GUI_FOCUS.

<{POST_SNAPBACK}>

I feel like such a nooblet....(sigh). Thanks for taking me to school, Mike. That did exactly what I wanted.

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

Slightly OT...

How can I tie the enter key in a widget created by GUICtrlCreateCombo() to the same function that is called when a user selects an item?

-John

<{POST_SNAPBACK}>

I'm afraid I don't understand the question, could you rephrase?

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

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