Sign in to follow this  
Followers 0
GaryFrost

GUI Hyperlink control

52 posts in this topic

#1 ·  Posted (edited)

Finally got this to work

Did this was just to see how it would be done.

Edit: added the ability to have the link in the control more than 1 time.

Edit: added the ability to have multiple links i.e. http for one link, mailto for another etc...

Edit: added the ability to set the font

Edit: added the visited link setting

Edit:

Working on making this a little more user friendly.

Put the events in it's own script

added _GuiCtrlHyperLinkFont function

Edit: added _GuiCtrlHyperLinkSetLink, _GuiCtrlHyperLinkGetLinkInfo

changed: GuiCtrlHyperLinkFont to GuiCtrlHyperLinkSetFont

note: visited flag gets set, but color doesn't change like it's suppose to.

Note: Min. Operating System WinXP

Enjoy!

Gary

Edited by Jon

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites



very nice gary....

I knew you would get it done!

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

very nice gary....

I knew you would get it done!

8)

Thanks, I quickly improved on it a bit, seperated the gui from the control and created an example

also

added the ability to have multiple links i.e. http for one link, mailto for another etc...

see 1st post for files....


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Need to figure out how to change the font on the control, if anyone has done this any help would be appreciated.

Gary


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Is there any way to detect if the mouse is over a link & change the color and/or backgroundcolor? Or would you have to check mouse pos in your main messageloop?

~cdkid


AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!

Share this post


Link to post
Share on other sites

Is there any way to detect if the mouse is over a link & change the color and/or backgroundcolor? Or would you have to check mouse pos in your main messageloop?

~cdkid

I'll be looking into that when I get time, also I'll be looking into adding a tooltip to the control.

Gary


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Very nice, thanks a lot for your work. Sadly it seems to colide with FileSelectFolder. Since I use your function, the Selection Pop-Up is not rendered correct anymore, it pops-up but the selection-tree is not visible any more FileSelectFolder("","",1,@scriptdir).


This post will be edited again by Polyphem: Tomorrow, 11:55 AM

Share this post


Link to post
Share on other sites

Very nice, thanks a lot for your work. Sadly it seems to colide with FileSelectFolder. Since I use your function, the Selection Pop-Up is not rendered correct anymore, it pops-up but the selection-tree is not visible any more FileSelectFolder("","",1,@scriptdir).

Think you might want to check how your calling FileDialog

i.e.

Opt("MustDeclareVars", 1)

#include "GuiHyperLink.au3"


_Main()

Func _Main()
    Local $GUI, $msg
    Local $Links[2] = ["http://www.Autoitscript.com/forum", "mailto:custompcs@charter.net"]
    Local $Link_On[2] = ["AutoIt Script home page", "UDF Maniac"]
    $GUI = GUICreate("Hyper Link Test", 500, 250)
    $hl_hwnd[0] = _GuiCtrlHyperLinkCreate ($GUI, _
            'Welcome to the AutoIt Script home page - the home of AutoIt scripting and related applications.  Be sure to Check out AutoIt Script home page ', _
            "http://www.Autoitscript.com/forum", "AutoIt Script home page", _
            10, 10, 480, 40, $WS_DLGFRAME, $WS_EX_CLIENTEDGE)
    
    ReDim $hl_hwnd[2]
    $hl_hwnd[1] = _GuiCtrlHyperLinkCreate ($GUI,  _
            'For Question/Suggestions e-mail: UDF Maniac of the AutoIt Forum', _
            "mailto:custompcs@charter.net", "UDF Maniac", _
            10, 60, 480, 20, -1, -1, "Arial", 14)
    
    ReDim $hl_hwnd[3]
    $hl_hwnd[2] = _GuiCtrlHyperLinkCreate ($GUI, _
            'Welcome to the AutoIt Script home page - the home of AutoIt scripting and related applications.' & @LF & @LF & _
            'For Question/Suggestions e-mail: UDF Maniac of the AutoIt Forum', _
            $Links, $Link_On, _
            10, 120, 480, 70, -1, $WS_EX_CLIENTEDGE, "Arial Bold", 12, 900, True, False, False)
    
    Local $button = GUICtrlCreateButton("FileDialog",10,220,120,20)
    GUISetState(@SW_SHOW)
;Register WM_NOTIFY  events
    GUIRegisterMsg($WM_NOTIFY, "WM_Notify_Events")
    While 1
        $msg = GUIGetMsg()
        
        Select
            
            Case $msg = $GUI_EVENT_CLOSE
                Exit
            Case $msg = $button
                Local $message = "Hold down Ctrl or Shift to choose multiple files."

                Local $var = FileOpenDialog($message, "C:\Windows\", "All (*.*)|Text files (*.txt)|Images (*.jpg;*.bmp)|Videos (*.avi;*.mpg)", 1 + 4 )
                
        EndSelect
    WEnd
EndFunc  ;==>_Main

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

Thanks for your quick response gafrost. The FileOpenDialog works for me too, but FileSelectFolder does not.

Edited by Polyphem

This post will be edited again by Polyphem: Tomorrow, 11:55 AM

Share this post


Link to post
Share on other sites

Thanks for your quick response gafrost. The FileOpenDialog works for me too, but FileSelectFolder does not.

Sorry, see what you mean, I'll look into it, should of had another cup of coffee before answering this morning.

Gary


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

comment out line 212 in the include file

line should containe

Local $coint = DllCall('ole32.dll', 'long', 'CoInitializeEx', 'int', 0, 'long', $COINIT_DISABLE_OLE1DDE)

Looks like the hyperlink still works with-out that line, and the folderdialog also works.


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Perfect, works for me as desired :think:, thanks a lot gafrost.


This post will be edited again by Polyphem: Tomorrow, 11:55 AM

Share this post


Link to post
Share on other sites

Just a question, cant you just like.. make a GUI, colored blue.. and do Case $msg = $linkbutton

launch broswer and navigate to site code here

or w/e ? :think:

Share this post


Link to post
Share on other sites

Just a question, cant you just like.. make a GUI, colored blue.. and do Case $msg = $linkbutton

launch broswer and navigate to site code here

or w/e ? :think:

yes you could, or a label, as was done in my old about example

but this way the whole control does not ack like a link, only the parts that need too.


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Note: Min. Operating System WinXP

Enjoy!

Gary

Hello! Do you have thought of the future that the program also works on Win98 SE?

(I living in the past...) lol

Share this post


Link to post
Share on other sites

Hello! Do you have thought of the future that the program also works on Win98 SE?

(I living in the past...) lol

The SysLink control is defined in the ComCtl32.dll version 6


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Hi there everybody,

is there any way to use this magnific GUI Hyperlink control with colouring and sizing the hyperlink itself, e.g.

the text is in size Arial 10 and coloured black, but I want to have the hyperlink to appear in size 12 and coloured red.

I tried to change the part in the GUIHyperlinkControl.au3 file where the anchor point is repleced with corresponding html commands to be included but did not get the result as expected, means the additional html commands are not used but displayed as text of the link itself.

Greetings Harald

Share this post


Link to post
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
Sign in to follow this  
Followers 0