Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/14/2016 in all areas

  1. Features: Create modern looking borderless and resizable GUIs with control buttons (Close,Maximize/Restore,Minimize, Fullscreen, Menu) True borderless, resizeable GUI with full support for aerosnap etc. Many color schemes/themes included. See MetroThemes.au3 for more details. 3 type of Windows 8/10 style buttons. Modern checkboxes, radios, toggles and progressbar. All buttons, checkboxes etc. have hover effects! Windows 10 style modern MsgBox. Windows 10/Android style menu that slides in from left. Windows 10 style right click menu Credits: @UEZ, for the function to create buttons with text using GDIPlus. @binhnx for his SSCtrlHover UDF Changelog: Download UDF with example:
    1 point
  2. Now replaced by a new version of the UDF in this link. <hr> [NEW VERSION] - 7 Mar 16 Added: A new option for $iAdded (+ 512) allows you to select just one cell of the ListView rather than the whole row. A new function _GUIListViewEx_SetDefColours allows the user to set the default colours when using either or both the "colour" and "single cell selection" options. Another new function _GUIListViewEx_BlockReDraw which prevents ListView redrawing during looped Insert/Delete/Change calls - this greatly speeds up execution by avoiding lengthy redrawing when using either or both the "colour" and "single cell selection" options, use of which forces the redraw to use a WM_NOTIFY handler within the script. Changed: A number of minor internal changes to speed up the loading of the ListView when using either or both of the "colour" and "single cell selection" options. A slightly modified Example_6 script shows the new functions in use. The LH native ListView can have rows and columns added/removed using both the old and new functions and has a context menu to allow for colour selection. The contents of this ListView can be mirrored to the RH UDF-created ListView which has "single cell selection" enabled and allows the colours of any item (including the selected cell) to be changed programmatically. New UDF in the zip below. Previous changes: ChangeLog.txt Hi, It seemed that I wanted to add, delete, edit or move items in a ListView quite often in my scripts and I got fed up with having to rewrite the code to do it each time. I also wanted to be able to drag items within and between ListViews with the mouse, plus edit the items. So I decided to write a UDF to make life easier and here is the result - GUIListViewEx. If you are interested in how it works, then read this bit - if not, then skip over it: The UDF is pretty easy to use: - You start by creating a ListView (either native or UDF) and passing the returned ControlID/handle and the array you used to fill it to the _Init function of the UDF. You also indicate whether the array has a count in the [0] (or [0][0]) element and if you create an empty ListView, the UDF will still cope and will shadow any items that you insert later. If you have a ListView filled with data but no matching array, there is a function to read that data into an array for you. You can select a colour for the insert mark when dragging items if you are going to use this feature - the default is black - and decide whether to have a shadow of the dragged item follow the mouse. Finally you can set the ListView to be sortable, editable - with various options to determine how the editing process works, determine external drag/drop behaviour and whether user colours are used. - You need to register a few Windows messages, but this is a single call to the _MsgRegister function. If you already have handlers for the relevant messages, there are functions to call within these handlers instead. If you do not want to drag, then you only need the WM_NOTIFY handler loaded. - Then you just need to call the main _Insert($vData), _Delete, _Up, and _Down functions when the appropriate button is pressed, select and drag items, or use one of the edit functions and your ListView responds automatically. - The UDF shadows the contents of the ListView (as explained in the spoiler section above) so you can get its current state at any time with the _ReturnArray function . Many of the functions actually return this data after each call just to help you keep track and there are dedicated Save/Load functions. - If enabled, the user can colour individual items within the ListView - and can set certain elements to be coloured on loading if required. - There are a couple of functions that you need to run in your idle loop if you need the functionality - they detect when items are dragged and edited. - When you have finished with the ListView, you should use the _Close function to clear the memory used by the UDF to shadow its contents. It is not vital, but if you use a lot of ListViews and do not do this, you could end up running out of memory. - You can have as many ListViews as you wish on display at any one time and the same "Insert", "Delete", "Up" and "Down" buttons can be used for them all - you just have to click on the one you want to be active. The UDF also allows you to set the active ListView programatically (_SetActive) - and to determine which is currently active (_GetActive). There are also additional Insert/DeleteSpec functions which allow you to action non-active ListViews. There are 6 example scripts to show the UDF working on native and UDF created ListViews, with single or multiple columns and either filled or empty, along with the UDF itself in this zip file: Credit to martin (for the basic drag code which I found on the forum), the Array UDF authors (for the basis of the array functions) and LarsJ (for the basic colour handler code). Happy for any feedback - hopefully positive! M23
    1 point
  3. To do something like this with AutoIt, you need to parse the name in some way and assign it using standard word characters. In other words, create your own language syntax. I sometimes do things like this by assigning the hexadecimal returned from StringToBinary(). This method introduces case sensitivity into the variable name, which brings with it some potential uses. Assign() is the function you need. I would only do something like this if it makes the code easier to write. In most situations it just makes things more complicated.
    1 point
  4. I have heard that book is 3.6x cleaner than 50 Shades of Grey.
    1 point
  5. I might be biased, but I would use mine...
    1 point
  6. If this script was in the parent folder, it would search through all of the files, return the ones that match the searchstring, and copy them to the testcopy folder. You can comment out the arraydisplay once you decide it is returning the correct targets. #include<file.au3> DirCreate(@ScriptDir & "\testCopy") $SearchString = "488" $aFound = _FileListToArrayRec(@ScriptDir , "*" & $SearchString & "*||" , 1 , 1 , 0 , 2) _ArrayDisplay($aFound) For $i = 1 to ubound($aFound) - 1 filecopy($aFound[$i] , @ScriptDir & "\testCopy" , 1) Next
    1 point
  7. Please try this You will need to declare the thousands and decimal separators as global vars at the top of the script This code uses a button, to make it work with TAB key just have a look at GUISetAccelerators in the help file #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) Global $sSep = ".", $sDec = "," $hGUI = GUICreate("Currency Decimal Separator", 232, 90) $Label = GUICtrlCreateLabel("Enter some numbers", 22, 8, 163, 17) $input = GUICtrlCreateInput("", 22, 30, 165, 24) GUICtrlSetLimit(-1, 19) GUICtrlSetFont(-1, 12) $btn = GUICtrlCreateButton("format cents", 22, 60, 80, 22) GUICtrlSetOnEvent(-1, "_format_cents") GUISetState() GUIRegisterMsg($WM_COMMAND, '_WM_COMMAND') GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") While Sleep(10) WEnd Func _WM_COMMAND($hWnd, $Msg, $wParam, $lParam) If BitAND($wParam, 0x0000FFFF) = $input Then GUICtrlSetData($input, _FormatInputNumber(GUICtrlRead($input))) EndIf Return $GUI_RUNDEFMSG EndFunc Func _FormatInputNumber($iNumber) $iNumber = StringRegExpReplace(StringRegExpReplace($iNumber, '^' & $sDec, "0" & $sDec), "[^0-9" & $sDec & "]", "") Local $s = StringSplit(StringReplace($iNumber, $sSep, ""), $sDec) Return StringRegExpReplace($s[1], '(?<=\d)(?=(\d{3})+$)', $sSep) & (($s[0] = 1) ? "" : $sDec & StringLeft($s[2], 2)) EndFunc Func _format_cents() Local $s = StringSplit(GUICtrlRead($input), $sDec) GUICtrlSetData($input, $s[1] & $sDec & (($s[0] = 1) ? "00" : StringTrimLeft(StringFormat("%2f", "." & $s[2]), 2))) EndFunc Func _Exit() Exit EndFunc
    1 point
  8. Updated UDF to v3.5 Updated Metro Msgbox function to support different button combinations like the default MsgBox function in Autoit.(See Help file for the button combination flags) Added function "_Metro_RadioIsChecked" due to request. Changed default font to Arial because "Calibri Light" is not installed on all Windows 7 computers. Updated example.
    1 point
  9. SQLite is now distributed with AutoIt, so I don't see what the problem is. Create a new topic in future and don't hijack.
    1 point
  10. Melba23

    Remove Blank Lines in a file

    DemonWareXT, Perhaps like this: #include <File.au3> #include <Array.au3> Global $aLines _FileReadToArray("Test.txt", $aLines) For $i = $aLines[0] To 1 Step -1 If $aLines[$i] = "" Then _ArrayDelete($aLines, $i) EndIf Next _FileWriteFromArray("NewTest.txt", $aLines, 1) Note you have to run the delete code from the end of the array or you run into errors with the count when you delete lines. M23
    1 point
×
×
  • Create New...