Delphi TRibbon ToolTip for buttons - delphi

I am trying to add a ToolTip (or hint as Delphi refers to it) to the buttons on the ribbon. I am using the TRibbon that comes with Delphi XE7. I am developing in the VCL framework.
I did find a Hint property in the Action that is linked to the button on the Ribbon, but I cannot get the Hint to display.
So it seems that the correct answer is to set ShowHint = True on the form.

First, I'd check if the form (and possibly the ribbon) have ShowHint = True.

Related

Labels and buttons do not work with tabs in Firemonkey

I want to use tabs in a FMX form. In VCL all is functioning as expected. In FMX I tried tabs with labels and buttons without success. HitTest is true, no other controls are on the form. The surrounding frame does not appear and pressing the TAB key does nothing. With edit fields it is working. Did I miss something? Current system is Windows 11 Pro 21H2 and Delphi 10.4.2.
To tab to a TLabel, set its CanFocus property to True. As this property is public, not published, you'll need to do that in code, such as in the form's OnCreate event or by overriding the form's Loaded method.

Make FireMonkey TListBox in XE5 transparent

I have done some FireMonkey stuff in XE2, in this case I'm having troubles with a customized TListBox.
In XE2 I built this customized TListBox by removing it's background and surrounding rectangle (basically I only need the 'grouping of child items' functionality provided by TListBox. This was simple, drop a TListBox, hit 'edit custom style', select the background rectangle, edit the fill and the stroke and you're golden.
Now we're moving to XE5 and I cannot reproduce the same behavior. Using the style book editor I can see the background (which is now TStyleObject and not TRectangle), but I cannot make the changes I could make before. I see tutorials on how to add stuff to a TListBox, but not on how to take default behavior away.
Can someone explain how to achieve this specific behavior, or point me towards a good tutorial?
Try changing the StyleLookup property of the list box to transparentlistboxstyle

Delphi: Styled TMainMenu and TToolBar in TCoolBar

I'm attempting to create an application menu and toolbar in Delphi XE3 that looks like the following (from a program I have):
I'm able to replicate a portion of this look by doing the following:
Create a new VCL Forms application
Add a TMainMenu and insert template menus for File/Edit/etc.
Add a TCoolBar to the form
Add a TToolBar to the TCoolBar
Add a TToolButton to the TToolBar for each of File/Edit/etc. and choose the Group property
Delete the Menu property from the form (so no program menu shows)
Assign the MenuItem property for each TToolButton to the corresponding File/Edit/etc.
Add a second TToolBar to the TCoolBar beneath the first one
Here's what it looks like:
It's somewhat similar but is still missing all the style elements to modify the look of the new application menu.
My question is, does anyone know of how to achieve a similar look, perhaps with a third-party component library? It seems likely that the original developer used a third-party VCL library. I'd like the drop shadow in addition to the styled menus and TCoolBar.
I've tried Raize Components, TMS Advanced Toolbars & Menus, and am in the process of trying DevExpress VCL components. None of them seem to provide a solution, but perhaps I'm not familiar enough with them yet to figure it out.
Delphi has come with an ActionBands demo that can show you how to obtain this appearance "out of the box" for your menus using TActionMainMenuBar (and TActionToolBar). Just change the Style menu to XP Style in the demo:
The rest of your steps seem pretty well complete. For the images on the menu items and toolbar buttons, see the use of ImageList components in association with the TActions on the menu and toolbar in the demo.

RichEdit VCL and URLs. Workarounds for OnPaint Issues

My issue is with the thing Delphi progies scare to death - Rich Edit in Windows (XP and pre-XP versions).
Situation:
I have added EM_AUTOURLDETECTION in OnCreate of form. Target -> RichEdit1. Then, I have form, that is "collapsed" after showing form. RichEdit Control is sattic, visible and enabled, but it is "hidden" because form window is collapsed.
I can expand and collapse form, using Button1 and changing forms Constraints and Size properties.
After first time I expand form, the URL inside RichEdit1 control is highlighted. But, after second, third, fourth, etc... times I collapse and expand form, the RichEdit1 Control does not highlight URL anymore.
I have tried EM_SETTEXTMODE messages, also WM_UPDATEUISTATE, also basic WM_TEXT message -> no luck. It sems like this merssage really works ( enables detection ) while sending keyboard strokes ( virtual keycodes ), but not when text has been modified.
Also - I am thinking to rewrite code to make RichEdit Control dynamic. Would this fix the problem?
Maybe solution is to override OnPaint / OnDraw method to avoid highlight ( formatting ) losing when collapsing or expanding form?
Weird is that my Embarcadero Documentation says this function must work in any moment text has been modified. Why it does not work?
Any help appreciated. I am making this Community Wiki because this is common problem and togewther we cam find solution, right? :)
Also - follow-ups and related Question:
Override OnPaint
How to autodetect urls in RichEdit 2.0?
http://www.vbforums.com/archive/index.php/t-59959.html
I am not sure but is the window of the richedit recreated when geing from hide to show? If this is the case you might create your own derived TRichEdit class, override the function that creates the WIndows Handle (TWinControl.CreateHandle) and add EM_AUTOURLDETECTION there.

Delphi control that could mimic "Add-ons|Extension list" of Firefox?

My aim is to update the look of the GUI in my app. Currently my GUI contains a lot of listboxes which are used to edit some objects in an old fashioned way, that is, user double-clicks an item and a dialog is shown to modify the corresponding object.
I think a good modern approach is how Firefox displays the extensions installed (a snapshot below).
My question is about how to build such a GUI in Delphi(win32) easily? Are there any components you use mimicing such behaviour or will I just need to code this from stratch using panels? (IMO a very cumbersome job I'd like to avoid - the selection logic, resizings, etc...)
You can do something similar (not exactly) with standard components; TDBCtrlGrid, TSpeedButton,...
alt text http://img8.imageshack.us/img8/9585/imagen29ox3.png
If you're using Delphi 2007 or Delphi 2009, you might be able to do something similar using TCategoryButtons (from the 'Additional' component palette page). Drop it on a form and right click to display the popup menu, and then click "Categories Editor...". Add a category with the resulting dialog, set it's caption, and optionally set up Items it contains. Not exactly the same, but it might do what you need.
You could also use a dialog with a TTreeView (if you have categories of objects) or TListView to emulate the Delphi 2007 Projects->Options dialog. Clicking an item in the TreeView or ListView displays the proper page of a TPageControl to configure the object.
I mostly agree with Lars, but I would use a frame for each item instead of a panel. That would separate into its own file, and you would get easy designtime support for it.
Using a TFrame for each list item and put them all Aligned Top on a TScrollBox might work. Also see TDBCtrlGrid which does something like that in combination with datasets.
It can be done with existing Delphi controls.
For instance in the TCustomListBox control you can create your own OnDrawItem event to draw your own list item. You also need to create your own OnMeasureItem to change the item height.
In some cases it is very limited, so if you want more freedom you will need to do it from scratch.

Resources