Jump to content

All inputs?


AlphaWolf
 Share

Recommended Posts

Hi,

I'm looking to make a program that can add some numbers up and get input from you, can you help me with getting a box to type in ( that will only allow numbers) and a drop down list that will give out a numeric value?

This is so you can choose months ( X12 ) and weeks ETC.

I should be able to do the rest, apart from that it maybe writes to .txt or something, and can then read the saved details from the .txt?

Thanks

Joe

p.s, i'm just trying to get you guys to do it all,i just want pointing in the right direction :)

Link to comment
Share on other sites

Tell me if im wrong. Is this where you are looking for?

I'm looking to make a program that can add some numbers up and get input from you, can you help me with getting a box to type in ( that will only allow numbers)

GUICtrlCreateInput ( "text", left, top [, width [, height [, style [, exStyle]]]] )
text The text of the control. 
left The left side of the control. If -1 is used then left will be computed according to GUICoordMode. 
top The top of the control. If -1 is used then top will be computed according to GUICoordMode. 
width [optional] The width of the control (default is the previously used width). 
height [optional] The height of the control (default is the previously used height). 
style [optional] Defines the style of the control. See GUI Control Styles Appendix.

default ( -1) : $ES_LEFT, $ES_AUTOHSCROLL
forced styles : $WS_TABSTOP only if no $ES_READONLY. $ES_MULTILINE is always reset.  
exStyle [optional] Defines the extended style of the control. See Extended Style Table. 

GUICtrlCreateEdit ( "text", left, top [, width [, height [, style [, exStyle]]]] )
text The text of the control. 
left The left side of the control. If -1 is used then left will be computed according to GUICoordMode. 
top The top of the control. If -1 is used then top will be computed according to GUICoordMode. 
width [optional] The width of the control (default is the previously used width). 
height [optional] The height of the control (default is the previously used height). 
style [optional] Defines the style of the control. See GUI Control Styles Appendix.

default ( -1) : $ES_WANTRETURN, $WS_VSCROLL, $WS_HSCROLL, $ES_AUTOVSCROLL, $ES_AUTOHSCROLL
forced styles : $ES_MULTILINE, $WS_TABSTOP only if not $ES_READONLY 
exStyle [optional] Defines the extended style of the control. See Extended Style Table.

$ES_NUMBER          // Accepts into the edit control only digits to be typed.

and a drop down list that will give out a numeric value?

GUICtrlCreateCombo ( "text", left, top [, width [, height [, style [, exStyle]]]] )
text The text which will appear in the combo control. 
left The left side of the control. If -1 is used then left will be computed according to GUICoordMode. 
top The top of the control. If -1 is used then top will be computed according to GUICoordMode. 
width [optional] The width of the control (default is the previously used width). 
height [optional] The height of the control (default is the previously used height). 
style [optional] Defines the style of the control. See GUI Control Styles Appendix.

default (-1) : $CBS_DROPDOWN, $CBS_AUTOHSCROLL, $WS_VSCROLL
forced style : $WS_TABSTOP 
exStyle [optional] Defines the extended style of the control. See Extended Style Table. 

GUICtrlSetData ( controlID, data [, default] )
controlID The control identifier (controlID) as returned by a GUICtrlCreate... function. 
data For Combo, List, ListView, ListViewItem : itemtext separated with Opt("GUIDataSeparatorChar",...)
For Progress : percent value
For Slider : value
For Group, Label, Button, Checkbox, Radio, Combo, List, Input, Edit, TabItem : text update
For Date : date or time depending the style of the control
For TreeViewItem: text update
For Dummy : value. 
default [optional]
for Combo, List : the value that will be the default.
for Edit, Input : if defined and not "" the "data" string is inserted not overriding the previous value at the caret point. 


Example:
$Combo1 = GUICtrlCreateCombo("1", xx, xx, xx, xx)
GUICtrlSetData($Combo1, "2|3|4|5|6|7|8|9|10|11|11", "1")

This is so you can choose months ( X12 ) and weeks ETC.

GUICtrlCreateDate ( "text", left, top [, width [, height [, style [, exStyle]]]] )
text The preselected date. 
left The left side of the control. If -1 is used then left will be computed according to GUICoordMode. 
top The top of the control. If -1 is used then top will be computed according to GUICoordMode. 
width [optional] The width of the control (default is the previously used width). 
height [optional] The height of the control (default is the previously used height). 
style [optional] Defines the style of the control. See GUI Control Styles Appendix.

default (-1) : $DTS_LONGDATEFORMAT
forced style : $WS_TABSTOP 
exStyle [optional] Defines the extended style of the control. See Extended Style Table.
default (-1) : WS_EX_CLIENTEDGE

AlmarM

Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Link to comment
Share on other sites

Mayby this sould help

#include <EditConstants.au3>

; GUICtrlCreateInput ( "text", left, top [, width [, height [, style [, exStyle]]]] )
$Input1 = GUICtrlCreateInput("", x, x, x, x, $ES_NUMBER)

; GUICtrlCreateEdit ( "text", left, top [, width [, height [, style [, exStyle]]]] )
$Edit1 = GUICtrlCreateInput("", x, x, x, x, $ES_NUMBER)

