Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/03/2019 in Posts

  1. It takes time to understand the "know-how" of most parts of AutoIt, time and experience. But you can always rely to this community when you need help. Or sometimes, just to attest if the code you made is optimal.
    2 points
  2. It has been more than a month since the last post in this thread and I did not manage to start working on the reference script until now... I blame the many things that I am try to balance in my schedule, which includes gaming on my new PS4 and watching a ton of YouTube when I am not working Anyway, I finally made a very basic reference script covering comments and variables, this should be enough to get me started: #cs This is a simple reference script which aims to include every possible combination of AutoIt Syntax As a matter of fact, we are demonstrating multi-line comments now! #ce #Region Comments ; == Single-line ; This is a single line comment ; == Multi-line #comments-start This is a comment spanning multiple lines #comments-end ; NOTE: Technically multi-line comments are directives which are processed by the preprocessor #EndRegion #Region Variables ; == Declaration Local $vLocalVariableDemo Global $g_vGlobalVariableDemo Dim $g_vDimVariableDemo ; Dynamic scope, avoid at all costs! Global Const $g_vGlobalConstantDemo = 3.14 ; You can't change PI! Enum $FOO, $BAR ; $FOO = 0 and $BAR = 1 Enum Step 2 $MAYBE_EVEN, $EVEN, $EVEN_AGAIN ; $MAYBE_EVEN = 0, $EVEN = 2, $EVEN_AGAIN = 4 Enum Step *2 $ONE_BIT, $TWO_BIT, $FOUR_BIT, $ONE_BYTE, $TWO_BYTES, $FOUR_BYTES ; Exponents of 2: 1, 2, 4, 8, 16, 32, ... ; === Array declaration Global $g_aArrayDemo[10] ; == Initialization Global $g_sInitializedString = "Test" Global $g_nInitializedNumber = 42 Global $g_vInitializedVarFromExp = (@SEC / 2) - Floor(@SEC / 2) = 0.5 ? "Even" : 0xDD ; Initialization with an expression whose type is dynamic ; === Array initialization Global $g_aInitializedArray[2] = ["Foo", "bar"] #EndRegion If anyone wants to expand the list, then feel free to do so! I will probably adapt your changes with modifications in my next iteration
    2 points
  3. I quickly post one more thank you to come a little closer to becoming an "Active Member".
    2 points
  4. @abberration You could streamlined your code like this : #include <GUIConstants.au3> GUICreate ("Test") $idCheckBox = GUICtrlCreateLabel (ChrW (0xA3),100, 70, 18, 18) GUICtrlSetFont(-1, 15, 500, -1, "Wingdings 2") $idLabelCheckBox = GUICtrlCreateLabel ("CheckBox", 122, 74, 100, 18) GUISetState () While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $idCheckBox, $idLabelCheckBox GUICtrlSetData ($idCheckBox, GUICtrlRead ($idCheckBox) = ChrW (0xA3) ? ChrW (0x51) : ChrW (0xA3)) EndSwitch Wend
    2 points
  5. Just add _GUICtrlListView_SetCallBackMask( $cListview, 4 ) ; Disable state information about focused item immediately after creation of the listview. This command disables the dotted focus rectangle around the listview item which has the input focus. Untested. But it should work.
    1 point
  6. The lexer takes care of the syntax coloring/highlighting and folding for a specific file extension. Jos
    1 point
  7. Thank you for your interest! This is a good hint! I have named the title DE because I want to see if it can work first. At a later date there may be a PSPad4AutoIt3 EN project if more users are interested. Until then the project name remains with DE, but the next improvement kit I will name it EN. Thanks for the hint! Until then, it has its home in the DE AutoIt forum, and is still basically set to English. You can change this as you like, e.g. in AutoIt, if you have installed the AutoIt help in German, or in French, or Chinese, ... PSPad will use it. Or for PSPad in the menu / Settings / Program Settings / Language / ... you can choose what you want. Please remember that it is at a very early stage! There are only a few features and probably many bugs. At this point there are more improvements that I can (hopefully) make available in 2 or 4 weeks.
    1 point
  8. Yes, I love the help file. It is very useful. I have spent more time reading it than actually programming. The biggest problem with it is more complicated things like regular expressions cannot be fully explained. That could be a book on its own. And functions were explained how parameters are used, but not the underlying concept of what a function does, why we use them or when is the best time to use them. I fully understand them now, but it took a while to get it. Unless I just stumbled upon the section that talked about conditional operators, I would never have known it existed. In other words, until today, I thought the way I wrote the script was the only way to do it. The help file cannot tell you "hey, there's a better way - check out this section...". And looking at the Case section, I now see the comma separating the two variable expressions, but the help file did not make that clear to me or show an example of more than one variable.
    1 point
  9. mmm..... my (wild) guess would be that CallTip.cxx contains the Caltip logic. .. but doubt you can just simply port it to PSPAD.
    1 point
  10. Help file is one of the greatest assets of the language. Most of the functions have a runable example, and many are not that trivial. Reading it and studying the examples is probably the best way to learn AutoIt. Glad you liked my example
    1 point
  11. Nine, that is really cool. I learned a few things from your example. First, I used to try and have a case for two items and used OR and it never worked. Now I know to use a comma. Also, I looked up in the help file and found the conditional operator you used for switching the between the characters. Nice. I have seen some videos on how to program with Autoit, but they were all simple stuff, nothing advanced. I wish there were a better way to learn.
    1 point
  12. Nothing wrong here. ListView is "not focused" so windows change color of selected LV Item. Try to use ControlFocus() function like in this following example: #include <GUIConstantsEx.au3> #include <GuiListView.au3> #include <MsgBoxConstants.au3> Example() Func Example() GUICreate("ListView Set Item Selected", 300, 110) Local $idButton = GUICtrlCreateButton("Button", 175, 50, 75, 20) Local $idListview = GUICtrlCreateListView("", 4, 4, 125, 100) #forceref $idButton GUISetState(@SW_SHOW) ; Add columns _GUICtrlListView_AddColumn($idListview, "Items", 100) ; Add items _GUICtrlListView_AddItem($idListview, "Item 1") _GUICtrlListView_AddItem($idListview, "Item 2") _GUICtrlListView_AddItem($idListview, "Item 3") ; Select item 2 _GUICtrlListView_SetItemSelected($idListview, 1) ControlFocus('ListView Set Item Selected','',$idListview) ; Loop until the user exits. Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>Example
    1 point
  13. Version 1.2.0.0 released Changelog can be found on the download page and the history in the ZIP file. For download please see my signature below. Please play with this version and tell me what doesn't work or is missing!
    1 point
  14. 1 point
  15. Guess so as I am the author of the script. I am fine with other using as long as it is credited and people don't expect support from me. Jos
    1 point
  16. Hi Professor Bernd, and welcome! From these threads, we get that it is okay to use code found on the forums, but there are no licenses for any of the code posted without something in their signature. It is general etiquette to give credit by mentioning the author... usually I see it in the function header something like this: ; Author ........: Melba23, Jos, water ; Modified.......: Professor Bernd I am quite sure that Jos maintains AutoIt3Wrapper... you may want to send him a message or '@' him here. I think he doesn't want the AutoIt3Wrapper distributed... I'll edit if I can find that thread
    1 point
  17. Another solution is to have the checkbox be $BS_PUSHLIKE + $BS_BITMAP. You simply need to have 2 .bmp (check and uncheck) of the same size. And you toggle between both .bmp. Easy to make...
    1 point
  18. Nine, great idea with the wingdings. Here's an example how that could work. #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 625, 443) $Label1 = GUICtrlCreateLabel("S", 88, 96, 36, 17) GUICtrlSetFont(-1, 12, 400, 0, "Wingdings 2") GUICtrlSetCursor (-1, 0) $Label2 = GUICtrlCreateLabel("Click Me", 104, 98, 70, 17) GUICtrlSetCursor (-1, 0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Label1 _ReverseSelection() Case $Label2 _ReverseSelection() EndSwitch WEnd Func _ReverseSelection() $current = GUICtrlRead($Label1) If $current = "S" Then GUICtrlSetData($Label1, Chr("163")) Else GUICtrlSetData($Label1, "S") EndIf EndFunc
    1 point
  19. I have written DDNS updaters also, so I knew that some DDNS providers have APIs that allow simple GET requests. Others, allow GET requests but require additional header information like special User-Agent strings. In those cases, InetRead() wouldn't work. Of course some also allow POST & PUT requests, as you stated. I just brought it up in case you may had overlooked that option.
    1 point
  20. tobject, Your code looks correct. This is something I wrote to answer another question some time ago which uses the same function (you need AutoIt Help open so you can click in it): #include <Misc.au3> #include <WinAPI.au3> _Convert_Coordinates() Func _Convert_Coordinates() Local $tPoint = DllStructCreate("int X;int Y") Local $aCoords Local $dll = DllOpen("user32.dll") While 1 If _Ispressed("01", $dll) = 1 Then $aCoords = MouseGetPos() ConsoleWrite("Screen coords: " & $aCoords[0] & " - " & $aCoords[1] & @CRLF) ExitLoop EndIf WEnd DllClose($dll) WinActivate("AutoIt Help") WinWaitActive("AutoIt Help") Local $hWnd = WinGetHandle("AutoIt Help") DllStructSetData($tPoint, "X", $aCoords[0]) DllStructSetData($tPoint, "Y", $aCoords[1]) _WinAPI_ScreenToClient($hWnd, $tPoint) $aCoords[0] = DllStructGetData($tPoint, "X") $aCoords[1] = DllStructGetData($tPoint, "Y") ConsoleWrite("Client coords: " & $aCoords[0] & " - " & $aCoords[1] & @CRLF) EndFuncTwo things spring to mind (bear in mind I am not at all familiar with the app you are using! ): 1. Does the active window of MS Publisher which you are using have coordinates which start 0,0 in the top left corner? 2. Is $oPublisherObj.Activewindow.hwnd actually giving you the handle of the window you want? (You can check this with the Au3 Window Info Tool) Sorry I cannot be of more help - I hope one of these suggestions does the trick. M23
    1 point
  21. Nine

    Drawing a line

    Interesting. I made a master in computer psychology. It is an exact science but it depends on what school you believe on.
    0 points
×
×
  • Create New...