randeep Posted June 24, 2009 Share Posted June 24, 2009 hello all i have created a GUI window. Now i want to place "." at the input of IP Address. it should not be editable or replaceable and should be counted as part of IP address. the input window will look like " . . . " , but not able to apply. pls help thanx expandcollapse popup#include "Variable Declaration.au3" #include <GUIConstantsEx.au3> #include <GUIConstants.au3> #include <EditConstants.au3> #include <WindowsConstants.au3> #include <Process.au3> #INCLUDE <File.au3> InputWindowForSingleSite() Func InputWindowForSingleSite() Local $msg1, $Btn_OK, $Label1, $Label2, $Label3, $Label4, $Label5, $Input1, $Input2, $Input3, $Input4, $Input5, $MainLabel, $InputWindowHandle Local $RetValue = True Opt("GUIOnEventMode",0) $InputWindowHandle = GUICreate("Details for Single Sites", 250, 250, -1, -1, $WS_EX_DLGMODALFRAME) ; will create a dialog box that when displayed is centered GUISetIcon("ARTEVEAI.ICO",-20) $MainLabel = GUICtrlCreateLabel("Please provide following details", 10, 20) $Label1 = GUICtrlCreateLabel("Database Name", 10, 50) $Label2 = GUICtrlCreateLabel("IP Address", 10, 80) $Label3 = GUICtrlCreateLabel("HostName", 10, 110) $Label4 = GUICtrlCreateLabel("Username", 10, 140) $Label5 = GUICtrlCreateLabel("Password", 10, 170) $Input1 = GUICtrlCreateInput("", 150, 43, 80) ;for DB Name $Input2 = GUICtrlCreateInput("", 150, 73, 80, 0, $ES_NUMBER) ;for Ip address $Input3 = GUICtrlCreateInput("", 150, 103, 80) $Input4 = guictrlcreateinput("", 150, 133, 80) ;for Username $Input5 = guictrlcreateinput("", 150, 163, 80) ;for password $Btn_OK = GUICtrlCreateButton("OK", 90, 193, 80) ;OK button GuiCtrlSetState($Btn_OK, $GUI_Disable) GUISetState() Local $Enabled = False While 1 $msg1 = GUIGetMsg() If GuiCtrlRead($Input1) And GuiCtrlRead($Input3) And GuiCtrlRead($Input4) And GuiCtrlRead($Input5) <> "" And $Enabled = False Then GuiCtrlSetState($Btn_OK, $GUI_ENABLE) $Enabled = True EndIf Select Case $msg1 = $Btn_OK $InputOfInputBoxDataBaseName = GUICtrlRead($Input1) $InputOfInputBoxIP = GUICtrlRead($Input2) $InputOfInputBoxHostName = GUICtrlRead($Input3) $InputOfInputBoxUserName = GUICtrlRead($Input4) $InputOfInputBoxPassword = GUICtrlRead($Input5) $RetValue = True ExitLoop Case $msg1 = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd GuiDelete($InputWindowHandle) WinWaitClose("Provide Details") Opt("GUIOnEventMode",1) EndFunc [font="Palatino Linotype"]Randeep Singh[/font][sub][/sub] Link to comment Share on other sites More sharing options...
BrettF Posted June 24, 2009 Share Posted June 24, 2009 Did you neglect to see _GUICtrlIpAddress_Create in the help file? Cheers, Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
KenNichols Posted June 24, 2009 Share Posted June 24, 2009 Check out http://www.autoitscript.com/forum/index.php?showtopic=97293 [topic="21048"]New to AutoIt? Check out AutoIt 1-2-3![/topic] Need to make a GUI? You NEED KODA FormDesigner! Link to comment Share on other sites More sharing options...
randeep Posted June 24, 2009 Author Share Posted June 24, 2009 now not able to have desired output of "$InputOfInputBoxIP" at below of function. expandcollapse popup#include <GUIConstantsEx.au3> #include <GUIConstants.au3> #include <EditConstants.au3> #include <WindowsConstants.au3> #include <Process.au3> #INCLUDE <File.au3> #Include <GuiIPAddress.au3> InputWindowForSingleSite() global $InputOfInputBoxDataBaseName, $InputOfInputBoxIP, $InputOfInputBoxHostName, $InputOfInputBoxUserName, $InputOfInputBoxPassword Func InputWindowForSingleSite() Local $msg1, $Btn_OK, $Label1, $Label2, $Label3, $Label4, $Label5, $Input1, $Input2, $Input3, $Input4, $Input5, $MainLabel, $InputWindowHandle Opt("GUIOnEventMode",0) $InputWindowHandle = GUICreate("Details for Single Sites", 250, 250, -1, -1, $WS_EX_DLGMODALFRAME) ; will create a dialog box that when displayed is centered GUISetIcon("ARTEVEAI.ICO",-20) $MainLabel = GUICtrlCreateLabel("Please provide following details:", 10, 20) $Label1 = GUICtrlCreateLabel("Database Name", 10, 50) $Label2 = GUICtrlCreateLabel("IP Address", 10, 80); $Label3 = GUICtrlCreateLabel("Host Name", 10, 110) $Label4 = GUICtrlCreateLabel("Username", 10, 140) $Label5 = GUICtrlCreateLabel("Password", 10, 170) $Input1 = GUICtrlCreateInput("", 150, 43, 90) ;for DB Name $Input2 = _GUICtrlIpAddress_Create ($InputWindowHandle, 150, 70, 90);GUICtrlCreateInput("", 150, 73, 80, 0);, $ES_NUMBER ;for Ip address _GUICtrlIpAddress_Set ($Input2, "000.000.000.000") $Input3 = GUICtrlCreateInput("", 150, 103, 90) $Input4 = guictrlcreateinput("artevea", 150, 133, 90) ;for Username $Input5 = guictrlcreateinput("tmatrix", 150, 163, 90) ;for password $Btn_OK = GUICtrlCreateButton("OK", 90, 193, 80) ;OK button GuiCtrlSetState($Btn_OK, $GUI_Disable) GUISetState() Local $Enabled = False While 1 $msg1 = GUIGetMsg() If GuiCtrlRead($Input1) And GuiCtrlRead($Input3) And GuiCtrlRead($Input4) And GuiCtrlRead($Input5) <> "" And $Enabled = False Then GuiCtrlSetState($Btn_OK, $GUI_ENABLE) $Enabled = True EndIf Select Case $msg1 = $Btn_OK $InputOfInputBoxDataBaseName = GUICtrlRead($Input1) $InputOfInputBoxIP = GUICtrlRead($Input2) $InputOfInputBoxHostName = GUICtrlRead($Input3) $InputOfInputBoxUserName = GUICtrlRead($Input4) $InputOfInputBoxPassword = GUICtrlRead($Input5) ExitLoop Case $msg1 = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd GuiDelete($InputWindowHandle) WinWaitClose("Provide Details") Opt("GUIOnEventMode",1) EndFunc msgbox(0, "", $InputOfInputBoxIP) [font="Palatino Linotype"]Randeep Singh[/font][sub][/sub] Link to comment Share on other sites More sharing options...
BrettF Posted June 24, 2009 Share Posted June 24, 2009 (edited) Now this is evidence of limited looking at the help file. So let me go through the steps to find your answer... We have a look for _GUICtrlIpAddress_Create (). We find it. We look at the included example. We notice that it sets the value of the control. We have a look to see what the function is. We notice that the function _GUICtrlIpAddress_Set. We then ponder to ourselves... 'I wonder if there is the reverse of that function?', which leads us to _GUICtrlIpAddress_Get, the function we are searching for. Is that extremely hard? The whole process shouldn't have taken more than 2minutes. Cheers, Brett Edited June 24, 2009 by BrettF Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
KenNichols Posted June 24, 2009 Share Posted June 24, 2009 Use _GUICtrlIpAddress_Get($InputOfInputBoxIP) [topic="21048"]New to AutoIt? Check out AutoIt 1-2-3![/topic] Need to make a GUI? You NEED KODA FormDesigner! Link to comment Share on other sites More sharing options...
randeep Posted June 24, 2009 Author Share Posted June 24, 2009 newbie actually will read help file carefully thanxNow this is evidence of limited looking at the help file. So let me go through the steps to find your answer...We have a look for _GUICtrlIpAddress_Create (). We find it. We look at the included example. We notice that it sets the value of the control. We have a look to see what the function is. We notice that the function _GUICtrlIpAddress_Set. We then ponder to ourselves... 'I wonder if there is the reverse of that function?', which leads us to _GUICtrlIpAddress_Get, the function we are searching for.Is that extremely hard? The whole process shouldn't have taken more than 2minutes.Cheers,Brett [font="Palatino Linotype"]Randeep Singh[/font][sub][/sub] Link to comment Share on other sites More sharing options...
randeep Posted June 24, 2009 Author Share Posted June 24, 2009 @KenNichols thanx for ur help Use _GUICtrlIpAddress_Get($InputOfInputBoxIP) [font="Palatino Linotype"]Randeep Singh[/font][sub][/sub] Link to comment Share on other sites More sharing options...
BrettF Posted June 24, 2009 Share Posted June 24, 2009 It should be your first port of call. Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! 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