Sign in to follow this  
Followers 0
James

Problem with status bar

5 posts in this topic

I'm making a Notepad replacement, with status bar. I did have a "statusbar" which was just a locked input box. I replaced it with the statusbar, but it flickers.

I can't figure out why though.

#include <GUIConstants.au3>
#include <String.au3>
#include <GuiStatusBar.au3>
#include <Sound.au3>

Local $BetaPad, $StatusBar, $msg
Local $a_PartsRightEdge[3] = [100, 350, -1]
Local $a_PartsText[3] = ["Ready", "VE2.0", "BetaPad"]

$BetaPad = GUICreate("BetaPad | Alpha VE2.0", 626, 466, @DesktopHeight / 3, @DesktopWidth / 5, BitOR($WS_MAXIMIZEBOX,$WS_MINIMIZEBOX,$WS_SIZEBOX))
$StatusBar = _GUICtrlStatusBarCreate ($BetaPad, $a_PartsRightEdge, $a_PartsText)

$sound = _SoundOpen(@WindowsDir & "\media\chimes.wav", "Startup")
_SoundPlay($sound)
$SearchInput = GUICtrlCreateInput("", 15, 10, 435, 21)
$Search = GUICtrlCreateButton("&Search", 536, 8, 72, 25, 0)
$Engine = GUICtrlCreateCombo("Pick one!", 456, 10, 73, 25)
          GUICtrlSetData(-1, "Google|Yahoo")

$Doc1 = GUICtrlCreateTabItem("Doc1")
$DocEd1 = GUICtrlCreateEdit("", 15, 40, 590, 340, BitOR($ES_AUTOVSCROLL,$ES_WANTRETURN,$WS_VSCROLL))
GUICtrlSetData(-1, "")

$File = GUICtrlCreateMenu("&File")
$New = GUICtrlCreateMenuItem("&New ", $File)
$Open = GUICtrlCreateMenuItem("Open", $File)
$Save = GUICtrlCreateMenuItem("Save", $File)
GUICtrlCreateMenuItem("", $File)
$Print = GUICtrlCreateMenuItem("&Print...         CTRL+P", $File)
GUICtrlCreateMenuItem("", $File)
$Exit = GUICtrlCreateMenuItem("E&xit", $File)

$Edit = GUICtrlCreateMenu("&Edit")
$InsDT = GUICtrlCreateMenuItem("&Insert Date + Time", $Edit)

$Format = GUICtrlCreateMenu("&Format")
$WCount = GUICtrlCreateMenuItem("Word Count", $Format)

$Tabs = GUICtrlCreateMenu("&Tabs")
$NewTab = GUICtrlCreateMenuItem("&New Tab", $Tabs)
$CloseTab = GUICtrlCreateMenuItem("&Close Tab", $Tabs)
$CloseAllTabs = GUICtrlCreateMenuItem("Close All Tabs", $Tabs)

$Dever = GUICtrlCreateMenu("&Developer")
$FileName = GUICtrlCreateMenuItem("&File Name (Long)", $Dever)
$FileSize = GUICtrlCreateMenuItem("&File Size", $Dever)
GUICtrlCreateMenuitem("", $Dever)
$Display = GUICtrlCreateMenuItem("&Display", $Dever)
GUICtrlCreateMenuitem("", $Dever)
$WinSize = GUICtrlCreateMenuitem("&Window Size", $Dever)
GUICtrlCreateMenuitem("", $Dever)
$Encrypter = GUICtrlCreateMenuitem("&Encrypt", $Dever)
$Decrypter = GUICtrlCreateMenuitem("Decrypt", $Dever)

$Help = GUICtrlCreateMenu("&Help")
$About = GUICtrlCreateMenuItem("&About", $Help)
GUICtrlCreateMenuItem("", $Help)
$Helpme = GUICtrlCreateMenuItem("&Help", $Help)

$it = GUICtrlCreateLabel("",-700,-700,10,10)
$un = GUICtrlCreateLabel("",-800,-800,10,10)
$st = GUICtrlCreateLabel("",-600,-600,10,10)
$fn = GUICtrlCreateLabel("Arial",-500,-500,10,10)
$sz = GUICtrlCreateLabel("9",-400,-400,10,10)
GUISetBkColor(0xEBEFF5)

GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            ExitLoop
        Case $nMsg = $GUI_EVENT_RESIZED
            _GUICtrlStatusBarResize($StatusBar)
        Case $Display
            $clg = GUICtrlRead($DocEd1)
            $GUI2 = GuiCreate("Choose Your Font", 250, 200, -1, -1, $WS_EX_LAYERED, $WS_EX_TOOLWINDOW)
            GUICtrlCreateLabel("Customize your font",10,5,120)
            GUICtrlSetFont(-1, 9, 400, 0, "Arial Bold")
            $i = GUICtrlCreateCheckbox("Italic",10,25)        ;2
            $b = GUICtrlCreateCheckbox("Bold",10,100)         ;4
            $u = GUICtrlCreateCheckbox("Underlined",10,50)    ;6
            $s = GUICtrlCreateCheckbox("Strikethrough",10,75) ;8
            $cmb = GUICtrlCreateCombo("Choose Font..", 105, 25, 120, 20)
            GUICtrlSetData($cmb, "Arial|Arial Bold|Comic Sans MS|Courier New|Tahoma|Times New Roman")
            $size = GUICtrlCreateInput("9", 105, 55, 40)
            GUICtrlCreateUpdown($size)
            GUICtrlSetLimit($size, 999, 1)
            $a1 = GUICtrlCreateLabel($clg, 8, 130, 230, 40, 1, 15)
            GuiCtrlSetBkColor(-1, 0xFFFFFF)
            GUISetState()
            While WinActive($GUI2)
                $msg = GUIGetMsg()
                Select
                Case $msg = $GUI_EVENT_CLOSE
                    Local $i1 = 0, $u1 = 0, $s1 = 0
                    If GUICtrlRead($i) = $GUI_CHECKED Then $i1 = 2
                    If GUICtrlRead($u) = $GUI_CHECKED Then $u1 = 4
                    If GUICtrlRead($s) = $GUI_CHECKED Then $s1 = 8
                    $1size = GUICtrlRead($size)
                    $font1 = GUICtrlRead($cmb)
                    $new = $i1+$u1+$s1
                    GUIDelete($GUI2)
                    If $s1 = 8 Then GUICtrlSetData($st, "s")
                    If $u1 = 4 Then GUICtrlSetData($un, "u")
                    If $i1 = 2 Then GUICtrlSetData($it, "i")
                    If NOT GUICtrlRead($cmb) = "Choose Font.." AND NOT GUICtrlRead($cmb) = "you can add more.." Then GUICtrlSetData($fn, $font1)
                    GUICtrlSetData($sz, $1size)
                    GUICtrlSetFont($DocEd1, $1size, 400, $new, $font1)
                    ExitLoop
                Case $msg = $size
                    Local $i3 = 0, $u3 = 0, $s3 = 0
                    If GUICtrlRead($i) = $GUI_CHECKED Then $i2 = 2
                    If GUICtrlRead($u) = $GUI_CHECKED Then $u2 = 4
                    If GUICtrlRead($s) = $GUI_CHECKED Then $s2 = 8
                    $1size = GUICtrlRead($size)
                    $new2 = $i2+$u2+$s2
                    $p = GUICtrlRead($cmb)
                    GUICtrlSetFont($a1, $1size, 400, $new2, $p)
                Case $msg = $cmb
                    Local $i2 = 0, $u2 = 0, $s2 = 0
                    If GUICtrlRead($i) = $GUI_CHECKED Then $i2 = 2
                    If GUICtrlRead($u) = $GUI_CHECKED Then $u2 = 4
                    If GUICtrlRead($s) = $GUI_CHECKED Then $s2 = 8
                    $1size = GUICtrlRead($size)
                    $new2 = $i2+$u2+$s2
                    $p = GUICtrlRead($cmb)
                    GUICtrlSetFont($a1, $1size, 400, $new2, $p)
                    GuiCtrlSetData($StatusBar, "The new font is:" & " " & $p)
                    IniWrite("Settings.ini", "Font", "NewFont", $p)
                Case $msg = $i;;;;;;;;;;;;;;;;;;;;;;;;;
                    If GUICtrlRead($i) = $GUI_CHECKED Then
                        $n = 2
                        If GUICtrlRead($u) = $GUI_CHECKED Then $n = 6
                        If GUICtrlRead($s) = $GUI_CHECKED Then $n = 10
                        If GUICtrlRead($u) = $GUI_CHECKED AND GUICtrlRead($s) = $GUI_CHECKED Then $n = 14
                        $1size = GUICtrlRead($size)
                        $font1 = GUICtrlRead($cmb)
                        GUICtrlSetFont($a1,$1size,400,$n, $font1)
                    Else
                        $n = 0
                        If GUICtrlRead($u) = $GUI_CHECKED Then $n = 4
                        If GUICtrlRead($s) = $GUI_CHECKED Then $n = 8
                        If GUICtrlRead($u) = $GUI_CHECKED AND GUICtrlRead($s) = $GUI_CHECKED Then $n = 12
                        $1size = GUICtrlRead($size)
                        $font1 = GUICtrlRead($cmb)
                        GUICtrlSetFont($a1,$1size,400,$n, $font1)
                    EndIf
                Case $msg = $u;;;;;;;;;;;;;;;;;;;;;;;;;
                    If GUICtrlRead($u) = $GUI_CHECKED Then
                        $n = 4
                        If GUICtrlRead($i) = $GUI_CHECKED Then $n = 6
                        If GUICtrlRead($s) = $GUI_CHECKED Then $n = 12
                        If GUICtrlRead($i) = $GUI_CHECKED AND GUICtrlRead($s) = $GUI_CHECKED Then $n = 14
                        $1size = GUICtrlRead($size)
                        $font1 = GUICtrlRead($cmb)
                        GUICtrlSetFont($a1,$1size,400,$n, $font1)
                    Else
                        $n = 0
                        If GUICtrlRead($i) = $GUI_CHECKED Then $n = 2
                        If GUICtrlRead($s) = $GUI_CHECKED Then $n = 8
                        If GUICtrlRead($i) = $GUI_CHECKED AND GUICtrlRead($s) = $GUI_CHECKED Then $n = 10
                        $1size = GUICtrlRead($size)
                        $font1 = GUICtrlRead($cmb)
                        GUICtrlSetFont($a1,$1size,400,$n, $font1)
                    EndIf
                Case $msg = $s;;;;;;;;;;;;;;;;;;;;;;;;;
                    If GUICtrlRead($s) = $GUI_CHECKED Then
                        $n = 8
                        If GUICtrlRead($u) = $GUI_CHECKED Then $n = 12
                        If GUICtrlRead($i) = $GUI_CHECKED Then $n = 10
                        If GUICtrlRead($u) = $GUI_CHECKED AND GUICtrlRead($i) = $GUI_CHECKED Then $n = 14
                        $1size = GUICtrlRead($size)
                        $font1 = GUICtrlRead($cmb)
                        GUICtrlSetFont($a1,$1size,400,$n, $font1)
                    Else
                        $n = 0
                        If GUICtrlRead($u) = $GUI_CHECKED Then $n = 4
                        If GUICtrlRead($i) = $GUI_CHECKED Then $n = 2
                        If GUICtrlRead($u) = $GUI_CHECKED AND GUICtrlRead($i) = $GUI_CHECKED Then $n = 6
                        $1size = GUICtrlRead($size)
                        $font1 = GUICtrlRead($cmb)
                        GUICtrlSetFont($a1,$1size,400,$n, $font1)
                    EndIf
                EndSelect
            WEnd
        Case $About
            MsgBox(0, "About", "BetaPad VE2.0 created by Secure_ICT." & @CRLF & @CRLF & "An open source text editor!" & @CRLF & "This script is licensed under the General Commons Lisence.")
        Case $InsDT
            GuiCtrlSetData($DocEd1, @Hour & ":" & @Min & " " & @MDAY & "/" & @Mon & "/" & @YEAR)
        Case $WCount
            $dok1 = GUICtrlRead($DocEd1)
            $do1  = StringSplit($dok1, " ")
            MsgBox(0,"Word Count",$do1[0]-1 & " words in total." & @CRLF & @CRLF & StringLen($dok1) & " letters in total.")
        Case $Search
            ShellExecute("www.google.com/search?q=" & GUICtrlRead($SearchInput))
        Case $Save
            $SaveDir = FileSaveDialog("Save",@MyDocumentsDir, "Text Document(*.txt)|Secure Document(*.ict)|Autoit Doccument(*.au3)",16)
        Switch GUICtrlRead($Doc1)
            Case 0
                $text = GUICtrlRead($DocEd1)
            EndSwitch
            $filehandle = FileOpen($SaveDir, 2)
            FileWrite($filehandle, $text)
            FileClose($filehandle)
        Case $open
            $OpenDir = FileOpenDialog("Open", @MyDocumentsDir, "Text Document(*.txt)|Secure Document(*.ict)|Autoit Doccument(*.au3)",16)
            $text = FileRead($OpenDir)
            GUICtrlSetData($Text, $OpenDir)
            GUICtrlSetData($Doced1, $Text)
        Case $WinSize
            $size = WinGetPos("BetaPad | Alpha VE2.0")
            MsgBox(0, "Window Size (x,y,width,height)", $size[0] & " " & $size[1] & " " & $size[2] & " " & $size[3])
        Case $Encrypter
            $word2encrypt = InputBox("Password", "What do you want the password to encrypt with be?")
            GuiCtrlSetData($DocEd1, _StringEncrypt(1, $DocEd1, $word2encrypt))
        Case $Decrypter
            $word2decrypt = InputBox("Password", "What is the password that will decrypt the text?")
            GUICtrlSetData($DocEd1, _StringEncrypt(0, $DocEd1, $word2decrypt))
                Case Else
            ;;;;;
    EndSwitch
