Terenz Posted February 5, 2014 Posted February 5, 2014 Hello, is hard to examplain so i'll do it with images: In a ListView you have a colum with a text: If you make the column smaller then the text the three dots appear: "My very long item" and the ... and "about AUTOIT!" is hidden So the question is, is possible to "hide" the text on the left side instead on the right side, like the image? "My very long item" is hidden, the ... and you can see "about AUTOIT!" Thanks for all the help Nothing is so strong as gentleness. Nothing is so gentle as real strength
Moderators Melba23 Posted February 5, 2014 Moderators Posted February 5, 2014 Terenz,Adding the $WS_EX_LAYOUTRTL extended style to the ListView does that - but it also reverses the entire ListView so you will have to change the column order. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Terenz Posted February 5, 2014 Author Posted February 5, 2014 Melba thanks but doesn't seem like i have asked, the dots are always on the right side: Nothing is so strong as gentleness. Nothing is so gentle as real strength
Moderators Melba23 Posted February 5, 2014 Moderators Posted February 5, 2014 Terenz,It works when I add that extended style or I would not have suggested it. Please post the code you are using so I perhaps can why it is not working for you. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Terenz Posted February 5, 2014 Author Posted February 5, 2014 (edited) #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <WindowsConstants.au3> #include <GuiListView.au3> $Form = GUICreate("Form1", 443, 291, 197, 150) $ListView = GUICtrlCreateListView("MYCAPTION", 8, 8, 289, 201, -1, $WS_EX_LAYOUTRTL) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 100) GUICtrlCreateListViewItem("My very long item about AUTOIT!", $ListView) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Edited February 5, 2014 by Terenz Nothing is so strong as gentleness. Nothing is so gentle as real strength
Moderators Melba23 Posted February 5, 2014 Moderators Posted February 5, 2014 Terenz,This is what I get: But looking more closely I see that you still do not get the part of the text that you require. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
BrewManNH Posted February 5, 2014 Posted February 5, 2014 That's normal Windows behavior, there's no DT_START_ELLIPSIS constant that would control that. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator
Terenz Posted February 5, 2014 Author Posted February 5, 2014 Ok, i know is the normal behavor but do you think guys is possible or not? Nothing is so strong as gentleness. Nothing is so gentle as real strength
Moderators Melba23 Posted February 5, 2014 Moderators Posted February 5, 2014 Terenz,No, I do not believe that it is.* I think you had best rewrite the text to get the part you want to see at the beginning. M23* Just sticking my neck out so someone can come along and prove me wrong! Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
BrewManNH Posted February 5, 2014 Posted February 5, 2014 Anything is possible, the question becomes how much effort are you willing to put in to make it. You can constantly monitor the column width with _GUICtrlListView_GetColumnWidth, get the text's width with StringLen, and when the StringLen is longer than the column width, completely redraw your listview with item text formatted the way you'd like it. Although, I'd think it would be terribly glitchy and would probably flicker like crazy if not done correctly. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator
Terenz Posted February 5, 2014 Author Posted February 5, 2014 The problem is i can really "cut" the text because i need it in the entire way, but for a "matter of readability" if i can see the last part instead of all the text is better. Thanks to both for the suggestion Nothing is so strong as gentleness. Nothing is so gentle as real strength
Moderators Melba23 Posted February 5, 2014 Moderators Posted February 5, 2014 Terenz,Add another hidden column to the ListView which contains the entire text and then you can just display a partial text in the visible column: #include <GUIConstantsEx.au3> #include <GuiListView.au3> $sFullText = "My very long item about AutoIt" $sShortText = "..." & StringRight($sFullText, 7) $Form = GUICreate("Form1", 443, 291, 197, 150) $ListView = GUICtrlCreateListView("MYCAPTION|My very long item about AutoIt", 8, 8, 289, 201) GUICtrlCreateListViewItem($sShortText & "|" & $sFullText, $ListView) $cButton = GUICtrlCreateButton("Read item", 10, 250, 80, 30) GUISetState(@SW_SHOW) ; Hide extra column _GUICtrlListView_HideColumn($ListView, 1) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $cButton ; But you can still read it MsgBox($MB_SYSTEMMODAL, "Read", _GUICtrlListView_GetItemText($ListView, 0, 1)) EndSwitch WEndGood enough? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now