Jump to content

My First Script PDA


testingtest
 Share

Recommended Posts

Hi this is my first script that contains a GUI.

I wasn't going to release this it was just a test please laugh at me if you must :whistle:.

I might make it better if I get some skills with photo shop or gimp or something on the lines of that.

all it does is let you write a simple line of text to a file.

CODE
#include <GUIConstants.au3>

#include <File.au3>

$Name = "Untitled PDA.txt"

If Not FileExists($Name) Then

_FileCreate($Name)

EndIf

$File = FileOpenDialog("Open a saved project" , @ScriptDir , "All File Types (*.*)")

If @Error Then

MsgBox(16 , "" , "No File(s) chosen")

EndIf

$PDA = GUICreate("PDA", 282, 402, 406, 224)

$Main = GUICtrlCreatePic(@ScriptDir & "\Main.bmp", 0, 0, 281, 401, BitOR($SS_NOTIFY,$WS_GROUP))

GUICtrlSetState(-1, $GUI_DISABLE)

$Text = GUICtrlCreateEdit("", 48, 64, 185, 225)

If $File = "" Then

GUICtrlSetData(-1 , "Type your text in here")

Else

GUICtrlSetData(-1 , $File)

EndIf

GUISetState(@SW_SHOW)

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

$Save = FileSaveDialog("Save your file" , @ScriptDir , "All File Types (*.*)")

If $Save = "" Then

Exit

Else

If FileExists($Name) Then

ProgressOn("Please Wait" , "Creating then Writing to the file" , "Shouldn't take long")

_FileCreate($Name)

FileOpen($Name , 2)

FileWrite($Name , GUICtrlRead($Text) & @CRLF)

FileClose($Name)

ProgressOff()

Else

Exit

EndIf

EndIf

Exit

EndSwitch

WEnd

my coding is pretty poor right now and I hope it will get better withing a few months.

My GUI is lacking on some stuff I couldn't figure out how to hide the GUI so it just shows the PDA picture.

What I plan to add if I continue this project will be...

- Font

- Font Size

- Font Colour

- Embed Internet Explorer

- Embed Windows Media Player

- Create a Ini file so the script knows if your a new user or not and can check for safed files

- Add the date to the top of every safed file

- This one is a bit advance but I want it to be able to store files in side it's self sort of like a win zip file

- Better GUI set up

sorry if this was a waste of time and sorry for my spelling mistakes and spelling habits (English is not my main language)

[updates]

CODE
$Main = GUICtrlCreatePic(@ScriptDir & "\Main.bmp", 0, 0, 281, 401, BitOR($SS_NOTIFY,$WS_GROUP))

Edited by testingtest
Link to comment
Share on other sites

A good start. So basically your trying to make a PDA Shell in AutoIT. I like it.

Edit: You might want to change:

$Main = GUICtrlCreatePic("C:\Documents and Settings\Proxy-Demon.JOHN\Desktop\pda\Main.bmp", 0, 0, 281, 401, BitOR($SS_NOTIFY,$WS_GROUP))
oÝ÷ Ù:ºÚ"µÍÌÍÓXZ[HÕRPÝÜX]TXÊØÜ  [È ][ÝÉÌLÓXZ[  ][ÝËK
K]Ô    ÌÍÔÔ×ÓÕQK    ÌÍÕÔ×ÑÔÕT
JB

Also you should look at ShapedGUI so you can get the PDA background as the GUI.

Edited by Secure_ICT
Link to comment
Share on other sites

A good start. So basically your trying to make a PDA Shell in AutoIT. I like it.

Edit: You might want to change:

$Main = GUICtrlCreatePic("C:\Documents and Settings\Proxy-Demon.JOHN\Desktop\pda\Main.bmp", 0, 0, 281, 401, BitOR($SS_NOTIFY,$WS_GROUP))
oÝ÷ Ù:ºÚ"µÍÌÍÓXZ[HÕRPÝÜX]TXÊØÜ  [È ][ÝÉÌLÓXZ[  ][ÝËK
K]Ô    ÌÍÔÔ×ÓÕQK    ÌÍÕÔ×ÑÔÕT
JB

Also you should look at ShapedGUI so you can get the PDA background as the GUI.

thanks for the suggestions.

I am always willing for help, questions and even people who think it is a stupid idea I would still like the truth to make everybody happy

Link to comment
Share on other sites

That's good! You could also look at one of Larry's posts. I will find it soon. But it cuts around an image and so that would make it easier. So are you going to make it like a mobile shell but in AutoIt? You could cut around the buttons at the bottom of the image and then make them into buttons and then when they are pressed they can bring up menus etc.

I will make you a small list of useful links to things you may find useful.

Edit: List below:

Ill edit with more later. Edited by Secure_ICT
Link to comment
Share on other sites

That's good! You could also look at one of Larry's posts. I will find it soon. But it cuts around an image and so that would make it easier. So are you going to make it like a mobile shell but in AutoIt? You could cut around the buttons at the bottom of the image and then make them into buttons and then when they are pressed they can bring up menus etc.

I will make you a small list of useful links to things you may find useful.

Edit: List below:

Ill edit with more later.

I really am pleased to see people helping me, because of you I will try the best to keep working on the project to the best of my ability.

Tanks again Ill try to make it worth everyones wild when I am finished. :whistle:

[Edited]

Here is what I got. I must be doing something wrong not sure of what though. The image is not fully showed and it isn't hiding the GUI part.

CODE
#include <GUIConstants.au3>

$gui = GUICreate("PDA", 282, 402, 406, 224 , $WS_POPUP)

