Jump to content

Url Like Control


Recommended Posts

I have tried several attempt to create a GUI control like I want and not been successful. I was looking to emulate something I did in VB a while ago. What I wanted was text, underlined like a url, that could be clicked and then use a case statement to figure what to do next.

I tried a label but it has no click event. Next, I tried a button but could not get is of the border. Finally, I tried an edit but when made read only I could not get rid of the border and it has no click event.

Is it possible to have a url type look to text that will fire an event?

Link to comment
Share on other sites

I have tried several attempt to create a GUI control like I want and not been successful.  I was looking to emulate something I did in VB a while ago.  What I wanted was text, underlined like a url, that could be clicked and then use a case statement to figure what to do next.

I tried a label but it has no click event.  Next, I tried a button but could not get is of the border.  Finally, I tried an edit but when made read only I could not get rid of the border and it has no click event. 

Is it possible to have a url type look to text that will fire an event?

try this :D

GUICreate ( "my URL", 450, 300)

GuiSetControl("Label", "url long",  10, 30)
GuiSetControlNotify(-1,1); to close
GuiSetControlEx(-1,0,-1,"",0xFF0000); to write in blue
GuiSetControlFont(-1,10,-1,"",4); to underline

GuiWaitClose()
Link to comment
Share on other sites

Hi jpm.

This script does not return the button I would expect. The handle is 1, but the GUIRead() is 2. Am I missing something?

#include "C:\Program Files\AutoIt3\Include\AU3GUI_include.au3"

GUICreate("Shares",450,90,300,200)

GUISetControl("label","DevTool",10,25,70,25)

GuiSetControlNotify(-1,1)

GuiSetControlEx(-1,0,-1,"",0xFF0000); to write in blue

GuiSetControlFont(-1,10,-1,"",4); to underline

GUISetControl("button","DTPub",100,25,70,25)

WinActivate("Shares")

GUIWaitClose()

MsgBox(0,"",GUIRead())

Exit

Link to comment
Share on other sites

Hi jpm.

This script does not return the button I would expect.  The handle is 1, but the GUIRead() is 2.  Am I missing something?

#include "C:\Program Files\AutoIt3\Include\AU3GUI_include.au3"

GUICreate("Shares",450,90,300,200)

GUISetControl("label","DevTool",10,25,70,25)

GuiSetControlNotify(-1,1)

GuiSetControlEx(-1,0,-1,"",0xFF0000); to write in blue

GuiSetControlFont(-1,10,-1,"",4); to underline

GUISetControl("button","DTPub",100,25,70,25)

WinActivate("Shares")

GUIWaitClose()

MsgBox(0,"",GUIRead())

Exit

You get a bug corrected in 102.18C. In fact most designer use the advanced method GuiMsg with GuiNotifyMode=1 and the bug does not occurs.

Thanks for your testing :D

PS. I don't know if you rename the include file "GUI_include.au3 "to "AU3GUI_include.au3" both exist but the goog one for Autoit-gui is the first one.

Link to comment
Share on other sites

Hi jpm:

I saw 18c And tried it out. In the code below GUIRead() returns 1 no matter which line gets clicked. When I had a label and a button or two buttons it is OK.

GUICreate("Shares",200,90,300,200)

GUISetControl("label","First",10,10,100,15)

GuiSetControlNotify(-1,1)

GuiSetControlEx(-1,0,-1,"",0xFF0000); to write in blue

GuiSetControlFont(-1,10,-1,"",4); to underline

GUISetControl("label","Second",10,40,100,15)

GuiSetControlNotify(-1,1)

GuiSetControlEx(-1,0,-1,"",0xFF0000); to write in blue

GuiSetControlFont(-1,10,-1,"",4); to underline

GUIWaitClose()

MsgBox(0,"",GUIRead())

Link to comment
Share on other sites

Hi jpm:

I saw 18c And tried it out. In the code below GUIRead() returns 1 no matter which line gets clicked.  When I had a label and a button or two buttons it is OK.

GUICreate("Shares",200,90,300,200)

GUISetControl("label","First",10,10,100,15)

GuiSetControlNotify(-1,1)

GuiSetControlEx(-1,0,-1,"",0xFF0000); to write in blue

GuiSetControlFont(-1,10,-1,"",4); to underline

GUISetControl("label","Second",10,40,100,15)

GuiSetControlNotify(-1,1)

GuiSetControlEx(-1,0,-1,"",0xFF0000); to write in blue

GuiSetControlFont(-1,10,-1,"",4); to underline

GUIWaitClose()

MsgBox(0,"",GUIRead())

You right the clicking on a label always return 1 so I will check

Stay tune :D

Link to comment
Share on other sites

@jpm: maybe the problem occurs of a missing label-line in the "read-function"?

I can't see there an entry like:

...
switch (GUICtrl[i].cType)
...
   case GUI_LABEL:
   case GUI_BUTTON:
   case GUI_DATE:

Holger

Edited by Holger
Link to comment
Share on other sites

@jpm: maybe the problem occurs of a missing label-line in the "read-function"?

I can't see there an entry like:

...
switch (GUICtrl[i].cType)
...
   case GUI_LABEL:
   case GUI_BUTTON:
   case GUI_DATE:

Holger

corrected in 102.18D = unstable

Still 3 problems to check

For the Read() code the default: take care of the label the pb was coming of the way the m_iCurctrl is set.

My difficulty now is the know when it is a real click/change usualy int the WM_COMMAND handling

THanks for taking care of this team piece of work :D

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