Delphi: custom button in custom title bar - à la Firefox/Opera main menu button - delphi

I want to create 5 buttons in a title bar of a window using this way: http://delphihaven.wordpress.com/2010/04/19/setting-up-a-custom-titlebar/
Firefox has one button (the same for Opera):
Not maximized window
Maximized window
How to make such buttons for my purpose? Rounded/curved, with bevels, with/without an image, with/without a gradient. Are there similar components? Do I need to make it manually? If so, then how? If it's not a button then what is it? Is there an alternative for it?

For an example of a component that draws on the glass at the top of your form, check out the TRibbon control that comes with Delphi 2010 and above. The source code is included with Delphi. I'd bet that the button is simply an image with an alpha channel. The TRibbon code also draw controls like that on glass.

Related

How to close a TMultiview from code in Delphi XE8?

I have a form with a speedbutton linked to a TMultiView component.
On the multiview I have some buttons. When clicking on any of the buttons I want the multiview to close and depending on the clicked button, different functions to be called. I have tried to set the Visible property of my MultiView to false, but the shadow over the form then remains. If I click on the speedbutton again, then menu disappears, and also the shadow, as expected.
Is there a way to solve this?
I'm using Deplhi XE 8.1
Multiview.HideMaster will close the multi view. Call this whenever/wherever you want the multiview to close.

How to make an edit control in fmx transparent and hide its border?

How can I make an edit control in fmx transparent and at the same time hide the borders of the control, so it will blend into the control in the back?
What I am trying to do is to make a small Notes program where, when I double-click a tabitem, it shows an edit control to change the text of the tabitem.
Right click the edit control (let's say Edit1) and click 'Edit Custom Style'.
Expand 'edit1style1'.
Click background:TActiveStyleObject.
Clear the SourceLookup property.

Hide the tab in a VCL Ribbon

I have 2 problems with a VCL TRibbon. I am using C++ Builder XE3.
Extra bar along the top. There is an extra bar along the top which i cant remove. I don't see any options which effect it.
Is there a way to remove just the tab. I only have 1 ribbon page and there is no need for the tab with the text.
I am trying to get the icons flush against the App border.

DELPHI - How to change a TButton background color in a VCL Form Application?

In my Delphi VCL Form Application I have to change the background color of a TButton.
Is there a way to apply this change without using a third-party components?
Thanks.
You can't change the color of a TButton component directly, instead you must use a third-party component or owner draw the button (BS_OWNERDRAW).
Create a panel.
Change panel's color to any color.
Empty panel's caption.
Create a SpeedButton inside the panel.
Set SpeedButton's Flat property True.
Set SpeedButton's Align propert alClient.
Voila! Here is your button with color!
Original source: https://engineertips.wordpress.com/2020/07/21/delphi-button-background-color/
Nice tip, thank you, Xel Naga!
You can also place an image on the panel, to make your button even nicer.
Here I’ve added an image of a Yellow- Glass- button.
To get the rounded corners, you shape the panel like this >>
SetWindowRgn(Panel1.Handle, CreateRoundRectRgn(0, 0, Panel1.Width, Panel1.Height, 65, 40), True);
Next level after that, you can add 3 more images (on top of each-other) for button states: Mouse Over (OnMouseEnter), Button Pressed (OnMouseDown) and Button Disabled. Just change the Visible state of the images to reveal the one you want to see...

How do I add buttons to a FireMonkey toolbar?

With 10 years of experience in development, I could not put new buttons on the Toolbar FireMonkey. Could anyone help me?
There is no component editor menu-item to add buttons or seperators, but you can drag buttons from the toolpallet to the toolbar. Or select the toolbar in the form and press F6. Type the name of the control you want on the toolbar and press enter.
TToolBar is now simply a container. You must drop your own controls onto it.
To add a control to a ToolBar, make sure that your ToolBar is selected on the form, select your child control in the Tool Palette, and then click the location in the ToolBar that you wish your child control to appear.
Another way to do this is to ensure that the ToolBar is selected and double-click the control in the Tool Palette. Whatever control is selected becomes the parent.
Many of the new FireMonkey UI controls are now simply containers, including TStatusBar.
To add a text line to TStatusBar, you must add your own TLabel or other control.
I found that the best way to put an image on a button was to literally drop a TImage onto the button and unset the TImage's HitTest property.
All FireMonkey controls are containers and can have child controls now. It might take a little longer to configure your UI, but you have a lot of flexibility.
Use the TLayout control for dividing up the parent control and aligning your controls. Use the Margin and Padding properties to adjust the spacing.

Resources