Zip Posted January 23, 2011 Share Posted January 23, 2011 This is great, thanks a lot ! Link to comment Share on other sites More sharing options...
mistersquirrle Posted January 23, 2011 Share Posted January 23, 2011 This is great, and I'm using it in a script that is making labels with array variables (so that I can clean it up easily), but since it returns an array, it acts weird. I don't really know how to explain it, but I wrote this example code. I don't know what to do about it, short of just using a normal variable... To me, it seems like it's create $Label[0] as a variable, and not a variable with an array... #include-once #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include "GUICtrlCreateTFLabel.au3" #include <Array.au3> Global $Label1[3] $Form1 = GUICreate("asdf", 617, 441, 192, 124) $Label1[0] = _GUICtrlCreateTFLabel("LABEL!", 56, 80) $Label2 = GUICtrlCreateLabel("Try to show a msgbox with $Label1[0][1] as the text... (click this)" & @CRLF & @CRLF & "I just figured that this should be the format ( $label1[0][1]) since $label1[0] has an array attached to it...", 56, 120) GUICtrlSetBkColor(-1, 0x000000) GUICtrlSetColor(-1, 0xffffff) GUISetState(@SW_SHOW) _ArrayDisplay($Label1, "$Label1 display") _ArrayDisplay($Label1[0], "$Label1[0] display") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Label2 MsgBox(0, '', $Label1[0][1]) EndSwitch WEnd We ought not to misbehave, but we should look as though we could. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 23, 2011 Moderators Share Posted January 23, 2011 mistersquirrle,In your script, you are declaring an array $Label1[3] and then placing the array returned from the UDF into the first element of that array when you use:$Label1[0] = _GUICtrlCreateTFLabel("LABEL!", 56, 80)This means that you now have an array within an array! AutoIt does not forbid this, but there is no way to read the internal array without extracting it or specifically addressing it - after all AutoIt cannot be expected to read your mind and know that you have an array as an element of another array. So when you try to examine the content of the arrays here:_ArrayDisplay($Label1, "$Label1 display") _ArrayDisplay($Label1[0], "$Label1[0] display")you get what appears to be an empty array $Label1. This is because AutoIt cannot display the internal array within the [0] element as part of the _ArrayDisplay dialog. But it is there, as you can see fron the second _ArrayDisplay dialog which correctly displays the contents of the internal array when directly it is addressed. But what you cannot do is use:MsgBox(0, '', $Label1[0][1])to try and extract the elements of the internal array directly. The syntax you are using is for a 2D array - not an array within an array. As I explained above you need to extract the internal array like this:$aTemp = $Label1[0] MsgBox(0, '', $aTemp[1])which will then correctly display the ControlID of the UDF created label. Does that explain what you are seeing? Please ask again if not. 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...
mistersquirrle Posted January 23, 2011 Share Posted January 23, 2011 Yes, Melba, that's great I didn't really think of that. I knew that it was something like that but I didn't know how to say it or what I should've done. Thanks for the help, almost every time I've had a problem on these forums, you've been there to help keep up the good work We ought not to misbehave, but we should look as though we could. Link to comment Share on other sites More sharing options...
MrCreatoR Posted June 23, 2011 Author Share Posted June 23, 2011 (edited) Update!History version:v1.4* Fixed issue when bkcolor parameter was recognized as color. It was causing bugs with correct label color displaying.* Improved width and height corrections for the output label(s).+ Added String Compare Example.Check the first post. Edited June 23, 2011 by MrCreatoR  Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1  AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ==================================================    AutoIt is simple, subtle, elegant. © AutoIt Team Link to comment Share on other sites More sharing options...
FireFox Posted June 23, 2011 Share Posted June 23, 2011 Nice... 5* Br, FireFox. Link to comment Share on other sites More sharing options...
MrCreatoR Posted June 3, 2012 Author Share Posted June 3, 2012 New version:v1.5* UDF renamed to GUITFLabel.au3.* _GUICtrlCreateTFLabel renamed to _GUICtrlTFLabel_Create, old function names still supported for backward compatibility.* Fixed few issues with text alignment.  Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1  AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ==================================================    AutoIt is simple, subtle, elegant. © AutoIt Team Link to comment Share on other sites More sharing options...
Zedna Posted June 3, 2012 Share Posted June 3, 2012 Very nice!! Resources UDF Â ResourcesEx UDF Â AutoIt Forum Search Link to comment Share on other sites More sharing options...
MrCreatoR Posted July 12, 2012 Author Share Posted July 12, 2012 Related (transformed) UDF:  Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1  AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ==================================================    AutoIt is simple, subtle, elegant. © AutoIt Team Link to comment Share on other sites More sharing options...
Raupi Posted July 13, 2012 Share Posted July 13, 2012 (edited) Hi. Is there a way to evaluate a click on the label. In GUITFLabel UDF you can check the click by GUIGetMsg. The other UDF has the disadvantage, that the text is not displayed transparent on a background-image. In this UDF the Labele looks great, the background is transparent. Btw, Good work, I like both UDF's Sorry for the eventual bad englisch, it was Powered by Google Edited July 13, 2012 by Raupi Link to comment Share on other sites More sharing options...
MrCreatoR Posted July 13, 2012 Author Share Posted July 13, 2012 Hi.Is there a way to evaluate a click on the label.In GUITFLabel UDF you can check the click by GUIGetMsg.The other UDF has the disadvantage, that the text is not displayed transparent on a background-image.In this UDF the Labele looks great, the backgrount is transparent.Hi,The GUIRichLabel UDF does have transparent background, and yes, clicks and mouse event (such as showing different cursors) not supported there yet, but i working on this issue.Thanks for the feedbacks.  Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1  AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ==================================================    AutoIt is simple, subtle, elegant. © AutoIt Team Link to comment Share on other sites More sharing options...
Raupi Posted July 13, 2012 Share Posted July 13, 2012 Hi,The GUIRichLabel UDF does have transparent background, and yes, clicks and mouse event (such as showing different cursors) not supported there yet, but i working on this issue.Thanks for the feedbacks.Ups, sorry. I have posted in the wrong thread >_<There should be post:That's what you get, when too many tabs are open. Link to comment Share on other sites More sharing options...
Cybernetic Posted June 10, 2013 Share Posted June 10, 2013 (edited) How does this work when you attempt to do: Guictrlsetdata($existinglabel, _guictrltflabel_create('<font color="Red">Lovely Text</font>', 0, 0) & "more normal text") sorry if the syntax is incorrect, but the coloured text will appear at the top of the GUI with the 0,0 markers, not on the $existinglabel. Does this also work with single item text in a listview control? Thanks, Edited June 10, 2013 by Cybernetic Link to comment Share on other sites More sharing options...
ESATU Posted September 22, 2013 Share Posted September 22, 2013 1st, This is great, thanks a lot ! But, in one line text with multi-colored and multi-size font, how to align the text with "BitOr($SS_CENTER,$SS_CENTERIMAGE)" to center it in GUI. I have tried many times but still doesn't work. 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