Jump to content

Recommended Posts

Posted (edited)

An about dialog is a nice little thing, often hardly bigger than a message box and usually just a minor thing. But almost every program has an about dialog, if only to put its "stamp" on it, insert a contact address or a copyright. Then there are the thank you notes, which in the 00's liked to be spiced up with some great effects, like vertical ticker, like in the credits of a movie. But who likes to watch the credits of a movie? :P I think it's nicer if you can scroll the credits yourself, as fast and as slow as you want.

So that's what it should be: An about dialog, where you can nicely display the name of the program with your own name, maybe show a version number, and with buttons and link labels you can click on, which will then open the web or email address. Oh yeah, and an area where you can express your thanks to everyone involved.

So I searched the DE forum here and the EN forum for example codes for an about dialog with credits area. You would think that there should be a lot of them, because about dialogs already existed in the computer stone age. But far from it: I found only 2 code examples. Both dialogs lacked a credits area, but - yay! - there were LinkLabels. So I was one step further.

Here in the forum I created a thread asking if someone could provide me with a nice About dialog. Even the first reply was promising and suggested using a RichEdit and loading an RTF file into it. Nice stuff. Unfortunately I had probably put my request too vague, because instead of the code for the about dialog I was only provided with a picture of the dialog. :P

Based on the tips and suggestions I developed my own code and provide it here. The About dialog is relatively large and consists of a RichEdit that takes up the left and middle areas of the dialog. In the right area there are labels and buttons. In the RichEdit you can show an about text as well as the credits, which you can scroll through manually.

Preview

preview.jpg.47699b10de715ce6a1134e5bb6ebf64f.jpg

 

Settings

I tried to keep the configuration simple. Probably it would have become rather complex to gather all configuration options in one place. Now it became 3 different places, which I marked with double lines well visibly and the code remained clear. To set your own settings, it is sufficient to make changes in these areas. So settings for the title bar and the right area with the labels and buttons can be made.

Settings for the text in RichEdit are made in the RTF file, also links for web and e-mail addresses are set up in the RTF file. The finished file is then simply loaded into RichEdit. The path to the RTF file can be customized in the code in the first settings area. Relative paths are possible, e.g. "..\..\About.rtf".

I have added an example RTF file: "About.rtf". My example RTF file was created with "LibreOffice Writer". Probably you can open it with any higher office program and design it according to your own ideas. Unfortunately, I don't have MS Office available at the moment to check this.

Important: With MS WordPad you cannot edit the existing example RTF file! (The data will be unreadable).

But you can create your own RTF file with MS WordPad and use it in the about dialog. The same applies to MS Office: If the existing RTF file cannot be edited, simply create a new one and design it according to your own wishes. :)

Feedback is welcome.

 

Version 0.0.12.2

  • First published Version.

Version 0.0.12.5

  • Added: Ability to display the RichEdit with or without borders.
  • Bugfix: When you scrolled the RichEdit with the scrollbar, the text and the scrollbar flickered. - Thanks to UEZ for finding this issue. 👍

Version 0.0.12.6

  •  Added: Hide caret when the RichEdit is scrolled with the scrollbar. Nevertheless, the caret sometimes flashes a little when scrolling.
  • Bugfix: Converted the background color value for the RichEdit from RGB to BGR.

About Dialog 0.0.12.6 (Professor Bernd).zip

Edited by Professor_Bernd
Posted

It's a nice old school design. :thumbsup:

The GUI is flickering when scrolling the text only using the scrollbar. 

What about an automatic slow scrolling of the text until user intervention?

Might be a good idea to add a small tune.

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Posted

Hi UEZ
Does it still flicker on your computer if you add the $WS_EX_COMPOSITED extended style ?

$g_hGui = GUICreate($sGuiTitle, 640, 360, -1, -1, BitOR($WS_CAPTION, $WS_POPUPWINDOW), -1, $g_hParent)

becoming
$g_hGui = GUICreate($sGuiTitle, 640, 360, -1, -1, BitOR($WS_CAPTION, $WS_POPUPWINDOW), $WS_EX_COMPOSITED, $g_hParent)

 

"I think you are searching a bug where there is no bug... don't listen to bad advice."

Posted

These repeated tests I did here and there, based on $WS_EX_COMPOSITED, seem to confirm that it worked fine until Win7 included (at least for the flickering part). After Win7, it's not useful anymore, a real pity...

"I think you are searching a bug where there is no bug... don't listen to bad advice."

Posted

Thanks for "Thanks" and "Likes"! :)

 

3 hours ago, UEZ said:

It's a nice old school design. 

Thanks a lot! (Actually, I thought the design was quite modern, but apparently my idea of "modern" is as outdated as I am). :muttley:

 

3 hours ago, UEZ said:

What about an automatic slow scrolling of the text until user intervention?

