Jump to content

Mobile phone


Mat
 Share

Recommended Posts

dnt ask y. im brd. lol

Its a gui fone dat wen u prss da btns it txts da way a prper fone does. (btw. dats Not da gess txt, dats 2 hrd 2 do 4 me)

qwite smpl, bt its jst a lil bt of fn.

dmn dat spll chckr is mad!

da code:

Global $aButtonTxt[4][3] = [["1 o_o", "2 abc", "3 def"], ["4 ghi", "5 jkl", "6 mno"], ["7 pqrs", "8 tuv", "9 wxyz"], ["* +", "0 _", "^ #"]]

Global $nCase = 0

Opt ("GUIOnEventMode", 1)

$hMobUI = GUICreate ("Mobile Phone!", 188, 296,  -1, -1, 0x00000080 + 0x00080000 + 0x00C00000, 0x00000001)
   GUISetOnEvent (-3, "_Exit")
   Global $hEdit = GUICtrlCreateEdit ("", 2, 2, 184, 184, 0x0040 + 0x0800)
   Global $hCur = GUICtrlCreateInput ("", 2, 186, 184, 20)
   For $x = 0 to 3
      For $i = 0 to 2
         GUICtrlCreateButton ($aButtonTxt[$x][$i], $i * 62 + 2, $x * 22 + 208, 60, 20)
            GUICtrlSetOnEvent (-1, "_Buttonclick")
      Next
   Next
   GUISetState ()
   While 1
      Sleep (1000)
   WEnd

Func _Buttonclick ()
   AdlibDisable ()
   If GUICtrlRead (@GUI_CTRLID) = "1 o_o" Then
      $nStr = StringInStr (".,!?1", GUICtrlRead ($hCur))
      If $nStr Then
         If $nStr = 5 Then $nStr = -1
         GUICtrlSetData ($hCur, StringMid (".,!?1", $nStr + 1, 1), "")
      Else
         GUICtrlSetData ($hEdit, GUICtrlRead ($hCur), 1)
         GUICtrlSetData ($hCur, StringMid (".,!?1", 1, 1), "")
      EndIf
      AdlibEnable ("_Timeout", 750)
      Return
   ElseIf GUICtrlRead (@GUI_CTRLID) = "* +" Then
      $nStr = StringInStr ("""()-+*/@;:_&%$£", GUICtrlRead ($hCur))
      If $nStr Then
         If $nStr = 15 Then $nStr = 0
         GUICtrlSetData ($hCur, StringMid ("""()-+*/@;:_&%$£", $nStr + 1, 1), "")
      Else
         GUICtrlSetData ($hEdit, GUICtrlRead ($hCur), 1)
         GUICtrlSetData ($hCur, " ")
      EndIf
      AdlibEnable ("_Timeout", 750)
      Return
   ElseIf GUICtrlRead (@GUI_CTRLID) = "^ #" Then
      GUICtrlSetData ($hEdit, GUICtrlRead ($hCur), 1)
      GUICtrlSetData ($hCur, "")
      If $nCase = 0 Then
         $nCase = 1
      Else
         $nCase = 0
      EndIf
      Return
   ElseIf GUICtrlRead (@GUI_CTRLID) = "0 _" Then
      $nStr = StringInStr ("0 ", GUICtrlRead ($hCur))
      If $nStr Then
         If $nStr = 2 Then $nStr = 0
         GUICtrlSetData ($hCur, StringMid ("0 ", $nStr + 1, 1), "")
      Else
         GUICtrlSetData ($hEdit, GUICtrlRead ($hCur), 1)
         GUICtrlSetData ($hCur, " ")
      EndIf
      AdlibEnable ("_Timeout", 750)
      Return
   EndIf
   $nStr = StringInStr (StringStripWS (GUICtrlRead (@GUI_CTRLID), 8), GUICtrlRead ($hCur))
   $data = GUICtrlRead (@GUI_CTRLID)
   If $nCase = 1 Then $data = StringUpper ($data)
   If $nStr = 0 Then
      If GUICtrlRead ($hCur) <> "" Then GUICtrlSetData ($hEdit, GUICtrlRead ($hCur), 1)
      GUICtrlSetData ($hCur, StringMid ($data, 3, 1), "")
   Else
      If $nStr = StringLen (StringStripWS (GUICtrlRead (@GUI_CTRLID), 8)) Then $nStr = -1
      GUICtrlSetData ($hCur, StringMid ($data, $nStr + 2, 1), "")
   EndIf
   AdlibEnable ("_Timeout", 750)
EndFunc ; ==> _Buttonclick

Func _TimeOut ()
   AdlibDisable ()
   GUICtrlSetData ($hEdit, GUICtrlRead ($hCur), 1)
   GUICtrlSetData ($hCur, "", "")
Endfunc ; ==> _TimeOut

Func _Exit ()
   Exit
EndFunc ; ==> _Exit

Mat

English translation. Its a very simple phone where pressing the "2 abc" button twice inserts "b" etc. And yes, before anyone posts to say, it is pointless.

Edited by Mat
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...