Jump to content

Autoit3-gui 102.17 Available


jpm
 Share

Recommended Posts

The white background come from a problem I cannot solve for the time being of the default color of a tab . Almost white in XP but gray under Win9x perhaps Win2K.

For the refresh color of a label I need to have a look to what happen.

Stay tune

@Josbe

the color label is solved 102.17B :D

Link to comment
Share on other sites

I think an edit control will be more appropriate to show the code.
You can manage to add lines very easily. What you cannot do easily is delete a line.

I originally did use an edit box - (which then also allowed the users to edit - funny that !!) but as you pointed out - it isn't so easy to cleanly delete the entry so I went down the list box route.

cheers

Edited by steve8tch
Link to comment
Share on other sites

GUISendMsg/GUIRecvMsg Question:

In my newest version of AutoPad, I am using EM_GETSEL which has pointers for both wParam and lParam.

How am I supposed to get the resulting values of wParram and lParam? I tried using each param type in GUIRecvMsg, but nothing worked. I finally used GUISendMsg to get someing close.....

This code should help show my problem:

Global $EM_GETSEL = 0xb0

GUICreate("GUI Message Problem", 400, 200)
$edit = GUISetControl("edit","Select some of this text..." & _
    @CRLF & "Click and drag BOTH left and right!", 0, 0)
$first= GUISetControl("label","First Index:", 300,20)
$last = GUISetControl("label","Last Index: ", 300,60)
GUIShow()
WinActivate("GUI Message Problem")

While 1
    Sleep(100)
    $msg = GUIMsg(0)
    If $msg = -3 Then ExitLoop

 ;I divide by 65537 because it works...
    $var = Int(GUISendMsg($edit, $EM_GETSEL, 0, 0) / 65537)
    GUIWrite($last, 0, "Last:  " & $var)

 ; Play with this line:
    $foo = GUIRecvMsg($edit, $EM_GETSEL)
    GUIWrite($first,0, "First: " & $foo)
WEnd
GUIDelete()
Edited by CyberSlug
Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Link to comment
Share on other sites

@CyberSlug

You get the GUIRecvMsg.au3 example which do what you need.

what is wrong with the doc? :D the return is done by an array :huh2:

Opt("GuiNotifyMode",1)   ; to get control when action occurs on any control
GUICreate("My GUI") ; will create a dialog box that when displayed is centered

$nEdit = GUISetControl("edit", "line 0", 10,10)
GUISetControl("Button", "Ok", 20,200,50)
GuiShow()

for $n=1 to 5
GuiWrite($nEdit,0, @CRLF & "line "& $n)
next

$EM_GETSEL = 0x00B0

While GUIMsg()
$a=GuiRecvMsg($nEdit, $EM_GETSEL)
GuiSetControlEx($nEdit,256)   ; set focus back on edit control

; will display the wParam and lParam values return by the control
MsgBox(0,"Current selection",StringFormat("start=%d end=%d", $a[0], $a[1]))
Wend
Link to comment
Share on other sites

@CyberSlug

You get the GUIRecvMsg.au3 example which do what you need.

what is wrong with the doc? :huh2:  the return is done by an array :)

I really could have *sworn* I tried that and got the "subscript used with non-Array variable" error....

But everything works now--exactly as documented and exactly as you said :D THANK YOU :lol:

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Link to comment
Share on other sites

Heh, you right, maybe it's really time to start squishing remain bugs :D

Today I found two issues (bugs?):

1. Why controls (labels, checkboxes, radios), placed onto tab page have white background by default?

2. I have a problem with WS_EX_ACCEPTFILES. In example shown below, when I drag file onto control, I see that cursor changed to arrow with "+" - that's ok. But after I've drop file - nothing appear.

Filename not show in the control, and GUIRead give me emptyness.

How I can get filename from control? Or maybe this bug?

Don't have 101.8 version, where this feature first appear, but it won't work in any other releases.

Opt("GUINotifyMode", 1)

GUICreate("GUI", 320,120, @DesktopWidth/2-160, @DesktopHeight/2-45, -1, 0x00000008)
$file = GUISetControl ("input",  "", 10,  5, 300, 20, -1, 0x00000010); WS_EX_ACCEPTFILES
$btn = GUISetControl ("button",  "Button", 40,  55, 60, 20)
GUISetControl ("input",  "", 10,  35, 300, 20); WS_EX_ACCEPTFILES
GUISetControl ("input",  "", 10,  55, 300, 20); WS_EX_ACCEPTFILES
   
While GUIMsg() > 0
        $res = GUIRead()
         Select
            Case $res = $btn
                MsgBox (4096, "title", GUIRead($file), 2)
        EndSelect
Wend
I was hard to find that it was a doc error.

the WS_EX_ACCEPTFILES extended file has to be set at GuiCreate level.

GUICreate("GUI", 320,120, @DesktopWidth/2-160, @DesktopHeight/2-45, -1, 0x00000018); WS_EX_ACCEPTFILES

$file = GUISetControl ("input",  "", 10,  5, 300, 20)

I am still looking for a good solution for the default background color on tab

Link to comment
Share on other sites

Ups... Thanks jpm, seems it works, but... why if I have more than one input control on the form, they all accept files? It's possibly to have only certain controls will accept files? Or block this on unneeded?

BTW Code I posted yesterday was really stupid... sorry if this was unclear. Copy'n'paste... not the best day :D

Link to comment
Share on other sites

Two questions:

1) Am I doing something stupid again? I am trying to send the EM_SETTABSTOPS message, but I get a crash! The parameters look okay.

