Armag3ddon Posted February 19, 2012 Share Posted February 19, 2012 Hi everyone I'm going crazy here. Over and over again I run into difficulties because the UDFs for gui creation and the regular gui creation functions of AutoIT apparently don't do the same. This is really freaking me out.The first thing I mentioned was that whenever I use a _GUICtrlX_Create() function I simply can't use GUICtrlSetOnEvent on it! This is a huge disadvantage when using OnEventMode (everything else would be horrible in my case).Now I wanted to use the the following script in my GUI because hey! it's useful and stuff: But Authenticity uses GUICtrlCreateTreeView and GUICtrlCreateTreeViewItem in his example and after hours of enraged testing I found out that this was for a reason: the whole thing doesn't work with _GUICtrlTreeView_AddChild!So by now I really came to hate the UDFs. Is there any way to make up these weird behaviour? I don't want to change everything again and again whenever I encounter a feature that requires the one or the other creation process Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 19, 2012 Moderators Share Posted February 19, 2012 Armag3ddon,You must be writing some very complex code if this causes you so much angst. Remember that the native Autoit GUICtrlCreate* functions make AutoIt do a lot of the normal housekeeping duties that you would otherwise have to code yourself - hiding the elements on different tabs for example. The various GUICtrl* functions are obviously designed to work these controls - that is why they take a ControlID (as returned by the GUICtrlCreate* functions) and not a handle (which is what you get from the UDFs which deal directly with the API). And, as you have discovered, they will not work on the UDF-created controls for this very reason. Incidentally, the ControlID is the index of the control in an internal array of natively-created controls maintained within AutoIt. You can often (but not always) use the UDF functions on natively-created controls - it all depends on the control itself. Complex things like TreeViews and ListViews are the most likely to give you problems, as you have again discovered. Now you have got that rant out of your system and I have explained why these things happen, I hope you come to realise the value of having both sets of functions. I would recommend trying to use the natively-created controls if you can - it means you can use the full range of AutoIt native functions on them, as well as many of the UDF functions. Enjoy what is left of your weekend. 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...
Armag3ddon Posted February 19, 2012 Author Share Posted February 19, 2012 Thanks for the calming words Yes, the angst level was very high at that point. I've arranged with the OnEvent stuff. I was just happy to have found a custom sort function for treeview but then was sad that it 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