I just noticed this aspect of CreateHyperLink (taken from the help page...)
The optional customtext$ parameter allows you to set friendly text that is displayed instead of the URL in the label. If this is set then the label's tooltip is automatically generated with the URL the link refers to. Although this masking text can be changed at any time by calling SetGadgetText, the url$ that the hyperlink gadget opens cannot be altered once the gadget has been created.
As I don't like the last sentence (and I want to be free to change the URL without destroying and recreate a new gadget) I suggest this little change to the CreateHyperLink() code
This will allow to change the URL via a SetGadgetText command. The tooltip (if any) must be defined with SetGadgetToolTip()
I think in this way the HyperLink gadget is more usable
ps: wow! I just noticed there is a new CreateSplitter gadget!
The optional customtext$ parameter allows you to set friendly text that is displayed instead of the URL in the label. If this is set then the label's tooltip is automatically generated with the URL the link refers to. Although this masking text can be changed at any time by calling SetGadgetText, the url$ that the hyperlink gadget opens cannot be altered once the gadget has been created.
As I don't like the last sentence (and I want to be free to change the URL without destroying and recreate a new gadget) I suggest this little change to the CreateHyperLink() code
Method SetText(_url$) url = _url Super.settext(_url) End Method Method SetToolTip(_url$) proxy.settooltip(_url) End Method
This will allow to change the URL via a SetGadgetText command. The tooltip (if any) must be defined with SetGadgetToolTip()
Strict Import MaxGUI.Drivers Import MaxGUI.ProxyGadgets AppTitle = "Hyperlink Test Window" Global wndMain:TGadget = CreateWindow( AppTitle, 100, 100, 300, 59, Null, WINDOW_TITLEBAR|WINDOW_CLIENTCOORDS|WINDOW_STATUS ) 'Standard Hyperlink Gadget Global hypLeft:TGadget = CreateHyperlink( "http://www.blitzbasic.com/", 2, 2, ClientWidth(wndMain)-4, 15, wndMain, LABEL_LEFT ) 'Center Aligned Hyperlink Gadget with alternate text Global hypCenter:TGadget = CreateHyperlink( "http://www.blitzbasic.com/", 2, 21, ClientWidth(wndMain)-4, 17, wndMain, LABEL_CENTER|LABEL_FRAME, "Alternate Text" ) 'Right Aligned Sunken Hyperlink Gadget with custom rollover colors set Global hypRight:TGadget = CreateHyperlink( "http://www.blitzbasic.com/", 2, 42, ClientWidth(wndMain)-4, 15, wndMain, LABEL_RIGHT, "Custom Rollover Colors" ) SetGadgetTextColor(hypRight,128,128,128) 'Set normal text color to grey. SetGadgetColor(hypRight,255,128,0) 'Set rollover color to orange. SetGadgetText hypCenter , "http://www.graphio.net" '<---- change the URL (keep the same initial tooltip) 'SetGadgetToolTip hypCenter,"my site" ' <---- change the tooltip Repeat WaitEvent() SetStatusText wndMain, CurrentEvent.ToString() Select EventID() Case EVENT_WINDOWCLOSE, EVENT_APPTERMINATE;End EndSelect Forever
I think in this way the HyperLink gadget is more usable
ps: wow! I just noticed there is a new CreateSplitter gadget!