Professor_Bernd Posted April 4, 2021 Share Posted April 4, 2021 Can someone provide me with a nice about window that has a credits area that you can scroll? Link to comment Share on other sites More sharing options...
Danyfirex Posted April 4, 2021 Share Posted April 4, 2021 Hello. You probably could use a Rich Text Edit Box and load a .rtf file or you could embed IE too with some HTML nice About page. I did something with PictureBox+RichEdit time ago and this is the result. It's minimalist. Saludos FrancescoDiMuro, Musashi, mLipok and 1 other 4 Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
Professor_Bernd Posted April 4, 2021 Author Share Posted April 4, 2021 Hmm, ... interesting idea! Since I wanted to load a text document for the credits anyway, it can of course be an .rtf. Link to comment Share on other sites More sharing options...
Professor_Bernd Posted April 5, 2021 Author Share Posted April 5, 2021 Can someone provide me with the code for a nice about window that has a credits area that you can scroll? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 5, 2021 Moderators Share Posted April 5, 2021 Professor_Bernd, Create a small GUI and use my Scrollbars UDF (link in my sig) to create a scrollable area within it. 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...
Professor_Bernd Posted April 5, 2021 Author Share Posted April 5, 2021 Believe it or not, I had this very thought of using your scrollbars UDF. Yesterday I searched for a long time without success to hide the caret and the selection in a RichEdit and made many unsuccessful attempts to make the RichEdit inaccessible with a label or a mask or as a child window, and many other attempts. And in the end I thought, either I can use your scrollbars UDF, or I set the RichEdit to read only and leave the stupid caret blinking and the selection visible. After working on my Improvement Kit for "PSPad4AutoIt3 (Editor IDE)" for months now, I thought that such a bit of About-Window would be quick to create after all. An about window is an ancient thing and there must be lots of example codes for it. But I found only 2 codes and they were very old (2004 - 2007). The good news: One of the most important elements in my above PSPad4AutoIt3 is the CallTipViewer. One of the most important elements in the CallTipViewer is "StringSize" from you. I think this is a unique code, because I haven't found anything similar. Thank you very much for this! Link to comment Share on other sites More sharing options...
Professor_Bernd Posted April 5, 2021 Author Share Posted April 5, 2021 @Melba23 Just now a user in the DE forum recommended your Marquee UDF to me. I'm not sure yet if I will let the credits scroll automatically, but for that I can use your UDF very well! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 5, 2021 Moderators Share Posted April 5, 2021 Professor_Bernd, Glad you like StringSize - here it is being used to create a scrolling section in an "About" GUI: expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include "StringSize.au3" Local $hInfo_Win = GUICreate("About App", 300, 150, -1, -1, BitOR($WS_POPUPWINDOW, $WS_CAPTION)) GUISetBkColor(0xCCCCFF) Local $cClose_Info_Button = GUICtrlCreateButton("Close", 190, 115, 80, 30) GUISetState(@SW_SHOW, $hInfo_Win) $sMsg = "My App" & @CRLF & "(c) Me" GUICtrlCreateLabel($sMsg, 10, 115, 150, 40) ; Size label to scroll Local $iScroll_Win_Width = 200 Local $iScroll_Win_Depth = 85 $sMsg = $sMsg & @CRLF & @CRLF & _ "This software is released as Freeware. It is provided 'as-is', without any express or implied warranty. " & _ "In no event shall the author be held liable for any damages arising from the use of this software." & @CRLF & @CRLF & _ "Permission is granted to anyone to use this software for any purpose, including commercial applications, " & _ "and to redistribute it, provided that the following conditions are met:" & @CRLF & @CRLF & _ "1. All redistributions in binary form must retain all occurrences of the above copyright notice " & _ "and the acknowledgements below." & @CRLF & @CRLF & _ "2. Modified versions in source or binary form must be plainly marked as such, and must not be " & _ "misrepresented as being the original software." & @CRLF & @CRLF & _ " Acknowledgements:" & @CRLF & @CRLF & _ "App built using AutoIt v" & @AutoItVersion & @CRLF & _ "(www.autoitscript.com/autoit3)" Local $aScroll_Size = _StringSize($sMsg, Default, Default, Default, Default, $iScroll_Win_Width - 2) Local $iScroll_Label_Depth = $aScroll_Size[3] ; Create and enable scroll child $aWin_Pos = WinGetPos($hInfo_Win, "") Local $hScroll_Win = GUICreate("Scroller", $iScroll_Win_Width, $iScroll_Win_Depth, -1, -1, $WS_POPUP, $WS_EX_MDICHILD, $hInfo_Win) WinMove($hScroll_Win, "", $aWin_Pos[0] + 70, $aWin_Pos[1] + 37) ; Create scrolling label Local $cScroll_Label = GUICtrlCreateLabel($aScroll_Size[0], $aWin_Pos[0] + 70, $aWin_Pos[1] + 37, $iScroll_Win_Width - 2, $iScroll_Label_Depth) ; Set transparency to permit dragging without artefacts WinSetTrans($hScroll_Win, "", 250) GUISetState(@SW_SHOW, $hScroll_Win) ; Reactivate main dialog WinActivate($hInfo_Win) Local $aMsg While 1 For $i = $iScroll_Win_Depth To -$iScroll_Label_Depth Step -1 $aMsg = GUIGetMsg(1) Switch $aMsg[1] Case $hInfo_Win Switch $aMsg[0] Case $GUI_EVENT_CLOSE, $cClose_Info_Button GUIDelete($hInfo_Win) Exit EndSwitch EndSwitch ControlMove($hScroll_Win, "", $cScroll_Label, 1, $i) Sleep(50) ; Needed to slow the scroll! Next WEnd That might be something you could use.... M23 Professor_Bernd 1 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...
Professor_Bernd Posted April 5, 2021 Author Share Posted April 5, 2021 1 hour ago, Melba23 said: Glad you like StringSize I not only like StringSize, I love it! 🧡 I've used a lot of code before in Visual Basic and Delphi, all of which had a problem with accuracy. This is much better with StringSize! When the width of a character is calculated in the CallTipViewer with StringSize, the value is exactly right. Even if the width was calculated for 200 characters in one line (= 200x possible deviations), when the CallTip is placed, it fits exactly. Thanks for the work you put into this and thanks for sharing! 👍 1 hour ago, Melba23 said: create a scrolling section in an "About" GUI: ... That might be something you could use.... In the past everything should be playful, today everything twitches and fidgets anyway, especially on the internet, on cell phones, ... I'm not sure yet if I'll use an auto-scrolling text in the about window. More likely one that you can scroll with the mouse. But I can definitely use your code. Thanks for that! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 5, 2021 Moderators Share Posted April 5, 2021 Professor_Bernd, Quote More likely one that you can scroll with the mouse Then you might like this amended script which uses my Scrollbar UDF as I originally suggested: expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include "StringSize.au3" #include "GUIScrollbars_Ex.au3" Local $hInfo_Win = GUICreate("About App", 300, 150, -1, -1, BitOR($WS_POPUPWINDOW, $WS_CAPTION)) GUISetBkColor(0xCCCCFF) Local $cClose_Info_Button = GUICtrlCreateButton("Close", 190, 115, 80, 30) GUISetState(@SW_SHOW, $hInfo_Win) $sMsg = "My App" & @CRLF & "(c) Me" GUICtrlCreateLabel($sMsg, 10, 115, 150, 40) ; Size label to scroll Local $iScroll_Win_Width = 200 Local $iScroll_Win_Depth = 85 $sMsg = $sMsg & @CRLF & @CRLF & _ "This software is released as Freeware. It is provided 'as-is', without any express or implied warranty. " & _ "In no event shall the author be held liable for any damages arising from the use of this software." & @CRLF & @CRLF & _ "Permission is granted to anyone to use this software for any purpose, including commercial applications, " & _ "and to redistribute it, provided that the following conditions are met:" & @CRLF & @CRLF & _ "1. All redistributions in binary form must retain all occurrences of the above copyright notice " & _ "and the acknowledgements below." & @CRLF & @CRLF & _ "2. Modified versions in source or binary form must be plainly marked as such, and must not be " & _ "misrepresented as being the original software." & @CRLF & @CRLF & _ " Acknowledgements:" & @CRLF & @CRLF & _ "App built using AutoIt v" & @AutoItVersion & @CRLF & _ "(www.autoitscript.com/autoit3)" Local $aScroll_Size = _StringSize($sMsg, Default, Default, Default, Default, $iScroll_Win_Width - 2) Local $iScroll_Label_Depth = $aScroll_Size[3] ; Create and enable scroll child $aWin_Pos = WinGetPos($hInfo_Win, "") Local $hScroll_Win = GUICreate("Scroller", $iScroll_Win_Width, $iScroll_Win_Depth, -1, -1, $WS_POPUP, $WS_EX_MDICHILD, $hInfo_Win) WinMove($hScroll_Win, "", $aWin_Pos[0] + 70, $aWin_Pos[1] + 37) ; Create scrolling label Local $cScroll_Label = GUICtrlCreateLabel($aScroll_Size[0], 0, 0, $iScroll_Win_Width - 2, $iScroll_Label_Depth) _GUIScrollbars_Generate($hScroll_Win, 0, $iScroll_Label_Depth) GUISetState(@SW_SHOW, $hScroll_Win) ; Reactivate main dialog WinActivate($hInfo_Win) Local $aMsg While 1 $aMsg = GUIGetMsg(1) Switch $aMsg[1] Case $hInfo_Win Switch $aMsg[0] Case $GUI_EVENT_CLOSE, $cClose_Info_Button GUIDelete($hInfo_Win) Exit EndSwitch EndSwitch WEnd 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...
Professor_Bernd Posted April 5, 2021 Author Share Posted April 5, 2021 29 minutes ago, Melba23 said: Then you might like this amended script which uses my Scrollbar UDF as I originally suggested: Yes, that's it! Now I just have to figure out how to combine a RichEdit with it. The RichEdit can then load the formatted text from an RTF file as Danyfirex suggested, a transparent label can cover it, and the scrollbars scroll the RichEdit. Let's see how I can make this work. But not today. 😴 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 5, 2021 Moderators Share Posted April 5, 2021 Professor_Bernd, Do not hesitate to ask if I can be of any help. 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...
Gianni Posted April 5, 2021 Share Posted April 5, 2021 (edited) In case you want to use a full HTML page as an "about" message, here is a very simple sample draft showing how. expandcollapse popup_About() Func _About() Local $iWidth = 250, $iHeight = 400 Local $oIE = ObjCreate("Shell.Explorer.2") Local $hAboutGui = GUICreate("About", $iWidth, $iHeight) GUISetState(@SW_SHOW) $hIE = GUICtrlCreateObj($oIE, 0, 0, $iWidth, $iHeight) ; <- embedd $oIE in the AutoIt GUI $oIE.navigate('about:blank') ; this will create a basic html structure into the browsercontrol ; this waits till the document is ready to be used (portion of code from IE.au3) While Not (String($oIE.readyState) = "complete" Or $oIE.readyState = 4) Sleep(100) WEnd While Not (String($oIE.document.readyState) = "complete" Or $oIE.document.readyState = 4) Sleep(100) WEnd $oIE.document.Write(_GetHTML()) ; inject lising directly to the HTML document: $oIE.document.close() ; close the write stream $oIE.document.execCommand("Refresh") ; Loop until the user exits. While 1 Switch GUIGetMsg() Case -3 ; $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd ; clean things up $oIE = "" GUIDelete($hAboutGui) EndFunc ;==>_About Func _GetHTML() Local $sMsg = "My App <img src='https://www.autoitscript.com/forum/uploads/emoticons/default_thumbsup.gif.11111111111111111111111111111111.gif'>" & _ '<p style="color:rgb(0,255,0);">Green paragraph text</p>' & _ "(<b>c</b>) Me<p>" & _ "This software is released as Freeware. It is provided 'as-is', without any express or implied warranty. " & _ "In no event shall the author be held liable for any damages arising from the use of this software." & _ "Permission is granted to anyone to use this software for any purpose, including commercial applications, " & _ "and to redistribute it, provided that the following conditions are met:" & _ "1. All redistributions in binary form must retain all occurrences of the above copyright notice " & _ "and the acknowledgements below." & _ "2. Modified versions in source or binary form must be plainly marked as such, and must not be " & _ "misrepresented as being the original software." & _ " Acknowledgements:" & _ "App built using AutoIt v" & @AutoItVersion & _ '<a href = "https://www.autoitscript.com/autoit3" target="_blank">(www.autoitscript.com/autoit3)</a>' Local $sHTML = _ "<!DOCTYPE HTML>" & @CRLF & _ "<html>" & @CRLF & _ "<head>" & @CRLF & _ "<meta http-equiv=""X-UA-Compatible"" content=""IE=edge"" />" & @CRLF & _ "</head>" & @CRLF & _ "<body>" & @CRLF & _ $sMsg & _ "</body>" & @CRLF & _ "</html>" Return $sHTML EndFunc ;==>_GetHTML Edited April 5, 2021 by Chimp Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
Professor_Bernd Posted April 5, 2021 Author Share Posted April 5, 2021 1 hour ago, Melba23 said: Do not hesitate to ask if I can be of any help. Wow, that would be wonderful! The next release of PSPad4AutoIt3 is coming up and I have my hands full. It would be great if you could create some code that can serve as a template for an about window in broad strokes. 2 or 3 labels for headlines and main text, 1 "link label" for the homepage to PSPad, 1 link label for the contact email address to me, and at the bottom a RichEdit for the credits that you can scroll manually. Ok, now that I'm writing this, I'm a little ashamed to ask you to do something like this. My apologies. 😳 Maybe you want to take the part for the manually scrollable RichEdit? I'm grateful for any help! Link to comment Share on other sites More sharing options...
Professor_Bernd Posted April 5, 2021 Author Share Posted April 5, 2021 17 minutes ago, Chimp said: In case you want to use a full HTML page as an "about" message, here is a very simple sample draft showing how. HTML is not so familiar to me, my skills are limited. But I'm impressed what you can include, for example the smilies! So thank you for this idea and the code example! Freely after the motto: A code example says more than thousand words! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 6, 2021 Moderators Share Posted April 6, 2021 Professor_Bernd, The offer was to help you get my UDFs integrated in your script if you were having problems - not to write the whole thing for you. M23 Musashi 1 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...
Professor_Bernd Posted April 6, 2021 Author Share Posted April 6, 2021 2 hours ago, Melba23 said: The offer was to help you get my UDFs integrated in your script if you were having problems - not to write the whole thing for you. Oh, too bad, ... you can always use a good man! Link to comment Share on other sites More sharing options...
Professor_Bernd Posted April 6, 2021 Author Share Posted April 6, 2021 (edited) I think the tip from Danyfirex will be. An RTF file with the credits will be loaded into a RichEdit. The about text with some info is either also written into the RTF, or gets its own label plus a title label. Let's see. In addition I set LinkLabels (similar to those of .net or C# or ...) for the PSPad homepage and the contact email address for ImpKit support. For AutoIt, very old code examples can be found here (by MrCreatoR) and here (by Zedna). I could not find newer ones. Finally a few buttons for version info etc. That should be enough. Does anyone know how to make the caret invisible in RichEdit? If not, it won't kill the user as long as he doesn't stare at it for more than 2.74 hours at a time! 🐠🐟 Edited April 6, 2021 by Professor_Bernd Link to comment Share on other sites More sharing options...
Werty Posted April 7, 2021 Share Posted April 7, 2021 (edited) 2 hours ago, Professor_Bernd said: Does anyone know how to make the caret invisible in RichEdit? User32.dll can hide it... #include <GUIConstantsEx.au3> #include <GuiRichEdit.au3> #include <WindowsConstants.au3> Local $hGui, $hRichEdit, $iMsg $hGui = GUICreate("Hide caret example", 320, 350, -1, -1) $hRichEdit = _GUICtrlRichEdit_Create($hGui, "This is a test.", 10, 10, 300, 220, BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL, $ES_READONLY )) _GUICtrlRichEdit_AppendText($hRichEdit, @CRLF & "This is more text") GUISetState(@SW_SHOW) Local $aResult = DllCall("user32.dll", "int", "HideCaret", "hwnd", $hRichEdit) ; <--- this hides caret While True $iMsg = GUIGetMsg() Select Case $iMsg = $GUI_EVENT_CLOSE _GUICtrlRichEdit_Destroy($hRichEdit) ; GUIDelete() Exit EndSelect WEnd It reappears if user clicks with the mouse in the box though. Edited April 7, 2021 by Werty too much code mLipok 1 Some guy's script + some other guy's script = my script! Link to comment Share on other sites More sharing options...
Professor_Bernd Posted April 7, 2021 Author Share Posted April 7, 2021 30 minutes ago, Werty said: It reappears if user clicks with the mouse in the box though. That's the problem. I tried the code from jguinch, which works for an edit. But with a RichEdit I did not succeed, the caret remains visible. Thanks for the tip anyway! 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