TdxBarManager VCL finding menu options - delphi

I am looking at a menu option on the all commands tab of a TdxBarMananger. Is there a quick way to find where on the menu the current command is? At present I have to open the dfm file and search for the command name.

You can only search for a bar item by manually expanding sub menus. There is no a list of conformity which would allow you to quickly define where a certain BarItem is positioned.

Related

How to fix a Tab as first tab on TPageControl and keep it showing while navigating on tabs?

I have this form:
Green arrow: Tab General, and I'd like to keep it always visible, but when the form is smaller than the tabs, TPageControl creates a navigator (the red arrow).
It's good, but I'd like to allow the user navigate but keep showing the possibility to click on the General Tab.
Example:
In this picture, I used the navigator and I can't see General Tab anymore.
I'd like to keep it as the first tab on the PageControl, like a "fixed column" in Excel for instance.
Yes, I didn't found a way to fix the tab! But I solved my problem creating a custom page control based on our discussion on this thread.
You can check it here

Shorten Joomla SEF URL Parent / Child / Sub Menu Items, Use only one alias without multiple parent alias

Is there anyway to only show the menu item alias in the URL without its parent alias? I know I can create a hidden menu with all items in the root level but this will make the breadcrumb unusable.
For example: www.mysite.com/grand-parent/parent/child
I like it to be just www.mysite.com/child
I have url rewrite/sef turned on using Joomla 2.5.
Thanks,
Will
There is a workaround.
Create a seperate menu and create menu item in that menu with required alias.
Then on the menu you want the link in the first place, create a menu item of type menu Alias and select the seperate menu item as target. This way parent alias will no appear infront for any alias type menu items.
No need for any workarounds. It works straight on.
(Written for J 2.5 but J 3 should be the same)
Choose the menu item which you wish to remove from the SEF URL (the parent menu which provides the url). Open it from the menu manager
In the section on the left, titled "Details" there is a row with "Alias". Next to it there's a button "Inherited". Click it so it becomes "Not Inherited".
Save & Close
Voila! It disappears .
It work's with "Direct Alias" extension.
http://extensions.joomla.org/extension/direct-alias
After instaling it "Inherited" button apears next to "Alias".
I have just had a similar problem and this plugin worked perfectly to achieve what I needed. This saves me hours of work creating 301 redirects. I had to buy the pro version to get the control over individual menu items. This gives you the functionality Ben Shomer describes above eg Next to it there's a button "Inherited". Click it so it becomes "Not Inherited". The free version controls ALL menu item aliases. Great plugin, highly recommended.
To perform what you want to do :
1- Install "Direct Alias" extension : http://extensions.joomla.org/extension/direct-alias
2- Go to "Menus" -> "All Menus Items" and select your menu item.
After "Alias" field you will have two buttons "Relative" and "Inherited".
Click on "Relative". It will transform to "Direct". Save and test.
You have now a direct link for your child item in your menu.
Note : If you don't install Direct "Direct Alias" extension the two button will not display.
I'm not sure it's possible with core Joomla.
You can achieve this - and complete control over your SEF urls - with the sh404 extension.
I solve it by following these steps.
Create a hidden menu which is your child menu. (For creating the hidden menu go to the Link Type tab and select No for Display in Menu option).
Then create your parent menu with a type of anything under the System Links (except Menu Item Alias)
Create a menu (as a child of the parent menu you have created before) with the type of Menu Item Alias and select the hidden child menu you've created before as the Menu Item.
That's all. Now you can show your menu structure like-
|-Parent
|--Child
And when you click on the Child link the URL will look like mysite.com/child

Delphi 2010 Action Manager & Main Menu Bar

