Sign in to follow this  
Followers 0
layer

my mathematics program!

5 posts in this topic

please read the known bugs before testing this... thanks

or actually, ill show u the known bugs first!

Known Bugs

-any problem typed into the calculator, return's "1"
-switching to "Conversions" seems to not make 2 gui's instead it hides the calculator window and goes to conversions
-exiting out of conversions takes two clicks on the "X" to actually exit

**so far, these are the only bugs, if you have any more, please post them, and if you have any ideas, comments, questions, whatever it may be, just post them, don't be emmbaressed :)

Also, only the # buttons and -, +, =, / buttons and the edit control were created with AutoBuilder... the rest was hard coded by me =)

Mathematic Program:

; Script generated by AutoBuilder 0.5 Prototype

GuiCreate("AuCalculator    v. 1.0", 300, 350,(@DesktopWidth-257)/2, (@DesktopHeight-303)/2 , 0x04CF0000)
#include <GUIConstants.au3>
Global $Button_13 = GuiCtrlCreateButton("1", 30, 70, 30, 20)
Global $Button_14 = GuiCtrlCreateButton("2", 110, 70, 30, 20)
Global $Button_15 = GuiCtrlCreateButton("3", 190, 70, 30, 20)
Global $Button_16 = GuiCtrlCreateButton("4", 30, 130, 30, 20)
Global $Button_17 = GuiCtrlCreateButton("5", 110, 130, 30, 20)
Global $Button_18 = GuiCtrlCreateButton("6", 190, 130, 30, 20)
Global $Button_19 = GuiCtrlCreateButton("7", 30, 180, 30, 20)
Global $Button_20 = GuiCtrlCreateButton("8", 110, 180, 30, 20)
Global $Button_21 = GuiCtrlCreateButton("9", 190, 180, 30, 20)
Global $Button_22 = GuiCtrlCreateButton("0", 110, 230, 30, 20)
Global $Edit_23 = GuiCtrlCreateEdit("", 40, 20, 170, 20, $ES_AUTOHSCROLL)
Global $Button_24 = GuiCtrlCreateButton("+ Add", 190, 230, 60, 30)
Global $Button_25 = GuiCtrlCreateButton("- Subtract", 20, 230, 60, 30)
Global $Button_26 = GuiCtrlCreateButton("= Equals", 90, 270, 70, 30)
Global $Button_27 = GuiCtrlCreateButton("/ Divide", 20, 270, 50, 30)
Global $Button_28 = GuiCtrlCreateButton("* Multiply", 200, 270, 50, 30)
Global $Menu_29= GUICtrlCreateMenu ("Switch to...")
Global $MenuItem_30= GUICtrlCreateMenuItem ("Conversions", $Menu_29)
GuiSetState()
Func Conversions ()
   #include <GUIConstants.au3>
GUICreate ("Conversions")
GUISetState (@SW_SHOW)
$b= GUICtrlCreateButton ("Convert", 5, 30)
$l= GUICtrlCreateLabel ("Feet to inches:", 1, 1)
$i= GUICtrlCreateInput ("Feet here", 55, 33)
$b2= GUICtrlCreateButton ("Convert", 5, 100,)
$l2= GUICtrlCreateLabel ("Inches to feet:", 1, 75) 
$i2= GUICtrlCreateInput ("Inches here", 54, 103)
$b3= GUICtrlCreateButton ("Convert", 5, 170)
$l3= GUICtrlCreateLabel ("Ounces to pounds:", 1, 145)
$i3= GUICtrlCreateInput ("Ounces here", 53, 173)
$b4= GUICtrlCreateButton ("Convert", 5, 233)
$l4= GUICtrlCreateLabel ("Pounds to ounces:", 1, 210)
$i4= GUICtrlCreateInput ("Pounds to ounces", 53, 235)
While 1
   $get= GUIGetMsg ()
   $tmpread2= GUIRead ($i2)
   $tmpread= GUIRead ($i)
   Select
   Case $get= $GUI_EVENT_CLOSE
      ExitLoop
   Case $get= $b
      $tmpread= GUIRead ($i)
      $fee2in= Number ($tmpread*12)
      MsgBox (0, "Result", $fee2in & " Inches")
   Case $get= $b2
      If $tmpread2= 12 Then
         MsgBox (0, "Result", "1 Foot")
      Else 
         $in2fee= Number ($tmpread2/12)
      MsgBox (0, "Result", $in2fee & " Feet")
   EndIf
