Jump to content

is8591

Active Members
  • Posts

    100
  • Joined

  • Last visited

Everything posted by is8591

  1. Thanks. Will try it over the weekend.
  2. Does anyone knows how to keep multiple versions of AutoIt installed? Also, any easy way of switching between the versions? The reason I am asking is that I have couple of scripts in 3.2.0. The new script will be in 3.2.10. I may need to modify the old scripts in the future but to test compatibility with new version is not practical because I don't have the data needed to test working scripts.
  3. I am not sure if posting in the right forum - so if needed Mod should move it. I searched the forum but couldn't find any easy way to receive emails. So searched the Net and found this dll: http://www.ostrosoft.com/pop3_component.asp Has a lot of information on use but I am not PC programmer. So if any of COM specialist want to take a shot - please. By the way, same site has similar DLL for sending emails
  4. Thank you this takes care of the cursor.
  5. Here is a small part of the code to illustrate it. When you click on items in ListView Msgbox will pop up. ClickOK to close the Msgbox and the cursor becomes Drag-and-Drop. I tested my full code for several days and that's the only problem I have noticed, everything else seems to work OK. I don't know if anything outside my code is going to mess up if I delay the GuiRegisterMsg(). But if cursor the only problem - how can I prevent cursor changing. As far as telling later: When user clicks on ListView he selects operational profile, I have to load profile parameters into separate GUIs. So normally I give user a chance to select a different profile instead of Default. My whole script is Event driven - any suggestions how I can be out of GuiRegisterMsg() and then show the warning. #include <GUIConstants.au3> #Include <GuiListView.au3> Global Const $WM_NOTIFY = 0x004E ;ListView Events Global Const $NM_FIRST = 0 Global Const $NM_LAST = (-99) Global Const $NM_OUTOFMEMORY = ($NM_FIRST - 1) Global Const $NM_CLICK = ($NM_FIRST - 2) Global Const $NM_DBLCLK = ($NM_FIRST - 3) Global Const $LVN_FIRST = -100; Global Const $LVN_ITEMCHANGED = ($LVN_FIRST-1) Opt("GUIOnEventMode", 1) $Accounts1 = GUICreate("GUI", 481, 294, 203, 126) GUISetOnEvent($GUI_EVENT_CLOSE, "Accounts1Close") $lv = GUICtrlCreateListView(" | ", 133, 94, 266, 58,BitOR($LVS_SHOWSELALWAYS, $LVS_SINGLESEL,$LVS_NOCOLUMNHEADER),BitOR($LVS_EX_FULLROWSELECT,$LVS_EX_FLATSB)) GUICtrlSetCursor(-1, 2) GUICtrlCreateListViewItem("abc|def", $lv) GUICtrlCreateListViewItem("ghi|klm", $lv) GUIRegisterMsg($WM_NOTIFY, "WM_Notify_Events") GUISetState(@SW_SHOW) While 1 Sleep(100) WEnd Func Accounts1Close() Exit EndFunc ; WM_NOTIFY event handler for listview Func WM_Notify_Events($hWndGUI, $MsgID, $wParam, $lParam) #forceref $hWndGUI, $MsgID, $wParam Local $nNotifyCode = _HiWord($wParam) Local $nID = _LoWord($wParam) Local $tagNMHDR, $event, $hwndFrom, $code $tagNMHDR = DllStructCreate("int;int;int;uint;uint;uint;int;int", $lParam) ; NMHDR hdr; iItem; iSubItem; uNewState; uOldState; uChanged; ptAction; If @error Then Return $event = DllStructGetData($tagNMHDR, 3) ;ConsoleWrite("Event:"&$nID & "::" & $nNotifyCode & "::" & $event & @CRLF) Select Case $wParam = $lv Select ;Case $event = $NM_CLICK ; ListView_Click () ;Case $event = $NM_DBLCLK ; ListView_DoubleClick () Case $event = $LVN_ITEMCHANGED If DllStructGetData($tagNMHDR, 6) = 3 And DllStructGetData($tagNMHDR, 7) = 0 And DllStructGetData($tagNMHDR, 8) = 8 Then lv_Change() EndSelect EndSelect $tagNMHDR = 0 $event = 0 $lParam = 0 Return $GUI_RUNDEFMSG EndFunc ;==>WM_Notify_Events Func _HiWord($x) Return BitShift($x, 16) EndFunc ;==>_HiWord Func _LoWord($x) Return BitAND($x, 0xFFFF) EndFunc ;==>_LoWord ;fill in listview header Func lv_Change() ; Local $a = _GUICtrlListViewGetItemText($lv_MrSch,-1,2) ; GUICtrlSetData($dt_MrSch, _GUICtrlListViewGetItemText($lv_MrSch,-1,0)) ; If StringInStr($av_StrSet[9], $a) =0 Then MsgBox(48,"test","") ; $a = "default" ; EndIf EndFunc
  6. Running GUI in OnEvent and using Notify to catch ListView ItemChange event. There are times when contents of ListView point to INI sections which were deleted, so need to inform that section was deleted and Default will be used. Any suggestions are welcomed. Thank you.
  7. Thanks again - I just realized this after reading Help and I tried to edit my 1st reply but you beat me to it.
  8. Thanks. Is there any way to catch it in GUIRegisterMsg()? In GUIRegisterMsg() is very fast to get Control ID.
  9. Can rightclick be captured in OnEvent mode using GUIRegisterMsg() without setting GUICtrlSetOnEvent for each control?
  10. Thank you all for helping. It seems dropdown is behaving normally and if it's a bug it's Windows. After seeing the options - labels is the way to go. Thanks again.
  11. I already run GUIRegisterMsg() to catch GetFocus, LostFocus, Selection Change. So I wouldn't mind another switch in the routine. It would be better than adding bunch of Labels. Problem - I have no idea how to figure out proper Messages. I always look up Gary's examples and reuse it. So if it's not a big deal, let me know how to setup GUIRegisterMsg() for this purpose. Thanks
  12. Thanks. Very nice approach. But is it a bug? Or may be there is a way to do it through GuiCtrlSendMsg?
  13. Simple GUI with Input and readonly combo. When Tabbing into combo does not show the dropdown, but when Mouse click on Edit portion dropdown shows. Is this a bug or is it suppose to be like this? I need the dropdown to show up only when clicking on dropdown icon. Thanks #include <GuiConstants.au3> GuiCreate("GUI", 200, 60,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $Input = GuiCtrlCreateInput("", 10, 10, 100, 20) $combo = GUICtrlCreateCombo("item1", 120, 10,60,200,BitOR($CBS_DROPDOWN,$CBS_DROPDOWNLIST,$WS_VSCROLL)) GUICtrlSetData(-1, "item2|item3", "item3") GuiSetState() While 1 if GuiGetMsg() = $GUI_EVENT_CLOSE Then Exit WEnd
  14. Check _DateAdd function. you may have to reformat the value read from control
  15. never mind - issue resolved
  16. Can't get your code to run at all. _ArrayDisplay needs parameters and will not do 2d arrays at all. May be you are using different Array library. Anyway, I can't find the bug but can suggest an easier way. Since you seem to search only in column 0 you may want to keep all entries in a string with a separator like this: $str_master = "|Shapes|Red|Orange|Yellow|Green|Blue|" and use StringInStr For $m = 0 To UBound($avInput) -1 If StringInStr($str_master, "|" & $avInput[$m] & "|") = 0 then $c11 = "no-match" Else $c11 = "match" EndIf Next This is just a suggestion but will simplify the code and probably will run faster since multi-d arrays are kind of slow in Autoit
  17. Very nice UDF. Any plans on adding Write functionality?
  18. I faced similar problem - needed to do price entry with KeyPad Dot adding .00 to price. I ended up using a hotkey. Here is example for Keypad period and Plus. You will need Hotkeys for all non numeric keys. Also, make sure you unregister Hotkeys when not in your GUI. HotKeySet("{NUMPADDOT}", "Dot") HotKeySet("{NUMPADADD}", "Plus") #region --- GuiBuilder code Start --- ; Script generated by AutoBuilder 0.6 Prototype #include <GuiConstants.au3> GuiCreate("Numeric only input", 214, 156,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $Input_1 = GuiCtrlCreateInput("", 20, 50, 90, 20,BitOR($ES_RIGHT,$ES_NUMBER)) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;; EndSelect WEnd Exit #endregion --- GuiBuilder generated code End --- Func Dot() GUICtrlSetData($Input_1,GUICtrlRead($Input_1) & ".") EndFunc Func Plus() GUICtrlSetData($Input_1,"+" & GUICtrlRead($Input_1)) EndFunc
  19. To do multi-field sort you need to create a calculated field and populate it with concatenation of fields you want to sort on in the same order as priority of sort. For example, your record has 4 fields: Field1 Field2 Field3 Field4 And you want to sort on Field3 and subsort on Field1 Create Field5 where data Field3 & Field1 - and now sort array on Field5 If you want to add subsort on Field2, then make Field5 = Field3 & Field1 & Field2 and sort on Field5. The topic that Valuater refered to also describes a pitfall of having Fields containing non-text data. In my case it was dates, or it could be time or just numbers. So preformat or convert data into text strings before populating Field5 in order to get true sorting.
  20. Sorry to post original in bug report. Tested on other computers and it works on most. So it's not a bug. But stiil would like to know why some don't work and how to make it work. Appreciate any input on this.
  21. Thanks. Could you recomend a more elegant solution than setting up 2 controls in same space?
  22. Why do you say "post-creation applying the styles in the other." I applied the style in Combo1 in postcreation. Combo2 was just to illustrate the difference I thought that style can be changed dynamically. As far as this being a "sign of bad code" - you may be right. Here is what I am trying to do - could you please give me good code. I have 2 combos and several edit boxes. There are 2 modes of operation: view and edit. In view mode combo boxes only provide dropdown for user to select INI section and key In edit mode user can modify the info in combo boxes. Edit boxes are always used for key values. In order to give this functionality I have to set style of combo to BitOR($CBS_DROPDOWNLIST,$WS_VSCROLL) not to have info edited. And remove the style when combo editable. Thanks
  23. Please disregard this whole thread - custom app is destroying Hover event. Once closed the app - Tip works. Can not get control tooltip to show up at all. Tooltip, traytip and contextmenu are working. OS - win2k sp4. Tried with Autoit 3.1.1.0 and 3.1.1.119 Code straight from Help file: #include <GUIConstants.au3> GUICreate("My GUI control tip"); will create a dialog box that when displayed is centered GUICtrlCreateLabel ("my label", 10,20) GUICtrlSetTip(-1,"tip of my label") GUISetState () ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop Wend
  24. Simple test GUI has 2 combo boxes. Box 1 gets Style set by GuiCtrlSetStyle, Box 2 style is set in control create command. Since the style value is identical both Combos should perform identically. But for some reason Combo 1 does not hold value after selection and allows type in, while Combo 2 operates perfectly. Anybody can explain. #include <GuiConstants.au3> $str = "Select Item|Item1|Item2|Item3" GuiCreate("Test", 140, 140) $Combo_1 = GuiCtrlCreateCombo("", 10, 25, 120, 80) $Combo_2 = GuiCtrlCreateCombo("", 10, 65, 120, 80, BitOR($CBS_DROPDOWNLIST,$WS_VSCROLL)) GUICtrlSetData($Combo_1, $str,"Select Item") GUICtrlSetData($Combo_2, $str,"Select Item") GUICtrlSetStyle($Combo_1,BitOR($CBS_DROPDOWNLIST,$WS_VSCROLL)) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;; EndSelect WEnd Exit
  25. Gary, is GuiCtrlSetTip supported on any OS - especially 2K? I am not getting the tooltip.
×
×
  • Create New...