Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 2 of 2 total |
Testing a control for a property |
Wed, Oct 25 2017 8:26 AM | Permanent Link |
Matthew Jones | Is there a way to test if a component or control has a particular property? Such that I can traverse the components and find all those with a particular property?
And asking this made me remember I'd done something, and Tim had said use caution, but to answer my own question, which I will post for myself and others when needed: (excuse the mix of naming conventions - copy and paste does that for me sometimes!) procedure DumpTabs(szInfo : String; xComponent : TControl); var i: integer; c: TControl; bTabStop : Boolean; nTabIndex : Integer; nLayoutOrder : Integer; TempType: Integer; begin if szInfo = '' then DebugReport('Component LayoutOrder/TabIndex'); TempType := xComponent.PropertyType('TabStop'); if (TempType = TYPE_INFO_BOOLEAN) then begin bTabStop := xComponent.GetProperty('TabStop'); nTabIndex := xComponent.GetProperty('TabOrder'); nLayoutOrder := xComponent.GetProperty('LayoutOrder'); if (bTabStop) then begin DebugReport(szInfo + xComponent.Name + ' ' + IntToStr(nLayoutOrder) + '/' + IntToStr(nTabIndex) {+ ' ' + IntToStr(Ord(bTabStop))}); end; end; for i := 0 to xComponent.ControlCount - 1 do begin c := xComponent.Controls[i]; DumpTabs(szInfo + xComponent.Name + '-', c); end; end; -- Matthew Jones |
Wed, Oct 25 2017 12:07 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Matthew,
<< And asking this made me remember I'd done something, and Tim had said use caution, but to answer my own question, which I will post for myself and others when needed: >> Caveats: this only covers published properties, is used internally by the persistence layer, provides zero type checking because of the use of variants and can cause runtime errors, and is subject to change at any time. Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Friday, April 19, 2024 at 07:09 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |