minxomat Posted March 8, 2015 Share Posted March 8, 2015 (edited) Screenshot Description This lets you create bezier nodes between GUI controls. See screenshot for features. This is not an UDF. Downloadhttps://gist.github.com/minxomat/be51ae55cdf25c99c692 Edited April 30, 2015 by minx mesale0077 and mLipok 2 I will answer every single PM, and you are free to ask anything anytime. Link to comment Share on other sites More sharing options...
mesale0077 Posted March 8, 2015 Share Posted March 8, 2015 cool Link to comment Share on other sites More sharing options...
jcpetu Posted March 8, 2015 Share Posted March 8, 2015 Hi Minx, this is a great job.Thanks a lot for sharing. Link to comment Share on other sites More sharing options...
JohnOne Posted March 8, 2015 Share Posted March 8, 2015 Have to ask a couple of questions.First, what would one generally use bezier nodes for?And second what is a bezier node? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
minxomat Posted March 8, 2015 Author Share Posted March 8, 2015 (edited) First, what would one generally use bezier nodes for?To visualize a flow or connection of elements with different properties. Take a look at the Blender node system. This kind of visualisation is also used in a Color Grading (Davinci Resolve), Music Production (various synths) and VFX apps. And second what is a bezier node?A bezier connecting two nodes. It's control points are fixed at 50% width or height of the bezier. Edited March 8, 2015 by minx JohnOne 1 I will answer every single PM, and you are free to ask anything anytime. Link to comment Share on other sites More sharing options...
jcpetu Posted March 8, 2015 Share Posted March 8, 2015 Minx, I attempted to change it a bit to make it On Event, but without success. I added: $aMovables[$Bound][0] = GUICtrlCreateButton($sText, $iLeft, $iTop, $iWidth, $iHeight, 0x2000) GUICtrlSetOnEvent(-1, "NodeControl") and the NodeControl out of the main loop: expandcollapse popupFunc NodeControl() $cur = GUIGetCursorInfo() If Not IsArray($cur) Then Return If $cur[2] = 1 Then For $nCtrl = 0 To UBound($aMovables) - 1 If $cur[4] = $aMovables[$nCtrl][0] Then $end = GUIGetCursorInfo() If Not IsArray($end) Then ContinueLoop $dx = $end[0] - $aMovables[$nCtrl][1] $dy = $end[1] - $aMovables[$nCtrl][2] $iDrawn = 0 $iTimer = TimerInit() Do $end = GUIGetCursorInfo() $aMovables[$nCtrl][1] = $end[0] - $dx $aMovables[$nCtrl][2] = $end[1] - $dy If $aMovables[$nCtrl][1] <= 6 Then $aMovables[$nCtrl][1] = 6 If $aMovables[$nCtrl][2] <= 6 Then $aMovables[$nCtrl][2] = 6 If $aMovables[$nCtrl][1] + $aMovables[$nCtrl][3] >= ($iGUIWidth - 6) Then $aMovables[$nCtrl][1] = ($iGUIWidth - 6) - $aMovables[$nCtrl][3] If $aMovables[$nCtrl][2] + $aMovables[$nCtrl][4] >= ($iGUIWidth - 26) Then $aMovables[$nCtrl][2] = ($iGUIHeight - 26) - $aMovables[$nCtrl][4] $aMovables[$nCtrl][6] = 0x00FF00 $back = $g $g = GUICtrlCreateGraphic(0, 0) GUICtrlSetState(-1, 128) DrawBounds() For $tCtrl = 0 To UBound($aMovables) - 1 If $aMovables[$tCtrl][5] <> "" Then $aNodes = StringSplit($aMovables[$tCtrl][5], ",", 3) For $nConnection = 0 To UBound($aNodes) - 1 If Not IsNodeInObject($aNodes[$nConnection], $tCtrl) Then DrawConnection($tCtrl, $aNodes[$nConnection], $aMovables) $iDrawn += 1 Next EndIf Next GUICtrlDelete($back) GUICtrlSetPos($aMovables[$nCtrl][0], $aMovables[$nCtrl][1], $aMovables[$nCtrl][2]) $aMovables[$nCtrl][6] = 0xFFFFFF Until $end[2] = 0 EndIf Next EndIf EndFunc ;==>NodeControl Link to comment Share on other sites More sharing options...
minxomat Posted March 8, 2015 Author Share Posted March 8, 2015 Why would you do that? You can use OnEvent just fine with the handler in the main loop. If the user doesn't click anything, nothing will be redrawn (== no CPU time wasted). I will answer every single PM, and you are free to ask anything anytime. Link to comment Share on other sites More sharing options...
jcpetu Posted March 8, 2015 Share Posted March 8, 2015 It is just to combine with a program I made wich is actually On Event driven, to show the relationship among groups and users. Link to comment Share on other sites More sharing options...
minxomat Posted March 8, 2015 Author Share Posted March 8, 2015 No problem. You can have a Loop while using OnEvent. OnEvent only affects GUICtrl message handling. I will answer every single PM, and you are free to ask anything anytime. Link to comment Share on other sites More sharing options...
jcpetu Posted March 8, 2015 Share Posted March 8, 2015 OK, I'll make it. Thanks a lot minx. regards. minxomat 1 Link to comment Share on other sites More sharing options...
spudw2k Posted March 11, 2015 Share Posted March 11, 2015 Very cool Minx! I noticed the CPU is heavy when dragging nodes. I inserted a sleep(10) (on line 120) after the for loops and it does not seem to have any major lag effect, but drops the CPU usage significantly. I know a band-aid like this isn't desirable, but just thought I'd try and see what happens. Regardless, Well done! Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
minxomat Posted March 11, 2015 Author Share Posted March 11, 2015 (edited) -snip-Well, I altered the script already to make it easier to handle for the CPU. Eventually, it completely broke down under the load of a realistic Node layout. Thus, I'm redesigning it using OpenGL and chunk-based refreshing now.Before (pure AutoIt (also no GDI+)):After (early prototype, using a better spring algorithm). OpenGL Edited March 11, 2015 by minx I will answer every single PM, and you are free to ask anything anytime. Link to comment Share on other sites More sharing options...
mesale0077 Posted March 11, 2015 Share Posted March 11, 2015 Before (pure AutoIt (also no GDI+)): source share please Link to comment Share on other sites More sharing options...
minxomat Posted March 12, 2015 Author Share Posted March 12, 2015 Before (pure AutoIt (also no GDI+)): source share pleaseIt's a mess. Not my usual mess, a messy mess. Using 5 Nodes already pushes the limit. I implemented auto-resizing canvas, canvas dragging, Node selection etc. before givin up on this approach. The new version won't be much different, but the performance will be (a whole) lot better. mLipok 1 I will answer every single PM, and you are free to ask anything anytime. Link to comment Share on other sites More sharing options...
ptrex Posted March 18, 2015 Share Posted March 18, 2015 Hello Minx, This is really great !! I see lot's of applications using this in practice. Speed and performance improvements are always welcome. I can imaging that the GDI wizard (UEZ) can be of big help here. Great addition for AU3. Thanks a lot for sharing, looking forward for the next release rgds ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
minxomat Posted March 18, 2015 Author Share Posted March 18, 2015 Nah, OpenGL is the way to go here. There are inbuilt tools for chunk management. GDI+ is slower than GDI in most cases, which is why it doesn't make much sense here. I will answer every single PM, and you are free to ask anything anytime. Link to comment Share on other sites More sharing options...
MikahS Posted March 18, 2015 Share Posted March 18, 2015 Very cool script, Minx. Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ Link to comment Share on other sites More sharing options...
GerrOrneq Posted April 22, 2015 Share Posted April 22, 2015 @ minx, Hi, I was amazed when I came across your posting. I didn't know that AutoIt was capable of doing this sort of thing at all. It seemed like it may be the answer to what I have been looking for for some time now. I downloaded it and played about with it and then I realised "Whoa! I am like a caveman playing about with a smartphone, I can see what it is doing but am unable to comprehend how it does what it does." But picking my way through it I tried to see if it would do as I would like it to and it wouldn't (or more probably, I stuffed up and cannot get it to do what I want!) Perhaps you could tell me if the following is possible? * To have the bezier curve change colour depending upon which direction the link goes in. i.e. in your example clicking on 'Render Framework' node lights up green to 3 nodes (SunX, AmbientLight &SunRed) going 'down' from 'Init' but if I click on any of the 3 nodes they go down further (green) and while I would still like to show those further 'down' links as green etc I would also like to show the 'upward' (back) links as say red or what ever. My Very Limited understanding of the way it behaved when I tinkered with it suggests that it can only display one-way links. I would need it to be able to display 3 types of links (3 colours) 1 for 'Up' links, 2 for 'Down' links & 3 for (Sideways/Parallel) links to a node that has an equivalent weight or value as the node being clicked on. e.g. If it was for instance to display a family tree like the following: [Mam]----[son1]----[Grandson] | | | [son2] [Dad] Then Clicking on: Mam should link blue to Dad, green to Son1 & Son2 Dad should link blue to Mam, green to Son1 & Son2 Son1 should link green to Grandson, Red back to Mam & Dad, then blue to Son2 (My usage will Not be for family trees but it seemed the simplest example of what linking I would like to perform.) Hopefully I have explained it clearly enough. * If the above is possible, how difficult would it be to create a UDF that could be called with the details and it would then display the linkages and return the ID of the node clicked on? Say you had the above data in an array: ID txt Up Same Dwn +----+------+-------+-----------+---------+ | 0 | Mam| | 1 | 2, 3 | +----+------+-------+-----------+---------+ | 1 | Dad | | 0 | 2, 3 | +----+------+-------+-----------+---------+ | 2 |Son1| 0, 1 | 3 | 4 | +----+------+-------+-----------+---------+ | 3 |Son2| 0, 1 | 2 | | +----+------+-------+-----------+---------+ | 4 |Gson| 2 | | | +----+------+-------+-----------+---------+ Then calling the UDF with array ID = 2 would read the array row 2 and populate the node freamework with the title 'Son1' and the other nodes 0, 1, 3, & 4. and colour the link apporpriately. Thank You for the script and for letting me know if the above is possible. br. DeMo. Quote of the week:"BASIC programmers never die, they GOSUB and don't RETURN." -- UnknownWisdom of the ages: I'd be unstoppable... if not for law enforcement and physics. Marriage, the number 1 cause of divorce. Don't steal... the government hates competition. Irish Government Motto: We’ve got what it takes to take what you’ve got. Birthdays are good for you. Statistics show that the people who have the most live the longest. Failure is not an option. It comes bundled with your Microsoft product.-- Ferenc Mantfeld If you learn from your mistakes, then why ain't I a genius?! -- Anonymous Remember, live every day as if it was your last day! one day you will be right. How is it one careless match can start a forest fire, but it takes a whole box to start a campfire? Sure my system is secure, it just locked up again. I haven't lost my mind; I have a tape back-up somewhere. ~Author Unknown Link to comment Share on other sites More sharing options...
mLipok Posted April 22, 2015 Share Posted April 22, 2015 It is absolutely wonderful. Surprising as it is simple and small. Many times I thought about something like that, but there was no time to implement. Thanks for sharing. 5* Best regards, mLipok Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24 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