How to patch TSpinEdit to use Vista/Win7 visual style? - delphi

Win7 must give ok style for TSpinEdit, but I see outdated style:
So arrows are not themed, and buttons are old.
I use Delphi7. How to patch VCL to fix style?
OK is:

I don't know if Delphi 7 already had it but you can use TEdit in combination with TUpDown and then set the Association property of the TUpDown to your TEdit.

TSpinEdit is a custom VCL control. There is no Windows control with that functionality. Even in the latest version of Delphi it looks exactly the same as in Delphi 7. And it's really rather ugly isn't it?
The control, in modern Delphi, is implemented in a unit named Vcl.Samples.Spin. Looking at the documentation for the Vcl.Samples namespace we have:
Contains the units for several sample VCL components delivered with RAD Studio - a calendar, an outline, a gauge, and a spinbutton.
The unit will be named differently in Delphi 7, but the principle is the same. These are sample controls, supplied with source code.
So, what you may do is take a copy of the TSpinEdit code, and modify the painting. Change the button drawing to be how you wish it to be.

Related

Can we use Popupmenu in FMX?

I am developing a mobile app in FMX where i need Popupmenu but it is showing disable in Tool Palette i cant use it but in VCL its enabled in Tool Palette and can use it. I just want to know if Firemonkey supports Popupmenu or my installation is having problems or we have to use other tools instead of Popupmenu in FMX? or what else can I do?
and actually i opened one VCL project and copied popupmenu from there to FMX and wrote code on one button and that code is
procedure TFRM_Party.BTN_Party_OptionClick(Sender: TObject);
begin
PopupMenu1.Popup(10,10);
PopupMenu1.Parent := Self;
end;
this code is not showing any error and also not performing also.
what to do? anybody having idea?
The short answer to your question is "Yes", you ought to be able to use the FMX version of TPopupMenu in a project created from File | New |Multi-Device Application in the IDE. If you can't find the FMX TPopupMenu on the Component Palette, something must be wrong with your Delphi install. I'm not quite sure what you mean when you say that it's "disabled" - components are usually either on the Component Palette or not, I don't recall seeing one looking disabled there.
You don't say in your question which version of Delphi you are using, but if it has FireMonkey at all, AFAIK it definitely ought to have the FMX version of TPopupMenu.
In Delphi 10.2 Seattle, for example, the FMX TPopupMenu appears on the "Standard" tab of the component palette, and is contained in the source unit FMX.Menus along with TMenuBar and TMainMenu, amongst others.
If you go to Component | Install packages in the IDE, the pop-up should show Embarcadero FMX Standard Components in the list, which is the file dclfmxstd250.bpl in the bin folder of your Delphi install. If that package isn't listed, that explains why you can't find the FMX TPopupMenu, but if that's the case for you, your Delphi ought to be lacking a lot more FMC components besides TPopupMenu. However, it should be easily solved by installing the .bpl file (or equivalent in your Delphi version). If the package is there, clicking the Components button to the bottom right of the pop-up should bring up the entire list of FXM standard components (which in my case does include TPopupMenu).
If your Delphi does include the Embarcadero FMX Standard Components but is still lacking TPopupMenu, you might try creating a new Package, adding FMX.Menus.pas to it and compiling and installing it in the IDE.
BTW, although it is possible to set up a combined FMX + VCL project (Google for how), just because you might be able to put a VCL TPopupMenu on an FMX Form doesn't mean that it's going to work.
Components are Grayed if you can't use its on current OS(your current choice in top combobox)

Form/Button/other component styles

