Jump to content

Notify - New version 17 Mar 22


Melba23
 Share

Recommended Posts

  • Moderators

mike2003,

Did you bother to read the _Notify_Size function header?

; Parameters ....: $iHeight   - Height in pixels of notification
;                                   Minimum = 40 (default)
;                                   Maximum = at least 8 notification will fit onscreen
;                  $iMinWidth - Minimum width of notification
;                                   Default 160 - must be at least 4 * $iHeight
;                  $iMaxWidth - Maximum width of notification
;                                   Default 320 - maximum of 10 * $iHeight

You were getting an @error/@extended return  of 2/1 telling you that the dimensions you had chosen did not meet those requirements (not able to fit at least 8 notifications into the screen). If I adjust the values to be within the limits I get all notifications correctly sized.

_Notify_Size(100, 500, 1000)

And the first one shows as the text now actually fits into the GUI - you were getting an @error/@extended of 5/1 from the _Notify_Show function which is explained in its own header:

; 5 = Title/text will not fit in widest message (@extended = 0/1 = Title/Text)

Anyway, as you still only get 2 lines of text, why are you setting such a large height for the notifications?

M23

Edited by Melba23
Added a bit more explanation

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 comment
Share on other sites

  • 1 month later...

Notify_Example_3.au3

Found a little bug here...

;~ $iMax = $aNotify_Data[0][1] <<== $aNotify_Data: possibly used before declaration.
$iMax = $g_aNotify_Data[0][1]

 

Notify.au3

...
For $i = 0 To UBound($g_aNotify_Settings, 2) - 1
    $g_aNotify_Settings[1][$i] = $g_aNotify_Settings[0][$i]
Next
...

Please wrap the For...Next in a function, otherwise $i will become a global variable, which is very ugly.

#include "Notify.au3"
ConsoleWrite('$i = ' & $i & @CRLF) ; $i = 9

Link to comment
Share on other sites

  • Moderators

Bitnugger,

Oops - theExample_3  version in the zip is not the one I have in my repository, which does use $g_aNotify_Data. No idea how it happened, but I will make sure the next release will contain the correct example script.

The loop variable $i will not become a Global variable - as explained in the Help file for For...To...Step...Next:

Quote

The variable will be created automatically with Local scope, even when MustDeclareVars is on

M23

Edit: Ah, I see the loop is actually in the main script, so that will probably not be the case. However, I really do not think is is a big deal as $i is pretty commonly used for loop variables and will be reinitialised each time a For..To...Step...Next loop is set up. Plus anyone who uses $i as a standard variable name is not being very sensible. However, now you have brought it to my attention I will change the loop variable to $g_iNotifyCounter so that it is unlikely to cause a problem.

Edited by Melba23

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 comment
Share on other sites

  • Melba23 changed the title to Notify - New version 17 Mar 22
  • Moderators

[NEW VERSION] - 17 Mar 22

Added: A new function _Notify_Size which allows you to adjust the size of the notification from its default 160x40. Please read the function header to see the max/min sizes that you can set for the width and height - the function returns informative @error/@extended values if these are not respected. Regardless of the size set, each notification will still display only 2 lines of text with the size of font used set automatically by the UDF.

New UDF in the first post.

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 comment
Share on other sites

  • 7 months later...
  • Moderators

mike2003,

Obviously a project of some importance seeing it was 9 months ago that you asked me to fix the sizing problem! Did you read the post I made at the top of this page where I explained in some detail why your own example did not work and gave you the required fix?

Quote

you have a check inside, it is crooked and with an error

Charming! Just what do you not like about the changes I made in the new(ish) version of the UDF? Perhaps you could take the time to tell us just what is wrong (in your eyes) and how it might be "improved".

Over to 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 comment
Share on other sites

$iHeight = 71
$e = _Notify_Size($iHeight, 4 * $iHeight, 10 * $iHeight)

$e = error in iMaxWidth step (Force to even)

----

Truncate title/text must be OFF default. It is always better to show than not to show for minimal settings. Otherwise, the whole message simply disappears.

 

Link to comment
Share on other sites

  • Moderators

mike2003,

For the first of your cryptic messages, I presume you are complaining that the $iHeight value is forced to an even number within the function which means that the function fails as $iMaxWidth is now more than 10 times the original odd value of $iHeight. I chose to force the height parameter of this function to an even number to simplify the later drawing of the Notification - both lines will be the same size when the height is even. By setting the values for min/max width of the Notification to the absolute limit you have found an edge case which I will look into to see if it can be resolved - although the final solution may be as simple as adding a warning that odd $iHeight values will be rounded up.

As to the second, the _Notify_Show function returns an @error/@extended pair to tell you that the required string will not fit in the Notification. I disagree that the current behaviour should be altered - the user can easily change the function behaviour by using the $bProc parameter in a _Notify_Set call and the function failure is quite clearly shown by the return value.

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 comment
Share on other sites

  • Moderators

MaximusCZ,

Just download the UDF zip and run the examples!

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 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...