1

Is there a way to have the "Structure View" in Delphi XE "stick" to a particular DFM and not follow editor context?

In Delphi 7 and older this was its behavior, but in XE, it follows the context, meaning that whenever you edit code, it shows the structure for that code.

I have components structures in the DFM that are used for hierarchical description of a UI model, and for that, the structure view is very convenient. However, the code associated to that DFM is in (other) plain units (UI/logic separation). So whenever I switch from the DFM unit to one of those other units (even just for a quick lookup), it loses focus of the DFM structure.
When going back to the DFM unit, it shows the (useless*) structure of the code of the DFM unit, and not that of the DFM components, you have to re-enter the visual editor and manually select something there to get the structure back...

If the solution involves the structure view never showing the structure of code, I would be happy with that, as I'm already using another tool for that purpose.

*PS: "useless" because the content of the DFM unit is auto-generated.

RRUZ
  • 134,889
  • 20
  • 356
  • 483
Eric Grange
  • 5,931
  • 1
  • 39
  • 61
  • DFM-DFM-DFM-DFM. It is a FORM. Oh, i hate when people are abusing file extensions to denote whatever files with given extensions really are. Either i didnt understand what you are complaining about, or that "useless" feature made so by design. It might lose SELECTION, which is more likely a bug. – Free Consulting Jan 24 '11 at 09:57
  • It isn't just for a form, which is a special case of DFM usage, the issue also occurs for frames and datamodules f.i.. In the above case, the DFM is that of a DataModule actually, but I didn't delve into the details, hence the usage of DFM. The structure view is "useless" on the source in that case, as it contains only auto-generated code. – Eric Grange Jan 24 '11 at 10:29
  • 5
    @Worm DFM is a pretty common usage. Your critical comments would carry more weight if you were ever to contribute something positive. As it stands it is not possible to discern whether or not you are an authority on Delphi. Your voting record also seems to suggest that you are our no. 1 silent down voter!! ;-) – David Heffernan Jan 24 '11 at 11:25
  • @David Heffernan, could you please stop mangling my nick already or find someone else to follow? And i do not want to have long discussion on that subject. I really didn't want to be that direct, but finally got tired from your constant attention. @All: solicitation is not very good way to influence my ratings on your posts, try carefully reading questions and not hurry to answer. Seriously, it works. And yes, i never make Captain Obvious cry by accompanying my rating with comment like "+1! Good answer!". – Free Consulting Jan 24 '11 at 14:48
  • 2
    @Worm I'm entitled to express my views, and your voting record is part of your profile. – David Heffernan Jan 24 '11 at 14:51
  • @Eric Grange, no, DFM is format for serializing data from *designer* (no matter you are designing form or frame or whatever custom module designer knows about). Structure pane preserves designer related state, for code editor thing are traditionally worse. Just undock or switch back to D7. – Free Consulting Jan 24 '11 at 14:58
  • @Heff, LOL, excellent example of quick answer w/o reading original post. Stop pestering me. Clear now? – Free Consulting Jan 24 '11 at 15:05
  • @Worm I'm not pestering you and you are entitled to ignore my comments. – David Heffernan Jan 24 '11 at 15:13
  • @David: If it's so important to Worm Regards to see his/her name always fully spelt out, I suggest just doing it. Or have I missed some drama behind this "Worm"/"Heff" thing? :-) – Uli Gerhardt Jan 24 '11 at 15:42
  • 1
    @Eric +1 because I don't like either this behavior change of the IDE; that's one of (many) reasons why I still use Delphi 7 (+CnPack/DevEx) as my daily IDE, and only use Delphi 2007/2010 as compiler. Unfortunately, I don't know any definitive answer to you question. Did you ask this in the EMB newsgroups: https://forums.embarcadero.com/forum.jspa?forumID=62 ? – Arnaud Bouchez Jan 24 '11 at 16:57
  • @Eric Code in a unit with an associated form isn't always auto-generated. Also, as an aside, on Delphi 2010, the behaviour you describe does not appear to occur. – David Heffernan Jan 25 '11 at 09:03
  • 1
    @Eric Does a couple of presses of F12 get you back to where you want to be? – David Heffernan Jan 25 '11 at 09:03
  • Double-tap F12 gets it back, but you first have to focus back on the DFM unit tab (and thus lose sight in the code editor of whatever you were looking up in the other unit). – Eric Grange Jan 27 '11 at 10:35

1 Answers1

0

This might sound trivial, but have you thought about copying the view to the clipboard with PrintScreen, and then pasting it into paintbrush, so you can see it even when you aren't looking at the form any more?

Warren P
  • 65,725
  • 40
  • 181
  • 316
  • The structure view allows to select entities in the hierarchies (components, collection items, etc.), which in turns updates the property view, allowing to view and adjust properties. Also even for viewing only, usually the hierarchy doesn't fit in the screen, so I use the ability to collapse and expand nodes of the structure view. – Eric Grange Jan 25 '11 at 08:54