telmob Posted January 3, 2013 Share Posted January 3, 2013 I have a list (guictrlcreatelist) with some files in it, but sometimes the paths get too big and i can't see them completely in the list. Is there any command to show the file paths like a marquee or in a tooltip? Link to comment Share on other sites More sharing options...
UEZ Posted January 3, 2013 Share Posted January 3, 2013 Use GUICtrlCreateListView() instead. Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
PhoenixXL Posted January 3, 2013 Share Posted January 3, 2013 This sets tip OnSelexpandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiListBox.au3> #include <WinAPI.au3> Opt('MustDeclareVars', 1) Global $mylist Example() Func Example() Local $MESSAGE = "The following buttons have been clicked" Local $add, $clear, $close, $msg GUICreate("My GUI list") ; will create a dialog box that when displayed is centered $add = GUICtrlCreateButton("Add", 64, 32, 75, 25) $clear = GUICtrlCreateButton("Clear", 64, 72, 75, 25) $mylist = GUICtrlCreateList("buttons that have been clicked", 176, 32, 121, 97) $close = GUICtrlCreateButton("my closing button", 64, 160, 175, 25) GUIRegisterMsg( $WM_COMMAND, 'WM_COMMAND' ) GUISetState() $msg = 0 While $msg <> $GUI_EVENT_CLOSE $msg = GUIGetMsg() Select Case $msg = $add GUICtrlSetData($mylist, "You clicked button No1|") Case $msg = $clear GUICtrlSetData($mylist, "") Case $msg = $close MsgBox(0, "", "the closing button has been clicked", 2) Exit EndSelect WEnd EndFunc ;==>Example Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam) Local $nCode = _WinAPI_HiWord( $wParam ) Switch $nCode Case $LBN_KILLFOCUS GUICtrlSetTip( $mylist, '' ) Case $LBN_SELCHANGE GUICtrlSetTip( $mylist, GUICtrlRead( $mylist ) ) EndSwitch EndFunc My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression. Link to comment Share on other sites More sharing options...
telmob Posted January 3, 2013 Author Share Posted January 3, 2013 (edited) Use GUICtrlCreateListView() instead.Br,UEZThanks for your reply.Unfortunately, not what i was looking for. Its not very practical.This sets tip OnSelBetter, but still... if i have multiple files and i click on one, even if i clicks on an empty space, the tip remains everytime i hover the list. These examples are great, but they just don't feel natural.Please don't think i'm ungrateful, its just that I thought this was a common/known behaviour possible in autoit, guess i was wrong... Edited January 3, 2013 by telmob Link to comment Share on other sites More sharing options...
PhoenixXL Posted January 3, 2013 Share Posted January 3, 2013 I am just trying to make a function on such calculations using _guictrllistbox_itemfrompoint will post the results My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression. Link to comment Share on other sites More sharing options...
telmob Posted January 3, 2013 Author Share Posted January 3, 2013 (edited) Cool! I really apreciate it. Oh, maybe this is possible with GuiGetCursorInfo...? Edit: WAIT!!! Found the solution here: Edited January 3, 2013 by telmob Link to comment Share on other sites More sharing options...
PhoenixXL Posted January 4, 2013 Share Posted January 4, 2013 (edited) Without GUIGetCursorInfo expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiListBox.au3> #include <WinAPI.au3> Opt('MustDeclareVars', 1) Global $mylist, $hGUI AdlibRegister('TimerFunc', 20) Example() Func Example() Local $MESSAGE = "The following buttons have been clicked" Local $add, $clear, $close, $msg GUICreate("My GUI list") ; will create a dialog box that when displayed is centered $add = GUICtrlCreateButton("Add", 64, 32, 75, 25) $clear = GUICtrlCreateButton("Clear", 64, 72, 75, 25) GUICtrlCreateList("buttons that have been clicked", 176, 32, 121, 97) $mylist = GUICtrlGetHandle(-1) $close = GUICtrlCreateButton("my closing button", 64, 160, 175, 25) GUISetState() $msg = 0 While $msg <> $GUI_EVENT_CLOSE $msg = GUIGetMsg() Select Case $msg = $add GUICtrlSetData($mylist, "You clicked button No1|") Case $msg = $clear GUICtrlSetData($mylist, "") Case $msg = $close MsgBox(0, "", "the closing button has been clicked", 2) Exit EndSelect WEnd EndFunc ;==>Example Func GetIndexofListBoxHovered($hWnd) Local $iIndex = _GUICtrlListBox_ItemFromPoint($hWnd, _ _WinAPI_GetMousePosX(True, $hWnd), _WinAPI_GetMousePosY(True, $hWnd)) Return $iIndex EndFunc ;==>GetIndexofListBoxHovered Func TimerFunc() Local $iIndex = GetIndexofListBoxHovered($mylist) If $iIndex < 0 Then Return ToolTip('') ToolTip(_GUICtrlListBox_GetText($mylist, $iIndex)) EndFunc ;==>TimerFunc Edited January 4, 2013 by PhoenixXL My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression. Link to comment Share on other sites More sharing options...
UEZ Posted January 4, 2013 Share Posted January 4, 2013 @PhoenixXL: nice idea! Modified your code to avoid flickering when Tooltip is displayed: expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiListBox.au3> #include <WinAPI.au3> Opt('MustDeclareVars', 1) Global $mylist, $hGUI AdlibRegister('TimerFunc', 50) Example() Func Example() Local $MESSAGE = "The following buttons have been clicked" Local $add, $clear, $close, $msg GUICreate("My GUI list") ; will create a dialog box that when displayed is centered $add = GUICtrlCreateButton("Add", 64, 32, 75, 25) $clear = GUICtrlCreateButton("Clear", 64, 72, 75, 25) GUICtrlCreateList("buttons that have been clicked", 176, 32, 121, 97) GUICtrlSetData(-1, "this is another line which is larger than the list box") $mylist = GUICtrlGetHandle(-1) $close = GUICtrlCreateButton("my closing button", 64, 160, 175, 25) GUISetState() $msg = 0 While $msg <> $GUI_EVENT_CLOSE $msg = GUIGetMsg() Select Case $msg = $add GUICtrlSetData($mylist, "You clicked button No1|") Case $msg = $clear GUICtrlSetData($mylist, "") Case $msg = $close MsgBox(0, "", "the closing button has been clicked", 2) Exit EndSelect WEnd EndFunc ;==>Example Func TimerFunc() Local Static $iMPosX_old, $iMPosY_old Local $iMPosX = _WinAPI_GetMousePosX(True, $mylist), $iMPosY = _WinAPI_GetMousePosY(True, $mylist) Local $iIndex = _GUICtrlListBox_ItemFromPoint($mylist, $iMPosX, $iMPosY) If $iIndex < 0 Then Return ToolTip('') If $iMPosX_old <> $iMPosX Or $iMPosY_old <> $iMPosY Then ToolTip(_GUICtrlListBox_GetText($mylist, $iIndex)) $iMPosX_old = $iMPosX $iMPosY_old = $iMPosY EndIf EndFunc ;==>TimerFunc Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
PhoenixXL Posted January 4, 2013 Share Posted January 4, 2013 (edited) Setting the Index number as the static variable is more efficient ( I believe ) In turn it keeps the ToolTip in one place expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiListBox.au3> #include <WinAPI.au3> Opt('MustDeclareVars', 1) Global $mylist, $hGUI AdlibRegister('TimerFunc', 50) Example() Func Example() Local $MESSAGE = "The following buttons have been clicked" Local $add, $clear, $close, $msg GUICreate("My GUI list") ; will create a dialog box that when displayed is centered $add = GUICtrlCreateButton("Add", 64, 32, 75, 25) $clear = GUICtrlCreateButton("Clear", 64, 72, 75, 25) GUICtrlCreateList("buttons that have been clicked", 176, 32, 121, 97) GUICtrlSetData(-1, "this is another line which is larger than the list box") $mylist = GUICtrlGetHandle(-1) $close = GUICtrlCreateButton("my closing button", 64, 160, 175, 25) GUISetState() $msg = 0 While $msg <> $GUI_EVENT_CLOSE $msg = GUIGetMsg() Select Case $msg = $add GUICtrlSetData($mylist, "You clicked button No1|") Case $msg = $clear GUICtrlSetData($mylist, "") Case $msg = $close MsgBox(0, "", "the closing button has been clicked", 2) Exit EndSelect WEnd EndFunc ;==>Example Func TimerFunc() Local Static $iIndex_old = -1 Local $iIndex = _GUICtrlListBox_ItemFromPoint($mylist, _WinAPI_GetMousePosX(True, $mylist), _WinAPI_GetMousePosY(True, $mylist)) If $iIndex < 0 Then $iIndex_old = -1 Return ToolTip('') EndIf If $iIndex = $iIndex_old Then Return ToolTip(_GUICtrlListBox_GetText($mylist, $iIndex)) $iIndex_old = $iIndex EndFunc ;==>TimerFunc Edited January 4, 2013 by PhoenixXL My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression. Link to comment Share on other sites More sharing options...
UEZ Posted January 4, 2013 Share Posted January 4, 2013 The disadvantage is when you move the mouse the ToolTip doesn't move. Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
PhoenixXL Posted January 4, 2013 Share Posted January 4, 2013 i regarded it as an advantage instead My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression. Link to comment Share on other sites More sharing options...
telmob Posted January 5, 2013 Author Share Posted January 5, 2013 First of all, thank you both for your hard work.i regarded it as an advantage instead Also agree. Really nice Link to comment Share on other sites More sharing options...
PhoenixXL Posted January 8, 2013 Share Posted January 8, 2013 Updated a bit so that short strings dont create a tooltip the calculations are still approximate..expandcollapse popup#include <GUIConstantsEx.au3> #include <GuiListBox.au3> #include <WinAPI.au3> Opt('MustDeclareVars', 1) Global $mylist, $hGUI, $iWidth = 100 Example() Func Example() Local $MESSAGE = "The following buttons have been clicked" Local $add, $clear, $close, $msg GUICreate("My GUI list", 120, 200) ; will create a dialog box that when displayed is centered GUICtrlCreateList("Hello", 10, 10, $iWidth, 180, 0) GUICtrlSetData(-1, "there this is a Long String|n ds is a short 1..ZX") $mylist = GUICtrlGetHandle(-1) GUISetState() Local $nMsg = GUIGetMsg() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE, $GUI_EVENT_SECONDARYDOWN GUIDelete() ExitLoop Case $GUI_EVENT_MOUSEMOVE TimerFunc() EndSwitch Sleep ( 10 ) WEnd EndFunc ;==>Example Func TimerFunc() Static $iIndex_old = -1 Local $iIndex = _GUICtrlListBox_ItemFromPoint($mylist, _WinAPI_GetMousePosX(True, $mylist), _WinAPI_GetMousePosY(True, $mylist)) Local $sText = _GUICtrlListBox_GetText( $mylist, $iIndex ) Local $iLen = TextIsSmallThanList( _WinAPI_GetDC( $mylist ), $sText, $iWidth) If $iIndex < 0 Or $iLen Then $iIndex_old = -1 Return ToolTip('') EndIf If $iIndex = $iIndex_old Then Return ToolTip( $sText ) $iIndex_old = $iIndex EndFunc ;==>TimerFunc ;Returns Approximate values - which causes to show ToolTip when very just close... Func TextIsSmallThanList( $hDc, $sString, $nMaxExtent ) Local $Size_Struct = DllStructCreate( $tagSIZE ) Local $aRet = DllCall( 'Gdi32.dll', 'int', 'GetTextExtentPoint32W', _ 'hwnd', $hDc, _ 'str', $sString , _ 'int', StringLen( $sString ), _ 'ptr', DllStructGetPtr( $Size_Struct ) ) If @error Or Not $aRet[0] Then Return SetError( 1, @error, $aRet[0] ) Return DllStructGetData($Size_Struct,1) < $nMaxExtent EndFunc My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression. Link to comment Share on other sites More sharing options...
AndreyS Posted September 7, 2013 Share Posted September 7, 2013 I am sincerely grateful for the fact that I paid attention to the issue of PhoenixXL! Let me show you what I need, ideally! It may seem even more on the Edit control but the difference is that the elements should not be changed, and when you click anywhere on the item, it should select the whole - with all its strings. Can you as a specialist have any idea how to do this? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 7, 2013 Moderators Share Posted September 7, 2013 AndreyS,I would suggest using a label to hold each string and using my Scrollbars UDF to show them within the window. There are some of my previous examples of this idea on the forum if you search. 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 Link to comment Share on other sites More sharing options...
AndreyS Posted September 7, 2013 Share Posted September 7, 2013 Oh! Thank you! I rush to the search! Link to comment Share on other sites More sharing options...
PhoenixXL Posted September 7, 2013 Share Posted September 7, 2013 When it comes to SRE or Edit controls I can probably help. I will soon reply you >here, for this topic has nothing to do with what you want now Regards My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression. Link to comment Share on other sites More sharing options...
AndreyS Posted September 7, 2013 Share Posted September 7, 2013 PhoenixXL, but that's not what I need! I need to control the displayed items completely, and did not derive them in the tooltip. Link to comment Share on other sites More sharing options...
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