Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

SplashText Sizer - WYSIWYG


  • Please log in to reply
5 replies to this topic
Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
Even after tooltips and traytips I find myself using SplashText sometimes. Traytips are always in short supply, no matter how many apps try, only one can use it at a time. And SplashText is always more attention grabbing than Tooltips. But its usually a pain to use trial & error for sizing it just right, as it doesn't auto-size itself like tool/tray tips.

Use this script to put in Title and Text for SplashText and size it using arrow keys... and when u get it right, press escape and the cmd reqd will be copied to clipboard... simple!... Its completely "what you see is what you get" (I guess SmartGUI is spoiling me! :wink: )



;The step-size per change (in pixels)
Step = 5

; Generated by SmartGUI Creator 3.0
Gui, Add, Edit, x6 y7 w250 h20 vSTitle, Title
Gui, Add, Edit, x6 y37 w250 h130 vSText, Text
Gui, Add, Button, x46 y177 w70 h20 Default, Ok
Gui, Add, Button, x136 y177 w70 h20, Cancel
Gui, Show, h206 w265, Enter SplashText Here:
Return


ButtonCancel:
GuiClose:
	ExitApp


ButtonOk:
	Gui, Submit
	gosub, DynamicSplash
	
	SWidth = %len%
	SHeight = %lines%
	SplashTextOn, %SWidth%, %SHeight%, %STitle%, %SText%
	HotKey, Up, Up
	HotKey, Down, Down
	HotKey, Left, Left
	HotKey, Right, Right
Return


Up:
	IfGreaterOrEqual, SHeight, %Step% 
		SHeight -= %Step%
	SplashTextOn, %SWidth%, %SHeight%, %STitle%, %SText%
Return


Down:
	SHeight += %Step%
	SplashTextOn, %SWidth%, %SHeight%, %STitle%, %SText%
Return


Left:
	IfGreaterOrEqual, SWidth, %Step%
		SWidth -= %Step%
	SplashTextOn, %SWidth%, %SHeight%, %STitle%, %SText%
Return


Right:
	SWidth += %Step%
	SplashTextOn, %SWidth%, %SHeight%, %STitle%, %SText%
Return


Esc::
	SplashTextOff
	StringReplace, SText, SText, `n, ``n, A
	SetEnv, ClipBoard,  SplashTextOn`, %SWidth%`, %SHeight%`, %STitle%`, %SText%`n
	SplashTextOn, 273, 46, Done!, The required command is copied to ClipBoard.
	Sleep, 500
	ExitApp
Return



DynamicSplash:
	setenv, charspace, 7 ;set space taken per character in text here
	setenv, linespace, 21 ;set space taken per line here

	StringSplit, piece, stext, `n
	setenv, len, 0

	Loop, %piece0%
	{
		StringLen, len0, piece%A_Index%
		ifgreater, len0, %len%, setenv, len, %len0%
	}
	setenv, lines, %piece0%
	envmult,len, %charspace%
	envmult,lines, %linespace%
	
	envadd, len, 10
Return

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
Nice one; thanks for sharing it.

beardboy
  • Members
  • 443 posts
  • Last active: May 27 2017 08:41 AM
  • Joined: 02 Mar 2004

; Generated by SmartGUI Creator 3.0

I don't have that version. ;)

thanks,
beardboy

sleepyy35
  • Members
  • 193 posts
  • Last active: Apr 23 2008 08:18 PM
  • Joined: 22 Jul 2004
hey thats nice thanx for sharing !
^sleepy^

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004

; Generated by SmartGUI Creator 3.0

I don't have that version. ;)

thanks,
beardboy


sharp vision! ... actually 3.0 is under development... seems quite stable but still needs testing... tabs affected almost all the sections and needed a lot of spl handling!

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


dekil
  • Members
  • 2 posts
  • Last active: Jan 22 2009 10:55 PM
  • Joined: 05 Jan 2009
my 1st p0st :D
Thanks, it's solution for my soft to make that view beauty. :D
Sory if my english very bad 8-)