Jump to content

TreeView & ListView 260 char string limit


EvilEd
 Share

Recommended Posts

I have a feeling the answer is no, but I'm hopeful there is a workaround. Is there a workaround for the TreeView & ListView controls 260 character string limit? I know they store more than 260 characters, but they only display 260. I would rather have the TreeView working, but will settle for ListView.

I have searched here and google without success.

Thanks

Ed

Link to comment
Share on other sites

Thanks!

Here is a sample:

#Include <String.au3>
#include <GuiTreeView.au3>
#include <GuiConstantsEx.au3>
#include <EditConstants.au3>
#include <WindowsConstants.au3>

Opt("GUIOnEventMode", 1)

$GUI = GUICreate("Testing TreeView 260 char text display limit", 500, 420)
GUISetOnEvent($GUI_EVENT_CLOSE, "dlgTabbedClose")

;$ListView = GUICtrlCreateListView("Results", 20, 100, 460, 220, $LVS_SORTASCENDING)
;$ListView = GUICtrlCreateListView("Results" & _StringRepeat(" ", 350), 20, 100, 460, 220, $LVS_SORTASCENDING)
;$ListView = _GUICtrlListView_Create($GUI, "Results", 20, 100, 460, 220)
;$hTreeView = GUICtrlCreateTreeView(20, 100, 460, 220, BitOR($TVS_EDITLABELS, $TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS, $TVS_CHECKBOXES), $WS_EX_CLIENTEDGE)
$hTreeView = _GUICtrlTreeView_Create($GUI, 20, 100, 460, 100)

$txtOutput = GUICtrlCreateEdit("Results", 20, 250, 460, 100, $ES_READONLY + $ES_MULTILINE + $ES_WANTRETURN + $ES_AUTOHSCROLL + $ES_AUTOVSCROLL + $WS_VSCROLL + $WS_HSCROLL)
$btnExit = GUICtrlCreateButton("Exit", 20, 370, 60, 20)
GUICtrlSetOnEvent(-1, "btnExitClick")

GUISetState(@SW_SHOW, $GUI)

    Local $msg, $text
    $msg = _StringRepeat("1234567890", 25) & "abcdefghijklmnopqrstuvwxyz"

    $hItem = _GUICtrlTreeView_Add($hTreeView, 0, "TreeView can't display over 260 chars:")

    $TestItem = _GUICtrlTreeView_AddChild($hTreeView, $hItem, $msg)
;$TestItem = _GUICtrlTreeView_InsertItem($hTreeView, $msg, $hItem)

    $text = _GUICtrlTreeView_GetText($hTreeView, $TestItem)
    GUICtrlSetData($txtOutput, "But it does save the whole string:" & @CRLF & $text)

    _GUICtrlTreeView_SelectItem($hTreeView, $TestItem)

While 1 = 1
    Sleep(100)
WEnd
Exit

Func btnExitClick()
    exit
EndFunc
Func dlgTabbedClose()
    exit
EndFunc

As far as I can tell, this is a Windows limit to the TreeView and ListView controls that AutoIt accesses.

Link to comment
Share on other sites

EvilEd

Seems this is the visual/showing limit, because below code returns a correct length of the string:

$text = _GUICtrlTreeView_GetText($hTreeView, $TestItem)
MsgBox(0, "String Length", StringLen($text))

:mellow:

Yes, that is correct. I'm sorry if I didn't explain it correctly, I thought I said that in my first message and made sure my example code points that out. I should have explained that the editbox under the treeview is actually reading the treeview control and has the full string past 260 chars. I'm hoping there is some way around this display limit. I'm thinking it will be confusing for people to view a string of 300 characters and only see 260 of it. As far as I can tell, it sounds like the limit is from Windows and not AutoIt3. I kinda doubt there is a way around this unless someone has written a similar control that doesn't rely on the Windows control. I hope I said that correctly... I'm pretty tired.

I thank you for taking the time to look at it. Any help would be greatly appreciated.

Ed

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...