Sign in to follow this  
Followers 0
Lakes

Edit Box Problem

6 posts in this topic

I am sending single text lines to the edit box, so the length of the string should not be an issue, as its always reset when the next line is read, however after a certain number of lines have been sent to the text box, it stops updating.

Is this limit set by STRBUFFER or WINTEXTBUFFER and is there any way to increase it?

Using GUICntrlSetData to send the string clears the edit box, which is not what I want.

I know the text string itself is fine as I can send this to a Label and this continues to update after the Edit Box stops.

I could setup a rolling "window" of text to send to the edit box as a work around, but I would prefer to have a way of increasing the Edit Box buffer size...

I have downloaded the latest beta.

Thanks!


2015 - Still no flying cars, instead blankets with sleeves.

Share this post


Link to post
Share on other sites



I am sending single text lines to the edit box, so the length of the string should not be an issue, as its always reset when the next line is read, however after a certain number of lines have been sent to the text box, it stops updating.

Is this limit set by STRBUFFER or WINTEXTBUFFER and is there any way to increase it?

Using GUICntrlSetData to send the string clears the edit box, which is not what I want.

I know the text string itself is fine as I can send this to a Label and this continues to update after the Edit Box stops.

I could setup a rolling "window" of text to send to the edit box as a work around, but I would prefer to have a way of increasing the Edit Box buffer size...

I have downloaded the latest beta.

Thanks!

Could post some code? Just a short, specific example of what doesn't work for you. :)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Could post some code? Just a short, specific example of what doesn't work for you. :)

Example Code:

#include <GUIConstants.au3>

; == GUI generated with Koda ==);

$TestEditBox = GUICreate("Test Edit Box", 405, 507, 190, 153)
$Testedit = GUICtrlCreateEdit("", 8, 8, 386, 457, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN,$WS_GROUP,$WS_HSCROLL,$WS_VSCROLL))

$CurrLine = GUICtrlCreateLabel("Current Line", 8, 480, 377, 17, $WS_GROUP)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")


GUISetState(@SW_SHOW)

$Count = 0
$String = "The Quick Brown Fox Jumped Over the Lazy Moon"


GUISetState(@SW_SHOW)

While 1
   $msg = GUIGetMsg()
   Select
      Case $msg = $GUI_EVENT_CLOSE
         GUIDelete()
         Exit
   EndSelect

 For $i = 1 to 1000
    ControlSend($TestEditBox, "", $TestEdit, $Count &" " &$String &"{ENTER}")
    GUICtrlSetData ($CurrLine, $Count)
        $Count = $Count +1
 Next   
    
WEnd

Edit Box line count stops at 590 while the Title count keeps updating (just to show that the script is still running).

Btw, why does this script use 80% processor time?

Edited by Lakes

2015 - Still no flying cars, instead blankets with sleeves.

Share this post


Link to post
Share on other sites

For $i = 1 to 1000
    ControlSend($TestEditBox, "", $TestEdit, $Count &" " &$String &"{ENTER}")
    GUICtrlSetData ($CurrLine, $Count)
        $Count = $Count +1
 Next

Btw, why does this script use 80% processor time?

that runs everytime thru the mainloop

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

that runs everytime thru the mainloop

That was an OOPS due to deleting other parts of the code to make this example...

Here`s the edit..

#include <GUIConstants.au3>

; == GUI generated with Koda ==);

$TestEditBox = GUICreate("Test Edit Box", 405, 507, 190, 153)
$Testedit = GUICtrlCreateEdit("", 8, 8, 386, 457, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN,$WS_GROUP,$WS_HSCROLL,$WS_VSCROLL))

$CurrLine = GUICtrlCreateLabel("Current Line", 8, 480, 377, 17, $WS_GROUP)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")


GUISetState(@SW_SHOW)

$Count = 0
$String = "The Quick Brown Fox Jumped Over the Lazy Moon"

GUISetState(@SW_SHOW)

 For $i = 1 to 1000
    ControlFocus ( $TestEditBox, "", $TestEdit )
    ControlSend($TestEditBox, "", $TestEdit, $Count &" " &$String &"{ENTER}")

    GUICtrlSetData ($CurrLine, $Count)
    $Count = $Count +1
 Next   

Exit

Still uses 80 % processor time while executing the loop, but never mind, its the Edit Box problem I need a solution to..


2015 - Still no flying cars, instead blankets with sleeves.

Share this post


Link to post
Share on other sites

Work around code....

#include <GUIConstants.au3>

; == GUI generated with Koda ==);

$TestEditBox = GUICreate("Test Edit Box", 405, 507, 190, 153)
$Testedit = GUICtrlCreateEdit("", 8, 8, 386, 457, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN,$WS_GROUP,$WS_HSCROLL,$WS_VSCROLL))

$CurrLine = GUICtrlCreateLabel("Current Line", 8, 480, 377, 17, $WS_GROUP)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")


GUISetState(@SW_SHOW)

$Count = 0
$String = "The Quick Brown Fox Jumped Over the Lazy Moon"
$NotePad = "Untitled - Notepad"
$NPad = "Edit1"

Run("notepad.exe")

GUISetState(@SW_SHOW)

 For $i = 1 to 2000
    $Line = ControlCommand($TestEditBox, "", $TestEdit,"GetLineCount", "")
    If $Line = 500 then GUICtrlSetData ( $TestEdit, $i)
    ControlFocus ( $TestEditBox, "", $TestEdit )
    ControlCommand($TestEditBox, "", $TestEdit, "EditPaste", $i &" " &$String)
    ControlSend($TestEditBox, "", $TestEdit, "{ENTER}")
    ControlCommand($NotePad, "", $NPad, "EditPaste", $i &" " &$String)
    ControlSend($NotePad, "", $NPad, "{ENTER}")
    GUICtrlSetData ($CurrLine, $i)
 Next   

Exit

You could use filewrite instead of running notepad.

In this example I have reset the EditBox at line 500, to be more accurate on detecting the EditBox limit, do a character count using StringLen and then reset the EditBox.


2015 - Still no flying cars, instead blankets with sleeves.

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