floating tooltip/information

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
archaismic
Newbie
Posts: 9
Joined: Mon Nov 29, 2010 10:54 am
Contact:

floating tooltip/information

Post by archaismic » Tue Jan 25, 2011 10:32 pm

is there a way to put a floating tool tip/information text block into the script? for instance

SRT>blah
tooltip>doing stuff
stuff stuff stuff
endtooltip
END>blah

? just something the will pop up and say what the script is doing?

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Tue Jan 25, 2011 10:39 pm

I posted a sample HERE

archaismic
Newbie
Posts: 9
Joined: Mon Nov 29, 2010 10:54 am
Contact:

Post by archaismic » Tue Jan 25, 2011 11:17 pm

found it... read it... not sure how to use it. do you just run the whole script and then insert the tooltip srt where you want a tooltip? is the rest of that just to set up the tooltip?

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Tue Jan 25, 2011 11:35 pm

Here's a simplified version. There are four code lines that will need your attention.

The "Text" variable is the text you want to display,
The "VarX" variable is the length of the text line before it wraps
The "Display_Dwell" variable is the time in seconds for the tooltip to display.

Then you have to set parameters in the GoSub>ToolTip line to control:

position on the screen
size of the dialog
the font
the font size
the font style
the font color
the background colors.

Experiment. you won't break anything.

Hope this helps.

Code: Select all

//Set these 3 variables then go to OTHER below
//The text to be displayed in our dialog
Let>Text=Start with a borderless dialog. Give the dialog a color and a line of text to display.
//Word wrap after VarX characters
Let>VarX=30
//How long to let the tooltip display
Let>Display_Dwell=5


//A dialog to be the text showcase.
Dialog>Dialog1
Caption=D~L~o~g1
Top=-1000000
Label=,12,8,True
EndDialog>Dialog1

Show>Dialog1
LibFunc>user32,SetWindowLongA,sres,Dialog1.handle,-16,1
CloseDialog>Dialog1

//Bob Hansen's word wrap RegEx sequestered in a subroutine.
//Usage:
//GoSub>WordWrap,Wrap Length,String
GoSub>WordWrap,VarX,Text



//OTHER
//Set these as needed for size, location and color
//Usage:
//GoSub>ToolTip,Xpos,Ypos,Wide,Tall,Text[,Font,Size,Style,TextColor[,BackColor]]
GoSub>ToolTip,500,100,200,90,WordWrapResult,Arial,12,0,16646144,6881279





//Display the message for a moment then close the window
Wait>Display_Dwell
CloseDialog>Dialog1
////****************************************************************

SRT>ToolTip
Let>Dialog1.mslabel1=ToolTip_var_5
ResetDialogAction>Dialog1
Show>Dialog1
SetDialogObjectColor>Dialog1,,ToolTip_var_10
SetDialogObjectFont>Dialog1,mslabel1,ToolTip_var_6,ToolTip_var_7,ToolTip_var_8,ToolTip_var_9
LibFunc>user32,ShowScrollBar,sbres,Dialog1.handle,3,0
MoveWindow>D~L~o~g1,ToolTip_var_1,ToolTip_var_2
ResizeWindow>D~L~o~g1,ToolTip_var_3,ToolTip_var_4
LibFunc>user32,ShowScrollBar,sbres,Dialog1.handle,3,0
END>ToolTip

SRT>WordWrap
Let>vNeedle=(.{1,%WordWrap_var_1%})(%SPACE%|$)
Let>vHaystack=%WordWrap_var_2%
RegEx>%vNeedle%,%vHaystack%,0,matches,matchnum,1,$1%CRLF%,WordWrapResult
END>WordWrap


Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts