PleasantNotify() - Beautiful popup msg, tooltip

Post your working scripts, libraries and tools
User avatar
Soft
Posts: 174
Joined: 07 Jan 2015, 13:18
GitHub: visionary1
Location: Seoul
Contact:

PleasantNotify() - Beautiful popup msg, tooltip

22 Jan 2015, 01:54

PleasantNotify CornerNotify Continuation

CornerNotify > PleasantNotify
●Added Fade In, Fade Out animation when show, exit
●Round Corner
●Optimized SourceCode
●Added persistent mode for time parameter
●Can modify Width and Height


/ Tested on AutoHotkey_L 32bit v1.1.19.1
/ based on 'Corner Notify' by robertcollier4
/ Credits robertcollier4, Learning One, lagomorph, joedf and all AHK forum users
/ Last Modified by Soft 2015/01/23


Image

Instruction
● To Create PleasantNotification
PleasantNotify(Title, Messages, width, height, position, time)
*Title - you can use variable, else must be String
*Messages - same as Title
*width - GUI width for PleasantNotify, if omited 700
*height - GUI height for PleasantNotify, if omitted 300
*position - GUI postion for PleasantNotify, it omitted bottom right corner

position argument syntax is to create a string with the following:
t=top, vc= vertical center, b=bottom
l=left, hc=horizontal center, r=right

*time - remaining time for PleasantNotify, if omitted 10
write "P" for Persistent remain, Notify_Destroy() to destroy


● To Destroy PleasantNotification GUI
Notify_Destroy()

● To Modify PleasantNotify's Title and Message
pn_mod_title(title)
pn_mod_msg(message)


Lib File

Code: [Select all] [Expand] [Download] (PleasantNotify.ahk)GeSHi © Codebox Plus



Example Script just test it out! function included

Code: [Select all] [Expand] [Download] (Example.ahk)GeSHi © Codebox Plus



Ideas are welcome! :D

Reference
CornerNotify http://www.autohotkey.com/board/topic/94458-msgbox-or-traytip-replacement-monolog-non-modal-transparent-msg-cornernotify/
WinMove http://www.autohotkey.com/board/topic/72630-gui-bottom-right/#entry461385
Winfade http://ahkscript.org/boards/viewtopic.php?f=6&t=512
Last edited by Soft on 22 Jan 2015, 21:56, edited 5 times in total.
AutoHotkey & AutoHotkey_H v1.1.22.07
User avatar
joedf
Posts: 6286
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada, Quebec
Contact:

Re: PleasantNotify() - Beautiful popup msg, tooltip

22 Jan 2015, 11:35

Nice script! also you're using winfade (viewtopic.php?f=6&t=512) ! Awesome! ;)
User avatar
boiler
Posts: 2370
Joined: 21 Dec 2014, 02:44

Re: PleasantNotify() - Beautiful popup msg, tooltip

22 Jan 2015, 11:59

Very nice. It looks like it's easily modifiable for different colors and to position it where I want, such as over the main gui of the calling script, or at least on the same monitor that the main gui is in. Since you're looking for ideas, you might consider adding color parameters and perhaps an optional parameter that would be the hwnd of a window, and it will appear over that window, positioned relative to the extents of that window by the position parameter (t hc, b hc, etc.).
User avatar
Soft
Posts: 174
Joined: 07 Jan 2015, 13:18
GitHub: visionary1
Location: Seoul
Contact:

Re: PleasantNotify() - Beautiful popup msg, tooltip

22 Jan 2015, 21:44

joedf wrote:Nice script! also you're using winfade (viewtopic.php?f=6&t=512) ! Awesome! ;)


oh thank you! I missed it
AutoHotkey & AutoHotkey_H v1.1.22.07
User avatar
Chef
Posts: 50
Joined: 14 Nov 2013, 13:01

Re: PleasantNotify() - Beautiful popup msg, tooltip

22 Jan 2015, 22:27

GDI is the only way to get eye-candy in ahk

This doesn't look good :/
Image
User avatar
Soft
Posts: 174
Joined: 07 Jan 2015, 13:18
GitHub: visionary1
Location: Seoul
Contact:

Re: PleasantNotify() - Beautiful popup msg, tooltip

22 Jan 2015, 22:53

Chef wrote:GDI is the only way to get eye-candy in ahk

This doesn't look good :/
Image


Agree :cry:
I'm trying to implement this to GDI right now

@boiler
OK
AutoHotkey & AutoHotkey_H v1.1.22.07
User avatar
evilC
Posts: 4179
Joined: 27 Feb 2014, 12:30

