LokErik Posted February 10, 2008 Share Posted February 10, 2008 (edited) CODE;I´m Sorry But All of the Helping line and the $Things is on swedich. ;Feel fre to edit if you whant to. #include <GUIConstants.au3> GUICreate("MiniRäknaren", 350, 178, 233, 122) ; Programmet GUICtrlCreateGroup("Räknesätt", 250, 4, 73, 161) ; Grupp $PLUS = GUICtrlCreateButton("+", 255, 26, 50, 20) ; Knapp GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") ; Text stolek och annat $MINUS = GUICtrlCreateButton("-", 255, 53, 50, 20) ; Knapp GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") ; Text stolek och annat $GANGER = GUICtrlCreateButton("*", 255, 80, 50, 20) ; Knapp GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") ; Text stolek och annat $DELAT = GUICtrlCreateButton("/", 255, 104, 50, 20) ; Knapp GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") ; Text stolek och annat $UPPHOJT = GUICtrlCreateButton("^", 255, 130, 50, 20) ; Knapp GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") ; Text stolek och annat GUICtrlCreateGroup("", -99, -99, 1, 1) ; Text stolek och annat $FORSTA = GUICtrlCreateInput("", 8, 48, 81, 21) ; FORSTA Input $ANDRA = GUICtrlCreateInput("", 120, 48, 89, 21) ; ANDRA Input GUICtrlCreateLabel("=", 96, 80, 15, 28) ; Likhetstecknet GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") ; Text stolek och annat $SVAR = GUICtrlCreateInput("", 40, 112, 129, 21) ; Svar Input GUICtrlCreateLabel(" Christer Garpenlund ", 0, 160, 100, 17) ; Mitt Namn GUISetState(@SW_SHOW) ; Programmets Status Do $nMsg = GUIGetMsg() If $nMsg = $PLUS Then ; Om man trycker på Plus $1 = GuiCtrlRead($FORSTA) ; LÄSER FÖRSTA INPUT $2 = GuiCtrlRead($ANDRA) ; LÄSER ANDRA INPUT GuiCtrlSetData($SVAR, $1 + $2, "") ; Skriver det SVARET SOM SKA VARA EndIf If $nMsg = $MINUS Then ; Om man trycker på Minus $1 = GuiCtrlRead($FORSTA) ; LÄSER FÖRSTA INPUT $2 = GuiCtrlRead($ANDRA) ; LÄSER ANDRA INPUT GuiCtrlSetData($SVAR, $1 - $2, "") ; Skriver det SVARET SOM SKA VARA EndIf If $nMsg = $GANGER Then ; Om man trycker på Gånger $1 = GuiCtrlRead($FORSTA) ; LÄSER FÖRSTA INPUT $2 = GuiCtrlRead($ANDRA) ; LÄSER ANDRA INPUT GuiCtrlSetData($SVAR, $1 * $2, "") ; Skriver det SVARET SOM SKA VARA EndIf If $nMsg = $DELAT Then ; Om man trycker på Delat $1 = GuiCtrlRead($FORSTA) ; LÄSER FÖRSTA INPUT $2 = GuiCtrlRead($ANDRA) ; LÄSER ANDRA INPUT GuiCtrlSetData($SVAR, $1 / $2, "") ; Skriver det SVARET SOM SKA VARA EndIf If $nMsg = $UPPHOJT Then ; Om man trycker på Delat $1 = GuiCtrlRead($FORSTA) ; LÄSER FÖRSTA INPUT $2 = GuiCtrlRead($ANDRA) ; LÄSER ANDRA INPUT GuiCtrlSetData($SVAR, $1 ^ $2, "") ; Skriver det SVARET SOM SKA VARA EndIf Until $nMsg = $GUI_EVENT_CLOSE ; Stänger Programmet. I´m Sorry about the helptext but i´m from sweden Feel free to change the code. NOW WITH ^ TOO. Pleace give some things to add. i tink over PI but dont knew how to add so it be good. Edited February 10, 2008 by LokErik The first error is one step closer to the perfect program. Link to comment Share on other sites More sharing options...
LIMITER Posted February 10, 2008 Share Posted February 10, 2008 Nice one Link to comment Share on other sites More sharing options...
LokErik Posted February 10, 2008 Author Share Posted February 10, 2008 I was thinking about to add PI and maybe add ^ But i tought that shuld be fine with this. The first error is one step closer to the perfect program. Link to comment Share on other sites More sharing options...
LIMITER Posted February 10, 2008 Share Posted February 10, 2008 (edited) I was thinking about to add PI and maybe add ^But i tought that shuld be fine with this. It's very useful if you'r on the run because it's simpleP.S. : i forgot to tell you to visit my app L|M|TER Media Player Edited February 10, 2008 by LIMITER Link to comment Share on other sites More sharing options...
balthazar Posted February 11, 2008 Share Posted February 11, 2008 CODE;I´m Sorry But All of the Helping line and the $Things is on swedich.;Feel fre to edit if you whant to.#include <GUIConstants.au3>GUICreate("MiniRäknaren", 350, 178, 233, 122) ; ProgrammetGUICtrlCreateGroup("Räknesätt", 250, 4, 73, 161) ; Grupp$PLUS = GUICtrlCreateButton("+", 255, 26, 50, 20) ; KnappGUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") ; Text stolek och annat$MINUS = GUICtrlCreateButton("-", 255, 53, 50, 20) ; KnappGUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") ; Text stolek och annat$GANGER = GUICtrlCreateButton("*", 255, 80, 50, 20) ; KnappGUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") ; Text stolek och annat$DELAT = GUICtrlCreateButton("/", 255, 104, 50, 20) ; KnappGUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") ; Text stolek och annat$UPPHOJT = GUICtrlCreateButton("^", 255, 130, 50, 20) ; KnappGUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") ; Text stolek och annatGUICtrlCreateGroup("", -99, -99, 1, 1) ; Text stolek och annat$FORSTA = GUICtrlCreateInput("", 8, 48, 81, 21) ; FORSTA Input$ANDRA = GUICtrlCreateInput("", 120, 48, 89, 21) ; ANDRA InputGUICtrlCreateLabel("=", 96, 80, 15, 28) ; LikhetstecknetGUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") ; Text stolek och annat$SVAR = GUICtrlCreateInput("", 40, 112, 129, 21) ; Svar InputGUICtrlCreateLabel(" Christer Garpenlund ", 0, 160, 100, 17) ; Mitt Namn GUISetState(@SW_SHOW) ; Programmets StatusDo $nMsg = GUIGetMsg() If $nMsg = $PLUS Then ; Om man trycker på Plus $1 = GuiCtrlRead($FORSTA) ; LÄSER FÖRSTA INPUT $2 = GuiCtrlRead($ANDRA) ; LÄSER ANDRA INPUT GuiCtrlSetData($SVAR, $1 + $2, "") ; Skriver det SVARET SOM SKA VARAEndIfIf $nMsg = $MINUS Then ; Om man trycker på Minus $1 = GuiCtrlRead($FORSTA) ; LÄSER FÖRSTA INPUT $2 = GuiCtrlRead($ANDRA) ; LÄSER ANDRA INPUT GuiCtrlSetData($SVAR, $1 - $2, "") ; Skriver det SVARET SOM SKA VARAEndIfIf $nMsg = $GANGER Then ; Om man trycker på Gånger $1 = GuiCtrlRead($FORSTA) ; LÄSER FÖRSTA INPUT $2 = GuiCtrlRead($ANDRA) ; LÄSER ANDRA INPUT GuiCtrlSetData($SVAR, $1 * $2, "") ; Skriver det SVARET SOM SKA VARAEndIfIf $nMsg = $DELAT Then ; Om man trycker på Delat $1 = GuiCtrlRead($FORSTA) ; LÄSER FÖRSTA INPUT $2 = GuiCtrlRead($ANDRA) ; LÄSER ANDRA INPUT GuiCtrlSetData($SVAR, $1 / $2, "") ; Skriver det SVARET SOM SKA VARAEndIfIf $nMsg = $UPPHOJT Then ; Om man trycker på Delat $1 = GuiCtrlRead($FORSTA) ; LÄSER FÖRSTA INPUT $2 = GuiCtrlRead($ANDRA) ; LÄSER ANDRA INPUT GuiCtrlSetData($SVAR, $1 ^ $2, "") ; Skriver det SVARET SOM SKA VARAEndIf Until $nMsg = $GUI_EVENT_CLOSE ; Stänger Programmet.I´m Sorry about the helptext but i´m from sweden Feel free to change the code.NOW WITH ^ TOO.Pleace give some things to add.i tink over PI but dont knew how to add so it be good. 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