On_fire
Members-
Posts
19 -
Joined
-
Last visited
On_fire's Achievements
Seeker (1/7)
0
Reputation
-
Determining if text is visible.
On_fire replied to On_fire's topic in AutoIt General Help and Support
Thanks for the help. I couldn't figure out how to find out how many characters it could display, so I made a block of text the right size, and checked how many lines there were. Here is the function I was working on, it changes the font size to the maximum that will display all the rows and columns specified. Please post any suggestions you have. Note: This does require the box to be read-only to work. EDIT: Wording and removed some old code. Func resize( $editBox, $cols, $rows ) $oldText = GUICtrlRead ( $editBox ) $testData = _StringRepeat ( " ", $cols) $testData = $testData & _StringRepeat ( @CRLF &_StringRepeat ( " ", $cols ), $rows -1) GUICtrlSetData ( $editBox, $testData ) Do increaseFontSize ( ) Until _GUICtrlEditGetLineCount ( $editBox ) <> $rows Do decreaseFontSize ( ) Until _GUICtrlEditGetLineCount ( $editBox ) = $rows GUICtrlSetData ( $editBox, $oldText ) EndFunc -
I have a read-only edit control and I need to determine if all of the text in it is visible. Is this possible, and if not could it be done with another control or without being read-only?
-
No, but I run the projectors at my church.Anyway, it's finished, hopefully there won't have to be too many versions after this one
-
This script adds a button to the "Edit Database Item" dialog that logs into your ccli.com account and searches for a song of your choice. Then it converts the song into the format for EasiSlides, and fills in all the information. Here is the script: [autoit]#cs ---------------------------------------------------------------------------- Script Name: CCLI Importer Script Description: Imports songs from the CCLI database. Instructions: Edit settings.ini to your needs. Author: Sean "On_fire" Goheen <projects@onfire.us> AutoIt Version: 3.1.1.0 License: Copyright EasiSlidesCCLI.exe
-
Yea, I know, I assumed it was something simple so I just copied the part that wasn't working and posted it. I will make sure it runs from now on. Yup that did it Thanks a lot. It is almost all done now, except for a few bug fixes.
-
The defaults there are correct. It's made to work with the program Easislides, but to be easily modified to work with other programs without me having to do another build.I was hoping it would be an obvious problem but apparently not.
-
Sorry, I should have tested it. Laziness never is worth it CODE#include <ANYGUI.au3> #include <array.au3> $button = _ArrayCreate("") $target = 0 Func makeButton() $targetWin = IniRead("settings.ini","Button Options","windowTitle","Edit Database Item") $targetID = IniRead("settings.ini","Button Options","toolbarID","132846") $targetIDX = IniRead("settings.ini","Button Options","tolbarIDX","429") $targetIDY = IniRead("settings.ini","Button Options","toolbarIDY","26") $targetIDW = IniRead("settings.ini","Button Options","toolbarIDW","52") $targetIDH = IniRead("settings.ini","Button Options","toolbarIDH","21") $target = _GuiTarget($targetWin, "", "", $targetID) Global $button = _TargetaddButton("Import",$targetIDX,$targetIDY,$targetIDW,$targetIDH,-1,-1, $target) GUISetState(@SW_SHOW) EndFunc makeButton() While 1 $msg = GUIGetMsg() Select Case $msg = $button[0] ;~ newSearch() Case $msg = $GUI_EVENT_CLOSE Exit Case Not WinExists($target) makeButton() EndSelect WEnd
-
oh, no I just didn't want to post the whole file yet, so I just posted the part that isn't working.
-
Hmm, this is weird. Can anyone see anything wrong with this? I can't get the button to show. Also though I can't figure out why, when I use $targetID it throws an error. I wonder if I am having a blond moment? CODE $button = _ArrayCreate("") $target = 0 Func makeButton() $targetWin = IniRead("settings.ini","Button Options","windowTitle","Edit Database Item") $targetID = IniRead("settings.ini","Button Options","toolbarID","132846") $targetIDX = IniRead("settings.ini","Button Options","tolbarIDX","429") $targetIDY = IniRead("settings.ini","Button Options","toolbarIDY","26") $targetIDW = IniRead("settings.ini","Button Options","toolbarIDW","52") $targetIDH = IniRead("settings.ini","Button Options","toolbarIDH","21") $target = _GuiTarget($targetWin, "", "", $targetID) Global $button = _TargetaddButton("Import",$targetIDX,$targetIDY,$targetIDW,$targetIDH,-1,-1, $target) GUISetState(@SW_SHOW) EndFunc makeButton() While 1 $msg = GUIGetMsg() Select Case $msg = $button[0] newSearch() Case $msg = $GUI_EVENT_CLOSE Exit Case Not WinExists($target) makeButton() EndSelect WEnd
-
Sorry it took so long to respond, I forgot all about it. XD I looked and didn't see anything wrong so it must just be my math. I am kinda putting this on the back burner for now, as I have more important things I need to get done. Sean
-
Thanks. It's probably just my math is off somewhere. It's supposed to detect the size of the borders and titlebar, but it still seems to be off a bit.I don't notice anything horribly wrong, but then I have the theme service turned off, so I don't know how well it will do on the default XP theme. On second thought it may be that windows isn't resizing the combo properly, I'll have a look at it in a bit.
-
Not to be a me too or anything, but you gave me an idea too. Anyway, this will be a launcher that will do calculations, run programs, search your harddrive, go to links, search the web, ect. Feel free to copy anything you want for your UDF. (Which I can help you with after I get done.) I would like to have multi monitor support, but a search didn't turn up anything that worked right. So if anyone knows how to get the size and position of monitors then please let me know. Here is my alpha that I am in the middle of rewriting (for obvious reasons). As far as I know it works fine, it's just bad, undocumented, code. XD Let me know if you find anything interesting, or need any help. CODE#cs ---------------------------------------------------------------------------- Script Name: Launcher Script Description: Adds a box to the top of your windows that runs things. Instructions: Edit settings.ini to your needs. Author: Sean "On_fire" Goheen <projects@onfire.us> AutoIt Version: 3.1.1.0 Credits: Secure_ICT Gave me the idea and the starting code. http://www.autoitscript.com/forum/index.php?showtopic=41473 Zebna Posted the code for getting the titlebar/border size. #ce ---------------------------------------------------------------------------- Opt("RunErrorsFatal", 0) #include <Misc.au3> #include <GuiConstants.au3> #Include <GuiCombo.au3> #include <File.au3> #include <Array.au3> Global $oldText = "" ;~ #NoTrayIcon _Singleton("Launcher") HotKeySet("{esc}","hide") HotKeySet("!{space}","show") #region from Zedna http://www.autoitscript.com/forum/index.ph...tSystemMetrics# Const $SM_CYCAPTION = 4 Const $SM_CXFIXEDFRAME = 7 $titleHeight = DllCall('user32.dll', 'int', 'GetSystemMetrics', 'int', $SM_CYCAPTION) $titleHeight = $titleHeight[0] ; 19 or 26 $border = DllCall('user32.dll', 'int', 'GetSystemMetrics', 'int', $SM_CXFIXEDFRAME) $border = $border[0] ; 3 #endregion #region Startup ;Add extra space for uncommon buttons when requested $extraBtnSpc = IniRead("settings.ini","settings", "extraBtnSpc", 0) $Width = IniRead("settings.ini","settings", "WidthAjust", 100) $Height = $titleHeight-IniRead("settings.ini","settings", "HeightAjust", 0) $defaultLeft = @DesktopWidth-$Width-$extraBtnSpc-$titleHeight-$titleHeight-$titleHeight-IniRead("settings.ini","settings", "dftLft", 0) $defaultTop = $border-IniRead("settings.ini","settings", "dftTop", 0) #endregion #region GUI $sGUI = GuiCreate("Launcher", $Width, $Height, $defaultLeft, $defaultTop, BitOR($WS_POPUP, $WS_EX_TOPMOST),$WS_EX_TOOLWINDOW) $sCombo = GUICtrlCreateCombo("", -1, -1, $Width+2, $Height+2,BitOR($CBS_NOINTEGRALHEIGHT,$GUI_SS_DEFAULT_COMBO)) $Submit = GUICtrlCreateButton("submit", -5, -5 , 2, 2, $BS_DEFPUSHBUTTON) $History = _ArrayCreate("") _FileReadToArray("history.txt", $History) _ArrayDelete($History,0) GUICtrlSetData($sCombo, _ArrayToString($History, "|")) $actvWin = WinGetPos("") WinMove($sGUI,"Launcher",($actvWin[0]+$actvWin[2])-$Width-$extraBtnSpc-$titleHeight-$titleHeight-$titleHeight-$border,$actvWin[1]+$border) GuiSetState() WinSetOnTop($sGUI, "", 1) #endregion While 1 $actvWin = WinGetpos("") If WinGetHandle("") <> $sGUI Then WinMove($sGUI,"Launcher",($actvWin[0]+$actvWin[2])-$Width-$extraBtnSpc-$titleHeight-$titleHeight-$titleHeight-$border,$actvWin[1]+$border) If WinGetHandle("") = "" Then WinMove($sGUI,"Launcher",$defaultLeft,$defaultTop) _GUICtrlComboAutoComplete ($sCombo, $oldText) $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Submit process() EndSwitch Wend Func process() $sRead = GuiCtrlRead($sCombo) $words=StringSplit($sRead," ") $srchRslt = IniRead("settings.ini", "Keywords", $words[1], 0) Select Case $words[1] = "exit" Exit Case $words[1] = "c" MsgBox(0, "Launcher - Calc", Execute(StringReplace($sRead, $words[1] & " ", ""))) Case $srchRslt <> "0" ShellExecute(StringReplace($srchRslt, "%s", StringReplace($sRead, $words[1] & " ", ""))) Case $sRead = "help" MsgBox(0, "Launcher - Help", "You need help?") Case Else ShellExecute($sRead) EndSelect $i = _ArraySearch($History, $sRead) If $i = -1 Then If UBound($History) < IniRead("settings.ini","settings", "maxHist", 10) Then _ArrayInsert($History, 0, $sRead) Else _ArrayPush($History,$sRead,1) EndIf Else _ArrayDelete($History, $i) _ArrayInsert($History, 0, $sRead) EndIf _FileWriteFromArray("history.txt", $History) GUICtrlSetData($sCombo,"") GUICtrlSetData($sCombo, _ArrayToString($History, "|")) EndFunc Func hide() GuiSetState(@SW_HIDE,$sGUI) GUICtrlSetData($sCombo,"") GUICtrlSetData($sCombo, _ArrayToString($History, "|")) EndFunc Func show() GuiSetState(@SW_SHOW,$sGUI) EndFunc
-
It would be more reliable if you use @WindowsDir to get the directory instead of basing it on the os. (Sometimes win 2000/nt is installed in Windows.) I would get rid of $Windows = @OSVersion If $Windows = "WIN_2000" Then $windir = "WINNT" ElseIf $Windows = "WIN_XP" Then $windir = "WINDOWS" Else MsgBox(0, "Sorry", "Incompatible operating system.") Exit EndIfoÝ÷ Ù©Ýr§æ®¶sc¶6÷ærfÆW2FòFV"F&V7F÷&W0¤fÆT6÷gV÷C´ÖvUõ&VGV6W"æWRgV÷C²ÂgV÷C´3¢gV÷C²fײb33c·væF"fײgV÷Cµ77FVÓ3"gV÷C²£¶VæB6÷ærin CLICK ME.au3 This way it would run on every install of windows XP/2K and if the keys are in the same place on 98, then it would also work on that. Or possibly copy it into the sendto folder on if the OS is 98.
-
Thank you both so much, I have been looking for a way to do modules for a program I am making, I combined the two and got this: #include <Array.au3> #include <File.au3> Dim $moduleList[1] $moduleList=_FileListToArray(@ScriptDir & "\Modules\", "*.au3") If (Not IsArray($moduleList)) Or (@Error=1) Then MsgBox (0,"","No modules found.") Exit EndIf _ArrayReverse($moduleList) _ArrayPop($moduleList) $file = FileOpen(@ScriptDir & '\includes.au3', 2) For $plugin In $moduleList FileWrite($file, "#include "& Chr(34) & @ScriptDir & "\Modules\" & $plugin & Chr(34) & @CRLF) Next FileClose($file) Run(@AutoItExe & ' /AutoIt3ExecuteScript "'&_PathFull('Main.au3')&'"') This loads everything in the /Modules directory that ends in .au3 and puts it in includes.au3 which is included at the bottom of Main.au3. Have fun with this. P.S. This requires the Beta P.S.S. The modules are loaded in reverse alphabetical order.
-
WM Recorder 11 GUI automation script
On_fire replied to Maxim Vexler's topic in AutoIt Example Scripts
I'm pretty sure this will do what you want. Only problem is it is kinda complex, and since you already have this, it might not be worth it. VLC