Jump to content

GUI Hyperlink control


GaryFrost
 Share

Recommended Posts

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.

 

Link to comment
Share on other sites

  • Replies 51
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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.

 

Link to comment
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!
Link to comment
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.

 

Link to comment
Share on other sites

  • 4 weeks later...

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
Link to comment
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.

 

Link to comment
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.

 

Link to comment
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.

 

Link to comment
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.

 

Link to comment
Share on other sites

  • 2 weeks later...

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.

 

Link to comment
Share on other sites

  • 1 month later...

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

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