Ok, so I downloaded a .zip file of all different kinds of examples from embarcadero... the way the buttons look and among other things are completely different from when I just create an application within my Delphi 7. I believe these examples were made for or made at a new time... because the button look way different from the way the button when I put them on my application. the buttons from the example look very modern and sleek and have mouse over effects (This applies for all the examples..its not a custom component ) I was wondering I can get this effect in my own applications within Delphi 7.. I can do this by opening one of the examples and just erasing all the code... but that's not what im trying to do..im wondering how I can accomplish these styles.. how come the examples have these nice looking buttons and such..but when I make an app within D7 its much older looking and such..
I apologize if my question is hard to understand.. and I appreciate any help on this.
Thank you in advance.. I appreciate it.
If I understand your question correctly, you're asking about the native control appearance changes that were added by the addition of Windows Themes in Windows XP.
Delphi 7 supported themes by use of the XPManifest component, which does nothing but add a manifest to your application which tells Windows your app is theme-aware and therefore it should load a more recent version of the common controls library. You can find the XPManifest component in the VCL component palette on the Win32 tab, or simply add the XPMan.pas unit to your uses clause. Note that the themed drawing does not work for all controls (grids, for instance, are not drawn using themes, and IIRC neither is TSpeedButton - it's been a long time since I used D7, so I'm not sure exactly what is and isn't supported, but the support is limited).
Starting with Delphi 2007, there is built-in support for Windows Themes, which is available by default in new projects. It can also be enabled in older projects using a checkbox in the Project->Options->Application dialog.
(Of course the real answer is that if you want your app to have the features included in modern versions of Windows, you should upgrade from your Windows-95 era version of Delphi to one that is more recent.)

Is there a Plugin for Better Filtering the Delphi 2006 Component Palette items?

I have hundreds of components in my Delphi 2006 installation, but I always have trouble finding those I haven't used before and that may be the solution for what I need at the moment. I have many undocumented packages, but by the name of the component you can have an idea of what it does.
For example:
I need a RadioButton, so I have TRadioButton, TElRadioButton or TAdvRadioButton to choose which one has the custom properties that I need.
But when I click the Filter Button of the Tool Palette, I have to Type from the beginning of the component name. If I could have a field editor where I could type only a part of the name and the Palette showed me the components that had that term in the middle of the name too, I would make my day!!!
Does anyone know how in Delphi 2006?
I know that Delphi XE2 has this filter field.
The DDevExtensions IDE extension (http://andy.jgknet.de/blog/ide-tools/ddevextensions/) has a Component Selector that does what you need
(also using D2006, so it definitely works)

Transparent checkbox with theme-support?

I'm looking for a simple, transparent checkbox component that properly supports XP/Vista/7 theming.
It should also work with Delphi 7.
I've found a component on Torry's that's not working properly, and I know that Raize components has a transparent checkbox - but I'm obviously not going to pay $300 for the entire package just to get this single component.
I've also found many other solutions, but none of them support theming.
The main problem is that TCustomCheckBox is a TWinControl descendant, and in order to implement transparency, you need to make a new TGraphic descendant control from ground up.
Any ideas?
LMD-Tools SE is free, works great on Delphi 7 and has a checkbox component that has a transparency property. I've recently used TLMDCheckbox with its transparency property enabled with Delphi 7.
http://www.lmdinnovative.com/download/index.php#LMD
Download file: setupse10d7.zip. Sorry, I can't post the whole path (url) since I don't have enough juice yet.
This should fix you up :).
ShawnH.
Raize Components is overkill for just this component, but much more capable and supports transparency in a whole load more components. Once you have it, you'll appreciate the other items greatly. I'd say it is the solution you are looking for.
If you can accept an alternative control there is JvXPCheckCtrls.pas with its TJvXPCheckbox component in the JVCL library. http://jvcl.delphi-jedi.org
I think (if I remember correct) it is transparent when themes are used.
It's quite a large package which will add to vcl with the installation of Jvcl. And it doesn't cost you a cent.
But remember, the TJvXPCheckbox component is part of their XP-controls package and you cannot simply lift out the component as a standalone. You will need the installation of Jedi and to get the core code and necessary theme handling to use it.
- Its Mozilla Public Licence ("MPL") version 1.1.
I use AlphaControls for some of my programs - all of their components are skinnable and have reasonably powerful graphics handling options. A lot of the components also have more features than their corresponding Delphi standard components - some I just use for those functions alone. There's a free Lite version available at www.alphaskins.com - it may just be what you're after. It's not Vista/7 theme-aware, mind you. We use Delphi 2010 and vista/7 theme awareness is built into the standard VCL there, although that's probably not the solution you were hoping for.
Not sure if this will help, but I ran into what I think is the same problem when working with the TMSSmooth controls: the label of a checkbox place on a form looked terrible because it was not transparent.
Their demo/example programs had nice looking checkboxes so I took a look at their sample code.
Turns out they reduced the width of the checkbox component to 13 so that only the box itself and no caption shows. Then they added a TLabel for the caption.
Seemed like a clever workaround to me.
Hope this helps.

How make DBLookupcombobox has a Windows 7 Look with RAD 2010?

I'm using RAD 2010 on windows 7 and all visual components looks normal (Edit, DBCombobox, for example) but the dblookupcombobox has the same border theme from Windows XP. I can't find how make it's looks like the other components. Anyone has any idea of how i can make this?
Thanks PS: Sorry by the bad english.
I have discovered that the reason for this behavior it that TDBLookupComboBox is a descendant of TCustomControl. Most similar controls are descendants of TCustomEdit, TCustomComboBox or TCustomListBox, which all call TWinControl.CreateSubClass to utilize a preregistered System Window Class of EDIT, COMBOBOX, and LISTBOX, respectively.
Since neither TDBLookupComboBox nor any of its ancestors do this, it just gets a plain border drawn due to the WS_BORDER flag in its Params.Style.
I'm going to assume there is a valid reason that TDBLookupComboBox does not call CreateSubClass to get a Windows COMBOBOX, but I'm not sure why. Maybe a future version of the VCL will utilize this.

Resources