I Couldn't find a property or some hack way to block the dock movements of the TdxBar in a TdxBarManager.
I configured the properties in the TdxBar.NotDocking category, this indeed prevent the bar to be docked but it still can be floated around.
im using vcl 2012 1.5
thx in advance.
If you want a static toolbar, just set the TdxBar BorderStyle to bbsNone (it defaults to bbsSingle).
Related
I'm relatively new to programming and my problem is with a TMainMenu on my form.
I researched a lot (a whole lot) of sites for a solution, but haven't found any that solves this exact problem.
The main menu won't resize, not even when I change the fontsize using Screen.MenuFont.Size. I tried setting the Height property in the OnMeasureItem handler, I tried resizing the images and sub-menuitems at both design- and runtime, I even tried capturing Windows' message WMDrawItem and changing it's parameter before passing it on...
The menu items in the component are resized accordingly, but the vertical height of the menubar itself isn't. (the line seen on the picture below cutting through the icons)
Is there an easy solution to this, like setting some well hidden height property somewhere?
Or do I have to rewrite half of delphi's code to achieve my goal?
Help with code examples are appreciated. :-)
Here's an image:
I am using Delphi 7 on a Win7 machine.
The height of the menu bar is a Windows metric setting. Thus it is valid system wide - not only for your application. If at all, it can only be changed via the display settings of Windows itself.
I would recommend to use TActionMainMenuBar instead. It is much more flexible then the TMainMenu.
You can change the font of the menu bar very easy as well.
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.
I am building an user interface. My program will consist of 4 main parts:
1) Top Menu - TMainMenu. A top of a window
2) Main Menu - TTreeView. A left of a window. Each item of TreeView=corresponded TabSheet of TPageCotrol.
3) Work space - TPageControl. No tabs. An left space.
Each TabSheet has it's own ToolBar and other controls. It will be 5 menus (5 items in TreeView) = 5 TabSheets -> 5 ToolBars and other controls on each TabSheet.
It almost exactly looks like here (it could be: TreeView as Main Menu; MainMenu as Top Menu; Work Area - ToolBar and other controls):
I would like to use an user interface like here:
Where the CoolBar are represented with the Top Menu and the ToolBar (it suits my purpose to use 5 ToolBars instead of 1 ToolBar on each TabSheet). But after a discussion here it seems impossible to copy this CoolBar with the MainMenu and the ToolBar.
My question: how to build an efficient user interface using as examples the UI of uTorrent and the UI of Windows Firewall?
Are there good alternatives, ideas of a building of the UI? How would you make your interface if you need those 4 parts as me?
Now I have something like this:
Thanks!
You'll have to have 5 panels in your client area.
As you select a node in the treeview on the left you will need to call
pnlInboundRules.BringToFront;
The difficult thing is then how to update the single toolbar with the items that should appear on it based on what "tab" you've selected.
You would have to delete the toolbar buttons, and add new buttons for that "page".
Ian suggest panels, I would go with PageControl and set it's tabs TabVisible to false at runtime(*). The reason is that it is much more easy to manage at design time. When user select an item from treeview, activate corresponding TabSheet...
*) I actually haven't done this with stock TPageControl so I don't rememeber would it work this way, ie would it activate TabSheet which have it's TabVisible set to false. It might be that you have to set TabHeight to 0 or use some other trick to hide tabs at runtime.
I am emulating (to the degree possible) a TPopup Menu so it can float and users can drag it around.
To do this, it's on its own form, and uses TPanels acting as if they are clickable TMenuItems.
I'm using TPanels so I can change their color.
To get the colors right, how can I determine at runtime (in Delphi 2010) the current theme's colors for TMenuItem.Color and TMenuItem.Font.Color (assuming such properties existed).
TIA
Edit
I could use clBtnFace for the background, and clWindowText for the text color. But, I need to know the the theme colors for when the mouse is over a menu selection.
Have a look at my answer to How can I get the color for a themed tabsheet - especially the edit.
The relevant constants can be found under Parts and States. Just search for "MENU" on that page.
Edit: There are tools to explore themes visually - see Windows Visual Themes: Gallery of Parts and States?. (Thanks to #TOndrej for bringing this up.)
I believe the popupmenu uses the colour in the clMenu constant. If you need the colour as an rgb value, use ColorToRgb(clMenu) to translate it. There's clMenuBar, clMenuText and clMenuHighlight constants too.
You can use the constants clMenu and clMenuText.
There are more windows colors defined in Graphics.pas
How do I prevent my form from being resized? I don't want it to be maximized (which can be toggled via the property editor), but I don't want anyone to be able to drag-resize it. Am I missing something simple, or does this require a little bit of coding?
I'm using Delphi 2007.
TForm has the property you need. Set
BorderStyle to bsSingle
so that the form doesn't appear to be sizable, and it has the added benefit of actually not being sizable. :-)
You can set the BorderStyle to bsDialog.
Don't forget about the Constraint properties of TForm, i.e. MaxHeight, MinHeight, MaxWidth, MinWidth.
You can set the BorderStyle to bsSingle, too. That will give you a proper top level frame, with icon and everything.
And if you want to get really geeky (i.e. the answers above are better), you can intercept the RESIZE Windows message.
I would go with the Constraints property myself.
Cheers
Set borderstyle to bstoolwindow. The windows will only have a close button and title bar.