WEnd

That is my whole script.

Secure

Share this post


Link to post
Share on other sites



Hi,

try this:

#include <GUIConstants.au3>
#include <String.au3>
#include <GuiStatusBar.au3>
#include <Sound.au3>

Local $BetaPad, $StatusBar, $msg
Local $a_PartsRightEdge[3] = [100, 350, -1]
Local $a_PartsText[3] = ["Ready", "VE2.0", "BetaPad"]

$BetaPad = GUICreate("BetaPad | Alpha VE2.0", 626, 466, @DesktopHeight / 3, @DesktopWidth / 5, BitOR($WS_MAXIMIZEBOX, $WS_MINIMIZEBOX, $WS_SIZEBOX))
$StatusBar = _GUICtrlStatusBarCreate($BetaPad, $a_PartsRightEdge, $a_PartsText)

$sound = _SoundOpen(@WindowsDir & "\media\chimes.wav", "Startup")
_SoundPlay($sound)
$SearchInput = GUICtrlCreateInput("", 15, 10, 435, 21)
$Search = GUICtrlCreateButton("&Search", 536, 8, 72, 25, 0)
$Engine = GUICtrlCreateCombo("Pick one!", 456, 10, 73, 25)
GUICtrlSetData(-1, "Google|Yahoo")

$Doc1 = GUICtrlCreateTabItem("Doc1")
$DocEd1 = GUICtrlCreateEdit("", 15, 40, 590, 340, BitOR($ES_AUTOVSCROLL, $ES_WANTRETURN, $WS_VSCROLL))
GUICtrlSetData(-1, "")

