1

How can I use TSynEdit or TSynMemo with Delphi XE4 and apply a Delphi VCL Style? I have SynEdit installed but I can not drag & drop a TSynMemo component onto a form once I activated a VCL style in the app. Do I need to make some kind of change to the SynEdit source to allow for VCL Style to work?

Thomas Jaeger
  • 923
  • 1
  • 9
  • 27
  • I can't reproduce this issue in Berlin. Here's what I did: File->New->VCL Forms Application. Project->Options->Application->Appearance, checked several visual styles, and set *Windows 10* as the default style. Closed the dialog, went to the Component Palette, typed *Syn* into the search box, and double-clicked a TSynMemo. It appeared on the form as usual. Re-opened the options dialog and changed to Amakrits as the style, closed the dialog, and ran the app. It worked (although the SynEdit wasn't styled). Do you have the most recent SynEdit installed? – Ken White Jun 28 '17 at 22:08
  • And what exactly does *can not drag & drop* mean? – Ken White Jun 28 '17 at 22:15
  • @KenWhite: "*And what exactly does "can not drag & drop" mean?*" - at design-time, users can visually drag a component from the Component Palette or Tools Palette and drop it on the Form Designer, instead of double-clicking or pressing Enter. So presumably the IDE is preventing the drop, or the component constructor is raising an exception – Remy Lebeau Jun 28 '17 at 22:30
  • @Remy: Yes, I know how the component palette and form designer work. I've also indicated that I can't reproduce the issue, and I'm wondering if the poster is just not seeing that in the palette, the palette tab is not available, or an error or exception is raised; the question simply says *can not drag & drop*. Something more specific would be helpful, just like more details are useful when a poster describes a problem as *this doesn't work*. – Ken White Jun 28 '17 at 22:33
  • @KenWhite The SynEdit component pallet does not even show up. It does show up under a normal Windows Application. – Thomas Jaeger Jun 28 '17 at 23:29
  • 1
    I'm suspecting you don't have the most recent SynEdit version, then. You may want to see if you can update it. – Ken White Jun 28 '17 at 23:43
  • 1
    @ThomasJaeger "*SynEdit component pallet does not even show up. It does show up under a normal Windows Application*" - the palettes are context sensitive. So either the project is not in a context that SynEdit is registered for (VCL vs FMX), or maybe the Form Designer is not active, or maybe the project simply doesn't have the SynEdit packages loaded (packages can be loaded/unloaded on a per-project basis) – Remy Lebeau Jun 29 '17 at 01:08
  • Why would anybody downgrade a good and valid question? WTF? The censorship and negativity on SO is crazy. – Thomas Jaeger Jun 29 '17 at 11:17
  • Forget score here, Thomas. From me you get an upvote now. But, I would consider including details about which elements you need to style by VCL Styles because SynEdit controls are (except a few) controlled by the used syntax highlighter style. – Victoria Jul 06 '17 at 01:06

1 Answers1

1

I was using an older version of SynEdit. I used this version: TurboPack/SynEdit

Once I installed it, the SynEdit pallet showed up in the designer. However, I don't see it being skinned at all whereas all other standard controls are skinned.

I found solutions here and here using a TStyleHook.

Thomas Jaeger
  • 923
  • 1
  • 9
  • 27
  • 3
    Yes, because no one created VCL Style for it. SynEdit is for syntax highlighting. At most the background and a default text font color could be styled, I would say. The rest depends on selected highlighter. To that you must reflect token colors of the used highlighter. I mean, you cannot apply a VCL Style to make that control having a black background whilst having e.g. identifier tokens colored by black font. – Victoria Jun 29 '17 at 03:42
  • 1
    @Victoria I know what SynEdit is for. I created custom highlighters. You would still need to style the vertical and horizontal scrollbars, for example. The highlighters have nothing to do with the skinning of a TSynEdit or TSynMemo. – Thomas Jaeger Jun 29 '17 at 11:16
  • Then [do this](https://stackoverflow.com/a/41731226/8041231). That's all. – Victoria Jun 29 '17 at 11:56