condoman Posted April 19, 2004 Share Posted April 19, 2004 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 More sharing options...
jpm Posted April 19, 2004 Share Posted April 19, 2004 LABELs should have a click event. If they don't then I believe it is a bug.Lar.You have to request the notification of a label only button have implicit close notification. Link to comment Share on other sites More sharing options...
jpm Posted April 19, 2004 Share Posted April 19, 2004 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 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 More sharing options...
condoman Posted April 19, 2004 Author Share Posted April 19, 2004 jpm, that works great. Thanks for all the hard work. Link to comment Share on other sites More sharing options...
condoman Posted April 20, 2004 Author Share Posted April 20, 2004 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 More sharing options...
jpm Posted April 20, 2004 Share Posted April 20, 2004 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 blueGuiSetControlFont(-1,10,-1,"",4); to underlineGUISetControl("button","DTPub",100,25,70,25)WinActivate("Shares")GUIWaitClose()MsgBox(0,"",GUIRead())ExitYou 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 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 More sharing options...
condoman Posted April 21, 2004 Author Share Posted April 21, 2004 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 More sharing options...
jpm Posted April 21, 2004 Share Posted April 21, 2004 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 blueGuiSetControlFont(-1,10,-1,"",4); to underlineGUISetControl("label","Second",10,40,100,15)GuiSetControlNotify(-1,1)GuiSetControlEx(-1,0,-1,"",0xFF0000); to write in blueGuiSetControlFont(-1,10,-1,"",4); to underlineGUIWaitClose()MsgBox(0,"",GUIRead())You right the clicking on a label always return 1 so I will checkStay tune Link to comment Share on other sites More sharing options...
Holger Posted April 21, 2004 Share Posted April 21, 2004 (edited) @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 April 21, 2004 by Holger Old project:GUI/Tray menu with icons and colors Other old stuff:IconFileScanner, TriState/ThreeState GUI TreeView, GUI ContextMenu created out of a TreeView Link to comment Share on other sites More sharing options...
jpm Posted April 21, 2004 Share Posted April 21, 2004 @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: Holgercorrected 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 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now