2
votes

Recently I've been doing some research in to VCL Styling (Embarcadero XE2 for Delphi). I can load and set the styles so that works fine.

Currently I'm exploring the VCL Style Designer and what I try to figure out is how can I move the minimize, maximize, resize, close and help button to the left instead of the current default right while the application text (caption of the form) is on the right.

I am at my whits end and hope some one can give me some pointers.

So basically what I try to 'emulate' is the Mac look on a Windows form.

Any help is welcome.

1
A simple workaround is to remove the window border and add the buttons yourself.invalid_id
I'm not really sure I understand where your going at. Could you please be a bit more specific??Blaatz0r
I cannot help with the exact code but it should be possible to do something like Window.Border.Visible = False. Then you can make your own border by making a bar with your buttons in the top.invalid_id
Ah okay I understand. That is one way to indeed fix the issue. But my main focus is to create it with VCL Style Designer. It's too bad I don't have the reputation to upload images yet. Then I could upload the image so you can see what I've created thus far.Blaatz0r
It's probably worth re-evaluating why you are doing this. It is generally a rather bad idea to try to change behaviour that people expect. There is a reason that mac and windows users often dislike (and find difficult to operate) their counterparts' operating systems - because nothing is where they expect it to be, nor does it do what they expect! If you make a windows application look and feel like a Mac application, Windows users are going to, largely, hate you for it and will not want to nor enjoy using your application. I would seriously reconsider this.J...

1 Answers

1
votes

What do you want accomplish is not related to the VCL Style Designer, instead you must create a custom form style hook.

Follow these steps.

  1. Create (and register) a new form style hook descending from the TFormStyleHook class.
  2. Override the PaintNC method to draw the title buttons in the new positions.
  3. Handle the WM_NCMOUSEMOVE, WM_NCLBUTTONDOWN and WM_WM_NCLBUTTONUP messages to detect the status of the title buttons (hot, pressed) and fire the actions (close, restore, maximize, minimize).