; GUICtrlCreateCombo ( "text", left, top [, width [, height [, style [, exStyle]]]] )
$Combo1 = GUICtrlCreateCombo("1", x, x, x, x)

; GUICtrlSetData ( controlID, data [, default] )
GUICtrlSetData($Combo1, "2|3|4|5|6|7|8|9|10|Etc.", "1")

; GUICtrlCreateDate ( "text", left, top [, width [, height [, style [, exStyle]]]] )
$Data1 = GUICtrlCreateDate("Dates", x, x, x, x)

AlmarM

EDIT: Edited some mistakes

Edited by AlmarM

Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Link to comment
Share on other sites

So far i got:

#include <EditConstants.au3>

#include <GuiConstantsEx.au3>

GUICreate("test", 1000, 1000 )

; GUICtrlCreateInput ( "text", left, top [, width [, height [, style [, exStyle]]]] )

$Input1 = GUICtrlCreateInput("1", 100, 100, -1, -1, $ES_NUMBER)

; GUICtrlCreateEdit ( "text", left, top [, width [, height [, style [, exStyle]]]] )

$Edit1 = GUICtrlCreateInput("2", 200, 200, -1, -1, $ES_NUMBER)

; GUICtrlCreateCombo ( "text", left, top [, width [, height [, style [, exStyle]]]] )

$Combo1 = GUICtrlCreateCombo("1", 300, 300 )

; GUICtrlSetData ( controlID, data [, default] )

GUICtrlSetData($Combo1, "2|3|4|5|6|7|8|9|10|Etc.", "1")

but this just seams to do nothing, its probably something stupid, ive been out of practice since my pc broke :)

Thanks

Joe

Link to comment
Share on other sites

Aaaahhh...

I know what your missing!

#include <EditConstants.au3>
#include <GuiConstantsEx.au3>
$GUI = GUICreate("test", 1000, 1000 ) ; You dont need to use the $GUI Its just, my style :P
$Input1 = GUICtrlCreateInput("1", 100, 100, -1, -1, $ES_NUMBER)
$Edit1 = GUICtrlCreateInput("2", 200, 200, -1, -1, $ES_NUMBER)
$Combo1 = GUICtrlCreateCombo("1", 300, 300 )
GUICtrlSetData($Combo1, "2|3|4|5|6|7|8|9|10|Etc.", "1")

; Run GUI untill the red [X] is pressed.
GUISetState()
While 1
    $nMsg = GUIGetMsg()
    Select
    Case $nMsg = $GUI_EVENT_CLOSE
        Exit
    EndSelect
WEnd

AlmarM

Edited by AlmarM

Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Link to comment
Share on other sites

Hi,

thanks for that mate,

s far i got:

#include <EditConstants.au3>

#include <GuiConstantsEx.au3>

$GUI = GUICreate("test", 800, 700 )

$Input1 = GUICtrlCreateInput("1", 100, 100, -1, -1, $ES_NUMBER)

$Edit1 = GUICtrlCreateInput("2", 200, 200, -1, -1, $ES_NUMBER)

$Combo1 = GUICtrlCreateCombo("1", 300, 300 )

GUICtrlSetData($Combo1, "Weekly|Monthly", "Weekly")

$Overall = $Input1 + $Edit1 + $Combo1

$Show = GUICtrlCreateLabel ("Your Total is: $Overall", 400, 400 )

; Run GUI untill the red [X] is pressed.

GUISetState()

While 1

$nMsg = GUIGetMsg()

Select

Case $nMsg = $GUI_EVENT_CLOSE

Exit

EndSelect

WEnd

But it wont display it the total " $Overall ", also, i was looking so that each option ( weekly and monthly ) gives out a number for the adding up part ( $Overall )

Thanks

Joe

Link to comment
Share on other sites

Use this:

#include <EditConstants.au3>
#include <GuiConstantsEx.au3>

$GUI = GUICreate("test", 800, 700 )
$Input1 = GUICtrlCreateInput("1", 100, 100, -1, -1, $ES_NUMBER)
$Edit1 = GUICtrlCreateInput("2", 200, 200, -1, -1, $ES_NUMBER)
$Combo1 = GUICtrlCreateCombo("1", 300, 300 )
GUICtrlSetData($Combo1, "Weekly|Monthly", "Weekly")
$Label1 = GUICtrlCreateLabel("", 400, 400, 200, 20)
$Button1 = GUICtrlCreateButton("Button1",  500, 500)

GUISetState()
While 1
    $nMsg = GUIGetMsg()
    Select
    Case $nMsg = $GUI_EVENT_CLOSE
        Exit
    Case $nMsg = $Button1
        $Read_Input1 = GUICtrlRead($Input1)
        $Read_Edit1 = GUICtrlRead($Edit1)
        $Read_Combo1 = GUICtrlRead($Combo1)
        $Overall = $Read_Input1 & " " & $Read_Edit1 & " " & $Read_Combo1
        GUICtrlSetData($Label1, "Your total is: " & $Overall)
    EndSelect
WEnd

AlmarM

Edited by AlmarM

Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

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