Jump to content
PeterPanettone

'View as Text' command menu item?

Recommended Posts

Posted (edited)

In Delphi 12.1 Form Designer you can show the DFM code in the Code Editor with the shortcut ALT+F12.

 

Where is the menu command for this action?

 

Wasn't the View menu supposed to show the menu item 'View as Text' for this command? There is none:

 

image.thumb.png.b45f836fb367a7e4642093f652e47e4a.png

Edited by PeterPanettone

Share this post


Link to post

AFAIK, this command is only available from the context menu of the form designer.

Share this post


Link to post
Posted (edited)
19 minutes ago, Uwe Raabe said:

AFAIK, this command is only available from the context menu of the form designer.

Unfortunately, the shortcut ALT+F12 is missing from the context menu!

 

image.thumb.png.a0f970fd8da314119baae8d864585c32.png

 

Isn't displaying existing shortcuts a requirement for a consistent UI?

Edited by PeterPanettone

Share this post


Link to post

Another issue is IDE insight is blind to context menu commands. This means things only available in a context menu are harder to find. 

Share this post


Link to post
Posted (edited)
41 minutes ago, Die Holländer said:

Right-Click on the form caption bar.

In my Delphi (12.1) the context menu is shown from the whole form (not only from the caption bar) - but not from the Form Designer canvas. Which is logically inconsistent because the Code Editor showing the DFM code shows the code of the whole form and and not specifically the code of the clicked object (which BTW would be an interesting option).

Edited by PeterPanettone

Share this post


Link to post
Posted (edited)
23 minutes ago, PeterPanettone said:

which BTW would be an interesting option

In complex forms with many (nested) objects, displaying only the DFM object code for the selected object would be a helpful option. It could help the user focus on that object when editing its code in the Code Editor.

What do you think about this?

Edited by PeterPanettone

Share this post


Link to post
Posted (edited)
2 hours ago, PeterPanettone said:

In my Delphi (12.1) the context menu is shown from the whole form (not only from the caption bar) - but not from the Form Designer canvas.

Yes, indeed, but right-click on the form name shows only "View as Form", while the display doesn't show the text of the form (*.dfm) at the moment.

It appears that this is a Toggle option and by selecting this option the display will switch to Text view...

The "View as Form" in the menu is just not displaying what it is going to do.  Same for Alt+F12 is toggle between Text and Form view.. (in Delphi 11.3)

image.png

Edited by Die Holländer

Share this post


Link to post

I usually use notepad++ when touching the dfms as text. But for viewing you could do the following.

  • Select desired nest in design and copy. 
  • Open new Vcl form.
  • Paste selected controls on edit form
  • Adjust controls 
  • Paste adjusted controls back to source design window.
  • Make new unit an inline or embedded frame to reduce nesting in source form?

Lazarus leaves the text view up once viewed as text but not really useful most of the time.  

 

  

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×