From: <eb...@us...> - 2010-12-03 08:10:58
|
Revision: 586 http://gexperts.svn.sourceforge.net/gexperts/?rev=586&view=rev Author: eberry Date: 2010-12-03 08:10:52 +0000 (Fri, 03 Dec 2010) Log Message: ----------- Add support for hiding non-visual controls on TFrame designers Modified Paths: -------------- trunk/Documentation/Readme.txt trunk/Source/Experts/GX_HideNonVisualComps.pas Modified: trunk/Documentation/Readme.txt =================================================================== --- trunk/Documentation/Readme.txt 2010-10-02 13:05:09 UTC (rev 585) +++ trunk/Documentation/Readme.txt 2010-12-03 08:10:52 UTC (rev 586) @@ -109,6 +109,7 @@ Always center the match line in the Grep Result context pane. - Components to Code: Optionally generate code to free all created components (Peter Dzomlija). +- Hide/Show Non-Visual Components: Added support for TFrame designers (Erik). VERSION 1.33 (May 31, 2009) - General: Added support for RAD Studio 2009/2010. Note that some of the tools Modified: trunk/Source/Experts/GX_HideNonVisualComps.pas =================================================================== --- trunk/Source/Experts/GX_HideNonVisualComps.pas 2010-10-02 13:05:09 UTC (rev 585) +++ trunk/Source/Experts/GX_HideNonVisualComps.pas 2010-12-03 08:10:52 UTC (rev 586) @@ -8,7 +8,7 @@ implementation uses - GX_OtaUtils, Forms, SysUtils, Windows, GX_GenericUtils; + GX_OtaUtils, Forms, SysUtils, Windows, GX_GenericUtils, Controls, Classes; type THideNonVisualComps = class(TGX_Expert) @@ -73,11 +73,31 @@ CompHandle: THandle; WindowClass: string; FirstCompFound: Boolean; + WinControl: TWinControl; + ChildControl: TWinControl; + i: Integer; begin Assert(Assigned(Form)); Assert(Form.Handle > 0); FirstCompFound := False; - FormHandle := GetWindow(Form.Handle, GW_CHILD); + WinControl := Form; + if InheritsFromClass(WinControl.ClassType, 'TWinControlForm') then + begin + for i := WinControl.ComponentCount - 1 downto 0 do + begin + if WinControl.Controls[i] is TWinControl then + begin + ChildControl := WinControl.Controls[i] as TWinControl; + if InheritsFromClass(ChildControl.ClassType, 'TCustomFrame') then + begin + WinControl := ChildControl; + Break; + end; + end; + end; + end; + + FormHandle := GetWindow(WinControl.Handle, GW_CHILD); CompHandle := GetWindow(FormHandle, GW_HWNDLAST); VisibleState := False; GxOtaClearSelectionOnCurrentForm; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |