Jump to content

Need some HELP with problems I encountered (see below)


Recommended Posts

Hi,

I'm trying to create a little tool that can manage points and keep track of a score.

I couldn't seem to figure out how to do certain things, though.

Could any of you tell me what the code is to let the script check or uncheck a checkbox?

Case $SelectAllButton
               Check $Checkbox1;<----------------
               Check $Checkbox2
               Check $Checkbox3
               Check $Checkbox4
               Check $Checkbox5
               Check $Checkbox6
               Check $Checkbox7
               Check $Checkbox8
               Check $Checkbox9
               Check $Checkbox10
           Case $DeselectAllButton
               Uncheck $Checkbox1;<-----------------
               Uncheck $Checkbox2
               Uncheck $Checkbox3
               Uncheck $Checkbox4
               Uncheck $Checkbox5
               Uncheck $Checkbox6
               Uncheck $Checkbox7
               Uncheck $Checkbox8
               Uncheck $Checkbox9
               Uncheck $Checkbox10

Also, I don't know how to make a variable equal to an inputvalue (from an inputbox)... :P

$PlusMinusValue = 0
   $ChangeInput = GUICtrlCreateInput("ChangeInput", 104, 224, 73, 21)
   (...)
   Case $Apply
               $PlusMinusValue = the inputvalue of $Changeinput

And I need some help with creating a message that can be pasted somewhere, containing variables.

$Standings= "$Name1 $Points1 :: $Name2 $Points2 :: $Name3 $Points3";;;;; Like: "John 23 :: Doe 16 :: Pete 86"
   (...)
   Case $AutoPostButton
               Sleep 2000
               WinActivate("Notepad")
               Sleep 6000
               Send("{ENTER}")
               Sleep 500
               Send($Standings)
               Sleep 500
               Send("{ENTER}")

I'd really appreciate your help :unsure:

Thanks

Edited by nf67
Link to comment
Share on other sites

  • Moderators

nf67,

Q1. Look at GUICtrlSetState in the Help file. You will need to use the $GUI_[uN]CHECKED states.

Q2. Look at GUICtrlRead in the Help file. You will only need the ControlID - so GUICtrlRead($ChangeInput) will do the trick.

Q3. Use the concatenation operator "&" (Help file - "Language Reference - Operators").

$Standings = $Name1 & " " & $Points1 & " :: " & $Name2 & " " & $Points2 & " :: " & $Name3 & " " & $Points3

will give you "John 23 :: Doe 16 :: Pete 86" - assuming that the variables exist and have been set to those values, of course. ;-)

I hope this helps.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
Share on other sites

::SOLVED::

Sorry I forgot to mention that $Name1 2 and 3 are actually inputboxes (so I can fill in names) , I need the value they contain.

I tried to use GuiCtrlRead($Name1) for the content of inputbox $Name1 but it (obviously?) didn't work :D .

My attempt:

$Name1 = GUICtrlCreateInput("Name1", 24, 24, 105, 21)
$Name2 = GUICtrlCreateInput("Name2", 24, 56, 105, 21)
$Name3 = GUICtrlCreateInput("Name3", 24, 88, 105, 21)
(...)
$Standings = GUICtrlRead($Name1) & " " & $Points1 & " :: " & GUICtrlRead($Name2) & " " & $Points2 & " :: " & GUICtrlRead($Name3) & " " & $Points3

(GuiCtrlRead doesn't work, apparently )

Your other solutions were great, I've fixed the other errors now :unsure: .

EDIT: This DOES seem to work now :P Odd but nice

Edited by nf67
Link to comment
Share on other sites

  • Moderators

nf67,

GUICtrlRead is definitely what you use to read the contents of an Input control - honest!

GUICreate("Test", 200, 200)

$hInput = GUICtrlCreateInput("fred", 10, 10, 180, 20)

$sContents = GUICtrlRead($hInput)

$hLabel = GUICtrlCreateLabel($sContents, 10, 50, 180, 20)

GUISetState()

While 1
    If GUIGetMsg() = -3 Then Exit
WEnd

If you cannot get it to work, post the code you are using and we will see what else is causing the problem.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

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