From: Laurent R. <ro...@cl...> - 2004-03-14 20:13:12
|
Hi All, It's probably time to made a new Win32::GUI release based on = Win32-GUI-0_0_665-fix branch. I can create a Win32-GUI-0.0.671 from this branch. Does someone have something to put in this branch before release ? After, it's probably time to stop working on this branch and start = working on next Win32-GUI with new event model implementation. I have made huge work on Win32::GUI this week-end for refactoring = Win32::GUI code. I have create a .xs file for each control and try to implement all = of SendMessage/Macro control API (not finish). For each CLASS control, i have a XS file with : * First part, define some control callback function : - xxx_onPreCreate : this function set defaut style for = control=20 - xxx_onParseOption: this function parse specific control = option - xxx_onPostCreate : this function handle specific control = option property (color,...) This function is call after Window creation and in = Change method too. We probably need a different name. I think we can extend this concept of callback method for = all control and add more function. After, we can replace all Switch(class) by a pFct[class] = call where pFct it's an array of pointer function. It's possibly something to use for new event model, create a = special callback fonction for handle all event of control. Like this, = all code for a control it's in one file.=20 * Second Part, i implement all Control API I use same ordre than MSDN documentation (alphabetic order) = and use same name than standard Window API (message name or macro name). I use same name because, i think it's probably easier for = find documentation in MSDN . http://msdn.microsoft.com/library/default.asp?url=3D/library/en-us/shellc= c/platform/commctls/wincontrols.asp=20 I create ALIAS for keep old Win32::GUI name. For sample, with Textfield, i define GetSel (same name as = message name) and define an ALIAS for Selection() method. = #########################################################################= ## # (@)METHOD:GetSel() # =20 # (@)METHOD:Selection() # See GetSel. =20 void GetSel(handle) HWND handle ALIAS: Win32::GUI::Textfield::Selection =3D 1 PREINIT: DWORD start; DWORD end; PPCODE: SendMessage(handle, EM_GETSEL, (WPARAM) &start, (LPARAM) &end); EXTEND(SP, 2); XST_mIV(0, (long) start); XST_mIV(1, (long) end); XSRETURN(2); * Last Part, containt more high level method for the control. I have keep in GUI.PM only pure perl method. You can see a copy of my developpement directory here : http://perso.club-internet.fr/rocherl/Win32-GUI-Dev/Win32-GUI.zip I you found this work interesting, we can use it as base code for = starting to work on next Win32::GUI implentation. We can use MAIN cvs branch (of Win32-GUI CVS module) for this. Cheers, Laurent. |