Armag3ddon
Active Members-
Posts
45 -
Joined
-
Last visited
Armag3ddon's Achievements
Seeker (1/7)
0
Reputation
-
Well, these UDFs are design pillars in my project, I'd rather leave out Irrlicht. But everything works now with the mentioned solution (do not use _IrrStop() unless the window is deleted, do not use _IrrRunning() without rendering a scene). Until of course I run into something else As for the GUIFrame crash, I rather blame Irrlicht than the frame script. It is true that maybe it shouldn't crash (or go infinite loop) when being roughly shut down but then _IrrStop() shouldn't kill AutoIt without triggering any kind of closing procedure. There could be all kind of unfinished stuff lying around. It's even dumb that you can't close Irrlicht without closing AutoIt.
-
Nice Well, I now have what you could call a working example. To test it, you will need the following scripts in the same dir: HotKey UDF: '?do=embed' frameborder='0' data-embedContent>> GUIFrame UDF: /'?do=embed' frameborder='0' data-embedContent>>/ (and of course au3Irrlicht2 in ./Bin/ as in your example) Code: #include <./Bin/au3Irrlicht2.au3> #include <HotKey.au3> #include <GUIFrame.au3> #include <WinAPI.au3> #include <Misc.au3> #include <GuiRichEdit.au3> #include <GUIConstantsEx.au3> Global Const $VK_ESCAPE = 0x1B $Gui = GUICreate("AutoIt Window", 1280, 785, -1, -1, BitOR($WS_CAPTION, $WS_SYSMENU, $WS_MINIMIZEBOX, $WS_MAXIMIZEBOX, $WS_THICKFRAME, $WS_CLIPCHILDREN)) Opt("GUICloseOnESC", 0) $Button = GUICtrlCreateButton("Close Window", 850, 200, 100, 100) ;create richedit control _GUICtrlRichEdit_Create($Gui, "Type here", 5,610, 800,100) ;create frame _GUIFrame_Create($Gui, 0, 200, 5, 850,350,100,100) ; register hotkey _HotKey_Assign($VK_ESCAPE, "_exit") ;Embed Irrlicht RenderWindow--------------------------------------------------------------------------------------- _IrrStart($IRR_EDT_opengl, 800, 600, $IRR_BITS_PER_PIXEL_32, $IRR_windowed, $IRR_SHADOWS, $IRR_IGNORE_EVENTS, $IRR_VERTICAL_SYNC_Off) _IrrSetWindowCaption( "IrrLicht Window") _WinAPI_SetWindowRgn(WinGetHandle("IrrLicht Window", ""), _WinAPI_CreateRectRgn(3, 22, 1024, 768)) ; Cut off IrrLicht Window Border WinMove("IrrLicht Window", "", -3, -22) ; It wants to be moved before set as child for some reason, not vice versa. _WinAPI_Setparent(WinGetHandle("IrrLicht Window", ""), $Gui); Set as child for autoit window WinActivate("AutoIt Window") GUISetState() ;-------------------------------------------------------------------------------------------------------------------- ;add your IrrLicht stuff here..... WHILE 1 If _IrrRunning() Then ;_IrrBeginScene(128,128,128) ;.......and here ;_IrrDrawScene() ;_IrrEndScene() EndIf If GUIGetMsg() = $Button Then ExitLoop EndIf Sleep(10) WEND Exit Func _exit() _IrrStop() EndFunc ; _exit First problem: Crash on _IrrStop() After testing around, I found out that _IrrStop() does exit the autoit script which is most unfortunate. This makes it completely useless to me. Now, this killing of the script causes _GUIFrame to go into an endless loop or similar. In my test case, you get a frame control in the gui and you can test this simply by hitting escape. Notice how everything works fine when using the Close Window button. I will avoid this from now on by not stopping Irrlicht. This will kill my script anyway, so I can't stop Irrlicht and continue with anything. Somewhat crappy behaviour but probably not much I can do about that. Second problem: Eating keystrokes. Another bad interference. Just type stuff into the rich edit control and you will hopefully see that not all keys make it into the control. E.g. I typed "This is a test" and got "Thisis a tst." outputted. This will get better when you comment _HotKey_Assign($VK_ESCAPE, "_exit") and do not define the HotKey (thus not get a hook into the key chain). I'm not sure if it's solved entirely afterwards. What I found out is that this does only occur if I call _IrrRunning() and then nothing else (notice how I commented the scene drawing lines). If you uncomment the scene drawing lines, everything works fine. My mistake for thinking that _IrrRunning() was a simple query function and nothing else. Apparently, there's some kind of evil functionality hidden in there. The solution for me is clear: Either do not call _IrrRunning or if do so, make sure to also go through a scene routine. Effectively, both my problems are solved. But here you got something to see what my problems were Good thing though, I got the solutions when trying to compose you a working example!
-
I have set Irrlicht to IGNORE_EVENTS already but it seems like it does register a hook anyway. These two (the one from HotKeys and Irrlicht) seems to interfere with each other. My solution would be to compile Irrlicht myself, without any keyboard input detection. As for the reproducer example, I will gladly compose one.
-
Does anyone here know a nice way to debug the IrrlichtWrapper and/or engine? I used Werty's embedding solution from above () in a rather big project, big GUI etc. I end up with all kinds of weird Irrlicht behaviour I get a crash whenever I call _IrrStop() without deleting my main GUI first. Even if I don't set it as parent for the Irrlicht window. Also, keypresses are not properly processed. I have a richedit control (to write stuff in!) and typing in there, I get 2 out of 3 key presses at best. Text is all scrambled because of that. I narrowed it down to that it only happens when I also use Yashied's HotKey UDF ('?do=embed' frameborder='0' data-embedContent>>) without assigned hotkeys. It seems that Irrlicht and the HotKeys get in each others way.
-
GUIFrame UDF - Melba23 version - 19 May 14
Armag3ddon replied to Melba23's topic in AutoIt Example Scripts
Ah, you have been busy, I see. Another well done script from you that I use in my project! Already used Scrollbars, ExtMsgBox and just saw StringSize. You really seem to make exactly what I'm desperately in need of -
Armag3ddon reacted to a post in a topic:
GUIFrame UDF - Melba23 version - 19 May 14
-
Thanks for the tip with the styles. Never saw that I typed SYSMENU twice Well, didn't do any harm anyway, it's all BitOR'ed. Looking at the help file isn't of much use, it's not written in there which style breaks this UDF... After some trial'n'error I found out that $WS_VISIBLE is breaking this. I need to set the state @SW_NORMAL now but then it works.
-
Armag3ddon reacted to a post in a topic:
HotKey UDF
-
Tested the above mentioned example on Win8.1 x64 - same result. The hotkey doesn't work until I refocus the window. Any suggestions?
-
Hi there! I'm having a problem here that the assigned hotkeys are not recognised until I unfocus and refocus the GUI window that should process them. I'm running Win 7 x64. Minimal example: #include <GUIConstantsEx.au3> #include <HotKey.au3> #include <vkConstants.au3> Global $hWnd $hWnd = GUICreate("HotKeys", 800, 600, -1, -1, BitOR($WS_CAPTION, $WS_MINIMIZEBOX, $WS_MAXIMIZEBOX, $WS_SYSMENU, $DS_CONTEXTHELP, $WS_SYSMENU, $WS_VISIBLE, $WS_CLIPCHILDREN, $WS_THICKFRAME)) GUISetState(@SW_ENABLE, $hWnd) _HotKey_Assign($VK_RETURN, "PressedEnter", $HK_FLAG_NOBLOCKHOTKEY, $hWnd) While GUIGetMsg() <> $GUI_EVENT_CLOSE Sleep(10) WEnd GUIDelete($hWnd) Exit Func PressedEnter() ConsoleWrite("Pressed enter") EndFunc I don't get the "Pressed enter" message (i.e. hotkey is not recognised) until I click on another window and then back to this one. Am I using your UDF wrong?
-
GUIFrame UDF - Melba23 version - 19 May 14
Armag3ddon replied to Melba23's topic in AutoIt Example Scripts
Many thanks! That is exactly what is was hoping for (works for me, my gui is only split once). -
Armag3ddon reacted to a post in a topic:
GUIFrame UDF - Melba23 version - 19 May 14
-
GUIFrame UDF - Melba23 version - 19 May 14
Armag3ddon replied to Melba23's topic in AutoIt Example Scripts
I'm drawing a more or less resource-heavy picture into one of the frames (using some GDIPlus stuff). Redrawing this on every call of WM_SIZE is a bit laggy. But redrawing once after resizing has finished, is fine (I do this now on WM_EXITSIZEMOVE). The user doesn't need to see the image while resizing. -
GUIFrame UDF - Melba23 version - 19 May 14
Armag3ddon replied to Melba23's topic in AutoIt Example Scripts
Hi there! Can you think of a convenient way to get a callback when frame resizing is finished? Unfortunateley, WM_EXITSIZEMOVE isn't called. But something similar would be nice -
Armag3ddon reacted to a post in a topic:
Resources UDF + Checkbox + BS_PUSHLIKE
-
Great UDF Do you consider further research into this request of embedding the window into another window? I am also looking for such a solution
-
Resources UDF + Checkbox + BS_PUSHLIKE
Armag3ddon replied to Armag3ddon's topic in AutoIt GUI Help and Support
That probably is the problem. The file is neither .ico nor .bmp but a PNG. #AutoIt3Wrapper_Res_File_Add=.resquickedit.png, rt_rcdata, QE_ICON Using it like this works fine for every button. But from your answer I assume that this is hacky and I should convert them into icons/bitmaps? -
Hi! I'd like to assign an icon to a checkbox with BS_PUSHLIKE and BS_ICON style. I use the same code I use for all my other buttons in that GUI, very simple: Local $quickedit = GUICtrlCreateCheckbox("", 595,536, 24,24, BitOR($BS_PUSHLIKE, $BS_ICON)) _ResourceSetImageToCtrl($quickedit, "QE_ICON") As I said, all other buttons work fine like this: Local $refresh = GUICtrlCreateButton("", 595,285, 24,24, $BS_ICON) _ResourceSetImageToCtrl($refresh, "REFRESH_ICON") Just the checkbox does not show an icon (it's an empty button instead). QE_ICON itself works fine when I assign it to something else. I've seen somewhere in this forum that it is possible to assign an icon to a pushlike checkbox. Just doesn't work in combination with the UDF for me. So, is it possible to combine these two things?
-
Ghost inputs; where start debugging?
Armag3ddon replied to Armag3ddon's topic in AutoIt GUI Help and Support
Oh my! Awesome, thanks! You are surely my hero of the day!