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)
Related
Even though it is not officially supported by Embarcadero there are many examples showing that you can include a FMX form in a VCL application e.g. MonkeyMixer and this SO question.
However, when I create a test application with only one empty VCL form and one empty FMX form, I get two problems:
There are two application icons in the task bar (apparently one for
each instance of TApplication i.e. VCL and FMX)
It crashes when I close the application (when it calls TStyleManager.UnInitialize in FMX.Forms.FinalizeForms).
How can I make this work?
I need this combination as we want our application to be native on Windows, Mac OS and iOS. Therefore on Windows it is a VCL application and the other OS's are FMX using the TMS native components. We have some large custom graphical components that are made for FMX, and they must also work on Windows.
Edit:
I see only two alternative solutions, and I like none of them:
Use FMX on Windows too. I don't like the idea of styled components instead of native. Experienced users can easily tell the difference.
Maintain to sets of our custom components: VCL and FMX editions. That will require some work, and also the graphical features of FMX are much better than VCL.
I've needed to host an FMX app inside a VCL app for display and training purposes. The FMX app is really an Android target and the VCL a Windows 'demonstrator'. The FMX hosting is done using TFireMonkeyContainer hosting the FMX main form. Yes it's got slight wrinkles but it works ok and I'm sure we'll find a way to improve things.
My FMX main form is created at runtime and has visibility of only FMX.Forms. It is then passed to TFireMonkeyContainer and is destroyed by it when the VCL app closes.
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.
As the title says really. How can I add an FMX form to a delphi package? In the package I have a Tpanel descendant component - which is all installed fine. What I'd like to do is include a form in the package so that when I click on the panel at runtime the form pops up for example. (I don't want to use the FMX form at design time - just at runtime, so I just want to include the FMX form as in the package, the component has design time properties though)
It seems I can only add a VCL form to the package - when I right click and 'add new' to the package, it tries to add the VCL to the package - which I don't want. I want to run it on OSX.
I've found plenty of adding VCL forms e.g. Adding forms and frames to packages probably something obvious I'm missing - tia
Delphi XE6 on Windows 8/OSX target
Packages have affinity to a particular framework. Your package appears to be a VCL package. In the .dproj file you will find
<FrameworkType>VCL</FrameworkType>
Change this to
<FrameworkType>FMX</FrameworkType>
to have affinity to FireMonkey.
Although I've not done so recently, I expect that you get to make the framework affinity choice when you create the package. Presumably you chose VCL. Or the package was created before FMX existed and the project upgrade process added (correctly) the VCL framework setting.
I would like to make Drag and Dock work as well in my applications as it does in the Delphi IDE (i.e. being able to drag around the Object Inspector / Structure View and Dock them at suitable sites). I've had pretty good success with docking forms into a PageControl, but was wondering if anyone knows how to get it to work with the the little close buttons and pins and so on.
I'd also be interested to know what components the Delphi IDE uses to achieve this.
The reason for my question is I want to make much more advanced videos on how to do this, the two that I have done previously are here and here.
You can use JVCL JvDocking components to drag and dock, in almost any version of Delphi. It's free and open source. The style with pins and close buttons is available using a docking style called the VID (visual interdev) style, that comes with JvDocking.
There are already a bunch of commercial alternatives also, and there is some support built into Delphi, which I find insufficient for my needs. While the Delphi IDE has its own internal docking library, tab support is very limited, slow, and in my subjective opinion, broken.
However, even on ancient delphi versions, Delphi 7 and up, JvDocking, provides all the functionality that the VCL's docking provides, plus more, so there's no problem ignoring the built in VCL functionality, which is to docking as TStringGrid is to real Grids.
Steps with JvDocking:
Drop dock server and dock style object on main (host form) and connect them.
Drop dock client component on the client (form to be docked) and connect it to the dockstyle.
Configure properties of dock server.
Run app. Have it create a form. Now drag the client form to an area that is made dockable by the dock server. Watch it dock nicely.
For docking in code demos see the JvDocking demos in the JVCL Examples folder.
Update
Or you can use what is built into the Delphi VCL since XE and XE2. XE and XE2 include a docking demo project named dockex.dpr.
On Win7/Vista the demo is located at:
C:\Users\Public\Documents\RAD Studio\9.0\Samples\Delphi\VCL\Docking
Look here for the demo on Win XP:
C:\Documents and Settings\All Users\Documents\RAD Studio\9.0\Samples\Delphi\VCL\Docking
You should also check out the documentation for TDockTabSet in the VCL, and the EDN article linked in the comments, which has source code you can download here. In my humble opinion, the Jedi JvDocking stuff is more professional and slick than the Docking Demo that ships with Delphi, but the built in stuff has the advantage of working without installing anything additional. I just tried the DockTabSet demo and the built in docking demos, and they are slow, and the painting is ugly and flickers. JvDocking looks professional. It's your call.
I have a Delphi project in 2007 that doesn't show the procedure names in the Object Inspector's Events such as Form OnClose, OnCreate or OnShow in the IDE. The code is there and if you click on OnCreate (for example) you are taken to the code and the IDE fills in the name of procedure. However on reload, the procedures are missing from the IDE again.
This same project causes various error messages when Delphi closes also, but I am not sure if this is related (no other project developed under this Delphi does but this one is the largest app and uses several 3rd party add-in libraries).
I have moved this app to various Delphi 2007 installations and it reacts the same, so it isn't a corrupt Delphi situation. Is there any way to rebuild or fix a corrupt project like this? Any help would be appreciated.
I would try to remove all the files and keep only the dpr and the pas/dfm files in case it's a corrupted project file.
I would also double check if there is any Form inheritance mess, as I have seen somewhat similar issues with the inherited event handlers. (look at the dfm files directly)
Try delete all the .DCU's, close Delphi, restart Delphi then rebuild your project.
Delphi's IDE takes several liberties with your code without warning you.
In particular : if you have a callback (eg: "TMyForm.FormCreate") linked in the dfm, and the IDE detects that the function's body is empty, when you save your unit, the ide removes the declaration and the implementation before saving your file.
Adding anything (even a simple "//") in the function's body prevents this : try typing some code or some comment in your function before closing your Delphi.
As for errors when Delphi closes, there can be so many reasons.
Do you have any third-party components or experts installed ?
Have you tried installing IDEFixpack for D2007 ?