2) Is re-drawing the GUI possible? According to Microsoft: "The EM_SETTABSTOPS message does not automatically redraw the edit control window. If the application is changing the tab stops for text already in the edit control, it should call the InvalidateRect function to redraw the edit control window."

Global $EM_SETTABSTOPS = 0xCB
HotKeySet("{Pause}", "setTabs")

GUICreate("Press Pause to Crash...")
Global $Edit = GUISetControl("edit", "Blah" & @TAB & "Okay" & @TAB & "done", 10,10)
GuiShow()

While GUIMsg(0) <> -3
   sleep(100)
Wend
Exit

Func setTabs()
   GUISendMsg( $Edit, $EM_SETTABSTOPS, 1, 5)
EndFunc

Hey, if I use GuiRevcMsg, then I can set a tab size of zero! Most other varitions crash, still: GUIRecvMsg( $Edit, $EM_SETTABSTOPS, 1, 2)

Edited by CyberSlug
Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Link to comment
Share on other sites

hey, I want know:

-Is there any way to initialize the Form with another TAB? (not the first)

e.g.: "TAB#2"  :huh2:

A different tab question :D

josbe, try adding the following code to the GuiTAB.au3 example file (provided with autoit-gui.102.17):

; The previous line was a GUISetControlEx

GUIShow()
ControlCommand("","", "SysTabControl321", "TabRight", "" ) 

; The very next line contains the While GuiMsg

The GUI Should display with Tab #2 open. Is that what you want?

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Link to comment
Share on other sites

Ups... Thanks jpm, seems it works, but... why if I have more than one input control on the form, they all accept files? It's possibly to have only certain controls will accept files? Or block this on unneeded?

BTW Code I posted yesterday was really stupid... sorry if this was unclear. Copy'n'paste... not the best day :huh2:

I know it is not so good but it is better than nothing. I need to think a way to restrict/ allow :D
Link to comment
Share on other sites

Two questions:

1)  Am I doing something stupid again?  I am trying to send the EM_SETTABSTOPS message, but I get a crash!  The parameters look okay.

2)  Is re-drawing the GUI possible?  According to Microsoft: "The EM_SETTABSTOPS message does not automatically redraw the edit control window. If the application is changing the tab stops for text already in the edit control, it should call the InvalidateRect function to redraw the edit control window."

Global $EM_SETTABSTOPS = 0xCB
HotKeySet("{Pause}", "setTabs")

GUICreate("Press Pause to Crash...")
Global $Edit = GUISetControl("edit", "Blah" & @TAB & "Okay" & @TAB & "done", 10,10)
GuiShow()

While GUIMsg(0) <> -3
   sleep(100)
Wend
Exit

Func setTabs()
   GUISendMsg( $Edit, $EM_SETTABSTOPS, 1, 5)
EndFunc

Hey, if I use GuiRevcMsg, then I can set a tab size of zero!  Most other varitions crash, still:  GUIRecvMsg( $Edit, $EM_SETTABSTOPS, 1, 2)

The implementation support integer or string as param not array of tabs so you cannot use the EM_SETTABSTOPS :D
Link to comment
Share on other sites

hey, I want know:

-Is there any way to initialize the Form with another TAB? (not the first)

e.g.: "TAB#2"  :huh2:

102.17C (not yet uploaded) has implementation for selecting first tab

GuiSetControl("tabitem",...

GuiSetControlEx(-1,$GUI_SHOW)

:D

Link to comment
Share on other sites

@jpm: In addition to my crash problem on the previous page, I have this question:

GuiRead seems to be limited to 32766 bytes.  Could it be increased to 65535 bytes?

Is it read too small? :huh2:

I hate to increase for increasing :D

Link to comment
Share on other sites

@jpm: I know an array can't be used. BUT

Am I not understanding Microsof't docs?

"If the wParam parameter is 1, this (lParam) parameter is a pointer to an unsigned integer containing the distance between all tab stops" :D

EDIT: About increasing GuiRead:

$EM_LIMITTEXT lets me increase the size to 65535, and this is supported by all versions of windows, so it would be nice. Currently, AutoPad could contain a buffer of 65535, but I'm unable to save a file that big using GuiRead and FileWrite....

Edited by CyberSlug
Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Link to comment
Share on other sites

@jpm:  I know an array can't be used.  BUT

Am I not understanding Microsof't docs?

"If the wParam parameter is 1, this (lParam) parameter is a pointer to an unsigned integer containing the distance between all tab stops" :D

EDIT:  About increasing GuiRead:

$EM_LIMITTEXT lets me increase the size to 65535, and this is supported by all versions  of windows, so it would be nice.  Currently, AutoPad could contain a buffer of 65535, but  I'm unable to save a file that big using GuiRead and FileWrite....

no problem for limits

I have a look at Ms doc on the tabs stuff

Link to comment
Share on other sites

josbe, try adding the following code to the GuiTAB.au3 example file (provided with autoit-gui.102.17):

; The previous line was a GUISetControlEx

GUIShow()
ControlCommand("","", "SysTabControl321", "TabRight", "" ) 

; The very next line contains the While GuiMsg

The GUI Should display with Tab #2 open.  Is that what you want?

Thxs, I try this, but I actually use in my form, TAB with flat buttons, and not work. :D

102.17C (not yet uploaded) has implementation for selecting first tab

GuiSetControl("tabitem",...

GuiSetControlEx(-1,$GUI_SHOW)

@jpm: Thxs for the update. :huh2:
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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...