Jump to content

Looking for a nice About window with credits area


Recommended Posts

How about now...

#include <GUIConstantsEx.au3>
#include <GuiRichEdit.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>

    Local $hGui, $hRichEdit, $iMsg
    Local $hUser32 = DllOpen("user32.dll")

    $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($hUser32, "int", "HideCaret", "hwnd", $hRichEdit) ; <--- this hides caret

While True
        $iMsg = GUIGetMsg()
        
If _IsPressed("01", $hUser32) Then
DllCall($hUser32, "int", "HideCaret", "hwnd", $hRichEdit)

EndIf
        Select
            Case $iMsg = $GUI_EVENT_CLOSE
                _GUICtrlRichEdit_Destroy($hRichEdit) ; needed unless script crashes
                ; GUIDelete()   ; is OK too
                Exit
        EndSelect
    WEnd

:D

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

Link to comment
Share on other sites

If one presses the Tab key, the complete text is selected in the RichEdit. To prevent this I use this code from MrCreatoR. Thanks a lot @MrCreatoR! :)

This also gives me the function "_IsFocused()" and I use it now to execute the DllCall(..., "HideCaret", ...) all the time when the RichEdit has the focus.

Can anyone tell me if this causes problems when the DllCall(..., "HideCaret", ...) is called all the time?

#include <GUIConstantsEx.au3>
#include <GuiRichEdit.au3>
#include <WindowsConstants.au3>

Global $g_hRichEdit

Global $g_hUser32 = DllOpen("user32.dll")

Example()

DllClose($g_hUser32)

Func Example()

  Local $hGui, $iMsg
  Local $bHotkeyForTabIsSet = False

  $hGui = GUICreate("Hide caret example", 320, 350, -1, -1)

  $g_hRichEdit = _GUICtrlRichEdit_Create($hGui, "This is a test.", 10, 10, 300, 220, _
    BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL, $ES_READONLY))
  _GUICtrlRichEdit_SetCharColor($g_hRichEdit, 0xFF0000)
  _GUICtrlRichEdit_AppendText($g_hRichEdit, @CRLF & "This is more text")

  GUISetState(@SW_SHOW)

  DllCall($g_hUser32, "int", "HideCaret", "hwnd", $g_hRichEdit)   ; <--- this hides caret initially

  While True
    $iMsg = GUIGetMsg()
    Switch $iMsg
      Case $GUI_EVENT_CLOSE
        _GUICtrlRichEdit_Destroy($g_hRichEdit)         ; needed unless script crashes
        ; GUIDelete()   ; is OK too
        ExitLoop
    EndSwitch

    If _IsFocused($hGui, $g_hRichEdit) Then

      DllCall($g_hUser32, "int", "HideCaret", "hwnd", $g_hRichEdit)   ; <--- this hides caret

      ; Intercepting the tab key.
      If $bHotkeyForTabIsSet = False Then
        $bHotkeyForTabIsSet = True
        HotKeySet("{TAB}", "TabPress")   ; <= It's just a dummy function because the RichEdit is read-only.
      EndIf
    Else
      If $bHotkeyForTabIsSet = True Then
        $bHotkeyForTabIsSet = False
        HotKeySet("{TAB}")
      EndIf
    EndIf ; If _IsFocused($hGui, $g_hRichEdit)
  WEnd
EndFunc   ;==>Example

; Autor: MrCreatoR, 2007-10-01.
; https://www.autoitscript.com/forum/topic/54322-edit-control-tab-key/?do=findComment&comment=411666
Func TabPress()
  ;   Send("^{TAB}")   ;This is the tip from Siao - Thanks!
EndFunc   ;==>TabPress

; Autor: MrCreatoR, 2007-10-01.
; https://www.autoitscript.com/forum/topic/54322-edit-control-tab-key/?do=findComment&comment=411666
Func _IsFocused($hWnd, $nCID)
  Return ControlGetHandle($hWnd, '', $nCID) = ControlGetHandle($hWnd, '', ControlGetFocus($hWnd))
EndFunc   ;==>_IsFocused

 

Link to comment
Share on other sites

7 minutes ago, Shark007 said:

I currently use a msgbox so anything would be a step up

That was the same for me, I also used a MsgBox until now. That was the reason why I was looking for something nicer. Unfortunately I found only 3 example codes, but they were all very old (2004 - 2007) and very simple. For example, none has an area for credits.

With the tip from Danyfirex it will now hopefully be a little prettier, but that is known to be a matter of taste. ;)

 

13 minutes ago, Shark007 said:
16 hours ago, argumentum said:

( and share it here for me to use )  ;)

+1    I currently use a msgbox so anything would be a step up

I think the HTML About dialog was a joke by argumentum. (If not, argumentum please excuse me!)please excuse!) Further up Chimp posted a short HTML example and I wrote of my modest HTML skills. I probably won't create an HTML About dialog anytime soon.

However, if you're interested in the About Dialog I'm putting together, I'll be happy to share it once it's done. :)

Link to comment
Share on other sites

Does anyone feel like creating a demo RTF with made up About text and made up credits? The RTF will be displayed in the left pane. As seen in the preview, feel free to make it a bit colorful and it should contain URLs and links.

The demo RTF should only contain fake data, not real data. ;)

Link to comment
Share on other sites

...since you are adamant in wanting to use rtf (... :P), you can use the built-in Windows WordPad program or an online RTF editor to create and save your rtf  "document" and then use the _GUICtrlRichEdit_StreamFromFile command to load it into the RichEdit control ...

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

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

Link to comment
Share on other sites

I have already done that. :P I load the RTF file with:

_GUICtrlRichEdit_SetText($g_hRichEdit, FileRead($sPathRTF))

 

3 minutes ago, Werty said:

I like how you talk about very old examples and then post a preview in 90's style layout with dark background and colored text.

That's because my artistic skills are as great as my HTML skills! :whistle:

Link to comment
Share on other sites

I didn't take that as a criticism either. It's just that my design skills are quite modest. :graduated: That reminds me: Since your design skills are certainly better than mine, could you create a demo RTF described above? I would be very happy and I can continue working on the code in the meantime. And I'm eager to see your design. :)

Link to comment
Share on other sites

13 minutes ago, Werty said:

I have absolutely ZERO experience with RTF, never used it.

It's not bad, I'll get it done, just takes a little longer. ;) Right now I'm trying to make the code as suitable and easy to use for everyone as possible.

 

7 minutes ago, Werty said:

How about a logo ?

That would be so cool! I would totally love a logo! :) I've often thought about a logo, but you know: my design skills ... :whistle:

"PSPad4AutoIt3" is way too long for a logo, of course. If you take as a basis "Pau3", can you do something with it? That would be really cool! :thumbsup:

By the way, your logo in the post above is good too! (only too wide for a SysTray icon) ;)

 

Link to comment
Share on other sites

oh, so now you need Icon, well, they have to be square and should not contain text as the resolution is too small for text to look good, any icon with text is an ugly icon.

Maybe something like this instead of text, still both the au3 and pspad logos..

pspad4au3.png.f561a9372cdccf1109d7c65b1ff7c3d5.png

I've been a little sloppy on the transparency job, I can fix it if you are gonna use it, didnt want to waste time if you're not going to use it.

Here's how it looks in 256x256, 128x128, 64x64, 32x32, 16x16...

pspad4au3-all.png.f554a2f551415778a8c4b6a41646aa71.png

/edit

hmmm.....

pspad4au3-1.png.45874e95fa1e85c568e03099b0529625.png

Edited by Werty
added alternative

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...