Might be a good idea to add a small tune.

I'm not sure if that won't be too much. Let's see. Thanks for the ideas! :)

 

3 hours ago, UEZ said:

The GUI is flickering when scrolling the text only using the scrollbar. 

This is because of $WS_EX_TRANSPARENT. ($ES_AUTOVSCROLL is also not needed). The following workaround should help: Remove/comment out the lines with $WS_EX_TRANSPARENT and add the other two lines, as in the following code snippet.

;     $g_hRichEdit = _GUICtrlRichEdit_Create($g_hGui, "", 10, 10, 440, 340, _
;         BitOR($ES_MULTILINE, $WS_HSCROLL, $WS_VSCROLL, $ES_AUTOVSCROLL, $ES_READONLY), $WS_EX_TRANSPARENT)

    $g_hRichEdit = _GUICtrlRichEdit_Create($g_hGui, "", 10, 10, 440, 340, BitOR($ES_MULTILINE, $WS_HSCROLL, $WS_VSCROLL, $ES_READONLY))

    _GUICtrlRichEdit_SetBkColor($g_hRichEdit, 0xC0C0C0) ; medium light gray 0xC0C0C0

After that it is a nice design of the even older school:D because the RichEdit gets a frame. Does anyone know how to remove the frame so that the RichEdit looks flat? Or is it possible to unflicker the RichEdit despite transparency?

Posted
1 hour ago, Professor_Bernd said:

Does anyone know how to remove the frame so that the RichEdit looks flat?

Hi Professor_Bernd
Just remove the default $WS_EX_CLIENTEDGE extended style applied to the rich edit control

$WS_EX_CLIENTEDGE : "Specifies that a window has a border with a sunken edge."
$g_hRichEdit = _GUICtrlRichEdit_Create($g_hGui, "", 10, 10, 440, 340, BitOR($ES_MULTILINE, $WS_HSCROLL, $WS_VSCROLL, $ES_READONLY))

becoming
$g_hRichEdit = _GUICtrlRichEdit_Create($g_hGui, "", 10, 10, 440, 340, BitOR($ES_MULTILINE, $WS_HSCROLL, $WS_VSCROLL, $ES_READONLY), 0)

 

"I think you are searching a bug where there is no bug... don't listen to bad advice."

Posted

Cool! 😎 I found a solution here and here to change the ExStyle after creating the RichEdit. But that is not necessary here. So I'm using your tip that removes the border already when creating the RichEdit.

I'll include a switch to select whether the RichEdit should have a frame or not.

Thanks to all the contributors! 👍 - Now you are also in the credits. - :D

Posted

Thx Professor_Bernd :)
I was lucky to find this extended style using Yashied's tool (reworked to add control styles names) :

richedit.png.8f87c5fceb41c44e9d637f0658e58f8d.png

"I think you are searching a bug where there is no bug... don't listen to bad advice."

Posted
13 minutes ago, pixelsearch said:

Yashied's tool (reworked to add control styles names)

Looks very interesting, could be useful. Where can you get this?

----

Before I upload the changed, flicker-free version of the About dialog, there's one tiny little thing: when you move the scrollbar, the caret is displayed in RichEdit as long as you hold the scrollbar. If someone knows a solution for this, I'll add it. :)

Posted (edited)
2 hours ago, Professor_Bernd said:

Where can you get this?

Yashied's original script has been reworked and is now maintained by argumentum. Thread got 9 pages, last update in this link

2 hours ago, Professor_Bernd said:

the caret is displayed in RichEdit as long as you hold the scrollbar

I read in the forum that hiding the caret is often problematic, though a radical solution seems to work, in a script where you don't have to type anything in input/edit fields :

GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")

;==============================================================================
Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam)
  #forceref $hWnd, $iMsg, $wParam

  Local $hWndFrom = $lParam ; Handle to any CONTROL window
  DllCall($g_hUser32DLL, 'int', 'HideCaret', 'hwnd', $hWndFrom)

  Return $GUI_RUNDEFMSG
EndFUnc

 

Edited by pixelsearch

"I think you are searching a bug where there is no bug... don't listen to bad advice."

Posted
2 hours ago, pixelsearch said:

Yashied's original script has been reworked and is now maintained by argumentum. Thread got 9 pages, last update in this link

Thanks for the info and the link.

2 hours ago, pixelsearch said:

Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam) ... DllCall($g_hUser32DLL, 'int', 'HideCaret', 'hwnd', $hWndFrom)

It's crazy. :o This function alone does not cause the caret to be hidden. But with the other functions I use in the about dialog, it does just the last bit I was looking for: It hides the caret when you scroll with the scrollbar. Only when you scroll back and forth quickly does the caret flash a little.

Posted

everything seems to work and nothing flickers here (win10)

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

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

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
×
×
  • Create New...