I'm trying to use the Action Manager and Action Main Menu Bar in Delphi 2010 an I have no idea how to make this work. I've tried looking at the examples that come with Delphi 2010 and I can't seem to figure this out.
I've tried playing around with the examples. I've been able to add an image to the Image List component and set that item to the new item index. At design time it displays properly at runtime it reverts back to the original.
I'd like to learn how to use the Action Manager and Action Main Menu Bar but I can find any help on these topics. Is there a tutorial on how to use the Action Manager and Action Main Menu Bar?
Drag and drop a ActionManager, a ActionMainMenuBar and a ImageList on your form.
Doubleclick the ImageList, you get the Imagelist Editor. Use the Add-button to add your icons (make sure their sizes are the same as the Height and Width properties that are set in the ImageList-control).
Set the Images-property of the ActionManager to your ImageList and set the ActionManager-property of your ActionMainMenuBar to your ActionManager.
Doubleclick the ActionManager, go to the tab 'Actions' and add new actions by the 'New'-button.
Click each Action in the ActionManager and set each action's properties, at least: ImageIndex (to choose an Icon), Caption and Category.
Note: A Category will serve as a main item in the menu (like File, Edit and View) and each Action will serve as menu item (like Save, Save as, Load). So set the Category property of all actions you want to belong to one main menu item to the same name. For instance give the actions 'Save' and 'Load' the category 'File' and give the actions 'Undo' and 'Redo' the category 'Edit'.
Doubleclick each Action in the ActionManager. You'll get the code editor. Type the code you want to perform when the user clicks this menu item. If you don't type any code or comment, the menu item will automatically be disabled when the application is running.
Now drag the categories from the ActionManager to the ActionMainMenuBar.
That's it.
I think Actions, Action Lists And Action Managers by Brian Long is a great start to explore the realm of actions.

Delphi Menu Merging problem

I'm trying to merge two main menus together, but am having problems getting the right result with sub-items. I'm using the GroupIndex property on my MenuItems to control the merging/insertion.
Menu1 (with groupindices) is like this
File=10
Open=11
Close=12
Edit=20
Cut=21
Paste=22
Help=90
About=91
Menu2 is like this
Edit=20
Clear=23
Widgets=30
Widget1=31
Widget2=32
And I'm doing
Menu1.Merge(Menu2);
I want the combined menu to have a new top menu "Widgets"and a new "Clear" command in the Edit menu. "Widgets" is working fine, but the Edit Menu has lost cut and paste, which wasn't what I wanted.
How can I stop the Cut and Paste commands from disappearing?
The menu merge feature in Delphi works a bit differently than what you'd expect: it's non-recursive (unfortunately!). That means that when you call Menu1.Merge, Menu1's "Edit" menu gets replaced by Menu2's.
You have two options:
Add "Cut" and "Paste" manually to Menu2.
Write your own Merge function.
I had the same problem a while ago (see this SO question):
What I eventually ended up with, is
using the
Toolbar2000
package for all my menus and toolbars.
You can then download a very nice
piece of code, called
TB2Merge,
which does exactly what you want.
You could also base any custom-written menu merge code on TB2Merge, I guess...

How can I change a main menu First level caption?

I have a main menu in an MDI parent form, and it as a main menu.
Now I need to change the first level caption of my first menu item in runtime. How can I do that?
--- Update ---
Sorry. I forgot to tell you that the mainMenu is housed in a TcontrolBar.
I think that is the problem because all answer so far don’t work. I had tried all that before.
But this only occurs for the first level, all other levels change correctly.
Perhaps I'm missing something, but it seems to be very simple:
MainMenu1.Items[0].Caption := '&Hello'; // first top-level item
MainMenu1.Items[1].Caption := '&World'; // second top-level item, etc.
In the Menu Editor (at design time in the IDE), click on the menu you want to change, open the property inspector and change the name to something relevant, i.e MyFirstMenu.
Then in your code, whenever you want to change the menu items caption you can use:
MyFirstMenu.Caption := 'A New Caption';
or if the Main Menu is built dynamically see the answer TOndrej gave above.
[Edit1]
Do you mean you can set the caption successfully on the menu item but do not see the change on the TControlBar?
If you are using the old technique of adding a TToolbar inside of a TControlBar, then adding a tool button for each top menu item, then what you see in the form as top level menu items are actually the tool buttons. Set their caption directly, and everything should work.

Resources