Sign in to follow this  
Followers 0
Bearpocalypse

Insanely stupid problem, but I can't figure it out...two of us at work can't.

6 posts in this topic

Now, I have a toolkit I use that uses ClipPut a good bit. I'm writing a small form for a semi-automated install until I, or a couple of co-workers can figure out how to get some information pre-configured. I am having the hardest time getting ClipPut to play nice. My other script has no problems, like I said. I've recreated exactly how I have it but to no avail. I can get the data copied without calling a function. Here is my code, nothing complex. Can anyone tell me what in the world is wrong and why the problem seems to haunt me. I feel silly asking about something this simple.

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>


$IP = "1.1.1.1"
$Desc = "Something meaningful"
$Port = "0000"


#region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 375, 152, 192, 124)
$Label1 = GUICtrlCreateLabel("This is my IP", 8, 24, 185, 21)
$Label2 = GUICtrlCreateLabel("This is my Description", 8, 56, 185, 21)
$Label3 = GUICtrlCreateLabel("This is my Port", 8, 88, 185, 21)
$IPButton = GUICtrlCreateButton("<-- Copy", 288, 24, 75, 25)
GUICtrlSetOnEvent(-1, "_IP")
$DescButton = GUICtrlCreateButton("<-- Copy", 288, 56, 75, 25)
GUICtrlSetOnEvent(-1, "_Desc")
$PortButton = GUICtrlCreateButton("<-- Copy", 288, 88, 75, 25)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###


Func _IP()
    GUICtrlRead(ClipPut($IP))
EndFunc   ;==>_IP

Func _Desc()
    ClipPut($Desc)
EndFunc   ;==>_Desc

Func _Port()
    ClipPut($Port)
EndFunc   ;==>_Port


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

Share this post


Link to post
Share on other sites



Bearpocalypse,

What is "GUICtrlRead(ClipPut($IP))" supposed to do? :huh:

And if you want specific help, how about telling us what problem you are having and what is the desired end-state - at the moment we have no idea of the required configuration of your information, which makes it a bit difficult to suggest how to get it. ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

BTW there will be a choice to make between OnEvent and GuiGetMsg()

Share this post


Link to post
Share on other sites

That part was supposed to be deleted out. Tidy seems to have put it back in. I'm wanting to have the associated button just simply copy the information. IE, IPButton copy 1.1.1.1 to the clipboard.

 

Bearpocalypse,

What is "GUICtrlRead(ClipPut($IP))" supposed to do? :huh:

And if you want specific help, how about telling us what problem you are having and what is the desired end-state - at the moment we have no idea of the required configuration of your information, which makes it a bit difficult to suggest how to get it. ;)

M23

Share this post


Link to post
Share on other sites

OK, it seems that you just forgot to put

Opt("GuiOnEventMode", 1)

at the top of the script

Share this post


Link to post
Share on other sites

Ah, don't I feel silly. Thanks for pointing out my and my co-workers oversight. Once again, you all are great!

Share this post


Link to post
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
Sign in to follow this  
Followers 0