$File = GUICtrlCreateMenu("&File")
$New = GUICtrlCreateMenuitem("&New ", $File)
$Open = GUICtrlCreateMenuitem("Open", $File)
$Save = GUICtrlCreateMenuitem("Save", $File)
GUICtrlCreateMenuitem("", $File)
$Print = GUICtrlCreateMenuitem("&Print...         CTRL+P", $File)
GUICtrlCreateMenuitem("", $File)
$Exit = GUICtrlCreateMenuitem("E&xit", $File)

$Edit = GUICtrlCreateMenu("&Edit")
$InsDT = GUICtrlCreateMenuitem("&Insert Date + Time", $Edit)

$Format = GUICtrlCreateMenu("&Format")
$WCount = GUICtrlCreateMenuitem("Word Count", $Format)

$Tabs = GUICtrlCreateMenu("&Tabs")
$NewTab = GUICtrlCreateMenuitem("&New Tab", $Tabs)
$CloseTab = GUICtrlCreateMenuitem("&Close Tab", $Tabs)
$CloseAllTabs = GUICtrlCreateMenuitem("Close All Tabs", $Tabs)

$Dever = GUICtrlCreateMenu("&Developer")
$FileName = GUICtrlCreateMenuitem("&File Name (Long)", $Dever)
$FileSize = GUICtrlCreateMenuitem("&File Size", $Dever)
GUICtrlCreateMenuitem("", $Dever)
$Display = GUICtrlCreateMenuitem("&Display", $Dever)
GUICtrlCreateMenuitem("", $Dever)
$WinSize = GUICtrlCreateMenuitem("&Window Size", $Dever)
GUICtrlCreateMenuitem("", $Dever)
$Encrypter = GUICtrlCreateMenuitem("&Encrypt", $Dever)
$Decrypter = GUICtrlCreateMenuitem("Decrypt", $Dever)