Case $get= $b3
   $tmpread= GUIRead ($i3)
   If $tmpread= 16 Then
      MsgBox (0, "Result", "1 Pound")
      Else
   $tmpread= GUIRead ($i3)
   $oz2lb= Number ($tmpread/16)
   MsgBox (0, "Result", $oz2lb & " Pounds")
EndIf
Case $get= $b4
   $tmpread= GUIRead (14)
   $lb2oz= Number ($tmpread*16)
   MsgBox (0, "Result", $lb2oz & " Ounces")
   EndSelect
   WEnd
EndFunc
   
While 1
    $get = GuiGetMsg()
    Select
    Case $get = -3;Should really use $GUI_EVENT_CLOSE
        ExitLoop
   Case $get= $button_13
      GUICtrlSetData ($edit_23, "1", 1)
   Case $get= $button_14
      GUICtrlSetData ($edit_23, "2", 1)
   Case $get= $button_15
      GUICtrlSetData ($edit_23, "3", 1)
   Case $get= $button_16
      GUICtrlSetData ($edit_23, "4", 1)
   Case $get= $button_17
      GUICtrlSetData ($edit_23, "5", 1)
   Case $get= $button_18
      GUICtrlSetData ($edit_23, "6", 1)
   Case $get= $button_19
      GUICtrlSetData ($edit_23, "7", 1)
   Case $get= $button_20
      GUICtrlSetData ($edit_23, "8", 1)
   Case $get= $button_21
      GUICtrlSetData ($edit_23, "9", 1)
   Case $get= $button_22
      GUICtrlSetData ($edit_23, "0", 1)
   Case $get=$button_24
      GUICtrlSetData ($edit_23, "+", 1)
   Case $get=$button_25
      GUICtrlSetData ($edit_23, "-", 1)
   Case $get=$button_26
      $math= GUIRead ($edit_23)
      $answer= Number ($math)
      GUICtrlSetData ($edit_23, "= ", 1)
      GUICtrlSetData ($edit_23, $answer, 1)
   Case $get=$button_27
      GUICtrlSetData ($edit_23, "/", 1)
   Case $get=$button_28
      GUICtrlSetData ($edit_23, "*", 1)
   Case $get= $MenuItem_30
      Conversions ()
    EndSelect
WEnd
Exit

FootbaG

Share this post


Link to post
Share on other sites

but i do not understand why using Number always returns zero... looky here:

$var= Number (1+2)
MsgBox (0, " ", $var)
$var2= Number (2-1)
MsgBox (0, " ", $var2)
$var3= Number (4/2)
MsgBox (0, " ", $var3)
$var4= Number (4*2)
MsgBox (0, " ", $var4)

that works, so why won't my Edit control work??


FootbaG

Share this post


Link to post
Share on other sites

errr... ive also tried an input box, that doesn't work either...

$lala= InputBox ("#'s", "enter math questions using '/' for division, '*' for multiplication, '+' for addition, and '-' for subtraction :")
$haha= Number ($lala)
MsgBox (0, "Results...", $haha)

hmmm, maybe someone else knows.. for the edit control


FootbaG

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Hmm, I wrote a calculater some time ago... leme find it..

My autoit folder is 50mb :idiot:

Edited by killaz219

Share this post


Link to post
Share on other sites

lol.. big file, but do you know whats wrong with this, have you tested it out?!?


FootbaG

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