Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/23/2016 in all areas

  1. Here some graphical examples written completely in FreeBasic just for fun. _WinAPI_SetWindowTitleIcon Check for Numeric Entry in an EditBox using RegEx CreateWindowEx (hGUI) Example FB 3D Starfield Rotating Flight FB File2Bas Code Generator FB Fire Particles FB Fireworks FB GFX Examples FB Image to Trapezoid Transformation FB Layered Parallax Effect FB Plasma FB Puristic Clock FB Rotating Cube FB Rotating Earth FB Rutt Etra Izer Effect FB Simple Recursive Tree Generator FB Snowfall FB Tunnel Flight FB Water Effect FMOD Examples GDI - GDI+ 3D Sinus Wave GDI - GDI+ Animated Pythagoras Tree GDI - GDI+ Bezier Lines GDI - GDI+ Particles - Repulsive Force Sim v2.0 GDI - GDI+ Plasma v5 Booster GDI - GDI+ Random Pattern GDI - GDI+ Space Flight GDI - GDI+ Tunnel Flight - WipeOut Style GDI Classic Raytraced Tunnel GDI Elastic Twister Effect GDI Exploding Pixels GDI Infinite Image Zoom Flight GDI Liquid Pixels GDI Mandelbrot GDI Particle Repulsion Grid GDI Particles Mouse Attraction GDI Starfield GDI The Nautilus Raymarcher GDI Worm Tunnel Flight GDI+ 3D Starfield Scrolling v1 Booster GDI+ 3D Starfield Scrolling v3 Booster GDI+ Convert Bitmap to ASCII GDI+ GIF Anim to ASCII Player GDI+ Image Painting GDI+ Impossible Possible GDI+ Kaleidoscope GDI+ Performance Test - Au3 vs FB GDI+ Polar Clock GDI+ Rotating Earth GDI+ Spiral Text GDI+ Star Wars Scroller GDI+ Streamer GDI+ Swiss Railway Clock GDI+ The MATRIX Ini Read - Write Rutt_Etra_Izer_Booster Stack TitchySID uFMOD Download: FreeBasic Examples build 2019-05-08.rar I will add new examples from time to time. FreeBasic source codes are also included.
    1 point
  2. There is no need for this: _ADO_Connection_Close($sConnectionString) $sConnectionString = Null $sConnectionString = 0 ; Release the connection object EndFunc ;==>_Example_MSExcelb as each of this following functions: _Example_1_RecordsetToConsole($sConnectionString, "select * from [Sheet1$]") _Example_2_RecordsetDisplay($sConnectionString, "select * from [Sheet1$]") _Example_3_ConnectionProperties($sConnectionString) is opening and cleaning up it internally. btw. $sConnectionString = Null $sConnectionString = 0 ; Release the connection object $sConnectionString is string not object.
    1 point
  3. @Raviteja please read this: * How to post code on the forum * And if you could, please edit your post accordingly. Thanks.
    1 point
  4. Remark 1: Wiki page are talking about ADO in general - I mean not related to my UDF. Wiki examples for ADO are very similar as I changed many of them to use the same variable names as in my ADO.au3 UDF. Remark 2: In some cases to correctly use Wiki Examples for ADO you should also use COM Error Handler. Wiki Examples for ADO showing to you only the concept how to use ADO in AutoIt. Of course it should use out of the box, but you are doing something wrong (I think so) and for this case you should use COM Error Handler Here is example: ; Error monitoring. This will trap all COM errors while alive. Global $oErrorHandler = ObjEvent("AutoIt.Error", "_ErrFunc") Global Const $iCursorType = 0 ; adOpenForwardOnly Global Const $iLockType = 1 ; adLockReadOnly Global Const $iOptions = 512 ; adCmdTableDirect - Return all rows from the specified table Global $oConnection = ObjCreate("ADODB.Connection") ; Create a connection object Global $sFilename = @ScriptDir & "\ADO_Example_Excel.xlsx" ;Global $sConnectionString = 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=' & $sFilename & ';Extended Properties="Excel 8.0;HDR=No"' ;xls Global $sConnectionString = 'Microsoft.ACE.OLEDB.12.0;Data Source=' & $sFilename & 'Extended Properties="Excel 12.0 Xml;HDR=No"' ;xlsx $oConnection.Open($sConnectionString) ; Open the connection ;"HDR=Yes;" indicates that the first row contains columnnames, not data. "HDR=No;" indicates the opposite. Global $oRecordset = ObjCreate("ADODB.Recordset") ; Create a recordset object Global $sSQL_Query = "Select F1,F2 FROM [Sheet1$A1:B2]" ; Select all records and all fields of the selected range A1:B2 $oRecordset.Open($sSQL_Query, $oConnection, $iCursorType, $iLockType, $iOptions) ; Issue the SQL query If Not @error Then With $oRecordset While Not .EOF ; repeat until End-Of-File (EOF) is reached ; Write the content of all fields to the console separated by | by processing the fields collection ConsoleWrite("Process the fields collection: ") For $oField In .Fields ConsoleWrite($oField.Value & "|") Next ConsoleWrite(@CR) ; Write a second line by accessing all fields of the collection by name or item number ConsoleWrite("Process the fields by name/item number: " & .Fields("F1").Value & "|" & .Fields(1).Value & "|" & @CR) .MoveNext ; Move To the Next record WEnd EndWith ; Clean Up Recordset $oRecordset.Close ; Close the recordset $oRecordset = 0 ; Release the recordset object EndIf ; Clean Up Connection $oConnection.Close ; Close the connection $oConnection = 0 ; Release the connection object ; User's COM error function. Will be called if COM error occurs Func _ErrFunc($oError) ; Do anything here. ConsoleWrite(@ScriptName & " (" & $oError.scriptline & ") : ==> COM Error intercepted !" & @CRLF & _ @TAB & "err.number is: " & @TAB & @TAB & "0x" & Hex($oError.number) & @CRLF & _ @TAB & "err.windescription:" & @TAB & $oError.windescription & @CRLF & _ @TAB & "err.description is: " & @TAB & $oError.description & @CRLF & _ @TAB & "err.source is: " & @TAB & @TAB & $oError.source & @CRLF & _ @TAB & "err.helpfile is: " & @TAB & $oError.helpfile & @CRLF & _ @TAB & "err.helpcontext is: " & @TAB & $oError.helpcontext & @CRLF & _ @TAB & "err.lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _ @TAB & "err.scriptline is: " & @TAB & $oError.scriptline & @CRLF & _ @TAB & "err.retcode is: " & @TAB & "0x" & Hex($oError.retcode) & @CRLF & @CRLF) EndFunc ;==>_ErrFunc QUESTION: in ADO_EXAMPLE.au3 there is a good example: Func _Example_MSExcel() Local $sFileFullPath = Default ; Here put FileFullPath to your Excel File or use Default to open FileOpenDialog Local $sProvider = Default Local $sExtProperties = Default Local $HDR = Default Local $IMEX = Default Local $sConnectionString = _ADO_ConnectionString_Excel($sFileFullPath, $sProvider, $sExtProperties, $HDR, $IMEX) _Example_1_RecordsetToConsole($sConnectionString, "select * from [Sheet1$]") _Example_2_RecordsetDisplay($sConnectionString, "select * from [Sheet1$]") _Example_3_ConnectionProperties($sConnectionString) EndFunc ;==>_Example_MSExcel Did you try it ?
    1 point
  5. Jfish

    _FileReadToArray bug?

    #include <Array.au3> #include <File.au3> Local $Test _FileReadToArray(@ScriptDir & "\test.txt", $Test, 4, '^^'); change $iFlags parameter from 0 to 4 _ArrayDisplay($Test, "Test")
    1 point
  6. czardas, I think I've addressed most of the issues in the zip below. The issues are: When the marked cell (cyan) is moved with the left/right arrow keys the standard 5 pixel horizontal scroll is suppressed. Use shift+left/right to perform this 5 pixel scroll. Use ctrl+left/right to move the marked cell horizontally a page at a time. The new marked cell is always aligned to the left edge of the listview. If the marked cell is outside the visible part of the listview (because the listview has been scrolled with the mouse) and Enter, left/right or ctrl+left/right is pressed, the marked cell is scrolled into the visible part of the listview. If the marked cell is not completely visible along left/right edge of the listview when you press Enter to edit the cell, the cell is scrolled into a completely visible position. Calculations are based on listview subitem rectangle instead of scrollbar position as you have proposed. The zip contains EditControlKeyboardTenCols.au3 (100 columns) and TenColumns.au3 (100 columns) which I've used to verify the behavior of a standard listview. Zip in first post is not updated. I'll go through the code more carefully and update the zip. ListViewEditingCells.7z
    1 point
  7. LarsJ

    Problem with OCR

    Here are a few posts you can study: Tesseract Simple Example, Getting Tesseract to Work and Tesseract doesnt detect the easiest image. Pixels with 10 shades variation: I don't think you can do this. Tesseract just finds all text in the image. 26 letters and 10 digits: I don't think you can do it and it should not be necessary. Tesseract is able to recognize letters and digits.
    1 point
  8. No I think it's ok, but that's not up to me to decide.
    1 point
  9. After holding down the left or right arrow keys for a period, the scroll bar continues to update after the key is released. These scroll actions are queued and are occurring after you set the position. If there was a way to interfere with these messages, it might be possible to set the scrollbar position accurately. Horizontal scrolling should work the same as vertical scrolling: with the scroll bar remaining static until the selection goes off screen.
    1 point
  10. There still appear to be problems associated with scrolling a large number of columns using the keyboard. I didn't get around to looking at this earlier because I've been mainly working on back end stuff. Attempts to integrate your current version were not entirely satisfactory. You can see the problem if you modify EditControlKeyboardTenCols.au3 and set it to generate 100 columns. It appears that an additional scroll action is taking place when using the arrow keys (I suppose this is standard scrollbar behaviour). I think that may be interfering with reading the precise horizontal scroll position - this is just a theory. Also try scrolling manually off screen with the mouse, then hit the left or right arrow key and see what happens. I'm currently using this when a column goes off screen: Func ShowColumn($hListView, $iSubItem) ; If $iSubItem = 0 Then Return ; specific to czardas' current project Local $iLvWidth = WinGetClientSize( $hListView )[0] Local $aRect = _GUICtrlListView_GetSubItemRect( $hListView, $iItem, $iSubItem ) If $aRect[0] < 0 Then _GUICtrlListView_Scroll($hListView, $aRect[0], 0) ElseIf $aRect[2] > $iLvWidth Then _GUICtrlListView_Scroll($hListView, $aRect[2] - $iLvWidth, 0) EndIf EndFunc ;==> ShowColumn I commented out the first line of the function because it is only relevant to my project: I am hiding the first column and dealing with it independently. Column 0 could cause problems with the code above (untested with your examples). The logic is not much different to MakeColumnVisible().
    1 point
  11. This might be useful to you too... #include <Constants.au3> #include <WindowsConstants.au3> #include <WinAPI.au3> Example() Func Example() Local $hGUI = GUICreate('') GUISetState(@SW_SHOW, $hGUI) ; Set the GUI as being on top using the handle returned by GUICreate. WinSetOnTop($hGUI, '', 1) MsgBox($MB_SYSTEMMODAL, '', 'Is the GUI on top: ' & _IsOnTop($hGUI) & ', this should be True') GUIDelete($hGUI) EndFunc ;==>Example ; Check if a window is on top. Func _IsOnTop($sTitle, $sText = '') Return BitAND(_WinAPI_GetWindowLong(WinGetHandle($sTitle, $sText), $GWL_EXSTYLE), $WS_EX_TOPMOST) = $WS_EX_TOPMOST EndFunc ;==>_IsOnTop
    1 point
×
×
  • Create New...