$Help = GUICtrlCreateMenu("&Help")
$About = GUICtrlCreateMenuitem("&About", $Help)
GUICtrlCreateMenuitem("", $Help)
$Helpme = GUICtrlCreateMenuitem("&Help", $Help)

$it = GUICtrlCreateLabel("", -700, -700, 10, 10)
$un = GUICtrlCreateLabel("", -800, -800, 10, 10)
$st = GUICtrlCreateLabel("", -600, -600, 10, 10)
$fn = GUICtrlCreateLabel("Arial", -500, -500, 10, 10)
$sz = GUICtrlCreateLabel("9", -400, -400, 10, 10)
GUISetBkColor(0xEBEFF5)
_GUICtrlStatusBarResize($StatusBar)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            ExitLoop
        Case $GUI_EVENT_RESIZED
            _GUICtrlStatusBarResize($StatusBar)
        Case $Display
            $clg = GUICtrlRead($DocEd1)
            $GUI2 = GUICreate("Choose Your Font", 250, 200, -1, -1, $WS_EX_LAYERED, $WS_EX_TOOLWINDOW)
            GUICtrlCreateLabel("Customize your font", 10, 5, 120)
            GUICtrlSetFont(-1, 9, 400, 0, "Arial Bold")
            $i = GUICtrlCreateCheckbox("Italic", 10, 25)        ;2
            $b = GUICtrlCreateCheckbox("Bold", 10, 100)         ;4
            $u = GUICtrlCreateCheckbox("Underlined", 10, 50)    ;6
            $s = GUICtrlCreateCheckbox("Strikethrough", 10, 75) ;8
            $cmb = GUICtrlCreateCombo("Choose Font..", 105, 25, 120, 20)
            GUICtrlSetData($cmb, "Arial|Arial Bold|Comic Sans MS|Courier New|Tahoma|Times New Roman")
            $size = GUICtrlCreateInput("9", 105, 55, 40)
            GUICtrlCreateUpdown($size)
            GUICtrlSetLimit($size, 999, 1)
            $a1 = GUICtrlCreateLabel($clg, 8, 130, 230, 40, 1, 15)
            GUICtrlSetBkColor(-1, 0xFFFFFF)
            GUISetState()
            While WinActive($GUI2)
                $msg = GUIGetMsg()
                Select
                    Case $msg = $GUI_EVENT_CLOSE
                        Local $i1 = 0, $u1 = 0, $s1 = 0
                        If GUICtrlRead($i) = $GUI_CHECKED Then $i1 = 2
                        If GUICtrlRead($u) = $GUI_CHECKED Then $u1 = 4
                        If GUICtrlRead($s) = $GUI_CHECKED Then $s1 = 8
                        $1size = GUICtrlRead($size)
                        $font1 = GUICtrlRead($cmb)
                        $New = $i1 + $u1 + $s1
                        GUIDelete($GUI2)
                        If $s1 = 8 Then GUICtrlSetData($st, "s")
                        If $u1 = 4 Then GUICtrlSetData($un, "u")
                        If $i1 = 2 Then GUICtrlSetData($it, "i")
                        If Not GUICtrlRead($cmb) = "Choose Font.." And Not GUICtrlRead($cmb) = "you can add more.." Then GUICtrlSetData($fn, $font1)
                        GUICtrlSetData($sz, $1size)
                        GUICtrlSetFont($DocEd1, $1size, 400, $New, $font1)
                        ExitLoop
                    Case $msg = $size
                        Local $i3 = 0, $u3 = 0, $s3 = 0
                        If GUICtrlRead($i) = $GUI_CHECKED Then $i2 = 2
                        If GUICtrlRead($u) = $GUI_CHECKED Then $u2 = 4
                        If GUICtrlRead($s) = $GUI_CHECKED Then $s2 = 8
                        $1size = GUICtrlRead($size)
                        $new2 = $i2 + $u2 + $s2
                        $p = GUICtrlRead($cmb)
                        GUICtrlSetFont($a1, $1size, 400, $new2, $p)
                    Case $msg = $cmb
                        Local $i2 = 0, $u2 = 0, $s2 = 0
                        If GUICtrlRead($i) = $GUI_CHECKED Then $i2 = 2
                        If GUICtrlRead($u) = $GUI_CHECKED Then $u2 = 4
                        If GUICtrlRead($s) = $GUI_CHECKED Then $s2 = 8
                        $1size = GUICtrlRead($size)
                        $new2 = $i2 + $u2 + $s2
                        $p = GUICtrlRead($cmb)
                        GUICtrlSetFont($a1, $1size, 400, $new2, $p)
                        GUICtrlSetData($StatusBar, "The new font is:" & " " & $p)
                        IniWrite("Settings.ini", "Font", "NewFont", $p)
                    Case $msg = $i;;;;;;;;;;;;;;;;;;;;;;;;;
                        If GUICtrlRead($i) = $GUI_CHECKED Then
                            $n = 2
                            If GUICtrlRead($u) = $GUI_CHECKED Then $n = 6
                            If GUICtrlRead($s) = $GUI_CHECKED Then $n = 10
                            If GUICtrlRead($u) = $GUI_CHECKED And GUICtrlRead($s) = $GUI_CHECKED Then $n = 14
                            $1size = GUICtrlRead($size)
                            $font1 = GUICtrlRead($cmb)
                            GUICtrlSetFont($a1, $1size, 400, $n, $font1)
                        Else
                            $n = 0
                            If GUICtrlRead($u) = $GUI_CHECKED Then $n = 4
                            If GUICtrlRead($s) = $GUI_CHECKED Then $n = 8
                            If GUICtrlRead($u) = $GUI_CHECKED And GUICtrlRead($s) = $GUI_CHECKED Then $n = 12
                            $1size = GUICtrlRead($size)
                            $font1 = GUICtrlRead($cmb)
                            GUICtrlSetFont($a1, $1size, 400, $n, $font1)
                        EndIf
                    Case $msg = $u;;;;;;;;;;;;;;;;;;;;;;;;;
                        If GUICtrlRead($u) = $GUI_CHECKED Then
                            $n = 4
                            If GUICtrlRead($i) = $GUI_CHECKED Then $n = 6
                            If GUICtrlRead($s) = $GUI_CHECKED Then $n = 12
                            If GUICtrlRead($i) = $GUI_CHECKED And GUICtrlRead($s) = $GUI_CHECKED Then $n = 14
                            $1size = GUICtrlRead($size)
                            $font1 = GUICtrlRead($cmb)
                            GUICtrlSetFont($a1, $1size, 400, $n, $font1)
                        Else
                            $n = 0
                            If GUICtrlRead($i) = $GUI_CHECKED Then $n = 2
                            If GUICtrlRead($s) = $GUI_CHECKED Then $n = 8
                            If GUICtrlRead($i) = $GUI_CHECKED And GUICtrlRead($s) = $GUI_CHECKED Then $n = 10
                            $1size = GUICtrlRead($size)
                            $font1 = GUICtrlRead($cmb)
                            GUICtrlSetFont($a1, $1size, 400, $n, $font1)
                        EndIf
                    Case $msg = $s;;;;;;;;;;;;;;;;;;;;;;;;;
                        If GUICtrlRead($s) = $GUI_CHECKED Then
                            $n = 8
                            If GUICtrlRead($u) = $GUI_CHECKED Then $n = 12
                            If GUICtrlRead($i) = $GUI_CHECKED Then $n = 10
                            If GUICtrlRead($u) = $GUI_CHECKED And GUICtrlRead($i) = $GUI_CHECKED Then $n = 14
                            $1size = GUICtrlRead($size)
                            $font1 = GUICtrlRead($cmb)
                            GUICtrlSetFont($a1, $1size, 400, $n, $font1)
                        Else
                            $n = 0
                            If GUICtrlRead($u) = $GUI_CHECKED Then $n = 4
                            If GUICtrlRead($i) = $GUI_CHECKED Then $n = 2
                            If GUICtrlRead($u) = $GUI_CHECKED And GUICtrlRead($i) = $GUI_CHECKED Then $n = 6
                            $1size = GUICtrlRead($size)
                            $font1 = GUICtrlRead($cmb)
                            GUICtrlSetFont($a1, $1size, 400, $n, $font1)
                        EndIf
                EndSelect
            WEnd
        Case $About
            MsgBox(0, "About", "BetaPad VE2.0 created by Secure_ICT." & @CRLF & @CRLF & "An open source text editor!" & @CRLF & "This script is licensed under the General Commons Lisence.")
        Case $InsDT
            GUICtrlSetData($DocEd1, @HOUR & ":" & @MIN & " " & @MDAY & "/" & @MON & "/" & @YEAR)
        Case $WCount
            $dok1 = GUICtrlRead($DocEd1)
            $do1 = StringSplit($dok1, " ")
            MsgBox(0, "Word Count", $do1[0] - 1 & " words in total." & @CRLF & @CRLF & StringLen($dok1) & " letters in total.")
        Case $Search
            ShellExecute ("www.google.com/search?q=" & GUICtrlRead($SearchInput))
        Case $Save
            $SaveDir = FileSaveDialog("Save", @MyDocumentsDir, "Text Document(*.txt)|Secure Document(*.ict)|Autoit Doccument(*.au3)", 16)
            Switch GUICtrlRead($Doc1)
                Case 0
                    $text = GUICtrlRead($DocEd1)
            EndSwitch
            $filehandle = FileOpen($SaveDir, 2)
            FileWrite($filehandle, $text)
            FileClose($filehandle)
        Case $Open
            $OpenDir = FileOpenDialog("Open", @MyDocumentsDir, "Text Document(*.txt)|Secure Document(*.ict)|Autoit Doccument(*.au3)", 16)
            $text = FileRead($OpenDir)
            GUICtrlSetData($text, $OpenDir)
            GUICtrlSetData($DocEd1, $text)
        Case $WinSize
            $size = WinGetPos("BetaPad | Alpha VE2.0")
            MsgBox(0, "Window Size (x,y,width,height)", $size[0] & " " & $size[1] & " " & $size[2] & " " & $size[3])
        Case $Encrypter
            $word2encrypt = InputBox("Password", "What do you want the password to encrypt with be?")
            GUICtrlSetData($DocEd1, _StringEncrypt(1, $DocEd1, $word2encrypt))
        Case $Decrypter
            $word2decrypt = InputBox("Password", "What is the password that will decrypt the text?")
            GUICtrlSetData($DocEd1, _StringEncrypt(0, $DocEd1, $word2decrypt))
        Case Else
            ;;;;;
    EndSwitch
WEnd

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

Thanks Mega! Works great.

Hi,

glad that I could help. Besides, nice skript.

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

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