Popular Post Nine Posted March 15 Popular Post Posted March 15 (edited) I have been creating few controls with round corners for awhile for my own needs and I felt it was time to make an UDF and share it with the community. The idea behind this UDF is to use essentially simple basic AutoIt GUI functions. I did not want to embark in GDI+ to create the controls. I wanted to be easy to use with enough features that it would answer most requirements. The functions contained in the UDF : _RGUI_RoundLabel _RGUI_RoundButton _RGUI_RoundInput _RGUI_RoundEdit _RGUI_RoundGroup _RGUI_RoundScrollBar _RGUI_ScrollBarSet _RGUI_ScrollBarDestroy _RGUI_RoundRect _RGUI_DrawLine _RGUI_ButtonPress _RGUI_ButtonReset Version 2025-03-28 * Added support to auto-size label and button controls (by passing -1 for width and/or height) * Removed the requirement to pass handle of the GUI to _RGUI_RoundGroup * Added 3rd example on how to use scrollbar with RichEdit Version 2025-03-21 * Added support of round corner scrollbar * Added a 2nd example on how to use scrollbar with ListBox Version 2025-03-15 * Basic framework for the UDF Here an example of what could be done with the UDF : If you feel there should be new controls, I will consider adding them to the UDF. RoundGUI.zip Edited Friday at 04:00 PM by Nine WildByDesign, donnyh13, CYCho and 6 others 9 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy
Solution Nine Posted March 21 Author Solution Posted March 21 New version available “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy
water Posted March 22 Posted March 22 Added to the wiki Nine 1 My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
WildByDesign Posted March 22 Posted March 22 This is really neat. I can’t wait to try this later. Thanks for sharing. I do have a suggestion for the thread title in the forum, though. With “Round Corner GUI UDF”, it gives me the impression of rounded corners for the GUI only, like Windows 11 style. I would suggest something like “Round Corner GUI Controls UDF” or similar. I think the word controls needs to be in there in some way.
Nine Posted March 22 Author Posted March 22 Done. WildByDesign 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy
WildByDesign Posted Friday at 12:12 PM Posted Friday at 12:12 PM I've tested this UDF a few times since you first posted it and I see a lot of potential here. I like it. And I can envision a lot of creativity can be had here by anyone using this UDF. I do have a usability suggestion though. The one main thing that drew me away from it initially was the lack of autosize to text for the controls that normally support it such as labels and buttons. I understand that you do some math with the corner radius, so I don't know how feasible it would be to support autosize to text. But if there is any way for you to add it, I think that it would be beneficial for usability. Especially for beginners like myself.
Nine Posted Friday at 12:33 PM Author Posted Friday at 12:33 PM The size is determined by the font you have chosen. I do not think it is a good approach to override the choice made by the programmer. WildByDesign 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy
WildByDesign Posted Friday at 12:57 PM Posted Friday at 12:57 PM I apologize if I didn't explain it right. I'll use a code example: Local $idExit = _RGUI_RoundButton("Exit", 0xB0B0B0, 10, 430, 80, 30, 0X404040, 0X404040, 6) Here is what I am referring to: Local $idExit = _RGUI_RoundButton("Exit", 0xB0B0B0, 10, 430, -1, -1, 0X404040, 0X404040, 6) My intended suggestion was to be able to put -1 for the $iWidth, $iHeight sizes. For the regular button and label GuiCreate* options that would autosize the control based on the text and (as you stated) the font size. But if I do -1 like above, it doesn't work. Nine 1
Nine Posted Friday at 04:06 PM Author Posted Friday at 04:06 PM I now understand what you meant before. I think it is a good idea, thanks. So I made it possible to both labels and buttons. Also added RichEdit using scrollbar example in the zip file. Added some minor optimizations. New version available. WildByDesign 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy
WildByDesign Posted Friday at 05:24 PM Posted Friday at 05:24 PM This is really fantastic with the autosize update. Thank you so much. 👍
pixelsearch Posted Friday at 07:28 PM Posted Friday at 07:28 PM @Nine great line found in your UDF : ($mScroll[$iID])[0]($iID, ($iY2 - $iTop)/($iBottom - $iTop), $iData) with ($mScroll[$iID])[0] corresponding to the UserFunction ScrollEdit found... in the calling script RoundGUI Example3.au3 Nice interaction between the UDF and its example "I think you are searching a bug where there is no bug..."
WildByDesign Posted 2 hours ago Posted 2 hours ago (edited) I just noticed with _RGUI_RoundGroup that the label text size at the top of the group does not match the text size set for the GUI. It’s only off by 1-2 pixels, but 1-2 pixel difference in a GUI can be important. Changing that text size doesn’t seem to have any effect either. It only seems to change the text size of controls within the group box. EDIT: Upon closer inspection, the font is different as well. I have the GUI set for Segoe UI Variable and the label over the Group is using normal Segoe UI. Edited 1 hour ago by WildByDesign
Nine Posted 1 hour ago Author Posted 1 hour ago Show me the code you are using (strict minimum please). “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy
WildByDesign Posted 38 minutes ago Posted 38 minutes ago Sorry, @Nine but it was entirely my fault. No bug. I had originally copy/pasted from your example to ensure that I did it correctly. It was the GUICtrlSetFont(-1, 10) right after the _RGUI_RoundGroup that I missed initially and that was what made me think that there was a bug.
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