
thewizard21
Members-
Posts
8 -
Joined
-
Last visited
Everything posted by thewizard21
-
GUIFrame UDF - Melba23 version - 19 May 14
thewizard21 replied to Melba23's topic in AutoIt Example Scripts
Thanks M23, for all the good work. one, hopefully final, question: do you have any incites as to why $WS_EX_ACCEPTFILES doesn't seem to work? Edit: after some testing, I think it's an off topic question - so forget about it... Edit2: just thought it would be better to put on note the glitch I had with dropped files: initially $GUI_EVENT_DROPPED didn't seem to work - of course the problem was you have to set the event on the handle of the frame in which the ctrl element resides, for ex.: GUISetOnEvent($GUI_EVENT_DROPPED, "GUIsystemEvent", _GUIFrame_GetHandle($FRAME, 1)) -
GUIFrame UDF - Melba23 version - 19 May 14
thewizard21 replied to Melba23's topic in AutoIt Example Scripts
Great, Great, Great! Now I think I've stumbled upon one more issue: $WS_TABSTOP doesn't seem to work. EDIT: there's one thing the makes a difference (still doesn't work though): when creating the frame, if I put $WS_EX_CONTROLPARENT in the extended style, then tab works but in a different / wrong way - for example in an input box it selects the string entered (like coming again to the same input box instead of going to the next one). So, maybe it's just some kind of an extended style I'm missing. -
GUIFrame UDF - Melba23 version - 19 May 14
thewizard21 replied to Melba23's topic in AutoIt Example Scripts
Hi Hi, Yep, very very good! Much better now, at least as long as we don't have params to choose which frame resize. -
GUIFrame UDF - Melba23 version - 19 May 14
thewizard21 replied to Melba23's topic in AutoIt Example Scripts
Hi M23, Sorry it took so long, it was a holiday here, family and all and I didn't touch the computer. The new parameter is fantastic, exactly what the doctor prescribed. As for your question: Yep, I still want the separator to move, moreover for my specific usage it's even desirable that the upper ('1') frame would be the sole growing one, since, I reckon, when someone wants to see more app real-estate usually they're after a larger summery of workers. But generically I think that if we won't have such parameters (which frame grow by how much, etc.) then it should grow symmetrically like all other GUI control's defaults. And if I hadn't said it enough already - Thanks again for this wonderful UDF. -
GUIFrame UDF - Melba23 version - 19 May 14
thewizard21 replied to Melba23's topic in AutoIt Example Scripts
Go to sleep Well I guess I can handle them both (separator location and a new (well..., the same actually) SetMin numbers when the size changes). Doing a new, and same, setmin on wm_sizing is kinda like scratching your ear with your feet, great if you're on all fours. On the other hand, it's already kept as percentage... Thanks for the great, prompt. replies! -
GUIFrame UDF - Melba23 version - 19 May 14
thewizard21 replied to Melba23's topic in AutoIt Example Scripts
works great! There is still one issue that remains, when changing the size of the window only the lower frame expands automatically while the upper one stays the same, i.e. the separator bar stays. one needs to move it again manually. Also, while you're at it, I would prefer a SetMin that does not do it in percentage, I mean - I want the log to be a minimum of (say, for example) 5 lines, and I don't want it to be changed to a minimum of 20 lines when maximized, I still want 5 lines and the new real estate used for the rest of the gui. -
GUIFrame UDF - Melba23 version - 19 May 14
thewizard21 replied to Melba23's topic in AutoIt Example Scripts
Right you are, sorry it's very messy (just a C&P snip, work in progress and all that) #include <GUIConstantsEx.au3> #include <WinAPI.au3> #include <ProgressConstants.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <GUIEdit.au3> #include "GUIFrame.au3" Global $GUI_FINISHEDIN, $GUI_DATASTREAM, $GUI_PROGRESS, $GUI_LOG Global $GUI, $GUILOGFRAME, $GUIMINWINDOWHEIGHT, $GUIMINWINDOWWIDTH, $GUI_BTN_START, $GUI_BTN_CTRLA, $GUI_PRG_TOTAL, $GUI_INPUT_PROCS = 3 Global Const $GUIMINWIDTH = 400 Global Const $GUIMINHEIGHT = 300 ; ------------------------------------------------------------- ; --- GUI --- ; ------------------------------------------------------------- Func createGUI() AutoItSetOption("GUIOnEventMode", TRUE) AutoItSetOption("GUIResizeMode", BitOR($GUI_DOCKLEFT, $GUI_DOCKRIGHT, $GUI_DOCKMENUBAR)) $GUI = GUICreate("", $GUIMINWIDTH, $GUIMINHEIGHT, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX, $WS_MAXIMIZEBOX, $WS_MINIMIZEBOX, $WS_CLIPCHILDREN)) ; set minimum width / height $GUIMINWINDOWWIDTH = _WinAPI_GetWindowWidth($GUI) $GUIMINWINDOWHEIGHT = _WinAPI_GetWindowHeight($GUI) GUIRegisterMsg($WM_GETMINMAXINFO, "WM_GETMINMAXINFO") ; ctrl-a dummy button $GUI_BTN_CTRLA = GUICtrlCreateDummy() GUICtrlSetOnEvent (-1, "GUIctrlEvent") Local $AccelKeys[1][2]=[["^a", $GUI_BTN_CTRLA]] GUISetAccelerators($AccelKeys) ; register system events GUISetOnEvent($GUI_EVENT_CLOSE, "GUIsystemEvent") GUISetOnEvent($GUI_EVENT_MINIMIZE, "GUIsystemEvent") GUISetOnEvent($GUI_EVENT_RESTORE, "GUIsystemEvent") GUISetOnEvent($GUI_EVENT_RESIZED, "GUIsystemEvent") ; start gui GUICtrlCreateLabel('Total progress', 10, 10, 67, 16) $GUI_PRG_TOTAL = GUICtrlCreateProgress( 10, 28, 380, 20, $PBS_SMOOTH) GUICtrlCreateLabel('<Destination Folder>', 10, 54, 100, 16, BitOr($GUI_SS_DEFAULT_LABEL, 0x0));, $SS_WHITERECT)) GUICtrlCreateListView("Worker|Progres|Speed", 10, 74, 380, 40);, BitOR($LVS_REPORT, $WS_BORDER)) GUISetState() $GUILOGFRAME = _GUIFrame_Create($GUI, 1, 200 ) _GUIFrame_SetMin($GUILOGFRAME, 70, 30) _GUIFrame_Switch($GUILOGFRAME, 2) $GUI_LOG = GUICtrlCreateEdit( "Welcome to "&@ScriptName&@LF, 2, 2, 396, 94, BitAND(BitOr($GUI_SS_DEFAULT_EDIT, $ES_READONLY),BitNOT($WS_HSCROLL))) GUICtrlSetResizing (-1, BitOR($GUI_DOCKLEFT, $GUI_DOCKRIGHT, $GUI_DOCKTOP, $GUI_DOCKBOTTOM)) ; Register the $WM_SIZE handler to permit resizing _GUIFrame_ResizeSet() _GUIFrame_ResizeReg() EndFunc Func GUIEditSelectAll() $hWnd = _WinAPI_GetFocus() $class = _WinAPI_GetClassName($hWnd) If $class = 'Edit' Then _GUICtrlEdit_SetSel($hWnd, 0, -1) EndFunc Func WM_GETMINMAXINFO($hwnd, $Msg, $wParam, $lParam) ; registered messages functions (like this one: WM_GETMINMAXINFO) are always called with four params: ; When the user function is called then these 4 parameters have the following values: ; 1 hWnd The Window handle of the GUI in which the message appears. ; 2 Msg The Windows message ID. ; 3 wParam The first message parameter as hex value. ; 4 lParam The second message parameter as hex value. ; ; from microsoft's msdn about WM_GETMINMAXINFO message we get that Parameters: ; wParam ; This parameter is not used. ; lParam ; A pointer to a MINMAXINFO structure that contains the default maximized position and dimensions, and the default minimum and maximum tracking sizes. ; An application can override the defaults by setting the members of this structure. ; ; from microsoft's msdn about MINMAXINFO stracture we learn: ; typedef struct tagMINMAXINFO { ; POINT ptReserved; ; POINT ptMaxSize; ; POINT ptMaxPosition; ; POINT ptMinTrackSize; ; POINT ptMaxTrackSize; ;} MINMAXINFO, *PMINMAXINFO, *LPMINMAXINFO; ; ; from microsoft's msdn about POINT structure: ; typedef struct tagPOINT { ; LONG x; ; LONG y; ;} POINT, *PPOINT; ; ; So... ; the last parameter of our "WM_GETMINMAXINFO", "$lParam", is a pointer to a MINMAXINFO stracture of a five points passed, of which we need to change the "POINT ptMinTrackSize;" (the ; one before the last one, 5 points with two int values each - the forth one is 7, 8 ints). ; ; lastly: ; this function has to exit as fast as possible! so no logging and definatly no blocking (msgbox, etc.) Local $StrucMax = DllStructCreate("int;int;int;int;int;int;int;int;int;int", $lParam) ; use $lParam pointer instead of allocating new memory for the struct. DllStructSetData($StrucMax, 7, $GUIMINWINDOWWIDTH) DllStructSetData($StrucMax, 8, $GUIMINWINDOWHEIGHT) Return 0 EndFunc Func GUIsystemEvent() Switch @GUI_CtrlId Case $GUI_EVENT_CLOSE LogLine ("exit") Sleep (100) Exit Case $GUI_EVENT_MINIMIZE ; TODO tooltips when minimizedd Case $GUI_EVENT_RESTORE ; TODO disable tooltips now that we're restored Case $GUI_EVENT_RESIZED LogLine ("resized") EndSwitch EndFunc Func GUIctrlEvent() Switch @GUI_CtrlId Case $GUI_BTN_CTRLA GUIEditSelectAll() EndSwitch EndFunc ; recursive, logs arrays too Func LogLine ( $line, $hdl=$GUI_LOG, $str="" ) ;If $DEBUG Then If IsArray ($line) Then Local $i, $j For $j = 1 To UBound($line,0) ; handle multidimentional arrays If $str <> "" Then $str = "("&$str&")" For $i = 0 To UBound($line, $j)-1 ; handle embedded arrays LogLine ($line[$i], $hdl, $str&"["&$i&"]") Next Next Else If $str <> "" Then $str = " { "&$str&" }" ;GUICtrlSetData($hdl, @MDAY&"."&@MON&"."&@YEAR&" "&@HOUR&":"&@MIN&":"&@SEC&"."&@MSEC&" - "& $line & @CRLF, 1) ; append _GUICtrlEdit_AppendText($hdl, @MDAY&"."&@MON&"."&@YEAR&" "&@HOUR&":"&@MIN&":"&@SEC&"."&@MSEC&" - "& $line & @CRLF) EndIf ;EndIf EndFunc createGUI() While True Sleep (1000) WEnd Using Autoit 3.3.8.1 on windows 7 64bit (autoit 32) BTW, I like my logline function and it's useful for files as well (change handle) and with debug level. -
GUIFrame UDF - Melba23 version - 19 May 14
thewizard21 replied to Melba23's topic in AutoIt Example Scripts
Unfortunatly there are still more then a few problems with it... BUGs I've found: On a horizontally split window, the resizing only changes the buttom (2) frame while keepping the first upper frame as is, it's just an inconvenience (one has to change the size by dragging the seperator again), BTW from browsing through it a bit it looks as though it should work and change the separator bar's position as well as top frame's size, I wonder.More alarmingly, it breaks listviews, they simply are not shown until the mouse is hovered above them.I would provide snipplets, it's just that I need to arrange it a bit and can't just C&P from my unreadble examples.