Guest Posted April 4, 2016 Share Posted April 4, 2016 (edited) Hello, I starded to implement Autoit native GUI fanctions in C++ The following functions are implemented:GUICreate, GUISetState, GUICtrlCreateButton, GUISetBkColor, GUICtrlCreateLabel You are welcome to improve the codes, report about problems and give suggestionshttps://github.com/GilEli1/CU3-Library/blob/master/gui.h known problems: Quote GUICtrlCreateLabel - does not create the label with the background color of the GUI. If the background color of the GUI is not normal then the label background color is not the same. GUICreate: 1) The outcome is not exactly the same. try to create the GUI with iWidth = 0 and iHeight = 0. in c++ you will not see the GUI because the size is 0. but in Autoit you will see part of title bar. So the outcome size is not the same. Because it is not a critical bug I did not focus on it but if you want you can. I am not going to fix this. Edited February 5, 2017 by Guest Link to comment Share on other sites More sharing options...
Guest Posted April 15, 2016 Share Posted April 15, 2016 (edited) Added:GUICtrlCreateListView_C (optimized for c) GUICtrlCreateListViewItem_C (optimized for c) GUICtrlCreateListView (Reimplemented, wrapper for the *_C )GUICtrlCreateListViewItem (Reimplemented, wrapper for the *_C ) Added: CU3_CTRL data type. GUICtrl... functions returns CU3_CTRLCU3_CTRL contains the following members: .hwnd The ctrl child window .intID1 main ID for the ctrl .intID2 second ID for the ctrl (mostly not needed) Changed/Added:GUISetDefaultWindowClass -> GUISetDefaultWindowClass_C(WNDPROC parm_WndProc, char parm_charRootName[] = "CU3L_GUI", HINSTANCE parm_hInstance = NULL)GUISelectWindowClass_C(WNDCLASSEX* ptr_wndclassexNew,bool bRegisterClass = false)GUIWait -> GUIWait_C Macros:CU3_GUIGetMsg_CCU3_GUIProcessMsg_C Example of GUICtrlCreateListView and GUICtrlCreateListViewItem: In c++ In Autoit (code almost copied entirely) Enjoy! Edited April 15, 2016 by Guest Link to comment Share on other sites More sharing options...
Guest Posted April 16, 2016 Share Posted April 16, 2016 (edited) Added:GUIScrollbars_ProcessMessages_initialize_CGUIScrollbars_SetRange_C(HWND hwndGUI,DWORD dwordFlagsSet,int intVSMax = NULL,int intHSMax = NULL, int intVSMin = 0, int intHSMin = 0)GUIScrollbars_ProcessMessages_C(HWND hwnd, UINT msg, WPARAM wParam)It was more complicated to implement than I thought Example: https://github.com/GilEli1/CU3-Library/blob/master/Examples/main/Example%203.h Edited April 16, 2016 by Guest Link to comment Share on other sites More sharing options...
GtaSpider Posted April 20, 2016 Share Posted April 20, 2016 Wow this is amazing! I will give this definitely a try on my next project. Thank you very much , gil! Greetings, Spider www.AutoIt.de - Moderator of the German AutoIt Forum Link to comment Share on other sites More sharing options...
Guest Posted April 20, 2016 Share Posted April 20, 2016 (edited) Thank you for the comment. It is still work in progress. Things are going to change. Changes that are going to cause to big "script breaking changes". This is because this project has just been born. over time, such changes will be less frequent. Note that I am focus only on GUI functions (that works on pure Win32 (direct use of WinAPI) not MFC). for the other stuff look at this project: Also, coming soon: VectorEx - Extension to the <vector> - vector 2D array, debug functions (Array Display for vector 1D and 2D) . Edited April 20, 2016 by Guest Link to comment Share on other sites More sharing options...
numdig Posted April 20, 2016 Share Posted April 20, 2016 Hi, looks interesting, but I don't understand what's the use for it ? Aren't those APIs (eg. GUICreate) already native to AutoIt3, and therefore written in C ? Link to comment Share on other sites More sharing options...
Guest Posted April 20, 2016 Share Posted April 20, 2016 (edited) If by design needs, the program need to be written in c++, then for me It seems more correct that the program will be 100% written in c++. You can write the GUI in autoit and all the other stuff in c. but I don't like this design. you will end with 2+ exes. also, in c++ you are less limited.. you can for example run some gui code with it's loop in another thread. you can't do this in autoit (But I don't sure that I recommend it although it is possible). Assuming that that most of the program is written in c++, it is more native that the gui functions are included directly(not AutoItX ). I didn't found any gui functions in AutoItX also, if you're used to code in autoit, you may want to do it in the most possible "autoit" way ( make it easier ) Edited April 20, 2016 by Guest Link to comment Share on other sites More sharing options...
Guest Posted April 21, 2016 Share Posted April 21, 2016 (edited) Added:GUICreate_C(char sTitle[] = NULL,int iWidth = CU3_DEFAULT_GUI_WIDTH,int iHeight = CU3_DEFAULT_GUI_HEIGHT,int iLeft = -1, int iTop = -1,WNDPROC GuiProc = NULL,DWORD dwGUICreateFlags = NULL,WNDCLASSEX* ptr_wcGU,WinClass = NULL,DWORD dwStyle = CU3_DEFAULT_GUI_STYLE,DWORD dwExStyle = NULL,HWND hwndParent = NULL) (optimized for c) Changed/Added:GUICreate is now bassed on GUICreate_C (wrapper for the *_C). (Autoit function syntex) Added features:GUICreate_C:GuiProc) Allows you to create the GUI with another WndProc function. you can create GUI with it's own " WndProc" function easily. example: https://github.com/GilEli1/CU3-Library/blob/master/Examples/main/Example%205.hptr_wcGUIWinClass) You can also pass your own window class to the function. allows you to create GUIs with some preset settings directly.dwGUICreateFlags) Control how the GUI will be created... read more in gui.h. Fixed:GUICreate & GUISetBkColor GUISetBkColor will now set the color only to the selected GUI and not other GUIs under one of the following conditions: 1) You created the GUI with GUICreate OR 2) You created the GUI with GUICreate_C with flag CU3_GUI_OWN_WINDOW_CLASS Added & Changed:GUICtrlCreateListView_C & GUICtrlCreateButton_C: iUniqueID) Set constant ID for the ctrl example: https://github.com/GilEli1/CU3-Library/blob/master/Examples/main/Example%206.h Added features: GUICtrlMove_C(CU3_CTRL* cu3Ctrl,int iXpos,int iYpos)GUICtrlResize_C(CU3_CTRL* cu3Ctrl, int iXsize, int iYsize) GUICtrlSetPos(CU3_CTRL* cu3Ctrl, int iLeft, int iTop, int iWidth = -1, int iHeight = -1) GUICtrlCreateListViewItem_C(.... dwFlags = NULL) Flag CU3_GUI_LISTVIEW_AUTO_COL_SIZE - If this flag included then it will resize the column width to match the text size in the column. Edited April 23, 2016 by Guest Link to comment Share on other sites More sharing options...
funkey Posted June 23, 2016 Share Posted June 23, 2016 Thanks gil900 for sharing your functions with us. I did the same thing a few years ago, but I never really finished. But now you inspired me to move on with that project. Programming today is a race between software engineers striving tobuild bigger and better idiot-proof programs, and the Universetrying to produce bigger and better idiots.So far, the Universe is winning. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now