GUICtrlCreatePic(".\Main2.bmp", 0 , 0, 346 , 548)

$a = DLLCall(".\BMP2RGN.dll","int","BMP2RGN", _

"str",".\Main2.bmp", _

"int",0, _

"int",0, _

"int",0)

SetWindowRgn($gui, $a[0])

GUISetState()

Sleep(2000)

Func SetWindowRgn($h_win, $rgn)

DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $rgn, "int", 1)

EndFunc

Note I did look at the pictures height and width

[qoute]

So are you going to make it like a mobile shell but in AutoIt

[/qoute]

I am not sure it will be something to keep notes in and will remind you of important stuff but I plan on making it do a lot of stuff. I would love it if you could explain a little more by the term mobile shell. I seen a few phone scripts maybe I can add that in as well

Edited by testingtest
Link to comment
Share on other sites

Hey,

I am pleased to hear you are going to carry on.

Here is what I got. I must be doing something wrong not sure of what though. The image is not fully showed and it isn't hiding the GUI part.

Hmm.. I see what you mean. I will have a look and see if I can try to fix it. I don't know.

I would love it if you could explain a little more by the term mobile shell.

Well, like a M$ phone works. You click a button and a little menu drops down or whatever it does.

Do you use Koda? Because if you do, then you can look at Com objects and place them in. This will allow you to use Windows Media Player and such.

Thanks,

Secure

Link to comment
Share on other sites

I suggest asking Larry to help with the Image as a GUI. I found that it is hard to use.

[center][font="Arial"]If practise makes perfect and no-ones perfect whats the point of practise?[/font]Sorry for my rude attitude when I started here.[/center]

Link to comment
Share on other sites

need bmp...attached

#include <GUIConstants.au3>
$gui = GUICreate("",346,548,-1,-1,$WS_POPUP)
GUICtrlCreatePic(".\main.bmp",0,0,346,548)

$a = DLLCall(".\BMP2RGN.dll","int","BMP2RGN", _
            "str",".\main.bmp", _
            "int",0, _
            "int",0, _
            "int",0)

SetWindowRgn($gui, $a[0])

GUISetState()
Sleep(2000)

Func SetWindowRgn($h_win, $rgn)
    DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $rgn, "int", 1)
EndFunc
you guys are so nice :whistle: thanks
Link to comment
Share on other sites

Hey,

I found this, its made by Smoke_N:

Global $Pic1 = 100000000000000000
$main = GUICreate('')
$button = GUICtrlCreateButton('Create Pic Button', 10, 10, 100, 30)
GUISetState()
While 1
    $msg = GUIGetMsg()
    If $msg = $button Then
        $Pic1 = GUICtrlCreatePic(@MyDocumentsDir & '\My Pictures\MyPic', 10, 100, 100, 30)
    EndIf
    If $msg = $Pic1 Then
        MsgBox(0, 'Works', 'You clicked the button pic')
    EndIf
WEnd

You will need to change the directory to where the picture is placed. This will allow a picture to become a button :whistle:

Original Topic: http://www.autoitscript.com/forum/index.ph...l=picture+words

Link to comment
Share on other sites

Hey,

I found this, its made by Smoke_N:

Global $Pic1 = 100000000000000000
$main = GUICreate('')
$button = GUICtrlCreateButton('Create Pic Button', 10, 10, 100, 30)
GUISetState()
While 1
    $msg = GUIGetMsg()
    If $msg = $button Then
        $Pic1 = GUICtrlCreatePic(@MyDocumentsDir & '\My Pictures\MyPic', 10, 100, 100, 30)
    EndIf
    If $msg = $Pic1 Then
        MsgBox(0, 'Works', 'You clicked the button pic')
    EndIf
WEnd

You will need to change the directory to where the picture is placed. This will allow a picture to become a button :)

Original Topic: http://www.autoitscript.com/forum/index.ph...l=picture+words

thanks a lot I had no clue were to look. :whistle:
Link to comment
Share on other sites

No Problem. :whistle: hehe! Need anything else?

wow you reply fast. what you doing up so early hehe. I think ill be ok once I can create the the fake buttons into real buttons.

you could help me out with the button idea's though I am not sure of what to make out of all of theses buttons heres a picture. I am sorry for my bad drawing skills

[edited]

forgot to upload the picture oh I see the picture is to big hold on

Posted Image

Edited by testingtest
Link to comment
Share on other sites

I'm in a different time zone, and I'm ill, so I'm sat at my computer :whistle: I have been watching some TV downstairs aswell.

About your picture. The ones in which you say not sure they could be movement through menus. Basically, Send functions with up/down/left/right keys being pressed. And the middle one can be select. The rest is all good.

Anything else? I really think you can do well with this. Keep it up!

Link to comment
Share on other sites

I'm in a different time zone, and I'm ill, so I'm sat at my computer :) I have been watching some TV downstairs aswell.

About your picture. The ones in which you say not sure they could be movement through menus. Basically, Send functions with up/down/left/right keys being pressed. And the middle one can be select. The rest is all good.

Anything else? I really think you can do well with this. Keep it up!

thanks, with all of this help I must continue on although I will take breaks from the script but it will get done.

I will try and add as many gadgets in this as possible,

I think ill even add something like this in it, if you look at the picture it looks pretty basic what it will allow you to do is make autoit files any were you go :whistle:

Posted Image

I might even add my cd tray lock if I work out the bugs and make sure it can't be by passed as easy.

I think you guys will get a kick out of this but its ok I though it was funny as well, I got this pda idea from doom 3

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