Re: PleasantNotify() - Beautiful popup msg, tooltip

23 Jan 2015, 06:44

Nice, I may well have a use for this in the future.

May I make a suggestion regarding the GUI?

What I would suggest is something like this:

Gui, New, HwndPopupHwnd
Gui, % PopupHwnd ":Add" ....

This would allow any number of notify windows to be on-screen at one time.
Last edited by evilC on 23 Jan 2015, 06:50, edited 1 time in total.
vasili111
Posts: 747
Joined: 21 Jan 2014, 02:04
Location: Georgia

Re: PleasantNotify() - Beautiful popup msg, tooltip

23 Jan 2015, 08:52

Please post it here too: viewtopic.php?f=6&t=3851&start=60
DRAKON-AutoHotkey: Visual programming for AutoHotkey.
User avatar
Soft
Posts: 174
Joined: 07 Jan 2015, 13:18
GitHub: visionary1
Location: Seoul
Contact:

Re: PleasantNotify() - Beautiful popup msg, tooltip

23 Jan 2015, 14:48

@evilC - hmm.. okay
@vasili111 - I did! thank you
AutoHotkey & AutoHotkey_H v1.1.22.07
User avatar
evilC
Posts: 4179
Joined: 27 Feb 2014, 12:30

Re: PleasantNotify() - Beautiful popup msg, tooltip

23 Jan 2015, 15:22

Here you go - this is the direction I think you should go with this project.

This sample code is part-classified - I just made the gui creation part into a class and used the HWND of the GUI as the unique identifier for the GUI.

So as you can see, you can have loads of notifications on-screen at one time.
They still all share the global variables though, so you would need to make it use versions of those variables from the class instance instead.

Code: [Select all] [Expand] [Download] (Script.ahk)GeSHi © Codebox Plus

User avatar
evilC
Posts: 4179
Joined: 27 Feb 2014, 12:30

Re: PleasantNotify() - Beautiful popup msg, tooltip

23 Jan 2015, 15:25

Also, the code as-is changes the default GUI.
So, for example, if your code got called mid-way through adding some stuff to a ListView, you would break that code.

So before you start messing with any GUIs, store the current "LastFound" HWND:

lastfound := WinExist()

then when done creating and adding to GUIs, execute:

Gui, % lastfound ":+Lastfound"

You might even want to declare Critical to stop it being interrupted.
User avatar
evilC
Posts: 4179
Joined: 27 Feb 2014, 12:30

Re: PleasantNotify() - Beautiful popup msg, tooltip

23 Jan 2015, 17:03

Here's what I have so far:

As much encapsulated inside a class as possible - minimum stuff in the global scope.
Old version used global vars such as w

Only uses PleasantNotify class name and function names _NotifyTimer and _NotifyOK

Unlimited number of notifications active at one time.

OK button for persistent notifications.

It lacks changing title or text for now, but those could be added quite easily

Code: [Select all] [Expand] [Download] (Script.ahk)GeSHi © Codebox Plus

User avatar
boiler
Posts: 2370
Joined: 21 Dec 2014, 02:44

Re: PleasantNotify() - Beautiful popup msg, tooltip

23 Jan 2015, 17:35

I was going to suggest an OK button. Very useful. If it could just show up in the same monitor as the gui from the calling script (if there is one), it would be great.

However, it's not useful (to me) yet if it's only usable with the new test build of AHK.
User avatar
evilC
Posts: 4179
Joined: 27 Feb 2014, 12:30

Re: PleasantNotify() - Beautiful popup msg, tooltip

23 Jan 2015, 17:41

boiler wrote:I was going to suggest an OK button. Very useful. If it could just show up in the same monitor as the gui from the calling script (if there is one), it would be great.

However, it's not useful (to me) yet if it's only usable with the new test build of AHK.

You mean requiring the test build is an issue, or requiring the newest AHK version when this is merged into the main branch?
User avatar
boiler
Posts: 2370
Joined: 21 Dec 2014, 02:44

Re: PleasantNotify() - Beautiful popup msg, tooltip

23 Jan 2015, 17:43

It will be fine when it is merged into the main branch. I guess if that's happening soon, then it's fine.
User avatar
Relayer
Posts: 112
Joined: 30 Sep 2013, 13:09
Location: Delaware, USA

Re: PleasantNotify() - Beautiful popup msg, tooltip

23 Jan 2015, 17:59

evilC,

The bind() function works just fine in v1.1.16.05

Relayer

Return to “Scripts and Functions”

Who is online

Users browsing this forum: HomePlayer and 22 guests