Jump to content

Looking for a nice About window with credits area


Recommended Posts

  • Replies 59
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Here a fast hack: ;Coded by UEZ build 2021-04-11 #include <GDIPlus.au3> #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> _GDIPlus_Star

I wonder if number of lines of code implementing About box finally will not be much bigger than whole main project (without About box) ...

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 th

Posted Images

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. 

Screenshot_5.png.88d807fcd7581c729f89262cbbfc9bb6.png

Saludos

 

Link to post
Share on other sites
  • Moderators

Professor_Bernd,

Create a small GUI and use my Scrollbars UDF (link in my sig) to create a scrollable area within it.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to post
Share on other sites

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. :thumbsup: Thank you very much for this!

 

Link to post
Share on other sites
  • Moderators

Professor_Bernd,

Glad you like StringSize - here it is being used to create a scrolling section in an "About" GUI:

#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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to post
Share on other sites
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 post
Share on other sites
  • Moderators

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:

#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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to post
Share on other sites
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! :cheer: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 post
Share on other sites
  • Moderators

Professor_Bernd,

Do not hesitate to ask if I can be of any help.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to post
Share on other sites

In case you want to use a full HTML page as an "about" message, here is a very simple sample draft showing how.

_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 by Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Link to post
Share on other sites
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. :sweating:

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 post
Share on other sites
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. :whistle:  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 post
Share on other sites
  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to post
Share on other sites
Posted (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! 🐠🐟 :P

Edited by Professor_Bernd
Link to post
Share on other sites
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 by Werty
too much code

Some guy's script + some other guy's script = my script!

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...