limelect 48 Posted September 15, 2020 Further to my small project and on D10.2.3 I am NOT using tool Pallet I am using ToolBar>Component as on d7. I want to detect the tabs and open one of them I am using also Winspector. FDelphiForm :=Application.MainForm; x:=TComponent(FDelphiForm.FindComponent('ComponentToolbarFrame')); x:=TComponent(x.FindComponent('TabControl'));<<< hear i tried also TTabControl instead of TComponent x IS NOT NIL. TTabControl(x).TabIndex:=3; <<<<< dose not work label1.caption:= TTabControl(x).Tabs[0] ; <<< Access violation Label2.Caption:=TComponent(x).name; ===TabControl Any thing with tabs give an error. I have tried many variations. As far as I recall @dummzeuch comented that multiline is not possible above D7 I tried it does not work. Maybe it is not possible to access the ToolBar ? Share this post Link to post
dummzeuch 1505 Posted September 15, 2020 15 minutes ago, limelect said: I am using also Winspector. Did you try one of the Delphi IDE Explorers? E.g. mine. It might get you better information than Winspector. 15 minutes ago, limelect said: As far as I recall @dummzeuch comented that multiline is not possible above D7 Multline tabs for the editor window are not possible with Delphi > 7. I don't know about the "new" old style component palette, I never used it. Share this post Link to post
limelect 48 Posted September 15, 2020 @dummzeuch I will try. However, what I did on each FindComponent I made sure it is not nil and save all components to file with ComponentCount Components.Name this how I found all the names. Share this post Link to post
limelect 48 Posted September 15, 2020 I cannot find IDE Explorer. I use 1.3.11.64 experimental quit old I gess. Share this post Link to post
dummzeuch 1505 Posted September 15, 2020 The link I posted goes directly to the page that gives you the description and in turn links to the source code. There is no ready built bpl for it. (And it's not part of GExperts.) Share this post Link to post
limelect 48 Posted September 16, 2020 @dummzeuch Thanks I used it. However, I sent you a personal mail with comments and changes to your software for you to add and publish. As for my problem, it seems I cannot reach the component tabs. Although TTabControl(x).Tabs in not nil it cannot be accessed. Share this post Link to post
limelect 48 Posted September 16, 2020 P.S TTabControl(x).Visible:=false; make all the tabs disapear. So I have control of the tabs but not on TTabControl(x).Tabs Share this post Link to post
dummzeuch 1505 Posted September 16, 2020 3 hours ago, limelect said: P.S TTabControl(x).Visible:=false; make all the tabs disapear. So I have control of the tabs but not on TTabControl(x).Tabs Since the Visible property is introduced very early in the controls hierarchy, it's more likely to work than the Tabs property. Most likely your "x" is not a TTabControl but something else. Have you checked its ClassName? Share this post Link to post
limelect 48 Posted September 16, 2020 @dummzeuch Yes ClassName and more. Every thing checked. It is a TTabControl and I even did a hide that hides all the tabs. with IDE Explorer (Not yours) I can see all propeties. ComponentToolbarFrame>TabControl=TTabControl My only problem now is that TABS is not nil but using it give an error. Share this post Link to post
dummzeuch 1505 Posted September 16, 2020 TabControl is a TGradientTabSet, not a TTabControl and it does not descend from TTabControl either (Look at the Hierarchy tab in the IDE explorer), so typecasting it to TTabControl won't work. It doesn't have a Tabs property either, so even RTTI won't help you there. I found a TGradientTabSet on https://github.com/RRUZ/Delphi-IDE-Colorizer/blob/master/IDE PlugIn/Galileo/TGradientTabSet.pas. Not sure this is the one used in the IDE, but it's worth a try since this seems to be an IDE plugin., Share this post Link to post
limelect 48 Posted September 17, 2020 (edited) @dummzeuch I will try P.s i saw it before It is not implemented. No idea how to use it. Edited September 17, 2020 by limelect Share this post Link to post
dummzeuch 1505 Posted September 17, 2020 (edited) Yeah, that's odd. I wonder where this declaration comes from. There are other classes there as well, that are naked declarations. Maybe looking at the project as a whole would give some clues. For a start I would remove all property and method declarations, typecast to this type and try to access the fields to see if that results in plausible values. If they do, it's possible to call the virtual methods through the VMT. But that's definitely out of my league. Edited September 17, 2020 by dummzeuch 1 Share this post Link to post
dummzeuch 1505 Posted September 17, 2020 Have a look at the code in "IDE PlugIn\Colorizer.Hooks.IDE.pas", "IDE PlugIn\Colorizer.Hooks.pas" and "IDE PlugIn\Colorizer.Wrappers.pas". These seem to be the places where the plugin hooks into the TGradientTabSet code of the IDE. I just grepped for "TGradientTabSet", I didn't try to understand any of the code, so don't ask me how it works, I don't know. Share this post Link to post
limelect 48 Posted September 17, 2020 (edited) Yes, I used your GREP already and I still, unfortunately, did not understand how to use it. Any idea? It will not work. For example, it has FTabList :TList; FTabList :TStringList; Is it allowed? Something fishy. Edited September 17, 2020 by limelect Share this post Link to post
limelect 48 Posted September 17, 2020 (edited) I will look further with your advice that it is TGradientTabSet and not TabControl But if I use IDE explorer (sorry not yours) I see all the properties and I do not see TABS but Items so you might be correct On CnWizard there is something to associate the toolbar search for TGradientTabSet. I will investigate Edited September 17, 2020 by limelect Share this post Link to post
limelect 48 Posted September 17, 2020 (edited) The joke is on me. They did not implement it only the d7. Back to the search Edited September 17, 2020 by limelect Share this post Link to post
limelect 48 Posted September 17, 2020 (edited) @dummzeuch With the help of this link and IDE explorer IIIIII DDDDIDDDD IT. From here I got https://stackoverflow.com/questions/2071247/dynamically-access-a-property-in-a-delphi-component/2071398 var PropInfo: PPropInfo; x:=TComponent(x.FindComponent('TabControl')); PropInfo:= GetPropInfo(x.ClassInfo, 'TabIndex').; SetOrdProp(x, PropInfo, 3); it press tab 4. Thanks every body and see you on my next NOT EASY problem. P.S may some know how to get a list of items from PropInfo:= GetPropInfo(x.ClassInfo, 'Items') into StrinList? Edited September 17, 2020 by limelect Share this post Link to post
limelect 48 Posted September 17, 2020 As of my last request reading an item like integer is no problem like PropInfo:= GetPropInfo(x.ClassInfo, 'LastShownIndex'); i:= GetOrdProp( x,PropInfo); Label2.Caption:=inttostr(i); But items=stringlist how? Share this post Link to post
dummzeuch 1505 Posted September 17, 2020 I think this is what you are looking for: https://stackoverflow.com/questions/7649812/get-set-sub-properties-ussing-rtti Share this post Link to post
limelect 48 Posted September 18, 2020 http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/delphivclwin32/TypInfo.html Investigating Share this post Link to post
limelect 48 Posted September 18, 2020 (edited) @dummzeuch without your lead I could not have done it I was thrown away by thinking that it was TabControl Thanks Checking that it works got the list of my tabs sx=tstringlist PropInfo:= GetPropInfo(x.ClassInfo, 'Items'); sx:= TStringList(GetObjectProp(x,PropInfo)); Label2.Caption:=inttostr(Sx.Count); Memo1.Clear; for I := 0 to Sx.Count-1 do Memo1.Lines.Add(sx) ; Greatwhy cannot write bracket i bracket ??????????? Edited September 18, 2020 by limelect Share this post Link to post
limelect 48 Posted September 18, 2020 (edited) Ok my software is OK Now for Embarcadero to give some Answers. I have 2 components bar. 1. D7 like. 2. Tool pallet. They differ in what the show position wise!!!!! For example, the Tool bar does not have BDE or ActivX in the same position !!!! What is going on? Edited September 18, 2020 by limelect Share this post Link to post
limelect 48 Posted September 19, 2020 Found one drawback sx := TStringList(GetObjectProp(x, PropInfo)); // all the tabs this instruction cannot be made ONShow only On form create. It makes on second-time error. It has to execute only once. Which mean installing a new component will not update unless I restart Delphi. Share this post Link to post